Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

AddChartIndicator not working in Strategy Analyzer charts

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

    AddChartIndicator not working in Strategy Analyzer charts

    With the code below I try to show an indicator in the Strategy Analyzer chart, but it's not working.
    1. Run a backtest in Strategy Analyzer
    2. Display Trades
    3. Select one trade, right click and open Chart...
    4. Indicator missing
    Version 8.0.21.1 64-bit on Win10.

    Any ideas? Many thanks.


    Code:
    namespace NinjaTrader.NinjaScript.Strategies
    {
        public class StrategyAddIndicators : Strategy
        {
            protected override void OnStateChange()
            {
                if (State == State.SetDefaults)
                {
                    Description                                    = @"Enter the description for your new custom Strategy here.";
                    Name                                        = "StrategyAddIndicators";
                    Calculate                                    = Calculate.OnBarClose;
                }
                else if (State == State.DataLoaded)
                {
                     AddChartIndicator(SMA(20));
                }
            }
    
            protected override void OnBarUpdate()
            {
                EnterLong();
                double sma = SMA(20)[0];
            }
        }
    }


    #2
    Hello wglmn,

    Thanks for your post.

    This would be expected behavior when selecting a singular trade from the trades display. The intent of the "Chart" selection here is to display quickly where the trade appears Indicators are not added to this display..

    To see your indicator on a chart, please set the the strategy analyzer Display to "Chart" which will display the added indicators. In the display Chart you can right mouse click on the time scroll bar slider button, select "Go to.." and enter the specific date/time to move the chart display to.

    Comment


      #3
      Hello Paul,

      Got it, but the "display quickly" chart makes nosense without indicators, at least it should use the default template, or better the indicators used in the strategy.

      Could this be a new feature request?

      Many thanks!

      Comment


        #4
        Hello wglmn,

        Thanks for your reply.

        I will write up a feature request. Please note that this does not mean the feature will be implemented.

        I will update this thread when i have further information.

        Thanks in advance for your suggestion and patience.

        Comment


          #5
          Hello wglmn,

          The feature request has been entered as SFT-4855, "Accessing a chart in the Strategy Analyzer by right clicking on a trade and selecting Chart to show with bar type and added indicators".

          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

          Comment


            #6
            Thanks Paul!

            Comment


              #7
              Originally posted by NinjaTrader_PaulH View Post
              Hello wglmn,

              Thanks for your reply.

              I will write up a feature request. Please note that this does not mean the feature will be implemented.

              I will update this thread when i have further information.

              Thanks in advance for your suggestion and patience.
              ++++1
              Please add me also to this request!
              It is ridiculous that you guys explain thoroughly how to add an indicator to the STRATEGY code to be able to see the indicators
              in backtesting and optimization via "AddChartIndicator" etc and when you REALLY need to see the indicators where there is a problem
              on the losses in "Trades" page and you right click on "Chart" which bring you QUICKLY to the exact point of the problem with your strategy - there
              are NO INDICATORS there and you need to add them MANUALLY one by one.
              Please add this ASAP and it is a quick fix (i am a senior .NET / C# programmer) because it is already working on the main "chart" page of the strategy analyzer
              of backtesting.
              Regards.

              Isaac.

              Comment


                #8
                add my vote as well, it's frustrating, when I set up indicators in strategy analyzer, and then just want to jump to particular trade from Trades tab and then all indicators are not displayed on that particular trade, but are displayed in Chart tab.

                Comment


                  #9
                  Hello UltraNIX,

                  I've added your vote to SFT-4855.

                  Thanks for your voice.
                  Chelsea B.NinjaTrader Customer Service

                  Comment


                    #10
                    I know this is an old post but please add my vote to this as well.
                    Thanks.
                    Aviram Y
                    NinjaTrader Ecosystem Vendor - Aviram Y

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by NullPointStrategies, Yesterday, 05:17 AM
                    0 responses
                    62 views
                    0 likes
                    Last Post NullPointStrategies  
                    Started by argusthome, 03-08-2026, 10:06 AM
                    0 responses
                    134 views
                    0 likes
                    Last Post argusthome  
                    Started by NabilKhattabi, 03-06-2026, 11:18 AM
                    0 responses
                    75 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
                    50 views
                    0 likes
                    Last Post TheRealMorford  
                    Working...
                    X