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

Adding a second instrument to chart

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

    Adding a second instrument to chart

    Hi NT team

    This probably a beginner question:

    I have a two instrument strategy. What code will I need to add to the
    "protected override void Initialize() " section to add this second symbol to the chart (split chart with the primary instrument on the upper chart and the secondary instrument on the lower chart). Both charts can use the same time frame. I guess if I add the second instrument, it will also reflect the executions of the second instrument on the chart.

    Thank you
    wtmnn

    #2
    Hello whotookmynickname,
    If you want to add a one minute chart for MSFT then please use the below code to do it
    Code:
    Add("MSFT", PeriodType.Minute, 1);
    Please refer to the SampleMultiInstrument strategy that comes with NinjaTrader to know more about it.
    • In Control Center menu bar goto Tools>Edit NinjaScript>Strategies...
    • In the Strategies dialog select SampleMultiInstrumnet and click Ok.


    Please refer to our help guide to know more about multi-series coding and concepts.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Thank you Joydeep. I am using this solution. However if I have this multi-instrument strategy and look at the chart in the strategy analyzer it will still only show the first dataseries. how can I add the second dataseries to the chart. I am really only talking about the chart. I know how to add another instrument to the strategy.

      Comment


        #4
        Hello whotookmynickname,
        Unfortunately the additional bar series wont be displayed in the chart.
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          How many charts can I have?

          Hi NT

          I am trying to add a second chart to be visible when my strategy is running.
          Is it possible? Thanks.

          Comment


            #6
            Hello coolhandsg,

            Thank you for your note.

            Are you running the strategy on live data, replay data or in the strategy analyzer? In the case of the strategy analyzer, only the one chart is provided. You can open a second chart in real time and replay.

            Thank you and I look forward to your reply.

            Comment


              #7
              Can it be performed in NT8 - to add additional bars series on chart visually - in additional chart panel - from any NinjaScript?
              fx.practic
              NinjaTrader Ecosystem Vendor - fx.practic

              Comment


                #8
                Hello fx.practic,

                Thank you for your post.

                While it is possible to add additional bar series in your code there is no means to have those added bar series automatically appear on the chart. You would either need to manually add those bar series to the chart or plot through a custom indicator to draw the values on the chart for the bar series.

                For information on multiple bar series, please visit the following link: https://ninjatrader.com/support/help...nstruments.htm

                You can find an example of custom plotting in the NinjaScript Editor under Indicators -> SampleCustomRender.

                Please let us know if further questions come up.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by algospoke, Yesterday, 06:40 PM
                2 responses
                19 views
                0 likes
                Last Post algospoke  
                Started by ghoul, Today, 06:02 PM
                3 responses
                14 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by jeronymite, 04-12-2024, 04:26 PM
                3 responses
                45 views
                0 likes
                Last Post jeronymite  
                Started by Barry Milan, Yesterday, 10:35 PM
                7 responses
                21 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by AttiM, 02-14-2024, 05:20 PM
                10 responses
                181 views
                0 likes
                Last Post jeronymite  
                Working...
                X