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 CarlTrading, 03-31-2026, 09:41 PM
              1 response
              68 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by CarlTrading, 04-01-2026, 02:41 AM
              0 responses
              38 views
              0 likes
              Last Post CarlTrading  
              Started by CaptainJack, 03-31-2026, 11:44 PM
              0 responses
              62 views
              1 like
              Last Post CaptainJack  
              Started by CarlTrading, 03-30-2026, 11:51 AM
              0 responses
              62 views
              0 likes
              Last Post CarlTrading  
              Started by CarlTrading, 03-30-2026, 11:48 AM
              0 responses
              53 views
              0 likes
              Last Post CarlTrading  
              Working...
              X