Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How can I get the value of "Days to load" of a strategy for internal calculations?

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

    How can I get the value of "Days to load" of a strategy for internal calculations?

    Hi NT,

    Could I get the value of "CurrentBar" within OnStartUp() ??

    How much would the impact be in ram memory when I set Maximum bars look to infinite, if I intend to use just 500 bars instead of 250?

    Thanks
    Last edited by pstrusi; 06-28-2019, 10:42 AM.

    #2
    Hello pstrusi, thanks for your note.

    CurrentBar will always be zero from within OnStartUp.

    As long as your computer meets the system requirements for NT7, setting Max lookback period to infinite is OK. The amount of ram taken should be negligible.

    Kind regards.

    Comment


      #3
      So, trying to get a workaround here: How can I get the value of: "Days to load" and "Minutes of a series" that is set in simulation, so I can do some internal calculations?
      Thanks

      Comment


        #4
        Hello pstrusi, thanks for your reply.

        You can use the BarsPeriod class to access this info:

        Print(BarsPeriod.Value.ToString());
        Print(BarsPeriod.BasePeriodType.ToString());

        It looks like this bit of undocumented code will return days to load:
        Bars.BarsData.DaysBack
        Last edited by NinjaTrader_ChrisL; 06-28-2019, 11:42 AM.

        Comment


          #5
          Thank you very much Chris, indeed useful.
          Kind regards!

          Comment


            #6
            I imagine that Bars.BarsData.DaysBack can be called within OnStartUp(), right?

            Comment


              #7
              Hi pstrusi, yes that is available through OnStartUp.

              All the best!

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Mindset, 04-21-2026, 06:46 AM
              0 responses
              102 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by M4ndoo, 04-20-2026, 05:21 PM
              0 responses
              144 views
              0 likes
              Last Post M4ndoo
              by M4ndoo
               
              Started by M4ndoo, 04-19-2026, 05:54 PM
              0 responses
              71 views
              0 likes
              Last Post M4ndoo
              by M4ndoo
               
              Started by cmoran13, 04-16-2026, 01:02 PM
              0 responses
              125 views
              0 likes
              Last Post cmoran13  
              Started by PaulMohn, 04-10-2026, 11:11 AM
              0 responses
              79 views
              0 likes
              Last Post PaulMohn  
              Working...
              X