PureBytes Links
Trading Reference Links
|
Dear Jim,
I don't know systems, but I believe the following would give you the entry
signal you're looking for:
IF Date[2] < Date[1] THEN IF C > O THEN Plot1(C,"Buy") ELSE IF C < O THEN
Plot2(C,"Sell");
Set the Show-Me Not to Update Every Tick, Use Dots for plots, set Plot1 to
Green & Plot2 to Red, then Buy on a Green Dot at the close of the 2nd bar and
Sell on a Red Dot at the close of the 2nd bar.
Sincerely,
Richard
Jim Johnson wrote:
> 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
|