The issue I'm running into may likely be due to this statement provided by the document for GetAtmStrategyMarketPosition():
An example of order execution:
11:32:59 OnBarClose: Entry conditionals are met and the ATM strategy executes it's entry
11:33:52 The ATM strategy take profit target executes
11:33:59 OnBarClose: Entry conditionals are met but the ATM strategy does not execute. Almost as if GetAtmStrategyMarketPosition() didn't report it as executed
11:34:59 OnBarClose: Entry conditionals are met and the ATM strategy executes it's entry
Ideally, the trade would have closed during that entry bar and on the close of that bar, the entry is still met and a new ATM is entered being that the first one closed.
If it didn't take an additional bar to enter, a larger profit could have been made - or more importantly a smaller loss.
If the GetAtmStrategyMarketPosition() is the problem, is there a way to get around this delay? I want to only enter a new ATM if there are no working orders.
Thanks.
Comment