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

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 ETFVoyageur, 04-30-2024, 02:04 PM
    7 responses
    42 views
    0 likes
    Last Post eDanny
    by eDanny
     
    Started by f.saeidi, Today, 07:07 AM
    5 responses
    14 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by Creamers, 04-27-2024, 05:32 AM
    9 responses
    60 views
    0 likes
    Last Post Creamers  
    Started by cmtjoancolmenero, 04-29-2024, 03:40 PM
    19 responses
    59 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by samish18, 04-17-2024, 08:57 AM
    26 responses
    116 views
    0 likes
    Last Post samish18  
    Working...
    X