This was working well in a demo account but in a live account, it is giving an error on some trades (Hedge is Prohibited)... It seems to be trying to enter a new order before closing the one in the opposite direction.
The interesting thing is most of these missed/failed trades were would have been very successful trades (would have hit the target with no issues)...
CloseOnReverseSignal is set to true.
How would I adjust the code so it closes open trades before placing an order in the opposite direction?
nvm got it figured out :)