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 Hwop38, 05-04-2026, 07:02 PM
        0 responses
        168 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        324 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        250 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        351 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        180 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Working...
        X