Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Displacement Workaround

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

    Displacement Workaround

    I am trying to plot four or five different moving averages with displacements of different days each into the future. Because of the nature of "Displacement" in Scripts it can only be set or used once. Therefore, I can not write just one custom script to get this job done.

    My question is if myDataSeries[0] represents the value of the current bar, and myDataSeries[1] represents the value of one bar in the past, then does myDataSeries[-2] represent the value of the dataseries two bars in the future?

    If I set such values, will they plot as other moving averages do?

    In this way, I might be able to make up for the shortcomings of "Displacement" and get the job done I need to.

    Thanks in advance,
    Joe_T

    #2
    Hello Joe_T, and thank you for your question. While at one point a negative index did refer to a bar in the future, negative indexing is not supported in NinjaTrader 8. To work around this limitation, I would like to recommend creating another bars series that is populated with time offset values in the future with respect to myDataSeries, and plotting off this data series. Please let us know if there are any other ways we can help.
    Jessica P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    557 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    324 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    545 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    547 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X