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 popecapllc, 08-09-2023, 07:42 PM
              13 responses
              3,972 views
              0 likes
              Last Post tradgrad  
              Started by morrnel, 06-19-2020, 06:21 PM
              11 responses
              19,557 views
              0 likes
              Last Post patricia70  
              Started by trdninstyle, 01-06-2025, 01:36 PM
              1 response
              22 views
              0 likes
              Last Post tradgrad  
              Started by nrgful, Today, 04:19 AM
              0 responses
              7 views
              0 likes
              Last Post nrgful
              by nrgful
               
              Started by GeorgeW, 01-12-2025, 11:59 AM
              2 responses
              34 views
              0 likes
              Last Post GeorgeW
              by GeorgeW
               
              Working...
              X