I'm translating into Ninja Trader 7 a strategy that I used to run on MultiCharts, but I have a problem with NT order restrictions.
Specifically, my problem is that when the strategy opens a position (for example a long one) it generates the following orders (in this order):
- An enterShortStop order to reverse the position
- An exitLongLimit to close de current position (stopProfit)
This works fine in Multicharts, but it seems that it doesn't in NT since I can't send a Profit Order to exit a position when there is active another order to open positions in the opposite direction. The Help Guide says: "Methods that generate orders to exit a position will be ignored if: A position is open 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"
Knowing this, I thought that a good solution would be to change the enterShortStop order to a exitLongStop and use the method OnExecute to throw the enterShortStop when the exitLongStop is executed, but the problem is that (on backtesting at least), the event OnExecute is only triggered at the end of the current bar, so it throws the order (the enterShortStop) in the next bar, and I need the strategy to throw it exactly at the same time that the execution of the exitLongStop.
Is there any posibility to do this? How?
Thanks in advance. Regards.

Comment