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

Re: Coding help



PureBytes Links

Trading Reference Links

It looks like on the last bar of the day you are putting in your stop order
and then it is getting executed the next morning.  I think you need another
qualifier before entering your order.  Something like:

and Time < CalcTime(Sess1EndTime, -30)

Let me know if this works.

Aaron Schindler




----- Original Message -----
From: "Jim Johnson" <jejohn@xxxxxxxxxxx>
To: <Omega-List@xxxxxxxxxx>
Sent: Friday, May 17, 2002 11:29 AM
Subject: Coding help


> Hello Omega-List,
>
>   I'm looking into the predictive ability of the 2nd 30 min bar of
>   the day in the SP's.  I want to buy if the 2nd bar is up and sell if
>   its down and for this purpose exit at close.  for some reason this
>   version is often entering on the first bar rather than after the
>   second.  Where am I going wrong (with the code that is)/
>
>   thanks.
>
>   {===============================================================}
>
> {30 min bars only}
>
> Inputs: Pts(1);
>
> Vars: BarDir(0), BarHi(0), BarLo(0), MP(0);
>
> If D > D[1] then begin
>         BarDir = 0;
>         BarHi = 0;
>         BarLo = 0;
> End;
>
> If Time = CalcTime(Sess1StartTime, 60) then begin
>         BarDir = Close - Open;
>         BarHi = High;
>         BarLo = Low;
> End;
>
> If Time > CalcTime(Sess1StartTime, 60) and BarDir < 0 then begin
>         Sell at BarLo - Pts Points Stop;
>         SetExitonClose;
> End;
>
> If Time > CalcTime(Sess1StartTime, 60) and BarDir > 0 then begin
>         Buy at BarHi + Pts Points Stop;
>         SetExitonClose;
> End;
> {========================================================================}
> --
> Best regards,
>  Jim Johnson                         mailto:jejohn@xxxxxxxxxxx
>
>