I was wondering if there is any documentation regarding the sequence of operations of automated strategies.
A little background info. I am running an automated system and enter long and shorts based on a candle close. These long / short triggers are entered based on specific IF statements in the OnBarUpdate statement.
But, I've noticed that when an ExitLong or ExitShort or any order method is triggered, the following IF block where MarketPosition.Flat is checked is not triggered.
So my question is, when does my MarketPosition actually become flat? Does the processing of orders happen AFTER or DURING the OnBarUpdate statements?
Comment