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

Re: EL Help



PureBytes Links

Trading Reference Links

At 10:31 AM -0400 5/16/98, Robert W Cummings wrote:

>How do you tell and indicator to reference itself back, for example the I
>need the cci to crosses below 100 before it plots a cross below 50 which
>might have been a couple of bars back.
>

I don't understand exactly what you are trying to do but if, for example,
you are trying to detect when CCI crosses below 50 within 3 bars after it
has crossed under 100 then something like the following should work:



{Set Condition1 if setup is true on any bar}
if CCI(Length) crosses below 100 then begin
   Condition1 = TRUE;
   Counter = 0;
end;

{Check for second condition within 3 bars of first condition on any bar}
if Condition1 and Counter <= 3 and CCI(Length) crosses below 50 then begin
    <some action>;
    Condition1 = FALSE;   {Reset condition}
end;

Counter = Counter + 1;    {Increment counter on every bar}

{Reset Condition1 for next case}
if CCI(Length) crosses above 100 then Condition1 = FALSE;


Bob Fulks






  • References: