Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bars.From and Bars.To

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

    Bars.From and Bars.To

    Hi,

    I scripted an indy for S/R lines from higher time frames and I use Data.Bars.GetBars() to load up extra history so that I don't need to have a chart showing huge amounts of history of the smaller time frame.

    Now I'm just refining the indy now and I am parameterizing the number of days of secondary data that I load in the OnStartup() event e.g. so the user is displaying the 5min chart and wants to see S/R based on the daily time frame using 60 days of data, the user would set this new parameter to 60, logically.

    However in the circumstance that the user is displaying 15 days of data on the chart, I want to load up only 60 - 15 = 45 days, to keep it consistent relative to the 'Days To Load' setting on the chart's data settings.

    How can I get this DaysToLoad setting? It doesn't seem to exist.

    From guesswork looking at the C# auto-completion options, I can use "Bars.From" and "Bars.To" which equals DaysToLoad.

    However this isn't documented - why is that? Is there a better way to do it?

    #2
    These are internal methods that are subject to change, which is why we do not have documentation as we cannot gurantee they will continue to work.

    This would be the best solution for your project and you're free to use them, just keep in mind that it is possible for these functions to change in future releases that may break you logic.
    MatthewNinjaTrader Product Management

    Comment


      #3
      Logically my next question has to be, is this changing in NT8?

      Also do you recommend any other approach?

      Comment


        #4
        There will be several code breaking changes to the next major release, but it's too early for us to say what exactly will be changing.

        We're expecting to have further documentation/support for these areas in that version.

        This would be the recommended approach.
        MatthewNinjaTrader Product Management

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        579 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        334 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        554 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X