Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Show Second Instrument Instead of Main Instrument in NinjaTrader 8

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

    Show Second Instrument Instead of Main Instrument in NinjaTrader 8

    Hey there everyone,

    I have a code where it uses Main Instrument's data to make trades for Second Instrument but the problem is that, main instrument is currently shown in the chart. What I want is that Second Instrument should be shown in the chart instead of Main Instrument. Is there anyway to do this? If so, how do I do it? or what specific code do I need? Thank you in advanced!

    #2
    Hello itgoesbrrrrrr,

    Thanks for your post.

    When using multi-timeframe or multi-instrument NinjaScripts, only the primary data series will display on the chart window. Secondary data series added to the script is used for calculations in the script and there are no supported ways to have that secondary series displayed on the chart.

    You could consider using the current secondary instrument as the primary instrument in your script. Then the current primary instrument could be added as a secondary instrument used for calculations in the script to place trades.

    See the help guide documentation below for more information.
    AddDataSeries(): https://ninjatrader.com/support/help...dataseries.htm
    Multi-TimeFrame and Multi-Instrument: https://ninjatrader.com/support/help...nstruments.htm

    Let us know if we may assist further.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      Hello NinjaTrader_BrandonH,

      Thank you for the information. How do I make the second instrument become a main instrument?

      Comment


        #4
        Hello itgoesbrrrrrr,

        Thanks for your note.

        The primary instrument that a NinjaScript strategy uses is the instrument that the strategy is enabled on. The secondary series would be added to the script using AddDataSeries().

        Say your current primary instrument is ES 03-22 and the secondary instrument added to the script with AddDataSeries() is CL 02-22. Say you want the CL 02-22 chart to display instead of the ES 03-22 chart.

        You would need to change these instruments around so that the primary instrument is CL 02-22 and the secondary instrument that is added to the script using AddDataSeries() is ES 03-22. This way, the CL 02-22 chart would be displayed. The ES 03-22 chart would not be displayed but would be used for calculations in the script.

        Please review the Multi-Timeframe and Multi-Instrument help guide documentation in post #2 for more information about working with multi-timeframe/instrument NinjaScripts.

        Let us know if we may assist further.
        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment


          #5
          Hello NinjaTrader_BrandonH,

          Thank you so much! I was able to switch the main chart to Second Instrument's chart by changing the Main Instrument in State.Configure.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          578 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          334 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          101 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          553 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          551 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X