• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Cbi.Instrument.RequestBars & State.DataLoaded Question

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

    Cbi.Instrument.RequestBars & State.DataLoaded Question

    Couple Questions:

    1) In troubleshooting why some strategies aren't getting enough bars to process I saw this in the trace file. I loaded a symbol list to a strategy, in the Strategies Tab, where each instance/symbol has primary bars of 1 Day and secondary bars of 1 Month per each symbol. Example( MSFT 1 Day Primary bars & MSFT 1 Month Secondary Bars) The days to load value is set to 400 days however many items just aren't getting enough data so that a year of month bars will exist. So looked at the Trace files. Why would the trace file show the data being requested be from 1/30/2019 to 1/31/2019 instead of from (400 days prior) to (today)? As of today 1/31/2019 doesn't and 1/30/2019 is not 400 days earlier. Also noticed that some of the requests have dates of 12/26/2017 when that should be way too far back to get for 400 days. Then another is why might the request occur multiple times such as SWCH or TEF as seen below? Note: Using Kinetick data feed. Note2: If I open a chart of the same symbols with Month bars and days to load is 400 I get just over a year of month bars as it should.

    Code:
    2019-01-30 21:19:45:065 Cbi.Instrument.RequestBars (to Provider): instrument='SWCH' from='1/30/2019 12:00:00 AM' to='1/31/2019 12:00:00 AM' period='Daily'
    2019-01-30 21:19:45:263 Cbi.Instrument.RequestBars (to Provider): instrument='SWCH' from='1/30/2019 12:00:00 AM' to='1/31/2019 12:00:00 AM' period='Daily'
    2019-01-30 21:19:45:263 Cbi.Instrument.RequestBars (to Provider): instrument='TAL' from='1/30/2019 12:00:00 AM' to='1/31/2019 12:00:00 AM' period='Daily'
    2019-01-30 21:19:45:263 Cbi.Instrument.RequestBars (to Provider): instrument='TECK' from='1/30/2019 12:00:00 AM' to='1/31/2019 12:00:00 AM' period='Daily'
    2019-01-30 21:19:45:263 Cbi.Instrument.RequestBars (to Provider): instrument='TEF' from='1/30/2019 12:00:00 AM' to='1/31/2019 12:00:00 AM' period='Daily'
    2019-01-30 21:19:45:263 Cbi.Instrument.RequestBars (to Provider): instrument='TCF' from='1/30/2019 12:00:00 AM' to='1/31/2019 12:00:00 AM' period='Daily'
    2019-01-30 21:19:45:263 Cbi.Instrument.RequestBars (to Provider): instrument='TECK' from='1/30/2019 12:00:00 AM' to='1/31/2019 12:00:00 AM' period='Daily'
    2019-01-30 21:19:45:263 Cbi.Instrument.RequestBars (to Provider): instrument='TEF' from='1/30/2019 12:00:00 AM' to='1/31/2019 12:00:00 AM' period='Daily'
    2019-01-30 21:19:45:533 Cbi.Instrument.RequestBars (to Provider): instrument='SONO' from='12/26/2017 12:00:00 AM' to='1/31/2019 12:00:00 AM' period='Daily'
    2019-01-30 21:19:45:989 Cbi.Instrument.RequestBars (to Provider): instrument='SMFG' from='1/30/2019 12:00:00 AM' to='1/31/2019 12:00:00 AM' period='Daily'
    2019-01-30 21:19:45:990 Cbi.Instrument.RequestBars (to Provider): instrument='SYF' from='1/30/2019 12:00:00 AM' to='1/31/2019 12:00:00 AM' period='Daily'
    2019-01-30 21:19:45:990 Cbi.Instrument.RequestBars (to Provider): instrument='SWN' from='1/30/2019 12:00:00 AM' to='1/31/2019 12:00:00 AM' period='Daily'
    2019-01-30 21:19:45:990 Cbi.Instrument.RequestBars (to Provider): instrument='TAL' from='1/30/2019 12:00:00 AM' to='1/31/2019 12:00:00 AM' period='Daily'
    2019-01-30 21:19:46:083 Cbi.Instrument.RequestBars (to Provider): instrument='SMFG' from='1/30/2019 12:00:00 AM' to='1/31/2019 12:00:00 AM' period='Daily'
    2) In State.DataLoaded the help guide says "DataLoaded is called only once after all data series have been loaded." To me this means that during State.DataLoaded all the historical data is available but just hasn't run through the OnBarUpdate process yet. If this were true then I should be able to access say two months ago yes? I've found that accessing Lows[1][0] will return the oldest month bar but Lows[1][2] errors out. In the end I'm trying to derive some data before OnBarUpdate even begins based on Month bars. I have been doing this by a second strategy that gets the data, processes it, and writes it to a file then I'd run the main strategy on day bars and let it read the file. Can this not be done in a single strategy?

    Thanks in advance,

    #2
    Hello antrux,

    Thank you for your post.

    I wanted to check, do you also see the data not loading when doing fewer strategies at once? For example, if you only enable 3 instead of the entire list does the same outcome happen? It would be helpful to set a baseline of what is working to find where the problem starts. If you are seeing this happen as well with only a few strategies, you may also try clearing the data cache to see if that is related to the problem.

    To delete the cache, follow the steps below.
    • Shut down NinjaTrader.
    • Open the Documents > NinjaTrader 8 > db folder.
    • Delete the sub-folder named 'cache'.
    • Restart NinjaTrader and test.

    Regarding the trace output, you would generally see the current date listed for the data request to gather the current data, this would list the end of the session or next day as the to date. Cache data requests are not traced from what I can tell, but reload historical data requests are. For example, if you load a chart with 400 daily bars, we would only see the prints you have posted however if I reload historical data, prints are added for the farther back dates.

    DateLoaded is simply a trigger to let you know data has loaded but is not a valid location to begin processing data. you would need to wait until bar 0 in OnBarUpdate if you wanted to do an action once. A simple way to do this is to add a check for CurrentBar == 0, however, as you are using the second series data you may instead need to add CurrentBars[1] == 0 as the check.

    I look forward to being of further assistance.




    JesseNinjaTrader Customer Service

    Comment


      #3
      Tested with 9 of the found symbols that did not get enough data and the same thing occurred.
      Deleted the cache folder that had just over 550 megs across 1.2 million files.
      Started and tested the 9 symbols again with better results. This time only 3 symbols didn't load. (AFSI, ADT, ASX)
      I added a couple print lines and got this in the output window for AFSI symbol.

      Code:
      if (trouble) Print("Day Bars Available: " + CurrentBars[0]);
      if (trouble) Print("Month Bars Available: " + CurrentBars[1]);
      This was with setting the strategy to Days to Load @ 450
      Primary strategy setup is Day bars, Month bars are added in State.Configure with "AddDataSeries(BarsPeriodType.Month, 1);"

      Code:
      Day Bars Available: 0
      Month Bars Available: -1
      Day Bars Available: 1
      Month Bars Available: -1
      Day Bars Available: 2
      Month Bars Available: -1
      Day Bars Available: 3
      Month Bars Available: -1
      Day Bars Available: 4
      Month Bars Available: -1
      Day Bars Available: 5
      Month Bars Available: -1
      Day Bars Available: 6
      Month Bars Available: -1
      Day Bars Available: 7
      Month Bars Available: -1
      Day Bars Available: 8
      Month Bars Available: -1
      Day Bars Available: 9
      Month Bars Available: -1
      Day Bars Available: 10
      Month Bars Available: -1
      Day Bars Available: 11
      Month Bars Available: -1
      Day Bars Available: 12
      Month Bars Available: -1
      Day Bars Available: 13
      Month Bars Available: -1
      Day Bars Available: 14
      Month Bars Available: -1
      Day Bars Available: 15
      Month Bars Available: -1
      Day Bars Available: 16
      Month Bars Available: 0
      Day Bars Available: 16
      Month Bars Available: 0
      Day Bars Available: 17
      Month Bars Available: 0
      Day Bars Available: 18
      Month Bars Available: 0
      Day Bars Available: 19
      Month Bars Available: 0
      Day Bars Available: 20
      Month Bars Available: 0
      Day Bars Available: 21
      Month Bars Available: 0
      Day Bars Available: 22
      Month Bars Available: 0
      Day Bars Available: 23
      Month Bars Available: 0
      Day Bars Available: 24
      Month Bars Available: 0
      Day Bars Available: 25
      Month Bars Available: 0
      Day Bars Available: 26
      Month Bars Available: 0
      Day Bars Available: 27
      Month Bars Available: 0
      Day Bars Available: 28
      Month Bars Available: 0
      Day Bars Available: 29
      Month Bars Available: 0
      Day Bars Available: 30
      Month Bars Available: 0
      Day Bars Available: 31
      Month Bars Available: 0
      Day Bars Available: 32
      Month Bars Available: 0
      Day Bars Available: 33
      Month Bars Available: 0
      Day Bars Available: 34
      Month Bars Available: 0
      Day Bars Available: 35
      Month Bars Available: 0
      Day Bars Available: 36
      Month Bars Available: 1
      Day Bars Available: 36
      Month Bars Available: 1
      Day Bars Available: 37
      Month Bars Available: 1
      Day Bars Available: 38
      Month Bars Available: 1
      Day Bars Available: 39
      Month Bars Available: 1
      Day Bars Available: 40
      Month Bars Available: 1
      Day Bars Available: 41
      Month Bars Available: 1
      Day Bars Available: 42
      Month Bars Available: 1
      Day Bars Available: 43
      Month Bars Available: 1
      Day Bars Available: 44
      Month Bars Available: 1
      Day Bars Available: 45
      Month Bars Available: 1
      Day Bars Available: 46
      Month Bars Available: 1
      Day Bars Available: 47
      Month Bars Available: 1
      Day Bars Available: 48
      Month Bars Available: 1
      Day Bars Available: 49
      Month Bars Available: 1
      Day Bars Available: 50
      Month Bars Available: 1
      Day Bars Available: 51
      Month Bars Available: 1
      Day Bars Available: 52
      Month Bars Available: 1
      Day Bars Available: 53
      Month Bars Available: 1
      Day Bars Available: 54
      Month Bars Available: 1
      Day Bars Available: 55
      Month Bars Available: 1
      Day Bars Available: 56
      Month Bars Available: 1
      Day Bars Available: 57
      Month Bars Available: 2
      Day Bars Available: 57
      Month Bars Available: 2
      Day Bars Available: 58
      Month Bars Available: 2
      Day Bars Available: 59
      Month Bars Available: 2
      Day Bars Available: 60
      Month Bars Available: 2
      Day Bars Available: 61
      Month Bars Available: 2
      Day Bars Available: 62
      Month Bars Available: 2
      Day Bars Available: 63
      Month Bars Available: 2
      Day Bars Available: 64
      Month Bars Available: 2
      Day Bars Available: 65
      Month Bars Available: 2
      Day Bars Available: 66
      Month Bars Available: 2
      Day Bars Available: 67
      Month Bars Available: 2
      Day Bars Available: 68
      Month Bars Available: 2
      Day Bars Available: 69
      Month Bars Available: 2
      Day Bars Available: 70
      Month Bars Available: 2
      Day Bars Available: 71
      Month Bars Available: 2
      Day Bars Available: 72
      Month Bars Available: 2
      Day Bars Available: 73
      Month Bars Available: 2
      Day Bars Available: 74
      Month Bars Available: 2
      Day Bars Available: 75
      Month Bars Available: 2
      Day Bars Available: 76
      Month Bars Available: 3
      Day Bars Available: 76
      Month Bars Available: 3
      Day Bars Available: 77
      Month Bars Available: 3
      Day Bars Available: 78
      Month Bars Available: 3
      Day Bars Available: 79
      Month Bars Available: 3
      Day Bars Available: 80
      Month Bars Available: 3
      Day Bars Available: 81
      Month Bars Available: 3
      Day Bars Available: 82
      Month Bars Available: 3
      Day Bars Available: 83
      Month Bars Available: 3
      Day Bars Available: 84
      Month Bars Available: 3
      Day Bars Available: 85
      Month Bars Available: 3
      Day Bars Available: 86
      Month Bars Available: 3
      Day Bars Available: 87
      Month Bars Available: 3
      Day Bars Available: 88
      Month Bars Available: 3
      Day Bars Available: 89
      Month Bars Available: 3
      Day Bars Available: 90
      Month Bars Available: 3
      Day Bars Available: 91
      Month Bars Available: 3
      Day Bars Available: 92
      Month Bars Available: 3
      Day Bars Available: 93
      Month Bars Available: 3
      Day Bars Available: 94
      Month Bars Available: 3
      Day Bars Available: 95
      Month Bars Available: 3
      Day Bars Available: 96
      Month Bars Available: 3
      Day Bars Available: 97
      Month Bars Available: 4
      Day Bars Available: 97
      Month Bars Available: 4
      Day Bars Available: 98
      Month Bars Available: 4
      Day Bars Available: 99
      Month Bars Available: 4
      Day Bars Available: 100
      Month Bars Available: 4
      Day Bars Available: 101
      Month Bars Available: 4
      Day Bars Available: 102
      Month Bars Available: 4
      Day Bars Available: 103
      Month Bars Available: 4
      Day Bars Available: 104
      Month Bars Available: 4
      Day Bars Available: 105
      Month Bars Available: 4
      Day Bars Available: 106
      Month Bars Available: 4
      Day Bars Available: 107
      Month Bars Available: 4
      Day Bars Available: 108
      Month Bars Available: 4
      Day Bars Available: 109
      Month Bars Available: 4
      Day Bars Available: 110
      Month Bars Available: 4
      Day Bars Available: 111
      Month Bars Available: 4
      Day Bars Available: 112
      Month Bars Available: 4
      Day Bars Available: 113
      Month Bars Available: 4
      Day Bars Available: 114
      Month Bars Available: 4
      Day Bars Available: 115
      Month Bars Available: 4
      Day Bars Available: 116
      Month Bars Available: 4
      Day Bars Available: 117
      Month Bars Available: 4
      Day Bars Available: 118
      Month Bars Available: 5
      
      *** Removed to save character count ***
      
      Day Bars Available: 224
      Month Bars Available: 10
      Day Bars Available: 224
      Month Bars Available: 10
      Day Bars Available: 225
      Month Bars Available: 10
      Day Bars Available: 226
      Month Bars Available: 10
      Day Bars Available: 227
      Month Bars Available: 10
      Day Bars Available: 228
      Month Bars Available: 10
      Day Bars Available: 229
      Month Bars Available: 10
      Day Bars Available: 230
      Month Bars Available: 10
      Day Bars Available: 231
      Month Bars Available: 10
      Day Bars Available: 232
      Month Bars Available: 10
      Day Bars Available: 233
      Month Bars Available: 10
      Day Bars Available: 234
      Month Bars Available: 10
      Day Bars Available: 235
      Month Bars Available: 10
      Day Bars Available: 236
      Month Bars Available: 10
      Day Bars Available: 237
      Month Bars Available: 10
      Day Bars Available: 238
      Month Bars Available: 10
      Day Bars Available: 239
      Month Bars Available: 10
      Day Bars Available: 240
      Month Bars Available: 10
      Day Bars Available: 241
      Month Bars Available: 10
      Day Bars Available: 242
      Month Bars Available: 10
      Day Bars Available: 243
      Month Bars Available: 10
      Day Bars Available: 244
      Month Bars Available: 10
      Day Bars Available: 245
      Month Bars Available: 10
      Day Bars Available: 246
      Month Bars Available: 10
      Day Bars Available: 247
      Month Bars Available: 11
      Day Bars Available: 247
      Month Bars Available: 11
      Day Bars Available: 248
      Month Bars Available: 11
      Day Bars Available: 249
      Month Bars Available: 11
      Day Bars Available: 250
      Month Bars Available: 11
      Day Bars Available: 251
      Month Bars Available: 11
      Day Bars Available: 252
      Month Bars Available: 11
      Day Bars Available: 253
      Month Bars Available: 11
      Day Bars Available: 254
      Month Bars Available: 11
      Day Bars Available: 255
      Month Bars Available: 11
      Day Bars Available: 256
      Month Bars Available: 11
      Day Bars Available: 257
      Month Bars Available: 11
      Day Bars Available: 258
      Month Bars Available: 11
      Day Bars Available: 259
      Month Bars Available: 11
      Day Bars Available: 260
      Month Bars Available: 11
      Day Bars Available: 261
      Month Bars Available: 11
      Day Bars Available: 262
      Month Bars Available: 11
      Day Bars Available: 263
      Month Bars Available: 11
      Day Bars Available: 264
      Month Bars Available: 11
      Day Bars Available: 265
      Month Bars Available: 11
      Note: During the transition from -1 Month bar to 0 the Day bars processed is 16, similarly at day bar 36 Month 2 is now available. Those months should be Nov and Dec of 2017. Haven't verified but those months should have had more than 16 and 20 days no?

      Opening a chart for AFSI with days to load at 400 did only give 11 past months as January isn't completed yet. Opening another chart with 450 days to load did give 12 full past months. I then edited the strategy to also have 450 days and the above output is what I got.

      Comment


        #4
        Using Historical Data under Tools did a Load of those 3 symbols from 1/1/2017 till today with the options for Minute and Day checked. All downloaded successfully.
        I then ran those three symbols individually with the same results.

        Trace File Attached.

        From the trace file even though I manually entered 1/1/2017 in the Start Date box odd 'from' dates appear below.
        After running the strategy again I again did a single historical data load for ADT with the same 1/1/2017 and that time the from entry was listed correctly. (last line)
        Again ran the strategy but total day bars available ended at 258 with 11 months in the Output window.

        Code:
        2019-01-31 17:26:23:155 Cbi.Instrument.RequestBars (to Provider): instrument='AFSI' from='1/1/2017 12:00:00 AM' to='1/31/2019 12:00:00 AM' period='1 Minute'
        2019-01-31 17:26:23:155 Cbi.Instrument.RequestBars (to Provider): instrument='AFSI' from='1/1/2017 12:00:00 AM' to='2/1/2019 12:00:00 AM' period='Daily'
        2019-01-31 17:26:23:389 Cbi.Instrument.RequestBars (to Provider): instrument='AFSI' from='11/28/2018 12:00:00 AM' to='1/30/2019 12:00:00 AM' period='Daily'
        2019-01-31 17:26:29:842 Cbi.Instrument.RequestBars (to Provider): instrument='ADT' from='1/1/2017 12:00:00 AM' to='2/1/2019 12:00:00 AM' period='Daily'
        2019-01-31 17:26:29:842 Cbi.Instrument.RequestBars (to Provider): instrument='ADT' from='1/1/2017 12:00:00 AM' to='1/31/2019 12:00:00 AM' period='1 Minute'
        2019-01-31 17:26:33:674 Cbi.Instrument.RequestBars (to Provider): instrument='AFSI' from='1/31/2019 12:00:00 AM' to='2/1/2019 12:00:00 AM' period='Daily'
        2019-01-31 17:26:35:156 Cbi.Instrument.RequestBars (to Provider): instrument='ASX' from='1/1/2017 12:00:00 AM' to='2/1/2019 12:00:00 AM' period='Daily'
        2019-01-31 17:26:35:156 Cbi.Instrument.RequestBars (to Provider): instrument='ASX' from='1/1/2017 12:00:00 AM' to='1/31/2019 12:00:00 AM' period='1 Minute'
        2019-01-31 17:26:45:862 Cbi.Instrument.RequestBars (to Provider): instrument='AFSI' from='11/28/2018 12:00:00 AM' to='2/1/2019 12:00:00 AM' period='Daily'
        2019-01-31 17:26:45:862 Cbi.Instrument.RequestBars (to Provider): instrument='AFSI' from='11/28/2018 12:00:00 AM' to='2/1/2019 12:00:00 AM' period='Daily'
        2019-01-31 17:26:52:703 Cbi.Instrument.RequestBars (to Provider): instrument='AFSI' from='11/28/2018 12:00:00 AM' to='2/1/2019 12:00:00 AM' period='Daily'
        2019-01-31 17:26:52:703 Cbi.Instrument.RequestBars (to Provider): instrument='AFSI' from='11/28/2018 12:00:00 AM' to='2/1/2019 12:00:00 AM' period='Daily'
        2019-01-31 17:27:08:451 Cbi.Instrument.RequestBars (to Provider): instrument='ADT' from='11/7/2017 12:00:00 AM' to='2/1/2019 12:00:00 AM' period='Daily'
        2019-01-31 17:27:08:451 Cbi.Instrument.RequestBars (to Provider): instrument='ADT' from='11/7/2017 12:00:00 AM' to='2/1/2019 12:00:00 AM' period='Daily'
        2019-01-31 17:27:27:358 Cbi.Instrument.RequestBars (to Provider): instrument='ASX' from='11/7/2017 12:00:00 AM' to='2/1/2019 12:00:00 AM' period='Daily'
        2019-01-31 17:27:27:358 Cbi.Instrument.RequestBars (to Provider): instrument='ASX' from='11/7/2017 12:00:00 AM' to='2/1/2019 12:00:00 AM' period='Daily'
        2019-01-31 17:31:13:076 Cbi.Instrument.RequestBars (to Provider): instrument='ADT' from='1/1/2017 12:00:00 AM' to='2/1/2019 12:00:00 AM' period='Daily'
        2019-01-31 17:31:13:076 Cbi.Instrument.RequestBars (to Provider): instrument='ADT' from='1/1/2017 12:00:00 AM' to='1/31/2019 12:00:00 AM' period='1 Minute'
        Attached Files

        Comment


          #5
          Hello ,antrux

          Thank you for your reply.

          I took a look at the trace file and see you are having some errors in the middle of the data requests. I am not certain if this is related to the overall problem, but it would be helpful to first identify and solve these errors to ensure they are not part of the problem. Being that the error is reported for OnStateChange on these scripts, that could affect data loading, however, this type of error should disable the scrips also. As I don't know what overall syntax is used, I don't want to omit something that may be related so it would be helpful if we address this first.


          2019-01-31 17:02:13:132 ERROR: Strategy 'RCCombined': Error on calling 'OnStateChange' method: Object reference not set to an instance of an object.
          2019-01-31 17:02:13:133 ERROR: Strategy 'RockClimber': Error on calling 'OnStateChange' method: Object reference not set to an instance of an object.
          2019-01-31 17:02:13:133 ERROR: Strategy 'RockClimber3': Error on calling 'OnStateChange' method: Object reference not set to an instance of an object.
          2019-01-31 17:02:13:143 ERROR: Strategy 'RCCombined': Error on calling 'OnStateChange' method: Object reference not set to an instance of an object.
          2019-01-31 17:02:13:143 ERROR: Strategy 'RockClimber': Error on calling 'OnStateChange' method: Object reference not set to an instance of an object.
          2019-01-31 17:02:13:143 ERROR: Strategy 'RockClimber3': Error on calling 'OnStateChange' method: Object reference not set to an instance of an object.
          2019-01-31 17:02:37:437 ERROR: Strategy 'RCCombined': Error on calling 'OnStateChange' method: Object reference not set to an instance of an object.
          2019-01-31 17:02:37:438 ERROR: Strategy 'RockClimber3': Error on calling 'OnStateChange' method: Object reference not set to an instance of an object.
          Can you check if you are seeing these errors when enabling the various scripts that failed? If you are seeing this in the output or log window of the control center, I believe a good next step would be to see why this is happening before we continue with the data request.

          If you are unsure why this error would be generated, can you provide a sample of each of these scripts OnStateChange syntax?


          I look forward to being of further assistance.
          JesseNinjaTrader Customer Service

          Comment


            #6
            Those OnStateChange errors only get generated when compiling && when no symbol is currently attached to it. They do not occur when running the strategy on a symbol.

            Code:
            else if (State == State.DataLoaded)
            {
               // Create Symbol Folder if It Doesn't Already Exist //
               System.IO.Directory.CreateDirectory(path + userName + desktop + strategy + data + Instrument.MasterInstrument.Name);
            }
            In a couple OnStateChange methods the strategy may write some data or read some data that was created prior to starting and the symbol being run is needed for the path. If the strategy is being compiled say from the editor then no value exists for Instrument.MasterInstrument.Name so that creates the null reference. If it is run with a symbol then all is well and no "Object reference not set to an instance of an object" is generated.

            I have commented out these lines before in testing other items and the same results happen with this miss-load of bar data. So these 'should' not be related to this issue. Especially since it doesn't happen to all symbols.

            Comment


              #7
              Hello antrux,

              Thank you for confirming that.

              I wanted to check, do you have a sample of the script you are using that you can provide? I would like to test one of the instruments being used to see if I also get a similar result or if this is isolated to your end. I noted in your last post you have some kind of condition being used with your print, if you do not use any logic and simply output the raw data, are you seeing the same result or something else?


              I look forward to being of further assistance.
              JesseNinjaTrader Customer Service

              Comment


                #8
                With the attached strategy using 15 min bars as the primary and days to load set to 370, Trading hours RTH, Break at EOD, Sim101, OnBarClose, Infinite Lookback, and Start behavior Wait until flat the following is what is generated in the output window.

                Note: I completely understand there is an easier way to get a month's high and low than this setup. I removed a lot of extra items that it would normally look at but this still generates the issue.

                For some viewing Month bars on a chart shows the month bars below yet some show more than below.
                Might Kinetick just not have enough minute data buy may have enough month data? (Some may not be that old yet but some are)
                Might this deal with missing minute data since if no activity occurs for say 5 minutes, and viewing minute bars, then those 5 bars don't get created?

                Symbol, DayBars, MonthBars (Only ran a few as an example.)
                ADT,6540,11
                AFSI,5460,9
                ASX,4901,7
                BILI,5312,9
                BJ,3651,6
                BPR,2573,4
                COLD
                DBX
                EAF
                EQH
                FTDR
                GSKY
                GTX
                HUYA
                IQ
                LTHM
                MITL
                MUFG
                NIO
                PAGS
                PDD
                PRSP
                PS
                PVTL
                QRTEA
                REZI
                SONO
                STNE
                YETI
                ZUO
                Attached Files

                Comment


                  #9
                  Hello antrux,

                  Thank you for providing the script and instruments.

                  I tried quite a few of these instruments and do see that very few of these have extended historical daily bars.

                  Might Kinetick just not have enough minute data buy may have enough month data?
                  Yes, and No, I will explain what I have observed.

                  Most of these instruments seem to have less than 1 year of daily data so a part of this question can likely be solved by knowing these instruments simply don't have that much data. As you are using a 15-minute primary series, you will also be limited to the length of the minute data availability which could be considerably less than the amount of daily data however it could also extend beyond what daily bars are available on the server. The server has 3 types of data which can be requested, tick minute and day, and in this case, we can see differences in availability between minute and daily data.

                  One example is the ADT, I see this goes back to January of 2018 while using Kinetick daily bars however the minute data goes considerably further back to ~2012. In this case, the limiting factor is the daily bars, both daily and weekly bars would rely on daily data which is not available for the total period you requested.

                  The Trace file also would not specifically be a good way to determine how much data has actually loaded, to know specifically what the script is seeing I would suggest a more simplified print like the following:

                  Code:
                          protected override void OnBarUpdate()
                          {
                              if(BarsInProgress > 0) //omit primary timestamps
                                  Print(string.Format("BarsInProgress: {0} Time: {1}", BarsInProgress, Time[0]));
                  This will just output the time and BarsInProgress but only for the secondary series. From my end I can see this printing the 1/19/2018 date for the daily bar starting point, however, I requested much more data than this.

                  The trace file will show the platform calculated timestamps meaning this is what the platform figured out for the data request based on what you had entered however that has nothing to do with the actual data on the server. This is just the guideline for the request, what you actually get back from that request depends on what's available.

                  For these instruments, you may need to reduce the amount of data required until the server has enough data to satisfy all the series being used. You can optionally look at third-party sources to import extended amounts of historical data to further avoid any missing data.



                  I look forward to being of further assistance.













                  JesseNinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by mittie3, Today, 03:33 AM
                  0 responses
                  5 views
                  0 likes
                  Last Post mittie3
                  by mittie3
                   
                  Started by Againmain1, Today, 03:04 AM
                  0 responses
                  6 views
                  0 likes
                  Last Post Againmain1  
                  Started by tonytimpa, Today, 01:33 AM
                  0 responses
                  5 views
                  0 likes
                  Last Post tonytimpa  
                  Started by kiwidtrader, Yesterday, 11:49 PM
                  0 responses
                  5 views
                  0 likes
                  Last Post kiwidtrader  
                  Started by jmahon, Yesterday, 11:44 PM
                  0 responses
                  7 views
                  0 likes
                  Last Post jmahon
                  by jmahon
                   
                  Working...
                  X