Methods that generate orders to enter a position will be ignored if:
• A position is open and an order submitted by an exit method (ExitLongLimit() for example) is active and the order is used to open a position in the opposite direction
• A position is open and an order submitted by a set method (SetStopLoss() for example) is active and the order is used to open a position in the opposite direction
• The strategy position is flat and an order submitted by an enter method (EnterLongLimit() for example) is active and the order is used to open a position in the opposite direction
• The entry signal name is not unique
Suggested new version of rule:
The current rule has been implemented so that if there is
However assuming the entry order on bar x did not use the 'advanced' isLiveUntilCancelled=true signature, the limit placed on bar x (and not filled) will be due to expire at bar x+1.
With the new version of the rule in place the implementation needs to change so that if the opposing direction limit order is due to expire now (bar x+1) then it should be cancelled before the new order is processed (currently the cancellation is being processed afterwards, so is still 'active' at point of request for new order, even though it is due for expiry, hence the rule violation).
See this thread for an examples of the problems and misunderstandings caused by the current implementation of the existing rule.
Comment