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