Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multiple time frames - how many bars back

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

    Multiple time frames - how many bars back

    Hello

    I have this strategy that I am testing in market replay. When only the primary data series is loaded (no Add() calls in the Initialize() function), and I reload ninjascript, it load several bars as historic data on the chart, shows the strategy's orders on those bars (and in strategy performance) and stands ready to start the replay.

    When I Add() another data series in the Initialize() function, it seems to change the number of bars loaded as historic without any code or system changes. What sets the number of bars loaded on secondary series and why does it affect the number of bars loaded for the primary series ?

    Thanks

    #2
    tickling, this would primarily be set by the range set for the primary series - what loading option do you use? Bars, Days or a Custom Range?

    Keep also in mind OnBarUpdate() would only be called then when all series have passed their BarsRequired.

    Comment


      #3
      Hello Bertrand,

      Thanks for answering.

      Dou you mean that OnBarUpdate() FOR EACH series is only called after ALL series have loaded enough bars ?

      What sets the range for the primary series ? Is it the default for the bar type on a chart ?

      The line I add is

      Add(PeriodType.Tick, 225)

      The primary series is a 10 range. What might cause the difference ? No code references the secondary series, just this line.

      Thanks

      Comment


        #4
        You would set the range as you create your chart in replay or as you setup the strategy in the tab.

        Correct, a MultiSeries strategy will start processing if the BarsRequired is fullfilled for all series it needs, so if this is set to 20, 20 bars need to be seen for both your series in the script.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        661 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        375 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        110 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        574 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        580 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X