Condsidering we need a trade management function for the OCO (one cancels the other) aspects of the strategy:

enterLong (oco, var v0, var v1 ...): TRADE*

and we need to specify the entry,

enterLong(1,-15*PIP);


I assume the pending nature of the orders needs to be specified in the trade management function. i.e. we cannot use both syntaxes of the enterLong function.

I was hoping for a very simple trade management function running on each tick along the lines of

Code:
if (NumOpenLong >0) {exitShort();}



but if the trade management function also needs to handle the entering of the pending orders once only and not per tick then it gets more complex.

Is there another way of handling this?