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

Antw: narrow range-inside day system



PureBytes Links

Trading Reference Links

Hi Jim,

the problem in your code is in the if statement:

If      Date > Date[1] and 
         ( R[1] < R[2] and R[1] < R[3] and R[1] < R[4] and R[1] < R[5] 
)                                       {narrowest range of last 4
days}
        and ( H[1] < H[2] and L[1] > L[2] ) then {inside day}

Using R[1] < R[2] compares the value of R one bar ago to the value of
R two bars ago. On an 5 minute chart one bar is equal 5 minutes, not
one day (re your comment in the code)

Regards,

Franz


>>> Jim Johnson <jejohn@xxxxxxxxxxxxxxxx> 05.02.2002 14:35:08 >>>
Hello omega-list,

  Could someone point out the (I think obvious to everyone but me)
problem with this code?

I am attempting to enter breakouts from an inside, narrow range day at
1 point above (below) the idnr day's range.

When I apply this code to SP, 5 min data I get no trades.

thank you for any assistance.

{+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++}

{enters breakout from inside day that is narrowest of last four; use
intra-day data.}

Inputs: AddPts(1);

Vars: R(0);

R = HighD(0) - LowD(0); {compute range using intraday data}



If      Date > Date[1] and 

         ( R[1] < R[2] and R[1] < R[3] and R[1] < R[4] and R[1] < R[5] 
)                                       {narrowest range of last 4
days}

        and ( H[1] < H[2] and L[1] > L[2] ) then {inside day}
begin
        Buy at HighD(1) + AddPts Points Stop;
        Sell at LowD(1) - AddPts Points Stop;
end;

{+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++}




-- 
Best regards,
 Jim Johnson                         mailto:jejohn@xxxxxxxxxxxxxxxx