I'm coding an indicator that takes trades using the AddonApproach. To make sure I only take trades in one direction at a time I check if the entry, stoploss and targetorders in the opposite direction are null before I enter a trade (Methods NoLongTrades() and NoShortTrades()). It ran as expected in sim101 account. Now I wanted to proceed my work on the indicator and tested it in playback mode. It started taking trades in the opposite direction eventhough I was still in a trade. I added prints to the OnBarUpdate() method to check the OrderState of my different orders. And they showed up to be null eventhough they were actually working or Filled. I attached screenshots from my code, the chart, the output window and the orders tab from when I paused the playback after the faulty behaviour occured.
The Long order should be Filled, the Target Order should be Working but their both null. Is that a playback bug or did I miss something?
Thank you for your help!

Comment