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

Submit multiple orders simultaneously.

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

    Submit multiple orders simultaneously.

    Example trade: I need to go long 2.4 contracts of RTY and short 1.3 contracts of YM, which is:

    Long 2 RTY
    Long 3 M2K
    Short 1 YM
    Short 3 MYM

    I admit I am quite inefficient at changing the symbol and quantity four times, so the market orders get spread out perhaps over a whole minute. Is there a way to stage these four market orders and then submit them all at once? It is easy to flatten everything to exit the trade simultaneously, but the entry is rather slow. I just need to do this manually, not in a strategy. Thanks.

    #2
    Hello HarvOS,

    Thanks for your post.

    It would not be possible to submit market orders on separate instruments at the same time without using a custom NinjaScript strategy. This would require changing the symbol on the chart and the quantity in chart trader to submit a certain number of orders to an instrument. Or, you could consider having 4 separate chart windows open to the instruments and have the quantity set in chart trader for each chart.

    If you are interested in creating a custom NinjaScript strategy to submit the orders to the instruments simultaneously, see the information below.

    The AddDataSeries() method would be used to add multiple data series to a script.

    Then, you could call your Entry order methods using the overload syntax that allows you to specify a barsInProgressIndex argument for the entry order and call the barsInProgressIndex that you want to submit the order to.

    The primary data series the script is running on will have a BarsInProgress value of 0. The first added secondary data series the script in the script will have a BarsInProgress value of 1. The second added secondary data series the script in the script will have a BarsInProgress value of 2, and so on.

    For example, if the first added data series in your script is RTY then you would specify a barsInProgressIndex argument of 1 when calling your Entry order. The below code demonstrates this.

    EnterLong(1, 2, "LongEntry")

    See the help guide documentation below for more information.

    AddDataSeries(): https://ninjatrader.com/support/help...dataseries.htm
    Managed Approach Order Methods: https://ninjatrader.com/support/help...d_approach.htm

    And, review this help guide page to gain a good understanding of working with Multi-Timeframe/Multi-Instrument NinjaScripts: https://ninjatrader.com/support/help...nstruments.htm
    Last edited by NinjaTrader_BrandonH; 07-13-2023, 07:32 AM.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Okay, thanks. I will just use separate charts/order entry windows.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by lightsun47, Today, 03:51 PM
      0 responses
      5 views
      0 likes
      Last Post lightsun47  
      Started by 00nevest, Today, 02:27 PM
      1 response
      8 views
      0 likes
      Last Post 00nevest  
      Started by futtrader, 04-21-2024, 01:50 AM
      4 responses
      44 views
      0 likes
      Last Post futtrader  
      Started by Option Whisperer, Today, 09:55 AM
      1 response
      13 views
      0 likes
      Last Post bltdavid  
      Started by port119, Today, 02:43 PM
      0 responses
      9 views
      0 likes
      Last Post port119
      by port119
       
      Working...
      X