Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

second data serios does't play on historic bars

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

    second data serios does't play on historic bars

    Hello

    My major data serios is renko bars.
    i have added a second data serios - 1 hour bar

    // Add a 1 hours Bars object: BarsInProgress index = 1
    AddDataSeries(Data.BarsPeriodType.Minute, 60);

    when i just turning on the strategy on existing bars (historic bars) i see only the main bars entry to OnBarUpdate() main function.

    when i run the bars on playback i see both BarsInProgress index 0 and 1 .
    What can i do inorder to make the second data serios to play also on historic bars ?

    Thanks
    Oren



    #2
    It should be work.
    I have tested it in my computer.

    Please download the file and see
    Attached Files

    Comment


      #3
      It must be something you have defined wrong in your program there.

      Comment


        #4
        Thanks cincai
        Problem still exist even at yours indicator.

        Main DataSeries 0 - 15Min
        second DataSeries 1 - 60Min

        I tested your indicator and here are the results when working with historical bars:

        First Series3/18/2021 12:15:00 AM
        First Series3/18/2021 12:30:00 AM
        First Series3/18/2021 12:45:00 AM
        First Series3/18/2021 1:00:00 AM
        First Series3/18/2021 1:15:00 AM
        First Series3/18/2021 1:30:00 AM
        First Series3/18/2021 1:45:00 AM
        First Series3/18/2021 2:00:00 AM
        First Series3/18/2021 2:15:00 AM
        First Series3/18/2021 2:30:00 AM
        First Series3/18/2021 2:45:00 AM
        First Series3/18/2021 3:00:00 AM

        and this is the output when i run the playback:

        First Series3/18/2021 12:15:00 AM
        First Series3/18/2021 12:30:00 AM
        First Series3/18/2021 12:45:00 AM
        First Series3/18/2021 1:00:00 AM
        Second SERIES3/18/2021 1:00:00 AM
        First Series3/18/2021 1:15:00 AM
        First Series3/18/2021 1:30:00 AM
        First Series3/18/2021 1:45:00 AM
        First Series3/18/2021 2:00:00 AM
        Second SERIES3/18/2021 2:00:00 AM
        First Series3/18/2021 2:15:00 AM
        First Series3/18/2021 2:30:00 AM
        First Series3/18/2021 2:45:00 AM
        First Series3/18/2021 3:00:00 AM
        Second SERIES3/18/2021 3:00:00 AM

        So looks that somting wrong with my ninjatrader platform settings which are on default setting....

        Comment


          #5
          Hello orenytz,

          Thanks for your post.

          It sounds like you may not have the minute based historical data. Please create a chart of the same instrument and set the data series to show 60 minute bars, to verify that you have the Minute historical bars needed to develop the 60 minute bars.

          Plyaback data is not the same data that your charts would show when not connected to playback.
          Paul H.NinjaTrader Customer Service

          Comment


            #6
            Are you connected to your data provider while testing?
            Have you any Minute data for that instrument?

            How to check that:
            Do you see the instrument folder in "<My Documents>\NinjaTrader 8\db\Minute" folder?

            How to fix that:
            (connect to data provider)
            CC -> Tools -> Historical Data > Load tab

            NT Support please verify:

            1. Does NT8 automatically download all needed historical data for all series referenced
            in AddDataSeries when that script is executed in Strategy Analyzer? If yes, obviously
            this is only possible if you're connected to your data provider, right?

            2. What is behavior when adding strategy to a chart when already connected to a
            real-time data provider? Does the historical data for needed AddDataSeries data get
            automatically downloaded when the strategy is added to the chart??

            3. Does State.DataLoaded reflect #1 and #2 above? Or, is State.DataLoaded only
            for use with the primary data series?

            I think understanding the answers to these questions might be relevant to OP's
            current situation.

            Comment


              #7
              Originally posted by NinjaTrader_PaulH View Post
              It sounds like you may not have the minute based historical data. Please create a chart of the same instrument and set the data series to show 60 minute bars, to verify that you have the Minute historical bars needed to develop the 60 minute bars.

              Playback data is not the same data that your charts would show when not connected to playback.
              Hi Paul,

              With reference to CC -> Tools -> Options -> Market data ...

              In context of your answer, could you expand upon how the setting,

              "Record live data as historical"

              affects OP's situation when checked or unchecked?

              Comment


                #8
                Hello bltdavid,

                Thanks for your post(s).

                1. Does NT8 automatically download all needed historical data for all series referenced
                in AddDataSeries when that script is executed in Strategy Analyzer? If yes, obviously
                this is only possible if you're connected to your data provider, right?


                Yes and yes, must be connected to the historical data provider.

                2. What is behavior when adding strategy to a chart when already connected to a
                real-time data provider? Does the historical data for needed AddDataSeries data get
                automatically downloaded when the strategy is added to the chart??


                The script would first pull any data locally and if not found then pull from the Historical data provider. Yes, any needed data not found locally (on the PC) would then be pulled from the historical data provider.

                3. Does State.DataLoaded reflect #1 and #2 above? Or, is State.DataLoaded only
                for use with the primary data series?


                From the help guide, "DataLoaded is called only once after all data series have been loaded." https://ninjatrader.com/support/help...tatechange.htm

                "With reference to CC -> Tools -> Options -> Market data ...
                In context of your answer, could you expand upon how the setting,
                "Record live data as historical"
                affects OP's situation when checked or unchecked?"


                From the help guide, "Enables or disables the storage of incoming real-time Chart data to your local PC for future historical data requests. If you are connected to a provider that supports historical data, disable this feature." Reference: https://ninjatrader.com/support/help...marketdata.htm If checked the strategy would only pull the data from his PC. If he did not have a minute based chart active or a Market analyzer running with that instrument, there would be no minute-based historical data.
                Paul H.NinjaTrader Customer Service

                Comment


                  #9
                  Hello all
                  my \NinjaTrader 8\db\minute folder was empty. i downloaded 1Min historical data and now it works well !!!
                  Thank you all !

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by yodaler, Today, 06:12 PM
                  0 responses
                  5 views
                  0 likes
                  Last Post yodaler
                  by yodaler
                   
                  Started by op1031, Today, 05:16 PM
                  0 responses
                  1 view
                  0 likes
                  Last Post op1031
                  by op1031
                   
                  Started by fscabrera03, Today, 01:18 PM
                  1 response
                  12 views
                  0 likes
                  Last Post fscabrera03  
                  Started by BottomShark77, Today, 12:20 PM
                  1 response
                  11 views
                  0 likes
                  Last Post NinjaTrader_ShawnB  
                  Started by bowling, Today, 06:16 AM
                  3 responses
                  30 views
                  0 likes
                  Last Post NinjaTrader_ShawnB  
                  Working...
                  X