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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        152 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        87 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        131 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        127 views
        1 like
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        106 views
        0 likes
        Last Post CarlTrading  
        Working...
        X