Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 timko, Today, 06:45 AM
        1 response
        7 views
        0 likes
        Last Post gaz0001
        by gaz0001
         
        Started by Waxavi, 04-19-2024, 02:10 AM
        3 responses
        41 views
        0 likes
        Last Post gaz0001
        by gaz0001
         
        Started by Max238, Today, 01:28 AM
        2 responses
        26 views
        0 likes
        Last Post NinjaTrader_ChristopherJ  
        Started by Shansen, 08-30-2019, 10:18 PM
        25 responses
        949 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by JonesJoker, 04-22-2024, 12:23 PM
        8 responses
        45 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X