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.

    Chris L.NinjaTrader Customer Service

    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.
        Chris L.NinjaTrader Customer Service

        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!
              Chris L.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by PaulMohn, Today, 12:36 PM
              1 response
              14 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Started by yertle, Yesterday, 08:38 AM
              8 responses
              36 views
              0 likes
              Last Post ryjoga
              by ryjoga
               
              Started by rdtdale, Today, 01:02 PM
              1 response
              6 views
              0 likes
              Last Post NinjaTrader_LuisH  
              Started by alifarahani, Today, 09:40 AM
              3 responses
              17 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by RookieTrader, Today, 09:37 AM
              4 responses
              20 views
              0 likes
              Last Post RookieTrader  
              Working...
              X