Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Why ChartBars is always null in Strategy Analyzer?

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

    Why ChartBars is always null in Strategy Analyzer?

    I am trying to change a few ChartBars properties during OnStateChange State.DataLoaded, and it seems like ChartBars is always set to null while in Strategy Analyzer.

    Check this code, it is always returning "*** ChartBars==null").

    Any ideas?

    Code:
    protected override void OnStateChange()
    {
        if (State==State.DataLoaded)
        {        
            if (ChartBars!=null)
            {
                ChartBars.Properties.PlotExecutions = ChartExecutionStyle.MarkersOnly;
                ChartBars.Properties.IsStableSession = false;
                Print("OnStateChange DataLoaded PlotExecutions="+ChartBars.Properties.PlotExecutions+", IsStableSession="+ChartBars.Properties.IsStableSession);
            }
            else
                Print("*** ChartBars==null");
        }
    }​

    #2
    There definitely should NOT be a ChartBars in Strategy Analyzer because no chart is being displayed. This is all in the documentation https://ninjatrader.com/support/help...?chartbars.htm - have you read through to see what ChartBars is?
    Bruce DeVault
    QuantKey Trading Vendor Services
    NinjaTrader Ecosystem Vendor - QuantKey

    Comment


      #3
      Thank you Bruce. How can I avoid the missy text when displaying the Chart on the Strategy Analyzer?

      Comment


        #4
        I don't think you can - maybe someone at NinjaTrader will shine some light on this but to my recollection the only thing that chart does is show the trades with their markers (I see that's one of the things you're trying to do there) - I don't think it can display indicators or text or anything of that sort.

        Also, I don't know about setting ChartBars.Properties.IsStableSession = false during State.DataLoaded - at that point, the data is already loaded. That seems unwise. You might be able to change that setting during State.Configure but even then, I wouldn't recommend trying to change ChartBars - that's a construct that is only for visualization.

        It seems like your question could be summed up as you want to only show the markers and not the associated text in the mini-chart that is shown in Strategy Analyzer. Perhaps NinjaTrader support can advise if that is possible.
        Bruce DeVault
        QuantKey Trading Vendor Services
        NinjaTrader Ecosystem Vendor - QuantKey

        Comment


          #5
          Hello, thanks for writing in. Unfortunately, It is not possible because the strategy is not using that specific chart embedded in the strategy analyzer. I will submit a feature request to add in the Data Series properties so the chart markers can be adjusted through the strategy analyzer.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Today, 05:17 AM
          0 responses
          38 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          124 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          64 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          41 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          46 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X