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.

    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

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Leeroy_Jenkins, 01-23-2021, 03:00 AM
            1 response
            23 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by vantojo, Today, 09:32 AM
            1 response
            5 views
            0 likes
            Last Post NinjaTrader_Kate  
            Started by FelipeRXP, Today, 08:40 AM
            2 responses
            13 views
            0 likes
            Last Post FelipeRXP  
            Started by petedian, Today, 08:44 AM
            0 responses
            16 views
            0 likes
            Last Post petedian  
            Started by J0shTrader, Yesterday, 12:29 PM
            1 response
            3 views
            0 likes
            Last Post NinjaTrader_ChrisL  
            Working...
            X