• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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, 09:54 AM.

                          Comment


                            #14
                            Hello GaryAlbers,

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

                            https://ninjatrader.com/bin/BVD.php

                            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 tvaughan4, 12-13-2019, 10:46 PM
                              2 responses
                              16 views
                              0 likes
                              Last Post tvaughan4  
                              Started by digibob, 12-13-2019, 10:01 PM
                              3 responses
                              12 views
                              0 likes
                              Last Post digibob
                              by digibob
                               
                              Started by ldissinger, Yesterday, 12:55 PM
                              1 response
                              17 views
                              0 likes
                              Last Post ldissinger  
                              Started by pstrusi, Yesterday, 09:06 AM
                              1 response
                              27 views
                              0 likes
                              Last Post marcus2300  
                              Started by vpzdcv, Yesterday, 02:31 AM
                              0 responses
                              13 views
                              0 likes
                              Last Post vpzdcv
                              by vpzdcv
                               
                              Working...
                              X