Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multiple Indicators on the same panel . . .

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

    Multiple Indicators on the same panel . . .

    I am trying to plot two different Indicators within a Strategy to display on the same Panel. Here's what I tried:

    // Indicator 1
    AddChartIndicator(Indicator1);
    Indicator1.Panel = 2;

    // Indicator 2
    AddChartIndicator(Indicator2);
    Indicator2.Panel = 2;

    I did this and I ended up with the Indicators showing on two different Panels.

    I tried this as suggested in a different post:

    // Indicator 1
    AddChartIndicator(Indicator1);
    ChartIndicators[0].Panel = 2;

    // Indicator 2
    AddChartIndicator(Indicator2);
    ChartIndicators[1].Panel = 2;

    And again the Indicators showed up in two different panels.

    So what am I doing wrong? According to the Example the above should work.

    #2
    Hello AMTtrader0001,

    Are these indicators using IsOverlay set to true?

    I would suggest changing the indicator's IsOverlay property and Panel properties before calling AddChartIndicator so...

    IsOverlay is set to false
    Panel is set to the panel index you want the indicator to go.

    If you need additional help, could you set up an example with NinjaTrader System indicators so I can set up the same and give better advise?

    We look forward to assisting.
    Last edited by NinjaTrader_Jim; 01-06-2022, 10:43 AM.

    Comment


      #3
      I added IsOverlay as outlined in https://ninjatrader.com/support/help...?isoverlay.htm
      and set it to true. This addresses IsOverlay as going over the Price Panel, which is not what I want to do, but was worth a try,

      Any other thoughts?

      Setting it to false adds another panel with the Strategy name.
      Setting to true does not add another panel and keeps the indicators on separate panels.
      Last edited by ATMtrader0001; 01-06-2022, 09:06 AM.

      Comment


        #4
        Hello AMTTrader0001,

        I would like to give more direct advise with an example using NinjaTrader System indicators.

        Could you give me an example for Indicator 1 and Indicator 2 and be specific on where you want the plotted?

        IE. Indicator 1 SMA, Indicator 2 MACD, I would like to have the SMA plotted in the MACD panel.

        Comment


          #5
          It is two different timeframes of the Indicator. It happens with any Indicater I have tried e.g. MACD, CCI, Bollinger Bands,

          I even tried with EMA and SMA but they got plotted to the Price Panel and not to a different panel.

          I want both plotted onto Panel 2
          Last edited by ATMtrader0001; 01-06-2022, 09:42 AM.

          Comment


            #6
            Hello ATMTrader0001,

            I've clarified my direction in Post #2.

            IsOverlay must be false, and then we can change the Panel of the indicator.

            For example:

            Code:
            SMA1 = SMA(Close, 14);
            EMA1 = EMA(Close, 14);
            
            SMA1.IsOverlay = false;
            EMA1.IsOverlay = false;
            
            EMA1.Panel = SMA1.Panel = 1;
            
            AddChartIndicator(SMA1);
            AddChartIndicator(EMA1);

            Comment


              #7
              So I have setup my code as above

              I have Declared the Indicators that I want with different periods. Then used the code you posted above. Adding the Line colors I want and then put them
              on Panel 2.

              Indicator1.IsOverlay = false;
              Indicator2.IsOverlay = false;

              Indicator1.Plots[0].Brush = Brushes.Green;
              Indicator2.Plots[0].Brush = Brushes.OrangeRed;

              Indicator1.Panel = Indicator2.Panel = 2;

              AddChartIndicator(Indicator1);
              AddChartIndicator(Indicator2);

              Even with the code above I get Indicator1 in Panel 2 and Indicator2 in Panel 3.

              I even tried to copy the code you have above:

              SMAFast = SMA(Close, Fast);
              EMASlow = EMA(Close,Slow);

              SMAFast.IsOverlay = false;
              EMASlow.IsOverlay = false;

              SMAFast.Plots[0].Brush = Brushes.Green;
              EMASlow.Plots[0].Brush = Brushes.OrangeRed;

              SMAFast.Panel = EMASlow.Panel = 1;

              AddChartIndicator(SMAFast);
              AddChartIndicator(EMASlow);

              And these indicators still end up in Panel 2 and Panel 3 respectively regardless of which Panel I set them to display on.

              Comment


                #8
                Hello ATMTrader0001,

                Keep in mind that panel indexing will start at 0.

                We should also consider removing the strategy completely and re-adding to properly test changes when we add indicators in a strategy.

                I have attached my test scripts from this morning that you may import and test on your end.

                Please feel free to modify the attached scripts and show a screenshot of what you see if you have additional questions.

                image_71229.zip
                Attached Files
                Last edited by NinjaTrader_Jim; 01-07-2022, 12:26 PM.

                Comment


                  #9
                  I don't see your attached scripts. I saw the two screenshots.

                  I will start over tomorrow.
                  Thanks for your help so far.

                  Comment


                    #10
                    Is there any update on the scripts which you said were attached?

                    This is still not working and would like to figure out why.

                    Comment


                      #11
                      Hello ATMTrader0001,

                      I asked IT to have a look at the attachment issue. It was there for a moment yesterday, and I went back and made sure a link to the attachment was included in the body of the post.

                      Direct Link: https://ninjatrader.com/support/foru...tch?id=1184708

                      Comment


                        #12
                        Thanks for the files. I took the files you provided and implemented, but I still get the same results. See screenshot. It was the same for both
                        strategy files provided.

                        What I have done, is open a new Chart with what I am looking to trade, added the Strategy to that Chart, then Enabled that Strategy in the Strategy tab.

                        Is that the correct way, or should I be doing this differently?

                        I did notice that I am on NT 8.0.25.0 and you are on NT 8.0.26.0.

                        I did not check the Indicator files you attached, but I suspect they are unchanged?
                        Attached Files
                        Last edited by ATMtrader0001; 01-07-2022, 01:13 PM.

                        Comment


                          #13
                          Hello ATMtrader0001,

                          I switched back to Release 25 and the results are the same as my screenshots in post #8.

                          Please test a clean environment. If you see different behavior testing the scripts from post #8, in the Clean Environment, would you be willing to schedule a remote support session with me so we can test these scripts in a clean environment, just as I have?

                          Clean Environment Test:

                          Creating a clean environment can be done by following the steps below:
                          1. Close NinjaTrader 8, and rename the "NinjaTrader 8" folder in My Documents to something like: "NinjaTrader 8 OLD" Do not delete this folder.
                          2. Uninstall NinjaTrader from the Windows Control Panel
                          3. Delete the C:\Program Files (x86)\NinjaTrader 8 folder
                          4. Reinstall using the installer from http://ninjatrader.com/PlatformDirect
                          5. Test importing the scripts from post #8. Please email me at scriptingsupport [at] ninjatrader [dot] com with the text "Attn Jim 3429011" and please also include a link to this thread. I can arrange a time to test this specific script next week as early as 9AM EST and I can schedule as late as 4:30PM EST.
                          If you ever need to switch back to your original platform, you may do so by closing NinjaTrader and swapping the platform folder names.

                          For example, Close NinjaTrader and rename the new "NinjaTrader 8" folder to "NinjaTrader 8 NEW" and the "NinjaTrader 8 OLD" folder to "NinjaTrader 8." Then restart the platform. Simply put: NinjaTrader 8 will always load the "NinjaTrader 8" folder in My Documents.

                          Comment


                            #14
                            Rather than follow your steps here's what I did.

                            I installed a fresh version of the Latest Windows 10.
                            I installed the current version of NT8
                            I installed the files you provided.

                            While I did not setup my data feed I did open a new ES Chart and added the SMAPanel2 Strategy you provided updating all the files.

                            As you can see in the attached screenshot, the SMA and EMA are showing in Different panels (not in the same panel as I am trying to do).

                            Using the we can rule out that it is the setup on My current computer since all software is default (Windows 10 and NT 8).

                            Is there something else I am missing?

                            Here's what I did:
                            Fresh Windows 10 Install using latest image
                            Fresh NT 8 Installl using defaults
                            I imported the ZIP file you provided and updated all files you included
                            I Opened a New ES Chart and added the Strategy above (not enabled)
                            I then Enabled the Strategy on the Strategy Tab (as shown in Capture2).
                            It then showed the EMA and SMA in different Panels as shown.

                            I disabled the strategy and then closed the Chart
                            I then Opened a new Chart for ES
                            I then added the Strategy and clicked the Enable button and clicked OK
                            Now both EMA and SMA are showing in the same panel as desired.
                            I then Disabled the Stategy on the Strategy Tab
                            I then Enabled the Strategy on the Strategies Tab (as shown in Capture2) and EMA/SMA are in different Panels.

                            I performed the same steps on my Live computer, and I get the same results.

                            So that begs the question as to why Enabling the Strategy on the Strategies tab produces different results than when
                            clicking Enabled when selecting Strategies on the Chart an enabling there.

                            At the end of the day I shutdown my workstation and the next trading day I start my workstation and enable the strategies
                            on the Strategies tab (as shown in Capture2). I would expect consistent behavior regardless of how/where I Enable the
                            strategy.

                            Please open a Bug on this after you verify that you can recreate this, or provide additional steps to get this to work.
                            Attached Files

                            Comment


                              #15
                              Hello ATMTrader0001,

                              Got it, thank you. That makes the difference. I have opened an internal ticket for further review.

                              In the mean time, enabling from the chart will give you your desired result.

                              UPDATE:

                              This issue has been addressed in NTEIGHT-15128. The number associated with this ticket number will be noted in the Release Notes page of the Help Guide when Release 26 comes out. (I cannot offer an ETA on when that will be.)

                              Last edited by NinjaTrader_Jim; 02-18-2022, 11:27 AM.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by NullPointStrategies, Yesterday, 05:17 AM
                              0 responses
                              56 views
                              0 likes
                              Last Post NullPointStrategies  
                              Started by argusthome, 03-08-2026, 10:06 AM
                              0 responses
                              133 views
                              0 likes
                              Last Post argusthome  
                              Started by NabilKhattabi, 03-06-2026, 11:18 AM
                              0 responses
                              73 views
                              0 likes
                              Last Post NabilKhattabi  
                              Started by Deep42, 03-06-2026, 12:28 AM
                              0 responses
                              45 views
                              0 likes
                              Last Post Deep42
                              by Deep42
                               
                              Started by TheRealMorford, 03-05-2026, 06:15 PM
                              0 responses
                              49 views
                              0 likes
                              Last Post TheRealMorford  
                              Working...
                              X