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

Menu item "days to load" ; "min. bars required"

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

    Menu item "days to load" ; "min. bars required"

    Hello,
    I have a question for the full assurance that I understand the matter.
    When setting the strategy set "days to load" what exactly? It is the number of days that are downloaded into a "stack" of graphs which are then interpreted and strategy?

    A menu item "Min. bar required "is exactly what? It is the number of bars that will be recorded from the beginning of the period skipped? What is this function good? This value is the number of days? Or do I need for 5min chart value (* 24hour 60min) / 5min?

    -If I am using multiinstrument strategy on 5 min chart with day instrument where I get ATR data what values should I enter into both items? Are they affecting second instrument as well?
    For days to load, say, 60 and for min bars required 20?

    Are these two items dependent on each other?




    Thank you very much

    #2
    Hello fLife,

    Thanks for your post.

    The days to load will determine how many days of historical data will be downloaded on your computer starting with the End date moving backwards. If Days to load is set to 5, and the interval type is minute, then 5 days of historical data will be downloaded to your computer.
    This is used for both charts and for back-testing over data.

    Min bars required is the number of bars that have to pass before the strategy will start evaluating.
    Lets say that you check a close price 10 bars ago in the code of your script. If you call Close[10] on the first historical bar and BarsRequired is set to 0, this will cause an error and break your script. If you call Close[10] then BarsRequired needs to be set to 11. (This ensures there is enough data to prevent an error from breaking the script)

    With multiple data series the BarsRequired should apply to all added data series, but its always best practice to hard code into your script a check that all CurrentBar indexes are greater than BarsRequired.
    For example:
    if (CurrentBars[0] < BarsRequired || CurrentBars[1] < BarsRequired)
    return;
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Patlpp, 08-16-2021, 03:10 PM
    11 responses
    504 views
    0 likes
    Last Post NinjaTrader_LuisH  
    Started by DawnTreader, Yesterday, 05:58 PM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by ntram, Yesterday, 05:39 PM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by bmarovets, Yesterday, 06:33 PM
    1 response
    15 views
    0 likes
    Last Post NinjaTrader_LuisH  
    Started by FishTrade, Yesterday, 03:42 PM
    1 response
    12 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Working...
    X