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

MarketData

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

    MarketData

    Hi,
    how can i add e second instrument with marketdata on a chart.
    I need the "change" and the "change%" only.
    BR
    Last edited by mate41; 06-09-2016, 08:09 AM.

    #2
    Hello mate41,

    This post is in the Indicator Development section of the forum. Are you wanting to use a script to add a visible second panel with a different data series?

    I am not aware of anyway to accomplish this with a NinjaScript.

    However, if you would like we can submit a feature request for this. It is up to our development to decide if an when to implement any feature request.

    Are you asking how to add a secondary series manually to your chart?

    This is done in the Data Series window from right-clicking the chart. Select the instrument, click the New button to add a secondary series, change any parameters on the right, click OK.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      1.I want a second instrument added like the attached screenshot for ex QQQ.
      2. if it could be done and better a second panel in the same chart.

      Number (1) could be done with a onbarsinprogress i presume + adding a second instrument.
      Attached Files

      Comment


        #4
        Hello mate41,

        I am not able to understand.

        Are you wanting to add a secondary instrument to a NinjaScript to use for calculations?
        Are you wanting to add the secondary series to the chart visually using a script?
        Are you wanting to add the secondary series to the chart visually manually?
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          I want in first instance adding a second instrument below and like that one i created in the screenshot.
          That way i become the primary instrument indications as in the screenshot, and below a want the same but with an other instrument.
          See the example in the screenshot.
          Attached Files
          Last edited by mate41; 06-09-2016, 09:01 AM.

          Comment


            #6
            Hello mate41,

            I am still not able to understand.
            Your screenshot is not a screenshot of a window in NinjaTrader.

            Lets start with one question at a time.

            Are you trying to write code into a script? Yes or No?
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Yes, as i did with the first screenshot.....

              Comment


                #8
                Hello mate41,

                Your first screenshot is not a screenshot of a window in NinjaTrader.

                I also do not understand how either screenshot relates to a second instrument.

                You have confirmed that you are attempting to write code in a script.

                Are you trying to add a secondary series visually to your chart using a script?

                This is not possible.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  Of course that screenshot is from a ninjatrader chart.
                  Here is a bigger part of that shart ......
                  Attached Files

                  Comment


                    #10
                    Hi mate41,

                    Thanks for the larger screenshot.

                    How does this screenshot relate to a secondary series?
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      #11
                      It's related to the primary and only dataseries of this instrument.

                      Comment


                        #12
                        Hi mate41,

                        How is the screenshot related to your inquiry?
                        Chelsea B.NinjaTrader Customer Service

                        Comment


                          #13
                          Originally posted by NinjaTrader_ChelseaB View Post
                          Hi mate41,

                          How is the screenshot related to your inquiry?
                          At the topright of the chart, I need the same type of values about another instrument (say QQQ), just below these of the primary instrument (in this case NQ).

                          Comment


                            #14
                            Hello mate41,

                            Thank you for confirming my question in post #4.

                            You are wanting to add a secondary instrument to a NinjaScript to use for calculations.

                            The screenshot is not really related, other than the fact that after you've added a secondary instrument you want to see the values for this in a text box.

                            To add a secondary series use the Add() method in Initialize()..

                            For example
                            Code:
                            Add("NQ 09-16", PeriodType.Minute, 1);
                            Below is a link to the help guide on Add().
                            http://ninjatrader.com/support/helpGuides/nt7/add3.htm

                            This will trigger OnBarUpdate once for the primary instrument and once for the secondary instrument. When the NQ 09-16 is triggering OnBarUpdate, BarsInProgress will be equal to 1 and the pricing information for this series will be from the Closes[1], Highs[1], Lows[1], Times[1], etc.

                            For example:
                            Code:
                            if (BarsInProgress == 1)
                            	DrawTextFixed("myTextBox", string.Format("{0} - Close: {1}", BarsArray[1].Instrument.FullName, Closes[1][0]), TextPosition.TopRight);
                            Below is a link to the help guide on BarsInProgress.
                            http://www.ninjatrader.com/support/h...inprogress.htm

                            And a link to the help guide on Multi-Time Frame & Instruments. Please see the section 'How Bar Data is Referenced', and 'Accessing the Price Data in a Multi-Bars NinjaScript'.
                            http://www.ninjatrader.com/support/h...nstruments.htm
                            Chelsea B.NinjaTrader Customer Service

                            Comment


                              #15
                              Thanks Chelsia.
                              Last edited by mate41; 06-14-2016, 06:21 AM.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by frankthearm, Today, 09:08 AM
                              5 responses
                              14 views
                              0 likes
                              Last Post NinjaTrader_Clayton  
                              Started by jeronymite, 04-12-2024, 04:26 PM
                              3 responses
                              43 views
                              0 likes
                              Last Post jeronymite  
                              Started by yertle, Today, 08:38 AM
                              5 responses
                              15 views
                              0 likes
                              Last Post NinjaTrader_BrandonH  
                              Started by adeelshahzad, Today, 03:54 AM
                              3 responses
                              19 views
                              0 likes
                              Last Post NinjaTrader_BrandonH  
                              Started by bill2023, Yesterday, 08:51 AM
                              6 responses
                              27 views
                              0 likes
                              Last Post NinjaTrader_Erick  
                              Working...
                              X