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

Execute strategy on one chart, but entry / exist on different symbol

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

    Execute strategy on one chart, but entry / exist on different symbol

    Hi there,

    exit* not exist... typo haha

    I have an ES future strategy that I would simply like to execute MES orders instead. Is there a straightforward way to do this in the strategy builder? Or is there some simple code I can insert into my NinjaScript?

    Thank you
    Last edited by quicksandatl; 08-13-2023, 10:47 AM.

    #2
    Hello quicksandatl,

    Thanks for your post.

    This would require adding a secondary additional data series to your strategy and submitting orders to the added series.

    The AddDataSeries() method would be used to add the MES instrument to the NinjaScript strategy. Then, you could submit orders to the added series by using the Entry/Exit method syntax that allows you to specify the barsInProgressIndex you want to submit the order to.

    The primary data series the script is running on would be BarsInProgress 0. The first added series in the script will have a BarsInProgress of 1.

    Note that this would need to be manually programmed in a NinjaScript Editor window and cannot be set up in the Strategy Builder.

    For example, the syntax to enter a long market position would look like this:

    EnterLong(int barsInProgressIndex, int quantity, string signalName)

    To submit the order to the first added secondary series, the code might look something like this:

    EnterLong(1, 1, "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
    Working with Multi-Timeframe/Multi-Instrument NinjaScripts: https://ninjatrader.com/support/help...nstruments.htm

    Here is a reference sample demonstrating submitting orders to an added series: https://ninjatrader.com/support/help...ipt_strate.htm
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Thank you Brandon, that answers it perfectly.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Jimmyk, 01-26-2018, 05:19 AM
      6 responses
      835 views
      0 likes
      Last Post emuns
      by emuns
       
      Started by jxs_xrj, 01-12-2020, 09:49 AM
      6 responses
      3,291 views
      1 like
      Last Post jgualdronc  
      Started by Touch-Ups, Today, 10:36 AM
      0 responses
      10 views
      0 likes
      Last Post Touch-Ups  
      Started by geddyisodin, 04-25-2024, 05:20 AM
      11 responses
      62 views
      0 likes
      Last Post halgo_boulder  
      Started by Option Whisperer, Today, 09:55 AM
      0 responses
      9 views
      0 likes
      Last Post Option Whisperer  
      Working...
      X