[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EL Help?_Take II



PureBytes Links

Trading Reference Links



I may not have been clear in what I am trying to do with this
EL excercise.
At C1 I want to return the Oscillator value at its highest point
after it has turned down. (Condition1). Then, return the value
for the previous time this has occured (C2)  so that I can compare
one to the other; eg If C1 < C2 then .....................

Maybe I'm mistaken to use the MRO function for this purpose??

Ian

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>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 (oscillator) 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
<