• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

EMA Indicator - Strategy errors from No Values in first few Bars

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

    EMA Indicator - Strategy errors from No Values in first few Bars

    I am getting errors saying the program cannot access EMAClose[2] because it is out of range. It takes about 15 bars for the EMA to calculate and begin to display on my chart. How do I code around that fact? I need it to wait 10 bars on the first day of data (not every day, just the first). After that initial period it displays. I am lost on how to code for that. Any help is appreciated.
    Thanks

    #2
    Hello cpabiz20k,
    Thanks for your post.

    This is a common error that is caused when a script tries to access an index that is not yet valid. The specific check you need to do will be highly dependent on your own custom logic.

    You can resolve this error by implementing the concepts in the help guide page at the following link: https://ninjatrader.com/support/help...nough_bars.htm

    Let me know if you have any questions.
    Josh G.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Nat11, Today, 04:30 AM
    1 response
    12 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by Option Whisperer, Yesterday, 11:50 AM
    2 responses
    10 views
    0 likes
    Last Post Option Whisperer  
    Started by TraderJim618, Yesterday, 01:20 PM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_ChrisL  
    Started by drpapp, 01-24-2019, 06:57 AM
    6 responses
    72 views
    1 like
    Last Post brucerobinson  
    Started by ttodua, 12-06-2019, 11:40 PM
    1 response
    13 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X