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 sjsj2732, Yesterday, 04:31 AM
    0 responses
    22 views
    0 likes
    Last Post sjsj2732  
    Started by NullPointStrategies, 03-13-2026, 05:17 AM
    0 responses
    280 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    279 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    130 views
    1 like
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    90 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Working...
    X