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

Re: Opening Range Breakout



PureBytes Links

Trading Reference Links

> Create a variable, DayOpen.
> If Date > Date[1] then
> Dayopen = O + ATR(10)
> End;

That will work if you only want to issue orders on the 2nd through 
Nth bars in the day.  Since you don't compute DayOpen until the end 
of the 1st bar of the day, you can't use it to issue orders on that 
1st bar.

To do that, you need to do something like:

vars:  DayOpen(0);
if Time = Sess1Endtime then DayOpen = Open of next bar;
if DayOpen <> 0 then buy at DayOpen + ATR(10)*X;

If you access the next bar like that, you can't use multiple data 
streams.  I've never understood why, but TS won't let you.  TS also 
limits your use of "on close" orders in a system that accesses the 
next bar, to prevent you from doing something like this:

if open of next bar > Close then buy;   { Buy this bar at close }
sell at market;                         { Sell next bar's open }

Gary