Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

NT7 - Mulit-timeframe multi-instrument protective orders

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    NT7 - Mulit-timeframe multi-instrument protective orders

    All,

    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)
    PROBLEM 1 - As orders from each of the four BarsArrays are triggered against the same BarsArray, there is no way to tell them apart. And as shorter-timeframe BarsArrays are indexed higher than longer-timeframe BarsArrays (due to the order in which they are "Added"), shorter-timeframe protective orders (when triggered at roughly the same time) over-write the original longer-timeframe protective orders.

    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

    #2
    Shannon, the idea to incorporate the BIP generated on into the signalName is a sound one.

    For issue 2 : what is the TraceOrders output showing for those trades? Any Ignored orders? If yes, for what reason would that be?

    Thanks
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thanks Bertrand.

      I should have seen it earlier.

      Regards
      Shannon

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by RubenCazorla, Today, 09:07 AM
      1 response
      5 views
      0 likes
      Last Post RubenCazorla  
      Started by Irukandji, Today, 09:34 AM
      0 responses
      3 views
      0 likes
      Last Post Irukandji  
      Started by TraderBCL, Today, 04:38 AM
      3 responses
      25 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by WeyldFalcon, 08-07-2020, 06:13 AM
      11 responses
      1,423 views
      0 likes
      Last Post jculp
      by jculp
       
      Started by BarzTrading, Today, 07:25 AM
      2 responses
      29 views
      1 like
      Last Post BarzTrading  
      Working...
      X