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 kinfxhk, 07-14-2026, 09:39 AM
        0 responses
        127 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 07-13-2026, 10:18 AM
        0 responses
        105 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 07-13-2026, 09:50 AM
        0 responses
        85 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 07-13-2026, 07:21 AM
        0 responses
        105 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 07-11-2026, 02:11 AM
        0 responses
        86 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X