Hi all,

I've seen this issue been raised a few times before, but have only seen one “solution” to it.  The issue I'm referring to is when you buy a position and then set a limit order (take-profit) and a stop loss order, and then the position moves enough in that one minute that it should execute the sell, but since its in the same bar as the buy, it doesnt execute the sell and then you get stuck in the position.  I put quotations around solution because the only answer I've seen is that once you make the algo live, then those orders follow the ticks, so this issue doesn't occur.  However, I don't want to pay for a live trading node to test this just to find out that that wasn't the fix in the end.  Could somebody confirm that there is no way to get around this in backtesting and that it will fix itself in live paper trading?  Or is there something else I can do to make the code more secure and be able to catch this?  I feel like ideally I should be able to have the OnData() method track the current AskPrice and then just make decisions based off of that, but I am working with options and cant figure out how to send the specific option contract into the OnData method to track its live prices.  Thank you in advance for the response(s)!!

Author