Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

6.5 plot 5 minute ema on a range chart question

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

    6.5 plot 5 minute ema on a range chart question

    Hi,

    I have been trying to plot an 8 period EMA from a 5 minute chart on a 6 range chart. Used the SampleStrategyPlot example and it works almost perfect. The average is exactly the same but shifted over one bar.

    the only real line i code that i added was:

    //StrategyPlot(0).Value.Set(High[0]);
    //StrategyPlot(1).Value.Set(Highs[1][0]);
    StrategyPlot(0).Value.Set(EMA(BarsArray[1],8)[0]); // this line was changed...

    Is there a way to shift the moving average back one bar.
    I have not been able to figure it out.
    Any direction would be appreciated?

    I've attached a JPG and the actual indicator/strategy...

    Regards

    Sammy
    Attached Files

    #2
    Hello SammyC,

    With version 6.5 secondary series should be smaller than primary series. When using range bars mixed with time, this will not always be the case. Sometimes one will update before the other, but the primary series is always processed first.

    This is a limitation that has been addressed in version 7, and you also don't have to plot from within a strategy. Please evaluate any multi series indicators with version 7 and let us know if it's not working the way you expect.

    If you would like to pursue shifting the moving average one bar back, can look at DataSeries class which offers advanced overload of this:


    DataSeries.Set(int barsAgo, double value)
    You can also set the value for historical bars by including a "barsAgo" value that represents the number of bars ago that you want the double value to be stored at.
    Ryan M.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    57 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    143 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    161 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    97 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    276 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X