• 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 akitenge, 06-14-2019, 02:54 PM
      4 responses
      27 views
      0 likes
      Last Post chartish  
      Started by siriusm, Today, 09:15 AM
      1 response
      9 views
      0 likes
      Last Post NinjaTrader_PatrickG  
      Started by Duval, Today, 09:27 AM
      2 responses
      5 views
      0 likes
      Last Post Duval
      by Duval
       
      Started by chazyang, Today, 08:11 AM
      2 responses
      6 views
      0 likes
      Last Post chazyang  
      Started by Erwin Beckers, 11-04-2018, 02:39 AM
      6 responses
      79 views
      2 likes
      Last Post koganam
      by koganam
       
      Working...
      X