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

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.

    Paul H.NinjaTrader Customer Service

    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.
        Paul H.NinjaTrader Customer Service

        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
          Paul H.NinjaTrader Customer Service

          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.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by briansaul, Today, 05:31 AM
                    0 responses
                    1 view
                    0 likes
                    Last Post briansaul  
                    Started by fwendolynlpxz, Today, 05:19 AM
                    0 responses
                    4 views
                    0 likes
                    Last Post fwendolynlpxz  
                    Started by traderqz, Yesterday, 12:06 AM
                    11 responses
                    28 views
                    0 likes
                    Last Post NinjaTrader_Gaby  
                    Started by PaulMohn, Today, 03:49 AM
                    0 responses
                    8 views
                    0 likes
                    Last Post PaulMohn  
                    Started by inanazsocial, Today, 01:15 AM
                    1 response
                    10 views
                    0 likes
                    Last Post NinjaTrader_Jason  
                    Working...
                    X