Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Drawing of SMA to Panel

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

    Drawing of SMA to Panel

    Hi,

    i have just a simple question!
    How can i draw a SMA directly to a defined Panel?

    smaFilterCTF01.Panel = 1; -- draws SMA directly to chart.
    smaFilterCTF01.DrawOnPricePanel = false; -- also provides no positive effect. SMA-Values always showing on chart.


    else if (State == State.DataLoaded)
    {
    // Add Indicator (SMA)
    smaFilterCTF01 = SMA(Closes[0], iAnalysisCTF_SMAC01__Value_Periode);
    smaFilterCTF01.Plots[0].Brush = Brushes.Gray;
    smaFilterCTF01.Panel = 1;
    smaFilterCTF01.DrawOnPricePanel = false;
    AddChartIndicator(smaFilterCTF01);
    .
    .
    .
    .


    May somebody have a simple hint... :-)

    With best regards,
    Peter

    #2
    Hello PeterGolz,

    Thanks for your post.

    If you change smaFilterCTF01.Panel = 1; to smaFilterCTF01.Panel = 2; does that draw the SMA in a new panel?

    Reference: https://ninjatrader.com/support/help..._strategie.htm

    DrawOnPricePanel would only relate to Draw.items such as Draw.Line, Draw.rectangle, etc.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Hi Paul,

      thanks for your feedback!

      Index of Panels start with 1 or with 0?
      What is the Panel-Index for Charting?

      With best regards,
      Peter

      Comment


        #4
        Hello PeterGolz,

        Thanks for your reply.

        Technically the panel index is zero-based so the price panel is 0 however the user interface would be 1 so you could use 0 or 1 and they will both point to the price panel. To add an indicator to an indicator panel it would have to be 2 or greater.





        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Hi Paul,

          i tried to implement your advices.
          Unfortanly without any positive rersult.

          1.)
          // Add Indicator (SMA)
          smaFilterCTF01 = SMA(Closes[0], iAnalysisCTF_SMAC01__Value_Periode);
          smaFilterCTF01.Plots[0].Brush = Brushes.Red;
          smaFilterCTF01.Panel = 2;
          AddChartIndicator(smaFilterCTF01);

          Shows SMA directly on Panel (0) - Price Panel.


          2.)
          // Add Indicator (SMA)
          Panel = 2;
          smaFilterCTF01 = SMA(Closes[0], iAnalysisCTF_SMAC01__Value_Periode);
          smaFilterCTF01.Plots[0].Brush = Brushes.Red;
          AddChartIndicator(smaFilterCTF01);

          Shows SMA on a seperate Panel (2), but all other EMA's also moving to this Panel. (Definition for EMA's was above SMA and with and without explicit panel definition...)


          I don't understand this concept!?
          Is there a general problem?
          Someboby have a hint for me?

          If i define what i'm looking for manually, it works fine...
          Last edited by PeterGolz; 08-06-2020, 01:53 AM.

          Comment


            #6
            Hello PeterGolz,

            Thanks for your reply.

            If your indicator has multiple plots, you can only send the entire indicator (all of its plots) to either the price panel or the indicator panel. There would be no options to change this.

            I have attached an example strategy that you can test with that adds an HMA either to the chart or creates an indicator panel based on a bool value that you can change when applying the strategy. To use: apply to a chart and enable, to change, disable the strategy, uncheck the bool checkbox ShowInPricePanel, re-enable and apply the strategy.

            To Import
            1. Download the NinjaScripts to your desktop, keep them in the compressed .zip file.
            2. From the Control Center window select the menu File> Utilities> Import NinjaScript
            3. Select the downloaded .zip file
            4. NinjaTrader will then confirm if the import has been successful.

            Critical - Specifically for some NinjaScripts, it will prompt that you are running newer versions of @SMA, @EMA, etc. and ask if you want to replace, press 'No'


            AddingIndicatorTest.zip
            Paul H.NinjaTrader Customer Service

            Comment


              #7
              Hi Paul,

              i really thanks you for your sample code!
              But when i drive this strategie on Backtest-Engine a switch of HMA never occurs between PriceChart and IndicatorPanel. (see Attachment)
              (Run Strategie with with parameter [ShowInPricePanel] true AND false!!!)

              Could you confirm this behaviour?


              With best regards,
              Peter

              Comment


                #8
                Hello PeterGolz,

                Thanks for your reply.

                Yes, this would be expected behavior in the Strategy Analyzer and my example shows that as well.

                An indicator that normally defaults to the price panel, like an SMA, can only be shown in the price panel in the strategy analyzer. This is not the case with live charts where you can assign any indicator to its own panel if you wish.

                We are tracking interest in this feature for the strategy analyzer so I will add your vote to SFT-3258, "Allow NinjaScript Panel manipulation in the Strategy Analyzer.".

                Feature Request Disclaimer.
                We receive many requests and cannot reasonably implement all requested features or changes. Interest is tracked internally and if enough interest is tracked, it would be weighed against how feasible it would be to make those changes to consider implementing.
                When new features are implemented, they will be listed in the Release Notes page of the Help Guide. The ID number will be different than the internal feature request tracking ID, but the description of the feature will let you know if that feature has been implemented.
                Release Notes - https://ninjatrader.com/support/help...ease_notes.htm
                Paul H.NinjaTrader Customer Service

                Comment


                  #9
                  So just to confirm... Did we ever discover if its possible to specify the chart indicator on the price panel in any way? Such as EMA1.Panel=1 or 0 or as ChartIndicators[0].Panel = 0 etc... I am not able to see either EMA on chart summary under strategies.

                  -Chad
                  chadnash
                  NinjaTrader Ecosystem Vendor - Nash Technologies

                  Comment


                    #10
                    Hello chadnash,

                    Thanks for your post and welcome to the Ninjatrader forums!

                    Yes, download the example strategy in Post#6 of this thread.

                    It uses a bool that you can set when you apply the strategy to "show in price panel" an HMA indicator. If unchecked the HMA is directed to its own panel.

                    References:




                    Paul H.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by algospoke, Yesterday, 06:40 PM
                    2 responses
                    23 views
                    0 likes
                    Last Post algospoke  
                    Started by ghoul, Today, 06:02 PM
                    3 responses
                    14 views
                    0 likes
                    Last Post NinjaTrader_Manfred  
                    Started by jeronymite, 04-12-2024, 04:26 PM
                    3 responses
                    45 views
                    0 likes
                    Last Post jeronymite  
                    Started by Barry Milan, Yesterday, 10:35 PM
                    7 responses
                    21 views
                    0 likes
                    Last Post NinjaTrader_Manfred  
                    Started by AttiM, 02-14-2024, 05:20 PM
                    10 responses
                    181 views
                    0 likes
                    Last Post jeronymite  
                    Working...
                    X