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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    58 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    80 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    43 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    101 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    61 views
    0 likes
    Last Post PaulMohn  
    Working...
    X