The pseudocode for my strategy would be like this:
if (flat and Close[0] above mean)
EnterLongStop()
else if (flat and Close[0] below mean)
EnterShortStop()
else
do other stuff
This means that the orders will be submitted every bar, which is my understanding of what I have to do to keep them alive. It also means I may switch directions: submit an EnterShortStop the bar after an EnterLongStop as long as I am still flat. Per the help, which states:
- A position is open and an order submitted by an exit method (ExitLongLimit() for example) is active
- A position is open and an order submitted by a set method (SetStopLoss() for example) is active
- The strategy position is flat and an order submitted by an enter method (EnterLongLimit() for example) is active
- The entry signal name is not unique

Comment