In essence, this is what I am trying to do.
If (Condition 1 that should trigger a long)
EnterLong
ExitShort
if (Condition 2 that should trigger a short)
EnterShort
ExitLong
The problem is I dont know how to check whether I have an active position to Exit (long or short). If I run it as above, an extra order is created.
Also, would appreciate if there is any "initialize" actions that I should do when the strategy starts.
Comment