Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Cannot reference data far back enough

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

    Cannot reference data far back enough

    I am working on a system which references a certain amount of bars prior to the current bar to make certain calculations. The strategy only allows me to reference up to twenty bars ago. For example, if I use Close[20], I get the value for the close of the bar that occurred 20 bars ago. However, if I use Close[21], it is not defined (it is undefined for any value past 20). Is there a limit on how many bars back a strategy can reference, and if so, is there any way to get around it?

    #2
    You can reference as far as you have historica data for. If you reference Close[21] and data does not exist for this then you will get an out of index error and your strategy will terminate and an error message is throw to the Log tab.
    RayNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, Yesterday, 10:06 AM
    0 responses
    20 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    18 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    14 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    9 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    38 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X