PureBytes Links
Trading Reference Links
|
----- Message d'origine -----
De : Ian Cunningham <CunCom@xxxxxxxxxxxxxx>
À : Omega-list <omega-list@xxxxxxxxxx>
Envoyé : vendredi 22 octobre 1999 21:14
Objet : EL Help?
>
>
> I am hoping someone can help with the following:
>
> Using an oscillator such as %R as an example,
>
>
> Vars: PR(0), C1(False), C2(False);
>
> PR = PercentR(10);
>
> Condition1= PR<PR[1] and PR[1]>=PR[2]; {Osc turns down}
>
> C1= MRO(Condition1, 40, 1) <> -1;
> C2 = MRO(Condition1, 40, 2) <> -1;
>
> { I want to capture the values of the highs at the turndowns of
> C1 and C2 for comparison. For C1 I can..............}
>
> If C1 then Value1 = PR[1]: { Is this correct?}
>
> {I have brainlock on how to get the value of C2. Any help
> would be appreciated.}
>
> TIA,
> Ian.
No for C1
C1 and C2 store the number of bars since the occurence.
No occurence foud returns -1 from the MRO function.
So, you need to check
if C1<>-1 then begin
value1=H[C1];
end;
same apply for C2
if C2<>-1 then begin
value2=H[C2];
end;
Howevere,there are smarter solutions by storing the high value when the crossover occurs
Condition1= PR<PR[1] and PR[1]>=PR[2]; {Osc turns down}
if condition1 then begin
value2=value1; { previous high #1 become #2}
value1=h {contains last ocurence high #1}
end;
Et voilà.
Sincerely,
-Pierre Orphelin
Neurofuzzy Logic tools for TradeStation
Free evaluation versions and competitive upgrades available
web: http://www.sirtrade.com
|