Only one buy and one sell

Some plan need to have only one open buy and one open sell. If a buy position is open, it only can open a sell and if a sell position is open, it only can open a buy. If a buy and a sell positions are open, ESB won’t enter any new position. To achieve this, set “max open positions” on 2 and then set entry position like this:

Buy expression: PrevOrderIsSell[0] and (…)

Sell expression: PrevOrderIsBuy[0] and (….)

Replace dots with your current entry conditions. For example you can set ESB open only new position by cross of two moving average and you need only either one buy or one sell or both and not open any other position till these are open.

Buy expression: PrevOrderIsSell[0] and (MA1 crossup MA2)

Sell expression: PrevOrderIsBuy[0] and (MA1 crossdown MA2)