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

Multi Time frame when "load data based on bars" for chart

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

    Multi Time frame when "load data based on bars" for chart

    Scenario:

    a chart is set to a number of bars to load for the primary time frame of the chart.

    If i "Add" a secondary time frame what will it load?
    A: As far back in time as the number of bars back for the chart
    B. Same number of bars as the primary time frame even if goes back farther or less time back.
    I am thinking it will do "A".

    What I am wondering is if I add a higher time frame I want to go back farther in time for it but not on the base chart.
    Is this possible or will the look back time for added time frames always be the same as the chart.

    #2
    Hi ct, it would be the primary series you're working with setting the date range used for all series involved in the script. We have an enhancement to the Add() method on our consideration list, where you would specify the amount of data to load for each series then.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Bertrand

      Thank for the reply. We will see if the enhancement makes it someday.

      Comment


        #4
        Hi,

        I have still the same issue and could not find any solution for it.

        Is there a new possibility in the meantime?

        Thanks and best regards,
        Glory1

        Comment


          #5
          There is an enhancement on the "Add" with version 8.

          Comment


            #6
            Hi ct,

            thanks for your quick reply and help.

            I briefly checked the reference of version 8 and find the AddDataSeries() method. But I am still not sure how to use it in the way to solve the issue. Could you please give me a little bit more guidance to find the right solution?

            Thanks and best regards,
            Glory1

            Comment


              #7
              Glory1

              Syntax for AddDataServies (version 8):
              AddDataSeries(string instrumentName, BarsPeriod barsPeriod, int barsToLoad, string tradingHoursName, bool? isResetOnNewTradingDay)

              barsToLoad - An int determining the number of historical bars to load

              Does this help?

              For more detail try: http://ninjatrader.com/support/forum...ad.php?t=83117

              I think this was your question or did I misunderstand.
              Last edited by ct; 01-03-2017, 02:24 PM.

              Comment


                #8
                Thanks ct - were you able to resolve your question Glory1?
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  Thanks for helping me so far!

                  Unfortunately I am not able to understand how I can use the AddDataSeries to load a daily data set with period=x and barsToLoad=y due to the named syntax of the AddDataSeries from the reference:

                  Code:
                  AddDataSeries(string instrumentName, BarsPeriod barsPeriod, int barsToLoad, string tradingHoursName, bool? isResetOnNewTradingDay)
                  Where is the part for the period or how can I use the method with period and barsToLoad?

                  Thanks and best regards

                  Comment


                    #10
                    Glory1, the period is then integrated basically into the BarsPeriod you supply in the AddDataSeries() overload call that includes the daysToLoad parameter, for example consider -

                    Code:
                    AddDataSeries("AAPL", new BarsPeriod { BarsPeriodType = BarsPeriodType.Day, Value = 1 }, 100, "US Equities RTH", null);
                    BertrandNinjaTrader Customer Service

                    Comment


                      #11
                      Bertrand, thank you very much for your explanation!

                      Just a brief information for other users. I dont use a value within the strings. This should work with every instrument.

                      Code:
                      AddDataSeries("", new BarsPeriod {BarsPeriodType = BarsPeriodType.Day, Value = 1}, 10, "", null);
                      Thanks a lot to Bertrand and CT!

                      Comment


                        #12
                        Is there a way to tell if the data being loaded is based on Bars, Days or Custom Range (in the Data Series dialog)?

                        All I could find was BarsArray[0].Count and BarsArray[0].DayCount, which does not really let me know if the data being loaded is based on Bars.

                        Thanks,
                        Greg
                        The Trading Mantis
                        NinjaTrader Ecosystem Vendor - The Trading Mantis

                        Comment


                          #13
                          Originally posted by gregschr View Post
                          Is there a way to tell if the data being loaded is based on Bars, Days or Custom Range (in the Data Series dialog)?

                          All I could find was BarsArray[0].Count and BarsArray[0].DayCount, which does not really let me know if the data being loaded is based on Bars.

                          Thanks,
                          Greg
                          Greg, you could try working with DaysToLoad - this would be 0 per default if you loaded via Days or Custom Range. So if you had a number returned other than 0 from you know, you'd be in Load based on Bars mode.
                          BertrandNinjaTrader Customer Service

                          Comment


                            #14
                            Thanks Bertrand,

                            You got me on to the right track.

                            What I ended up using was:
                            if (ChartBars.Properties.RangeType == RangeType.Bars)
                            The Trading Mantis
                            NinjaTrader Ecosystem Vendor - The Trading Mantis

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by heiheilau2000, 06-11-2024, 08:32 AM
                            6 responses
                            23 views
                            0 likes
                            Last Post heiheilau2000  
                            Started by franjcy, Today, 01:23 PM
                            0 responses
                            9 views
                            0 likes
                            Last Post franjcy
                            by franjcy
                             
                            Started by tony_28217, Today, 12:55 PM
                            0 responses
                            6 views
                            0 likes
                            Last Post tony_28217  
                            Started by thumper57, Today, 12:12 PM
                            0 responses
                            16 views
                            0 likes
                            Last Post thumper57  
                            Started by yertle, Today, 11:03 AM
                            0 responses
                            8 views
                            0 likes
                            Last Post yertle
                            by yertle
                             
                            Working...
                            X