I am proramming a strategy which uses a specific session (trading hours) from 8 AM to 7 PM.
My strategie is based on daily (modified with the new trading hours) indicators but I want to backtest it on minute bars.
So I added the minute chart to my daily bars (minutes / 1440).
At 7 PM for each day, I know exactly what I will need to do on the next day.
Buy the high of the current day on stop
Sell the low of the current day on stop
So at 7 PM (of the secondary bar), I send an unmanaged order such as:
SubmitOrderUnmanaged(1, OrderAction.Buy, OrderType.StopMarket, positionSize, 0, StopPrice, orderString, nameOrder)
Unfortunately, This does not work as I would have expected ...
if the StopPrice is included in the current bar then the order is not accepted.
I would have loved to create the order on the first bar of the next day, but then the order cannot be filled on the opening if the condition is met (stop should be triggered) since the order only starts on the next bar...
Could you help me understand why the backtesting does not allow me to execute in the current bar or does not accept an order which is for the next bar ?
When we send an unmanaged order, are we pre open, post open but pre close, post close ?
Thanks
Comment