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

EL Help



PureBytes Links

Trading Reference Links


The following oscillator crosses above/below zero.  "Hosc" is the highest 
value of the oscillator while it is above zero, then is set to zero when the 
oscillator crosses below zero.

Can anyone tell me how (in easylanguage, please) to reference the previous 
cycle values of "Hosc"?

In other words, once the oscillator crosses below zero and "Hosc" is equal 
to zero, I would like to be able to reference the Highest Value of the 
oscillator prior to the cross below zero.

I would also like to be able to reference other previous values of "Hosc" 
created as the oscillator swings above/below zero.

Thanks,

Ron
archer@xxxxxxx



Inputs:	OscLen(34);
Vars:	Osc(0),Hosc(0),Losc(0);

Osc = Average((H+L)/2,5) - Average((H+L)/2,OscLen);

{*** Hosc returns the Highest Osc Value, while Osc > 0 ***} 
If Osc > 0 then 
Hosc = Osc;
If Osc > Hosc[1] then Hosc = Osc
else Hosc = Hosc[1];

If Osc crosses below 0 then
Hosc = 0;

{*** Losc returns the Lowest Osc Value, while Osc < 0 ***} 
If Osc < 0 then 
Losc = Osc;
If Osc < Losc[1] then Losc = Osc
else Losc = Losc[1];

If Osc crosses above 0 then
Losc = 0;

Plot1(Hosc,"Hosc");
Plot2(Losc,"Losc");
If Osc > 0 then Plot3(Osc,"Up");
If Osc < 0 then Plot4(Osc,"Dn");