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

Re: Coding Help



PureBytes Links

Trading Reference Links

IIRC, a "feature" of tradestation is that the platform does not
recognize entries until end of bar or start of next bar. 

So if you issue "buy next bar on open" on bar 1, 
it recognizes entry at end of bar 2.  

You are allowed to issue orders in bar 2 but they
will not start execution until bar 3.

The only way around this problem I can see is to
manually calculate your exit on fill and manually
issue the stop order in bar 2.  The program will take
it from bar 3 on.


if c<h then begin (setup on today's bar) 
buy next bar on open; 
end;

If barssinceentry >=1 then begin
sell High limit; 
exitshort at (h+l)/2 stop; 
exitshort at entryprice-xx points stop; 
end;


allister 


---------- Original Message ----------------------------------
From: Scorpio Massimiliano <massimiliano.scorpio@xxxxxxxxxxxx>
Date:  Wed, 27 Mar 2002 14:32:00 +0100

>I need to code a signal this way on daily chart:
>
>If there is a setup today 
>
>I buy next bar on the open and sell short at today's high.I take profit on
>the same bar at today midpoint ((h+l)/2) or I exit on xx points stop loss or
>on close;
>
>This is how I coded but it doesn't work the way i thought.
>
>if c<h then begin (setup on today's bar)
>
>buy next bar on open;
>sell on High limit;
>exitshort at (h+l)/2 stop;
>exitshort at entryprice-xx points stop;
>end;
>I then activate the Close at end of day option on Strategy Builder.
>
>It buys and sells correctly but there is not profit taking on midpoint and
>no way to have the stop on the same bar.
>
>Any help please?
>
>Max
>
>