• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 7robert, Today, 08:11 AM
              3 responses
              47 views
              0 likes
              Last Post NinjaTrader_Kate  
              Started by madmen, Yesterday, 09:18 PM
              1 response
              12 views
              0 likes
              Last Post NinjaTrader_ChrisL  
              Started by stoner, Today, 09:01 AM
              1 response
              8 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by Conall, Yesterday, 04:00 PM
              1 response
              9 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by neoikon, Today, 08:43 AM
              2 responses
              10 views
              0 likes
              Last Post neoikon
              by neoikon
               
              Working...
              X