A multi-timeframe multi-instrument strategy is structured to set protective orders using the OnOrderUpdate() method. As outlined in the below linked post.
http://www.ninjatrader.com/support/forum/showthread.php?t=7499
In this strategy a position can be triggered from any one of four BarArrays with any entry/exit implemented on one instrument (a futures contract).
In each of the below orders methods the "BarsInProgress" element must be set to 0. The primary BarsArray, the futures contract all orders are implemented upon:
- entryOrder = EnterLong(int barsInProgressIndex, int quantity, string signalName)
- stopOrder = ExitLongStop(int barsInProgressIndex, bool liveUntilCancelled, int quantity, double stopPrice, string signalName, string fromEntrySignal)
- targetOrder = ExitLongLimit(int barsInProgressIndex, bool liveUntilCancelled, int quantity, double limitPrice, string signalName, string fromEntrySignal)
POSSIBLE SOLUTION - Incorporate BarsInProgress in the order signalName:
entryOrder = EnterLong(int barsInProgressIndex, int quantity, string signalName) becomes entryOrder = EnterLong(0, default, BarsInProgress + " Long") or alternatively BarsInProgress.ToString() + " Long".
PROBLEM 2 - Despite amending the stopOrder and targetOrder string fromEntrySignal to be the same (i.e. BarsInProgress + " Long") the orders do not appear to be linked to the original entryOrder. As a result the intended trades are eventually closed out at the end of the day as opposed to the intended stopOrder or targetOrder levels.
Any ideas / suggestions would be greatly appreciated.
Regards
Shannon
Comment