Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.

    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 adeelshahzad, Today, 03:54 AM
      5 responses
      32 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by stafe, 04-15-2024, 08:34 PM
      7 responses
      32 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by merzo, 06-25-2023, 02:19 AM
      10 responses
      823 views
      1 like
      Last Post NinjaTrader_ChristopherJ  
      Started by frankthearm, Today, 09:08 AM
      5 responses
      21 views
      0 likes
      Last Post NinjaTrader_Clayton  
      Started by jeronymite, 04-12-2024, 04:26 PM
      3 responses
      43 views
      0 likes
      Last Post jeronymite  
      Working...
      X