Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi Timeframe Plot is Different Than Chart Plot for 60 Minute Chart

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

    Multi Timeframe Plot is Different Than Chart Plot for 60 Minute Chart

    Hi,

    I created a simple multi-timeframe 200-SMA plot for a 60-minute dataseries. But, when I add the plot to a 1-minute chart, I noticed that the 200-SMA 60-minute plot does not agree with the actual version of the 200-SMA on the 60-minute chart. This problem appears to only happen for a 60-minute data series. I tested for a 5-minute dataseries and it seems to be working fine. Can anyone tell me what I am doing wrong?

    Edit: I tested this problem using the stock "MAR" on 10/15/2010

    Thanks in advance



    Code:
    protected override void Initialize()
            {
                Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Plot0"));
                Add(PeriodType.Minute, 60);
                
                Overlay                = false;
            }
    
            /// <summary>
            /// Called on each bar update event (incoming tick)
            /// </summary>
            protected override void OnBarUpdate()
            {
                // Use this method for calculating your indicator values. Assign a value to each
                // plot below by replacing 'Close[0]' with your own formula.
               
                
                if (CurrentBar < 201 )
                 return;
                
                
                if (BarsInProgress != 0 )
                 return;
                Plot0.Set(SMA(BarsArray[1], 200)[0]);
            }

    #2
    Are you loading enough days back for your comparison charts? Also on the 60 minute chart, do you set CalculateOnBarClose = false to get the updated SMA 200 value for the last bar on the chart? Please also ensure all charts would use the same sessions to be comparable.

    Thanks,

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      Are you loading enough days back for your comparison charts? Also on the 60 minute chart, do you set CalculateOnBarClose = false to get the updated SMA 200 value for the last bar on the chart? Please also ensure all charts would use the same sessions to be comparable.

      Thanks,
      Hi Bertrand,

      Both charts are using the same session template and calculateonbarclose = false.

      The 60-minute chart is set to 100 days back but the 1-minute chart is only set to 8 days back. However, shouldn't Ninjatrader automatically pull the required 60-minute bars? Because I used the following code:

      if (CurrentBar < 201 )
      return;
      So shouldn't Ninjatrader pull at least 200 bars for the 60-minute chart? Could you test it on your end....

      Comment


        #4
        No, as you could not programmatically set how much data to load, it would depend on your primary series on the chart - so please try with longer lookbacks to ensure enough historical data to calculate out the 60 min 200 SMA series, then compare the 60 minute 200 SMA with CalculateOnBarClose = false to the 1 min chart running your MultiSeries indicator.

        Thanks,

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        606 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        353 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        105 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        560 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        561 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X