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

Re: EL- why is one not working, when its counterpart is working ?!



PureBytes Links

Trading Reference Links

At 01:11 PM 3/1/2004, Romi Ghose wrote:

>if datacompression<2 and date=lastcalcdate then begin
>
>value1=iff(high>value1[1],high,value1[1]);    {high of the last trading
>}    - this guy works
>value2=iff(low<value2[1],low,value2[1]);    (low of the last trading
>     - this guy does not work
>
>plot1(value1);    - works
>plot2(value2);    - does not work
>
>end;
>
>last trading day or not, value2 returns zero.  Am I missing something?

Value2 is initialized to zero by default so "low" is never less than value2.

You need to declare a variable and initialize it to a high number. Something like:


Vars: LLow(999999), HHigh(0);

if datacompression < 2 and date = lastcalcdate then begin

  HHigh = iff(high > HHigh, high, HHigh);    {high of the last trading} 
  LLow  = iff(low  < LLow,  low,  LLow);     {low of the last trading}

  plot1(value1); 
  plot2(value2); 

end;


Bob Fulks