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

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 adeelshahzad, Today, 03:54 AM
                  5 responses
                  31 views
                  0 likes
                  Last Post NinjaTrader_BrandonH  
                  Started by stafe, 04-15-2024, 08:34 PM
                  7 responses
                  31 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Started by merzo, 06-25-2023, 02:19 AM
                  10 responses
                  823 views
                  1 like
                  Last Post NinjaTrader_ChristopherJ  
                  Started by frankthearm, Today, 09:08 AM
                  5 responses
                  18 views
                  0 likes
                  Last Post NinjaTrader_Clayton  
                  Started by jeronymite, 04-12-2024, 04:26 PM
                  3 responses
                  43 views
                  0 likes
                  Last Post jeronymite  
                  Working...
                  X