• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

MultiInstrument Script OrderHandling

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

    MultiInstrument Script OrderHandling

    Hello,

    I want to exit all trades in a multi-instrument script. The simple code is "if(FirstTickOfBar) {ExitLong(); ExitShort();}" it only exits the first of 4 instruments in a trade. Why? It should exit all positions.

    Thank you!
    Tony

    #2
    Hello Tony,

    When a Bars index is not used for an order, the BarsInProgress of the currently processing series will be used for the order.

    If there are multiple instrument series, then an Exit() would need to be called during each Bar series update of OnBarUpdate, or alternatively, you would need to submit an exit for each instrument series.

    NinjaTrader does not automatically submit orders to all instruments in a multi-instrument script. It only submits the order to the active series or to the series specified.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello Chelsea,

      thank you. This worked.

      Best regards
      Tony

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NinjaTrader_Brandon, Today, 10:44 AM
      0 responses
      2 views
      0 likes
      Last Post NinjaTrader_Brandon  
      Started by lwsco, Today, 10:40 AM
      0 responses
      2 views
      0 likes
      Last Post lwsco
      by lwsco
       
      Started by Antares66, Today, 10:18 AM
      0 responses
      8 views
      0 likes
      Last Post Antares66  
      Started by ralett, Today, 09:11 AM
      2 responses
      14 views
      0 likes
      Last Post ralett
      by ralett
       
      Started by futurenick, Today, 09:04 AM
      2 responses
      8 views
      0 likes
      Last Post futurenick  
      Working...
      X