I need to say - if the open >high of yesterday then sell at the open - 10 ticks stop
Data1 = S&P 500 5 minute bars
Data2=S&P 500 daily bars
I wrote:
If opend(0)>highd(1) then sell 1 contract next bar at opend(0)-2 stop;
This does not work. I don't know why.
Gap opens
- Dave Masalov
- Posts: 1712
- Joined: 16 Apr 2010
- Has thanked: 51 times
- Been thanked: 489 times
Re: Gap opens
Dear evanscje,
Do you want the entry to be triggered on the first bar of the day? Then, you should turn Intra-Bar Order Generation on.
Do you want the entry to be triggered on the first bar of the day? Then, you should turn Intra-Bar Order Generation on.
Re: Gap opens
I thought that wouldn't be necessary since I was using a 5 minute chart but I can see (now) why it's needed.
In a similar vein - If I have a daily chart and have switched on iog and use an identical order I am getting fills at the opening tick .. is that because (in those cases) it's using the open of yesterday on that first tick (and the price is lower than yesterdays open - 2 ticks?
Can I fix this by putting in a time constraint - like if time >open+ 1 minute then begin
?
In a similar vein - If I have a daily chart and have switched on iog and use an identical order I am getting fills at the opening tick .. is that because (in those cases) it's using the open of yesterday on that first tick (and the price is lower than yesterdays open - 2 ticks?
Can I fix this by putting in a time constraint - like if time >open+ 1 minute then begin
?
- Dave Masalov
- Posts: 1712
- Joined: 16 Apr 2010
- Has thanked: 51 times
- Been thanked: 489 times
Re: Gap opens
Dear evanscje,
You should add minute data series as data2 and check session time using data 2, for example:
if time data2 > 831 then...
You should add minute data series as data2 and check session time using data 2, for example:
if time data2 > 831 then...
Re: Gap opens
except it's not working .. I added a second data stream = 1 minute. The historical time for an indicator that is = time data2 is always equal to the last time of the the day so all back-testing fails and no historical trades are shown