Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 PhillT, 04-19-2024, 02:16 PM
    4 responses
    34 views
    0 likes
    Last Post PhillT
    by PhillT
     
    Started by ageeholdings, 05-01-2024, 05:22 AM
    5 responses
    37 views
    0 likes
    Last Post ageeholdings  
    Started by reynoldsn, Today, 02:34 PM
    0 responses
    12 views
    0 likes
    Last Post reynoldsn  
    Started by nightstalker, Today, 02:05 PM
    0 responses
    18 views
    0 likes
    Last Post nightstalker  
    Started by llanqui, Yesterday, 09:59 AM
    8 responses
    31 views
    0 likes
    Last Post llanqui
    by llanqui
     
    Working...
    X