This should be simple but not used to deal with daily data.
I have a strategy that works with daily data but with real-time data for the last bar ( while building ) cause I set OnBarClose = False. I want to submit orders if a certain intraday condition is met, the problem is that whenever I run the simulation ( Strategy with live broker data and Sim101 ) those detected triggers for the historical data, submit the right orders but at the bar ending, so the real fill is complete in the next bar. I thought to use "If historical...return" but I need the historical data for certain calculations.
The Strategy in real time seems to be fine, so my goal is: how to use historical data for calculations while ignore all historical orders but the recent one.
So, I like to listen to any suggestions, workaround or direct commands that address the problem.
Thanks
EDIT
I forgot to say that I was using Limit orders ( with broad prices ), but now that I'm trying market orders it seems to work better.
Since IB is always notifying when you use "Market orders", I try always to use limit orders as long I can. Now I was trying to use Limit orders but using GetcurrentBid() and GetcurrentAsk() to submit orders almost like market, but the behavior is not the same, several historical orders remain unfilled. This happens when the Next day Bar has a gap and the simulator can match the limit order price to the open of new bar.
SOLUTION
What I did is to use " if (Historical) return" before submitting orders, so just allows real-time new orders. It seems to work but still checking
Comment