When it is not in DLL form it works flawlessly.
For some reason though when I convert to DLL it is cancelling my Close Order even though it is being submitted after the cancelallorders function is called.
I would just use the Flatten function but that disables the strategy.
Here is the code below. Let me know if I am doing something wrong, Thanks!
"""
if(button.Name == "Close"){
currAccount.Submit(new[] {CloseOrder});
if(pos.MarketPosition == MarketPosition.Short){
currAccount.Submit(new[] {CloseOrder});
}
if(StopOrder != null){
StopOrder = null;
"""
Comment