I have a strategy that is supposed to trade between 9:30 AM EST and 3:59 PM EST.
The strategy trades on 30 minute bars. I have CalculateOnBarClose set to false.
Each time OnBarUpdate is called, I first check the time by the following statement:
if (ToTime(Time[0]) > ToTime(9, 29, 59) && ToTime(Time[0]) < ToTime(15, 59, 0))
All trade logic is followed only if the above statement is true.
I have seen that when I first start the strategy around 9:15 am, it immediately places an order although the order does not get executed until after 9:30 am. Shouldn't the order be placed only after 9:30 am?
I have also seen that during the last half hour of the day (between 3:30 pm EST and 4:00 pm EST), NO trades are placed even though according to the rules of the system, conditions are present for a trade to occur.
Any ideas of what I need to change? I am on the East Coast and trade E-mini futures. The data feed is Interactive Brokers. Does it have anything to do with time zones?
Thanks for your hlep.
Comment