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 jclose, Today, 09:37 PM
                0 responses
                6 views
                0 likes
                Last Post jclose
                by jclose
                 
                Started by WeyldFalcon, 08-07-2020, 06:13 AM
                10 responses
                1,414 views
                0 likes
                Last Post Traderontheroad  
                Started by firefoxforum12, Today, 08:53 PM
                0 responses
                11 views
                0 likes
                Last Post firefoxforum12  
                Started by stafe, Today, 08:34 PM
                0 responses
                11 views
                0 likes
                Last Post stafe
                by stafe
                 
                Started by sastrades, 01-31-2024, 10:19 PM
                11 responses
                169 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Working...
                X