Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Code question .

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

    Code question .

    If this: [1]: displaces a Moving average one bar to the right .... Does this
    [-1] displaced it one bar to the Left ? It verifies ,but nothing shows up on
    a chart when I try to plot it ....

    #2
    T2020,

    [1] does not displace the indicator. All it does is access the value of the indicator on the previous bar. [-1] does not make sense as there is no bars at that index location.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      OK , in the screen shot the Blue line represents :
      fastEma.Set(SMA(Input, Fast)[0]);

      And the Black line represents :
      fastEma.Set(SMA(Input, Fast)[1]);

      The black line appears to be offset one bar the right and there is a plot
      on the current bar .
      But I see what your saying ,you can't reference a bar that hasn't been
      created yet . right ?
      Attached Files

      Comment


        #4
        Correct. You cannot select a value to set your plot that does not exist yet.
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        567 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        330 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
        547 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        548 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X