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

How to force two indicators on same panel from strategy?

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

    How to force two indicators on same panel from strategy?

    I have a strategy that uses AddChartIndicator to add two indicators.
    I want them to display on the same panel.
    However, they show in separate panels.

    Here are the essential lines:
    Code:
    macd = MACD(12,26,9);
    macd.Panel = 2;
    macd.ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Left;
    stoc = Stochastics(7,14,3);
    stoc.Panel = 2;
    AddChartIndicator(macd);
    AddChartIndicator(stoc);
    If this approach is not correct, what is the correct way?

    I have attached the sample strategy for your testing.

    Thanks,
    Gary
    Attached Files

    #2
    Hello GaryAlbers,

    Thank you for writing in.

    It would not be possible to have both indicators displayed in the same panel using AddChartIndicator unless you were to combine both indicators into the same indicator.

    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Are you saying that the code in my example is wrong or not supported?
      Or are you saying that when setting the 'Panel' attribute with the number 2 your code ignores it?

      If I manually move one indicator from one panel to the other via a drag and drop motion, it works. So clearly your code supports this.

      Is seems to me that it is a bug to have a writable attribute (Panel) that when it's value is set, it is ignored.

      Gary

      Comment


        #4
        Hello GaryAlbers,

        I was incorrect, you can set the panel property of the indicator however you would not be able to set two different indicators to the same panel without combining the indicator into 1.

        Please let us know if you need further assistance.
        Alan P.NinjaTrader Customer Service

        Comment


          #5
          If the attribute can be set AND the chart actually supports two indicators on the same panel, then it seems to me that the intention was there to support this from code.
          It just appears that full support for the feature was not implemented yet.
          Can you provide a tracking number so we watch for the final delivery of this feature?

          Thanks,
          Gary

          Comment


            #6
            Originally posted by GaryAlbers View Post
            If the attribute can be set AND the chart actually supports two indicators on the same panel, then it seems to me that the intention was there to support this from code.
            It just appears that full support for the feature was not implemented yet.
            Can you provide a tracking number so we watch for the final delivery of this feature?

            Thanks,
            Gary
            Try setting the Panel property before you assign the values to the indicators.

            Comment


              #7
              Hello GaryAlbers,

              I just tested NT7 and was able to set the panels the same, not in NT8, even after koganam's suggestion, thank you koganam.

              I have reported this to development and will follow up when I have more information.
              Alan P.NinjaTrader Customer Service

              Comment


                #8
                koganam,
                The sample code in post number 1 shows the order of events I follow.
                - I create the indicator,
                - assign the attribute: stoch.Panel = 2;
                - then call AddChartIndicator.

                Isn't that doing what you suggest?

                Gary

                Comment


                  #9
                  Originally posted by GaryAlbers View Post
                  koganam,
                  The sample code in post number 1 shows the order of events I follow.
                  - I create the indicator,
                  - assign the attribute: stoch.Panel = 2;
                  - then call AddChartIndicator.

                  Isn't that doing what you suggest?

                  Gary
                  Not really.

                  I meant to reverse these first two lines:
                  Code:
                  macd = MACD(12,26,9);
                  macd.Panel = 2;

                  Comment


                    #10
                    Hello GaryAlbers,

                    Being unable to set certain parameters is a bug which is slated to be resolved in a future version of NT8. You can track this issue in the release notes of the helpguide on the next release to see if its been resolved, with the following number 12307.

                    Please let us know if you need further assistance.
                    Alan P.NinjaTrader Customer Service

                    Comment


                      #11
                      Hi, I'm trying to do the same thing and cannot get it to work with the latest NT8.

                      ATRInd = ATR(30);
                      AddChartIndicator(ATRInd);
                      ATRInd.Plots[0].Brush = Brushes.Cyan;
                      ATRInd.ScaleJustification = ScaleJustification.Right;
                      ATRInd.Panel = 2;

                      EMA5Ind = EMA(5);
                      AddChartIndicator(EMA5Ind);
                      EMA5Ind.Plots[0].Brush = Brushes.Gold;
                      EMA5Ind.ScaleJustification = ScaleJustification.Left;
                      EMA5Ind.Panel = 2;

                      The ATR one plots in the bottom panel but the EMA5 one plots in the Input Series.
                      According to the NT8 release notes, the issue 12307 was fixed back in December.
                      What am I doing wrong?

                      Comment


                        #12
                        Hello PN720,

                        Thank you for your note.

                        When I apply the code you provided both plot in the 1st extra panel applied to the chart.

                        If you import the attached strategy, are you seeing differently?

                        What version of NinjaTrader 8 are you running? Control Center>Help>About?

                        I look forward to your reply.
                        Attached Files
                        Alan P.NinjaTrader Customer Service

                        Comment


                          #13
                          Hi Alan,

                          I'm using 8.0.13.1 64-bit (Standard) and attached what I see and my simple script.

                          I also see the same thing when I import your attached strategy.
                          Attached Files
                          Last edited by PN720; 06-04-2018, 10:54 AM.

                          Comment


                            #14
                            Hello GaryAlbers,

                            If you upgrade to the newest version 8.0.14.0, does the issue persist?



                            I look forward to your reply.
                            Alan P.NinjaTrader Customer Service

                            Comment


                              #15
                              Hi, I just upgraded to the latest version and still see the same thing.

                              Thanks for the note though as I always keep current. I guess I didn't see the last upgrade reminder.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by terofs, Yesterday, 04:18 PM
                              1 response
                              21 views
                              0 likes
                              Last Post terofs
                              by terofs
                               
                              Started by CommonWhale, Today, 09:55 AM
                              1 response
                              3 views
                              0 likes
                              Last Post NinjaTrader_Erick  
                              Started by Gerik, Today, 09:40 AM
                              2 responses
                              7 views
                              0 likes
                              Last Post Gerik
                              by Gerik
                               
                              Started by RookieTrader, Today, 09:37 AM
                              2 responses
                              13 views
                              0 likes
                              Last Post RookieTrader  
                              Started by alifarahani, Today, 09:40 AM
                              1 response
                              7 views
                              0 likes
                              Last Post NinjaTrader_Jesse  
                              Working...
                              X