Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Historical bars with two instruments

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

    #16
    Hello cassb,

    I have tested the TickReplay and I am finding the number of updates to OnBarUpdate with Calculate set to Calculate.OnEachTick, matches the historical data exactly.

    Below is a link to a video of this test.
    Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.


    Attached is the script I have used to test.
    Attached Files
    Chelsea B.NinjaTrader Customer Service

    Comment


      #17
      Thank you, Chelsea. I have modified your code so that it reproduces my issue. Please put the attached indicator on a CL 02-17 chart with each bar = 1 tick. I am connected to Playback when I do this, and have playback set to run from 12/5/16 to 12/9/16.

      Then put the indicator on the chart with the output window open. You should see something like below... with Closes[1][0] = the same number for every bar of the chart. The price you will see is whatever the close of the last bar on the chart is for the 03-17 contract. I am expecting to see the close price of 03-17 at each progressive bar on the chart. If there is no 03-17 bar at the same timestamp as 02-17, then whatever the previous close was.

      1: Close CL 02-17 = 51.99, Close CL 03-17 = 53.17
      2: Close CL 02-17 = 51.99, Close CL 03-17 = 53.17
      3: Close CL 02-17 = 51.99, Close CL 03-17 = 53.17
      4: Close CL 02-17 = 51.99, Close CL 03-17 = 53.17
      5: Close CL 02-17 = 51.99, Close CL 03-17 = 53.17
      6: Close CL 02-17 = 51.99, Close CL 03-17 = 53.17
      7: Close CL 02-17 = 51.99, Close CL 03-17 = 53.17
      8: Close CL 02-17 = 51.99, Close CL 03-17 = 53.17
      9: Close CL 02-17 = 51.99, Close CL 03-17 = 53.17
      10: Close CL 02-17 = 51.99, Close CL 03-17 = 53.17
      11: Close CL 02-17 = 51.99, Close CL 03-17 = 53.17
      12: Close CL 02-17 = 51.99, Close CL 03-17 = 53.17
      13: Close CL 02-17 = 51.94, Close CL 03-17 = 53.17
      14: Close CL 02-17 = 51.94, Close CL 03-17 = 53.17
      15: Close CL 02-17 = 51.94, Close CL 03-17 = 53.17
      16: Close CL 02-17 = 51.94, Close CL 03-17 = 53.17
      17: Close CL 02-17 = 51.94, Close CL 03-17 = 53.17
      18: Close CL 02-17 = 51.94, Close CL 03-17 = 53.17
      19: Close CL 02-17 = 51.94, Close CL 03-17 = 53.17
      20: Close CL 02-17 = 51.94, Close CL 03-17 = 53.17
      21: Close CL 02-17 = 51.92, Close CL 03-17 = 53.17
      22: Close CL 02-17 = 51.94, Close CL 03-17 = 53.17
      23: Close CL 02-17 = 51.94, Close CL 03-17 = 53.17
      24: Close CL 02-17 = 51.95, Close CL 03-17 = 53.17
      25: Close CL 02-17 = 51.97, Close CL 03-17 = 53.17
      26: Close CL 02-17 = 51.98, Close CL 03-17 = 53.17
      27: Close CL 02-17 = 52.06, Close CL 03-17 = 53.17
      28: Close CL 02-17 = 51.98, Close CL 03-17 = 53.17
      29: Close CL 02-17 = 51.97, Close CL 03-17 = 53.17
      30: Close CL 02-17 = 51.99, Close CL 03-17 = 53.17
      31: Close CL 02-17 = 51.96, Close CL 03-17 = 53.17
      32: Close CL 02-17 = 51.97, Close CL 03-17 = 53.17
      33: Close CL 02-17 = 51.98, Close CL 03-17 = 53.17
      34: Close CL 02-17 = 51.98, Close CL 03-17 = 53.17
      35: Close CL 02-17 = 52, Close CL 03-17 = 53.17
      36: Close CL 02-17 = 51.98, Close CL 03-17 = 53.17
      37: Close CL 02-17 = 51.98, Close CL 03-17 = 53.17
      38: Close CL 02-17 = 51.99, Close CL 03-17 = 53.17
      39: Close CL 02-17 = 52.02, Close CL 03-17 = 53.17
      40: Close CL 02-17 = 52.03, Close CL 03-17 = 53.17
      41: Close CL 02-17 = 52.01, Close CL 03-17 = 53.17
      42: Close CL 02-17 = 51.99, Close CL 03-17 = 53.17
      43: Close CL 02-17 = 51.98, Close CL 03-17 = 53.17
      44: Close CL 02-17 = 51.98, Close CL 03-17 = 53.17
      45: Close CL 02-17 = 51.98, Close CL 03-17 = 53.17
      46: Close CL 02-17 = 52.01, Close CL 03-17 = 53.17
      47: Close CL 02-17 = 52.01, Close CL 03-17 = 53.17
      48: Close CL 02-17 = 52.04, Close CL 03-17 = 53.17
      49: Close CL 02-17 = 52.06, Close CL 03-17 = 53.17
      50: Close CL 02-17 = 52.06, Close CL 03-17 = 53.17
      51: Close CL 02-17 = 52.06, Close CL 03-17 = 53.17
      52: Close CL 02-17 = 52.07, Close CL 03-17 = 53.17
      53: Close CL 02-17 = 52.07, Close CL 03-17 = 53.17
      54: Close CL 02-17 = 52.07, Close CL 03-17 = 53.17
      55: Close CL 02-17 = 52.05, Close CL 03-17 = 53.17
      56: Close CL 02-17 = 52.07, Close CL 03-17 = 53.17
      57: Close CL 02-17 = 52.07, Close CL 03-17 = 53.17
      58: Close CL 02-17 = 52.06, Close CL 03-17 = 53.17
      59: Close CL 02-17 = 52.05, Close CL 03-17 = 53.17
      60: Close CL 02-17 = 52.04, Close CL 03-17 = 53.17
      61: Close CL 02-17 = 52.03, Close CL 03-17 = 53.17
      62: Close CL 02-17 = 52.05, Close CL 03-17 = 53.17
      63: Close CL 02-17 = 52.03, Close CL 03-17 = 53.17
      64: Close CL 02-17 = 52.03, Close CL 03-17 = 53.17
      65: Close CL 02-17 = 52.03, Close CL 03-17 = 53.17
      66: Close CL 02-17 = 52.02, Close CL 03-17 = 53.17
      67: Close CL 02-17 = 52.02, Close CL 03-17 = 53.17
      68: Close CL 02-17 = 52.04, Close CL 03-17 = 53.17
      69: Close CL 02-17 = 52.04, Close CL 03-17 = 53.17
      70: Close CL 02-17 = 52.04, Close CL 03-17 = 53.17
      71: Close CL 02-17 = 52.04, Close CL 03-17 = 53.17
      72: Close CL 02-17 = 52.03, Close CL 03-17 = 53.17
      73: Close CL 02-17 = 52.02, Close CL 03-17 = 53.17
      74: Close CL 02-17 = 52.02, Close CL 03-17 = 53.17
      75: Close CL 02-17 = 52.02, Close CL 03-17 = 53.17
      76: Close CL 02-17 = 52.02, Close CL 03-17 = 53.17
      77: Close CL 02-17 = 52.02, Close CL 03-17 = 53.17
      78: Close CL 02-17 = 52.02, Close CL 03-17 = 53.17
      79: Close CL 02-17 = 52.03, Close CL 03-17 = 53.17
      80: Close CL 02-17 = 52.04, Close CL 03-17 = 53.17
      81: Close CL 02-17 = 52.05, Close CL 03-17 = 53.17
      82: Close CL 02-17 = 52.05, Close CL 03-17 = 53.17
      83: Close CL 02-17 = 52.05, Close CL 03-17 = 53.17
      84: Close CL 02-17 = 52.05, Close CL 03-17 = 53.17
      85: Close CL 02-17 = 52.05, Close CL 03-17 = 53.17
      86: Close CL 02-17 = 52.05, Close CL 03-17 = 53.17
      87: Close CL 02-17 = 52.06, Close CL 03-17 = 53.17
      88: Close CL 02-17 = 52.09, Close CL 03-17 = 53.17
      89: Close CL 02-17 = 52.1, Close CL 03-17 = 53.17
      90: Close CL 02-17 = 52.1, Close CL 03-17 = 53.17
      91: Close CL 02-17 = 52.11, Close CL 03-17 = 53.17
      92: Close CL 02-17 = 52.12, Close CL 03-17 = 53.17
      93: Close CL 02-17 = 52.13, Close CL 03-17 = 53.17
      94: Close CL 02-17 = 52.15, Close CL 03-17 = 53.17
      95: Close CL 02-17 = 52.15, Close CL 03-17 = 53.17
      96: Close CL 02-17 = 52.15, Close CL 03-17 = 53.17
      97: Close CL 02-17 = 52.16, Close CL 03-17 = 53.17
      98: Close CL 02-17 = 52.11, Close CL 03-17 = 53.17
      Attached Files
      cassb
      NinjaTrader Ecosystem Vendor - Logical Forex

      Comment


        #18
        Hello cassb,

        The CL 03-17 has not yet rolled over. This means that if your merge policy is set to MergeBackAdjusted, you are only getting data for the CL 02-17.

        The script and I have created was intended to show that when using valid instruments, the number of updates to OnBarUpdate matches the number of historical ticks.
        Last edited by NinjaTrader_ChelseaB; 01-11-2017, 09:40 AM.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #19
          I have that set to "Do Not Merge". Also, when I pull up a chart for the 03-17 contract, there is plenty of historical data on it that should be getting processed by the indicator. But it's not for some reason. Is there anything else I can check to make it process the 03-17 bars?

          Thanks!
          Bryan
          cassb
          NinjaTrader Ecosystem Vendor - Logical Forex

          Comment


            #20
            Hello Bryan,

            You have explicitly coded into your script to only update on the first tick of a bar.

            What is the issue you are experiencing that you would like help with?
            Chelsea B.NinjaTrader Customer Service

            Comment


              #21
              I can remove that code and process every tick and it does the same thing. I have the chart set to 1-tick bars, so every tick is the first tick! :-)

              I have attached the updated code that processes every tick -- same result. Why is every tick 52.42 on the 03-17 contract when there are clearly historical ticks for 03-17 that are not 52.42? Is it not calling OnBarUpdate() for BarsInProgress = 1?

              1: Close CL 02-17 = 47.85, Close CL 03-17 = 52.42
              2: Close CL 02-17 = 47.85, Close CL 03-17 = 52.42
              3: Close CL 02-17 = 47.85, Close CL 03-17 = 52.42
              4: Close CL 02-17 = 47.85, Close CL 03-17 = 52.42
              5: Close CL 02-17 = 47.85, Close CL 03-17 = 52.42
              6: Close CL 02-17 = 47.85, Close CL 03-17 = 52.42
              7: Close CL 02-17 = 47.85, Close CL 03-17 = 52.42
              8: Close CL 02-17 = 47.85, Close CL 03-17 = 52.42
              9: Close CL 02-17 = 47.81, Close CL 03-17 = 52.42
              10: Close CL 02-17 = 47.82, Close CL 03-17 = 52.42
              11: Close CL 02-17 = 47.84, Close CL 03-17 = 52.42
              12: Close CL 02-17 = 47.84, Close CL 03-17 = 52.42
              13: Close CL 02-17 = 47.84, Close CL 03-17 = 52.42
              14: Close CL 02-17 = 47.83, Close CL 03-17 = 52.42
              15: Close CL 02-17 = 47.84, Close CL 03-17 = 52.42
              16: Close CL 02-17 = 47.82, Close CL 03-17 = 52.42
              17: Close CL 02-17 = 47.81, Close CL 03-17 = 52.42
              18: Close CL 02-17 = 47.81, Close CL 03-17 = 52.42
              19: Close CL 02-17 = 47.81, Close CL 03-17 = 52.42
              20: Close CL 02-17 = 47.78, Close CL 03-17 = 52.42
              21: Close CL 02-17 = 47.75, Close CL 03-17 = 52.42
              22: Close CL 02-17 = 47.75, Close CL 03-17 = 52.42
              23: Close CL 02-17 = 47.75, Close CL 03-17 = 52.42
              24: Close CL 02-17 = 47.75, Close CL 03-17 = 52.42
              25: Close CL 02-17 = 47.74, Close CL 03-17 = 52.42
              26: Close CL 02-17 = 47.74, Close CL 03-17 = 52.42
              27: Close CL 02-17 = 47.72, Close CL 03-17 = 52.42
              28: Close CL 02-17 = 47.72, Close CL 03-17 = 52.42
              29: Close CL 02-17 = 47.72, Close CL 03-17 = 52.42
              30: Close CL 02-17 = 47.72, Close CL 03-17 = 52.42
              31: Close CL 02-17 = 47.72, Close CL 03-17 = 52.42
              32: Close CL 02-17 = 47.72, Close CL 03-17 = 52.42
              33: Close CL 02-17 = 47.71, Close CL 03-17 = 52.42
              34: Close CL 02-17 = 47.72, Close CL 03-17 = 52.42
              35: Close CL 02-17 = 47.72, Close CL 03-17 = 52.42
              36: Close CL 02-17 = 47.72, Close CL 03-17 = 52.42
              37: Close CL 02-17 = 47.72, Close CL 03-17 = 52.42
              38: Close CL 02-17 = 47.72, Close CL 03-17 = 52.42
              39: Close CL 02-17 = 47.72, Close CL 03-17 = 52.42
              40: Close CL 02-17 = 47.71, Close CL 03-17 = 52.42
              41: Close CL 02-17 = 47.71, Close CL 03-17 = 52.42
              42: Close CL 02-17 = 47.7, Close CL 03-17 = 52.42
              43: Close CL 02-17 = 47.67, Close CL 03-17 = 52.42
              44: Close CL 02-17 = 47.67, Close CL 03-17 = 52.42
              45: Close CL 02-17 = 47.67, Close CL 03-17 = 52.42
              46: Close CL 02-17 = 47.67, Close CL 03-17 = 52.42
              47: Close CL 02-17 = 47.67, Close CL 03-17 = 52.42
              48: Close CL 02-17 = 47.64, Close CL 03-17 = 52.42
              49: Close CL 02-17 = 47.65, Close CL 03-17 = 52.42
              50: Close CL 02-17 = 47.65, Close CL 03-17 = 52.42
              51: Close CL 02-17 = 47.63, Close CL 03-17 = 52.42
              52: Close CL 02-17 = 47.63, Close CL 03-17 = 52.42
              53: Close CL 02-17 = 47.62, Close CL 03-17 = 52.42
              54: Close CL 02-17 = 47.62, Close CL 03-17 = 52.42
              55: Close CL 02-17 = 47.58, Close CL 03-17 = 52.42
              56: Close CL 02-17 = 47.58, Close CL 03-17 = 52.42
              57: Close CL 02-17 = 47.6, Close CL 03-17 = 52.42
              58: Close CL 02-17 = 47.6, Close CL 03-17 = 52.42
              59: Close CL 02-17 = 47.59, Close CL 03-17 = 52.42
              60: Close CL 02-17 = 47.58, Close CL 03-17 = 52.42
              61: Close CL 02-17 = 47.58, Close CL 03-17 = 52.42
              62: Close CL 02-17 = 47.58, Close CL 03-17 = 52.42
              63: Close CL 02-17 = 47.57, Close CL 03-17 = 52.42
              64: Close CL 02-17 = 47.57, Close CL 03-17 = 52.42
              65: Close CL 02-17 = 47.57, Close CL 03-17 = 52.42
              66: Close CL 02-17 = 47.58, Close CL 03-17 = 52.42
              67: Close CL 02-17 = 47.58, Close CL 03-17 = 52.42
              68: Close CL 02-17 = 47.58, Close CL 03-17 = 52.42
              69: Close CL 02-17 = 47.59, Close CL 03-17 = 52.42
              70: Close CL 02-17 = 47.59, Close CL 03-17 = 52.42
              71: Close CL 02-17 = 47.59, Close CL 03-17 = 52.42
              72: Close CL 02-17 = 47.6, Close CL 03-17 = 52.42
              73: Close CL 02-17 = 47.6, Close CL 03-17 = 52.42
              74: Close CL 02-17 = 47.58, Close CL 03-17 = 52.42
              75: Close CL 02-17 = 47.6, Close CL 03-17 = 52.42
              76: Close CL 02-17 = 47.6, Close CL 03-17 = 52.42
              77: Close CL 02-17 = 47.61, Close CL 03-17 = 52.42
              78: Close CL 02-17 = 47.61, Close CL 03-17 = 52.42
              79: Close CL 02-17 = 47.61, Close CL 03-17 = 52.42
              80: Close CL 02-17 = 47.61, Close CL 03-17 = 52.42
              81: Close CL 02-17 = 47.61, Close CL 03-17 = 52.42
              82: Close CL 02-17 = 47.62, Close CL 03-17 = 52.42
              83: Close CL 02-17 = 47.62, Close CL 03-17 = 52.42
              84: Close CL 02-17 = 47.62, Close CL 03-17 = 52.42
              85: Close CL 02-17 = 47.61, Close CL 03-17 = 52.42
              86: Close CL 02-17 = 47.62, Close CL 03-17 = 52.42
              87: Close CL 02-17 = 47.59, Close CL 03-17 = 52.42
              88: Close CL 02-17 = 47.58, Close CL 03-17 = 52.42
              89: Close CL 02-17 = 47.58, Close CL 03-17 = 52.42
              90: Close CL 02-17 = 47.57, Close CL 03-17 = 52.42
              91: Close CL 02-17 = 47.59, Close CL 03-17 = 52.42
              92: Close CL 02-17 = 47.59, Close CL 03-17 = 52.42
              93: Close CL 02-17 = 47.6, Close CL 03-17 = 52.42
              94: Close CL 02-17 = 47.61, Close CL 03-17 = 52.42
              95: Close CL 02-17 = 47.63, Close CL 03-17 = 52.42
              96: Close CL 02-17 = 47.64, Close CL 03-17 = 52.42
              97: Close CL 02-17 = 47.63, Close CL 03-17 = 52.42
              98: Close CL 02-17 = 47.65, Close CL 03-17 = 52.42
              99: Close CL 02-17 = 47.65, Close CL 03-17 = 52.42
              100: Close CL 02-17 = 47.66, Close CL 03-17 = 52.42
              101: Close CL 02-17 = 47.67, Close CL 03-17 = 52.42
              102: Close CL 02-17 = 47.7, Close CL 03-17 = 52.42
              103: Close CL 02-17 = 47.7, Close CL 03-17 = 52.42
              104: Close CL 02-17 = 47.68, Close CL 03-17 = 52.42
              105: Close CL 02-17 = 47.68, Close CL 03-17 = 52.42
              106: Close CL 02-17 = 47.68, Close CL 03-17 = 52.42
              107: Close CL 02-17 = 47.68, Close CL 03-17 = 52.42
              108: Close CL 02-17 = 47.68, Close CL 03-17 = 52.42
              109: Close CL 02-17 = 47.69, Close CL 03-17 = 52.42
              110: Close CL 02-17 = 47.67, Close CL 03-17 = 52.42
              111: Close CL 02-17 = 47.69, Close CL 03-17 = 52.42
              112: Close CL 02-17 = 47.71, Close CL 03-17 = 52.42
              113: Close CL 02-17 = 47.71, Close CL 03-17 = 52.42
              114: Close CL 02-17 = 47.73, Close CL 03-17 = 52.42
              115: Close CL 02-17 = 47.73, Close CL 03-17 = 52.42
              116: Close CL 02-17 = 47.73, Close CL 03-17 = 52.42
              117: Close CL 02-17 = 47.73, Close CL 03-17 = 52.42
              118: Close CL 02-17 = 47.74, Close CL 03-17 = 52.42
              119: Close CL 02-17 = 47.74, Close CL 03-17 = 52.42
              120: Close CL 02-17 = 47.74, Close CL 03-17 = 52.42
              121: Close CL 02-17 = 47.75, Close CL 03-17 = 52.42
              122: Close CL 02-17 = 47.75, Close CL 03-17 = 52.42
              123: Close CL 02-17 = 47.74, Close CL 03-17 = 52.42
              124: Close CL 02-17 = 47.73, Close CL 03-17 = 52.42
              125: Close CL 02-17 = 47.74, Close CL 03-17 = 52.42
              126: Close CL 02-17 = 47.76, Close CL 03-17 = 52.42
              127: Close CL 02-17 = 47.76, Close CL 03-17 = 52.42
              128: Close CL 02-17 = 47.78, Close CL 03-17 = 52.42
              129: Close CL 02-17 = 47.76, Close CL 03-17 = 52.42
              130: Close CL 02-17 = 47.76, Close CL 03-17 = 52.42

              Bryan
              Attached Files
              Last edited by cassb; 01-11-2017, 01:33 PM.
              cassb
              NinjaTrader Ecosystem Vendor - Logical Forex

              Comment


                #22
                Hello Bryan,

                I am not able to reproduce this behavior using the script I have provided you.

                I have tested using the CL 02-17 as the primary and CL 03-17 as the secondary. (The script has one small change. The AddDataSeries() call was changed to CL 03-17 instead of NQ 03-17.)
                The amount of ticks still appear correct.

                Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #23
                  I watched your video, thank you! I see that it is working correctly when you are using the same instrument for both BarsInProgress. Would you do me a favor and run your same test on a chart with the CL 02-17 instrument on it? You don't even need to have two data series on the chart. Just open a new chart with 02-17 with 1-Tick bars and run the same test with the same code. Let me know what it does this time. I think the issue is when I have two different instruments.

                  And just for grins, can you run the Test.zip indicator I attached last time on a CL 02-17 chart as well and show the output window?

                  Thanks!
                  Bryan
                  cassb
                  NinjaTrader Ecosystem Vendor - Logical Forex

                  Comment


                    #24
                    We will be happy to continue assisting in the debugging process and investigating NinjaTrader. At this point, would you be able to help us get on the same page as far as our goals are?

                    For reference I am including the changes that have been made to our test script. The differences between the script my colleague Chelsea put together to the first script you sent us are in diffs1.patch . The differences between that script and the Test.zip script are in diffs2.patch. To summarize their contents :

                    diffs1.patch :
                    • NQ 03-17 became CL 03-17
                    • The output window is no longer cleared during historical bars
                    • The check to see if there are enough bars was modified
                    • All BarsInProgress checks were eliminated
                    • The check to ensure we were not calculating on each tick was removed
                    • The diagnostic message which lets us know whether we are on the first tick of a bar was modified

                    diffs2.patch
                    • The last mentioned diagnostic message was made to print always, whether it was the first tick of the bar or not

                    Could you let us know the purpose of these changes, and what we are testing for with respect to multiple instruments? If we move on to this sort of test we will no longer be testing front month merged v unmerged differences.


                    I look forward to assisting further.
                    Attached Files
                    Jessica P.NinjaTrader Customer Service

                    Comment


                      #25
                      Hi -- we are trying to find out why, for every historical bar on the chart, the value of the second instrument added in the indicator code is always the same value. The Test.zip code I attached is very simple and illustrates my point in the Output window if you run it on a CL 02-17 chart.

                      In the video Chelsea did, he is using the same instrument with a different bar interval. My test is using a different instrument with the same bar interval, namely the CL 02-17 and CL 03-17 instruments and the bar interval of 1 tick. If you want to connect to my PC, I will demonstrate for you.

                      Bryan
                      cassb
                      NinjaTrader Ecosystem Vendor - Logical Forex

                      Comment


                        #26
                        Hello Bryan,

                        Once resources have allowed me time to retest, I was able to do more testing where the secondary series matches the primary series.

                        I am showing the number of ticks appears to double.
                        Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.


                        I've submitted a bug report to our development about this. Once I have a tracking ID for this report I will post this in this thread so that you may references this after a new build is released.
                        Chelsea B.NinjaTrader Customer Service

                        Comment


                          #27
                          Hi Chelsea. I watched your video. I am still not sure if you are testing the same scenario that I am testing. Why are you adding a 1M bar chart as the secondary series? My code adds a 1 Tick bar chart as the secondary.

                          I don't care if the number of ticks between the primary and secondary series are the same, in fact they will never be the same since I am using two different instruments. The bug I have found is that when OnBarUpdate is called on historical bars, it is only called for BarsInProgress = 0. Why isn't it called for BarsInProgress = 1? Maybe it has to do with which instruments I am using, and the 1 tick bar? You can reproduce this with the Test.zip file I attached.

                          Thanks!
                          Bryan
                          cassb
                          NinjaTrader Ecosystem Vendor - Logical Forex

                          Comment


                            #28
                            Hello Bryan,

                            We add a 1 minute secondary series because we are testing Calculate.OnEachTick, is this correct?

                            In other words, we are checking to see how many ticks are produced by Calculate.OnEachTick when TickReplay is enabled. This is what TickReplay is used for. This automatically adds a secondary series to trigger OnBarUpdate for each tick when Calculate is set to .OnEachTick or each time the prices changes with .OnPriceChange.

                            We compare to see if the number of historical ticks on the chart matches the number of updates to OnBarUpdate when TickReplay is enabled and the Calculate mode is .OnEachTick.

                            If you are adding a 1 tick secondary series, I am unsure what you are testing.

                            Can you clarify what the issue is and what you are testing for?
                            Chelsea B.NinjaTrader Customer Service

                            Comment


                              #29
                              In the end, I want to know what the price difference is between each tick of tick CL 02-17 contract and the CL 03-17 contract. I do this on a 1-tick bar chart. So on bar #1 on the chart, what is the price difference between bar #1 CL 02-17 and bar #1 CL 03-17? On bar #2, what is the price difference between bar #2 of CL 02-17 and bar #2 of CL 03-17 (or bar #1 of 03-17 if a new tick has not happen on that contract yet)? Does that make it more clear? I can share my screen and demonstrate if you'd like.

                              Thanks!
                              Bryan
                              cassb
                              NinjaTrader Ecosystem Vendor - Logical Forex

                              Comment


                                #30
                                Hello Bryan,

                                I must not be understanding the issue.

                                In post #22 I have created a video comparing the number of updates to OnBarUpdate with TickReplay enabled with the CL 02-17 with the CL 03-17.

                                This is to compare the Ticks triggered by TickReplay with the historical ticks on a chart.

                                I am not able to understand how this is not what you are describing in your post (#29).

                                Can you please describe how this script and video in post #22 is not comparing the Ticks of the CL 02-17 with the ticks of the CL 03-17?
                                Chelsea B.NinjaTrader Customer Service

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by jclose, Today, 09:37 PM
                                0 responses
                                4 views
                                0 likes
                                Last Post jclose
                                by jclose
                                 
                                Started by WeyldFalcon, 08-07-2020, 06:13 AM
                                10 responses
                                1,413 views
                                0 likes
                                Last Post Traderontheroad  
                                Started by firefoxforum12, Today, 08:53 PM
                                0 responses
                                10 views
                                0 likes
                                Last Post firefoxforum12  
                                Started by stafe, Today, 08:34 PM
                                0 responses
                                10 views
                                0 likes
                                Last Post stafe
                                by stafe
                                 
                                Started by sastrades, 01-31-2024, 10:19 PM
                                11 responses
                                169 views
                                0 likes
                                Last Post NinjaTrader_Manfred  
                                Working...
                                X