Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error compiling indicator in Ninja7.

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

    Error compiling indicator in Ninja7.

    Hello all,

    I receive this error when trzing to compile my indicator in NT7(last version):

    Error on calling 'OnBarUpdate' method for indicator 'EmaTrend' on bar 0: You are accessing an index with a value that is invalid since its out of range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart.

    here a copy of the code that I created:

    // Accelleration
    if (
    EMA(8)[0] > EMA(8)[1]
    && EMA(13)[0] > EMA(13)[1]
    && EMA(21)[0] > EMA(21)[1]
    )

    I just want to say: if EMA8(actual bar) > EMA8(precedent bar).. then

    did I missed something?

    Thanks!

    Frederic

    #2
    Hello,

    Thanks for your forum post.

    There is one small thing your missing which is located here:



    Let me know if I can be of further assistance.
    BrettNinjaTrader Product Management

    Comment


      #3
      Hello Brett,

      thanks for info, it helped me. Have a nice day

      Regards,
      Frederic

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      636 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      366 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      107 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      568 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      571 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X