Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Tick replay in strategy analyzer

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

    Tick replay in strategy analyzer

    Hi,
    I created a strategy that runs on a minute chart but I wanted some logic to run on each tick.
    I added a 1 tick based data series as follows:
    Code:
    else if (State == State.Configure)
    {
    	AddDataSeries("ES 06-16", Data.BarsPeriodType.Tick, 1, Data.MarketDataType.Last);
    }
    I enabled Tick Reply in the strategy analyzer.

    As I understand the Tick Reply should trigger OnMarketData with all the "Last" events.

    I printed each event of OnMarketData, as well as OnBarUpdate tick series (when BarsInProgress is 1).
    Code:
    if (BarsInProgress == 1)
    {			
    	Print("OnBarUpdate: " + Close[0]);
    }
    I expected to get the same number of event calls in OnBarUpdate and OnMarketData but when I look at the output window I see there are more events in OnMarketData.

    Is this to be expected?

    This is a part of the output window:
    Code:
    instrument='ES 06-16 Globex' type=Last price=2044 volume=3 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
    instrument='ES 06-16 Globex' type=Last price=2044.25 volume=1 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
    OnBarUpdate: 2044.25
    instrument='ES 06-16 Globex' type=Last price=2044.25 volume=1 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
    instrument='ES 06-16 Globex' type=Last price=2044.25 volume=2 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
    instrument='ES 06-16 Globex' type=Last price=2044.25 volume=2 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
    OnBarUpdate: 2044.25
    instrument='ES 06-16 Globex' type=Last price=2044.25 volume=2 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
    OnBarUpdate: 2044.25
    instrument='ES 06-16 Globex' type=Last price=2044.25 volume=2 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
    instrument='ES 06-16 Globex' type=Last price=2044.25 volume=1 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
    OnBarUpdate: 2044.25
    instrument='ES 06-16 Globex' type=Last price=2044.25 volume=1 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
    instrument='ES 06-16 Globex' type=Last price=2044 volume=1 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
    OnBarUpdate: 2044
    instrument='ES 06-16 Globex' type=Last price=2044 volume=1 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
    instrument='ES 06-16 Globex' type=Last price=2044.25 volume=2 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
    OnBarUpdate: 2044.25
    instrument='ES 06-16 Globex' type=Last price=2044.25 volume=2 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
    instrument='ES 06-16 Globex' type=Last price=2044.25 volume=1 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
    OnBarUpdate: 2044.25
    instrument='ES 06-16 Globex' type=Last price=2044.25 volume=1 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
    instrument='ES 06-16 Globex' type=Last price=2044 volume=13 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
    instrument='ES 06-16 Globex' type=Last price=2044 volume=14 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
    instrument='ES 06-16 Globex' type=Last price=2044 volume=2 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
    instrument='ES 06-16 Globex' type=Last price=2044 volume=15 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
    instrument='ES 06-16 Globex' type=Last price=2044 volume=8 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
    instrument='ES 06-16 Globex' type=Last price=2044 volume=8 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
    instrument='ES 06-16 Globex' type=Last price=2044 volume=8 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
    instrument='ES 06-16 Globex' type=Last price=2044 volume=8 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
    instrument='ES 06-16 Globex' type=Last price=2044 volume=8 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
    instrument='ES 06-16 Globex' type=Last price=2044 volume=8 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
    instrument='ES 06-16 Globex' type=Last price=2044 volume=7 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
    instrument='ES 06-16 Globex' type=Last price=2044 volume=8 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
    instrument='ES 06-16 Globex' type=Last price=2044 volume=1 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
    instrument='ES 06-16 Globex' type=Last price=2044 volume=1 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
    instrument='ES 06-16 Globex' type=Last price=2044 volume=10 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
    instrument='ES 06-16 Globex' type=Last price=2044 volume=1 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
    instrument='ES 06-16 Globex' type=Last price=2044 volume=4 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
    instrument='ES 06-16 Globex' type=Last price=2044 volume=1 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
    instrument='ES 06-16 Globex' type=Last price=2044 volume=1 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
    instrument='ES 06-16 Globex' type=Last price=2044 volume=4 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
    instrument='ES 06-16 Globex' type=Last price=2044 volume=3 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
    OnBarUpdate: 2044
    instrument='ES 06-16 Globex' type=Last price=2044 volume=13 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
    Edit:
    I added the following data series as well and printed the OnMarketData events as well as the BarsInProgress number.
    Code:
    AddDataSeries(base.Instrument.FullName, Data.BarsPeriodType.Tick, 1, Data.MarketDataType.Ask);
    AddDataSeries(base.Instrument.FullName, Data.BarsPeriodType.Tick, 1, Data.MarketDataType.Bid);
    I think the events' type has a bug, it should be "ask" after number "2" and "bid" after number "3". You can see it from the volumes as well. "Last" events have small volumes usually and "bid" and "ask" events just update the quantity left in bid0 and ask0 respectively.

    Code:
    3
    instrument='ES 06-16 Globex' type=Last price=2044.5 volume=145 time='17/05/2016 15:59:58' bid=2044.5 ask=2044.75 isReset=False
    instrument='ES 06-16 Globex' type=Last price=2044.5 volume=4 time='17/05/2016 15:59:58' bid=2044.5 ask=2044.75 isReset=False
    1
    OnBarUpdate: 2044.5
    instrument='ES 06-16 Globex' type=Last price=2044.5 volume=4 time='17/05/2016 15:59:58' bid=2044.5 ask=2044.75 isReset=False
    2
    instrument='ES 06-16 Globex' type=Last price=2044.75 volume=168 time='17/05/2016 15:59:58' bid=2044.75 ask=2045 isReset=False
    3
    instrument='ES 06-16 Globex' type=Last price=2044.5 volume=141 time='17/05/2016 15:59:58' bid=2044.5 ask=2044.75 isReset=False
    instrument='ES 06-16 Globex' type=Last price=2044.5 volume=4 time='17/05/2016 15:59:58' bid=2044.5 ask=2044.75 isReset=False
    1
    OnBarUpdate: 2044.5
    instrument='ES 06-16 Globex' type=Last price=2044.5 volume=4 time='17/05/2016 15:59:58' bid=2044.5 ask=2044.75 isReset=False
    2
    instrument='ES 06-16 Globex' type=Last price=2044.75 volume=172 time='17/05/2016 15:59:58' bid=2044.75 ask=2045 isReset=False
    3
    instrument='ES 06-16 Globex' type=Last price=2044.5 volume=137 time='17/05/2016 15:59:58' bid=2044.5 ask=2044.75 isReset=False
    instrument='ES 06-16 Globex' type=Last price=2044.75 volume=2 time='17/05/2016 15:59:58' bid=2044.5 ask=2044.75 isReset=False
    1
    OnBarUpdate: 2044.75
    instrument='ES 06-16 Globex' type=Last price=2044.75 volume=2 time='17/05/2016 15:59:58' bid=2044.5 ask=2044.75 isReset=False
    2
    instrument='ES 06-16 Globex' type=Last price=2044.75 volume=170 time='17/05/2016 15:59:58' bid=2044.75 ask=2045 isReset=False
    3
    instrument='ES 06-16 Globex' type=Last price=2044.5 volume=135 time='17/05/2016 15:59:58' bid=2044.5 ask=2044.75 isReset=False
    instrument='ES 06-16 Globex' type=Last price=2044.5 volume=3 time='17/05/2016 15:59:58' bid=2044.5 ask=2044.75 isReset=False
    1
    OnBarUpdate: 2044.5
    instrument='ES 06-16 Globex' type=Last price=2044.5 volume=3 time='17/05/2016 15:59:58' bid=2044.5 ask=2044.75 isReset=False
    2
    instrument='ES 06-16 Globex' type=Last price=2044.75 volume=167 time='17/05/2016 15:59:58' bid=2044.75 ask=2045 isReset=False
    3
    instrument='ES 06-16 Globex' type=Last price=2044.5 volume=132 time='17/05/2016 15:59:58' bid=2044.5 ask=2044.75 isReset=False
    instrument='ES 06-16 Globex' type=Last price=2044.5 volume=4 time='17/05/2016 15:59:58' bid=2044.5 ask=2044.75 isReset=False
    1
    OnBarUpdate: 2044.5
    instrument='ES 06-16 Globex' type=Last price=2044.5 volume=4 time='17/05/2016 15:59:58' bid=2044.5 ask=2044.75 isReset=False
    2
    instrument='ES 06-16 Globex' type=Last price=2044.75 volume=164 time='17/05/2016 15:59:58' bid=2044.75 ask=2045 isReset=False
    2
    instrument='ES 06-16 Globex' type=Last price=2044.75 volume=163 time='17/05/2016 15:59:58' bid=2044.75 ask=2045 isReset=False
    3
    instrument='ES 06-16 Globex' type=Last price=2044.5 volume=128 time='17/05/2016 15:59:58' bid=2044.5 ask=2044.75 isReset=False
    3
    instrument='ES 06-16 Globex' type=Last price=2044.5 volume=129 time='17/05/2016 15:59:59' bid=2044.5 ask=2044.75 isReset=False
    instrument='ES 06-16 Globex' type=Last price=2044.5 volume=1 time='17/05/2016 15:59:59' bid=2044.5 ask=2044.75 isReset=False
    1
    OnBarUpdate: 2044.5
    instrument='ES 06-16 Globex' type=Last price=2044.5 volume=1 time='17/05/2016 15:59:59' bid=2044.5 ask=2044.75 isReset=False
    3
    instrument='ES 06-16 Globex' type=Last price=2044.5 volume=128 time='17/05/2016 15:59:59' bid=2044.5 ask=2044.75 isReset=False
    instrument='ES 06-16 Globex' type=Last price=2044.5 volume=1 time='17/05/2016 15:59:59' bid=2044.5 ask=2044.75 isReset=False
    Last edited by ToMer_K; 07-05-2016, 08:04 PM.

    #2
    Hi again,
    I rechecked, each time you add the "Data.MarketDataType.Ask" or "Data.MarketDataType.Bid" 1 Tick data series they appear as "type=Last" events in OnMarketData. Definitely a bug.

    Comment


      #3
      Hello,

      Thank you for the post.

      I wanted to check as the print for the OnMarketData was not provided, are you following the sample in this document regarding checking the TickReplay data? : http://ninjatrader.com/support/helpG...=tick%2Breplay

      The prints can be helpful but without seeing the syntax used in OnMarketData it would be hard to say what is expected with what was provided.

      If you can provide the test you are currently using in its full context, that would be helpful to complete the same test as you to determine if what was printed would be expected.

      Please let me know if I may be of additional assistance.
      JesseNinjaTrader Customer Service

      Comment


        #4
        Hi,
        I followed the guide.

        I cannot provide the code.

        All you need for you to see the same behavior is to create a custom strategy, add the 3 data series and print the events in OnMarketData and OnBarUpdate as I did.

        Code:
        else if (State == State.Configure)
        {
                AddDataSeries(base.Instrument.FullName, Data.BarsPeriodType.Tick, 1,         Data.MarketDataType.Last);
                AddDataSeries(base.Instrument.FullName, Data.BarsPeriodType.Tick, 1, Data.MarketDataType.Ask);
        	AddDataSeries(base.Instrument.FullName, Data.BarsPeriodType.Tick, 1, Data.MarketDataType.Bid);
        }
        Code:
        protected override void OnBarUpdate()
        {
                Print(BarsInProgress);
                if (BarsInProgress == 1)
                {			
                	Print("OnBarUpdate: " + Close[0]);
                }
        }
        Code:
        protected override void OnMarketData(MarketDataEventArgs e)
        {
        	Print(e.ToString());
        }

        Comment


          #5
          Has the bug been reported? I see it again in B12.

          Comment


            #6
            Hello,

            Thank you for the reply.


            In this case I am unable to see any bug, the comparison being used would not match and would be expected.

            Each added series will additionally add TickReplay for those series, so the Prints in the first test would not match because you are adding an additional series.

            Using only a Primary series with TickReplay would result in the OnMarketData event only being called for the replay data associated with the Primary series in historical


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

            Comment


              #7
              Bug1

              Hi Jesse,
              Please rethink it because I am sure there are bugs here. I have been researching the events in OnMarketData for more than a year, I know what I am seeing.

              Bug 1 - Tick replay shows more events than an added 1 tick (Last) data series:
              The main data series is ES 06-16 1 minute chart, which during tick replay will use 1 tick data (Last events only) in OnMarketData. I added an additional data series that is the same as the one the tick replay uses (1 tick ES 06-16) . I printed only the BarsInProgress == 1 in OnBarUpdate and the OnMarkerData events. They should be the same amount of ticks (= numbet of printed lines) because they rely on the same input data. Look at the green OnMarketData sequence with no OnBarUpdate events in between.

              Code:
              instrument='ES 06-16 Globex' type=Last price=2044 volume=3 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
              instrument='ES 06-16 Globex' type=Last price=2044.25 volume=1 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
              OnBarUpdate: 2044.25
              instrument='ES 06-16 Globex' type=Last price=2044.25 volume=1 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
              instrument='ES 06-16 Globex' type=Last price=2044.25 volume=2 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
              instrument='ES 06-16 Globex' type=Last price=2044.25 volume=2 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
              OnBarUpdate: 2044.25
              instrument='ES 06-16 Globex' type=Last price=2044.25 volume=2 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
              OnBarUpdate: 2044.25
              instrument='ES 06-16 Globex' type=Last price=2044.25 volume=2 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
              instrument='ES 06-16 Globex' type=Last price=2044.25 volume=1 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
              OnBarUpdate: 2044.25
              instrument='ES 06-16 Globex' type=Last price=2044.25 volume=1 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
              instrument='ES 06-16 Globex' type=Last price=2044 volume=1 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
              OnBarUpdate: 2044
              instrument='ES 06-16 Globex' type=Last price=2044 volume=1 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
              instrument='ES 06-16 Globex' type=Last price=2044.25 volume=2 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
              OnBarUpdate: 2044.25
              instrument='ES 06-16 Globex' type=Last price=2044.25 volume=2 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
              instrument='ES 06-16 Globex' type=Last price=2044.25 volume=1 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
              [COLOR="Red"]OnBarUpdate: 2044.25[/COLOR]
              [COLOR="DarkGreen"]instrument='ES 06-16 Globex' type=Last price=2044.25 volume=1 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
              instrument='ES 06-16 Globex' type=Last price=2044 volume=13 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
              instrument='ES 06-16 Globex' type=Last price=2044 volume=14 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
              instrument='ES 06-16 Globex' type=Last price=2044 volume=2 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
              instrument='ES 06-16 Globex' type=Last price=2044 volume=15 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
              instrument='ES 06-16 Globex' type=Last price=2044 volume=8 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
              instrument='ES 06-16 Globex' type=Last price=2044 volume=8 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
              instrument='ES 06-16 Globex' type=Last price=2044 volume=8 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
              instrument='ES 06-16 Globex' type=Last price=2044 volume=8 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
              instrument='ES 06-16 Globex' type=Last price=2044 volume=8 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
              instrument='ES 06-16 Globex' type=Last price=2044 volume=8 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
              instrument='ES 06-16 Globex' type=Last price=2044 volume=7 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
              instrument='ES 06-16 Globex' type=Last price=2044 volume=8 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
              instrument='ES 06-16 Globex' type=Last price=2044 volume=1 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
              instrument='ES 06-16 Globex' type=Last price=2044 volume=1 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
              instrument='ES 06-16 Globex' type=Last price=2044 volume=10 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
              instrument='ES 06-16 Globex' type=Last price=2044 volume=1 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
              instrument='ES 06-16 Globex' type=Last price=2044 volume=4 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
              instrument='ES 06-16 Globex' type=Last price=2044 volume=1 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
              instrument='ES 06-16 Globex' type=Last price=2044 volume=1 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
              instrument='ES 06-16 Globex' type=Last price=2044 volume=4 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False
              instrument='ES 06-16 Globex' type=Last price=2044 volume=3 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False[/COLOR]
              [COLOR="Red"][/COLOR]OnBarUpdate: 2044
              instrument='ES 06-16 Globex' type=Last price=2044 volume=13 time='17/05/2016 15:14:58' bid=2044 ask=2044.25 isReset=False

              Comment


                #8
                Bug 2

                Bug 2 - When adding 1 tick "bid" or "ask" data series these ticks are being processed in OnMarketData as "Last" events:
                In my prints you can see the bars in progress printed as single numbers, the OnBarUpdate calls in "BarsInProgress == 1" (= 1 tick "Last" data) and all the OnMarketDataEvents.

                In order for you to see it more clearly I colored the bid and ask events in red (BarsInProgress == 2 or 3) and the Last events (BIP = 1) in green. You can see that after each red number (2 or 3) the OnMarketData events shows big numbers that correspond to bid and ask volume updates. After each green number there is a small volume number that is corresponds to Last events (when market orders take place, usually 1-10).

                The problem is that the red volumes are also "type=Last" events. That is the bug. You can test an indicator of historical bid and ask that uses OnMarketData events and see it gets no bid or ask events.

                Code:
                [COLOR="Red"]3[/COLOR]
                instrument='ES 06-16 Globex' type=Last price=2044.5 volume=[COLOR="red"]145[/COLOR] time='17/05/2016 15:59:58' bid=2044.5 ask=2044.75 isReset=False
                instrument='ES 06-16 Globex' type=Last price=2044.5 volume=4 time='17/05/2016 15:59:58' bid=2044.5 ask=2044.75 isReset=False
                [COLOR="Lime"]1[/COLOR]
                OnBarUpdate: 2044.5
                instrument='ES 06-16 Globex' type=Last price=2044.5 volume=[COLOR="Lime"]4[/COLOR] time='17/05/2016 15:59:58' bid=2044.5 ask=2044.75 isReset=False
                [COLOR="red"]2[/COLOR]
                instrument='ES 06-16 Globex' type=Last price=2044.75 volume=[COLOR="Red"]168[/COLOR] time='17/05/2016 15:59:58' bid=2044.75 ask=2045 isReset=False
                [COLOR="red"]3[/COLOR]
                instrument='ES 06-16 Globex' type=Last price=2044.5 volume=[COLOR="red"]141[/COLOR] time='17/05/2016 15:59:58' bid=2044.5 ask=2044.75 isReset=False
                instrument='ES 06-16 Globex' type=Last price=2044.5 volume=4 time='17/05/2016 15:59:58' bid=2044.5 ask=2044.75 isReset=False
                [COLOR="Lime"]1[/COLOR]
                OnBarUpdate: 2044.5
                instrument='ES 06-16 Globex' type=Last price=2044.5 volume=[COLOR="lime"]4[/COLOR] time='17/05/2016 15:59:58' bid=2044.5 ask=2044.75 isReset=False
                [COLOR="red"]2[/COLOR]
                instrument='ES 06-16 Globex' type=Last price=2044.75 volume=[COLOR="red"]172[/COLOR] time='17/05/2016 15:59:58' bid=2044.75 ask=2045 isReset=False
                [COLOR="red"]3[/COLOR]
                instrument='ES 06-16 Globex' type=Last price=2044.5 volume=[COLOR="red"]137[/COLOR] time='17/05/2016 15:59:58' bid=2044.5 ask=2044.75 isReset=False
                instrument='ES 06-16 Globex' type=Last price=2044.75 volume=2 time='17/05/2016 15:59:58' bid=2044.5 ask=2044.75 isReset=False
                [COLOR="lime"]1[/COLOR]
                OnBarUpdate: 2044.75
                instrument='ES 06-16 Globex' type=Last price=2044.75 volume=[COLOR="lime"]2[/COLOR] time='17/05/2016 15:59:58' bid=2044.5 ask=2044.75 isReset=False
                [COLOR="red"]2[/COLOR]
                instrument='ES 06-16 Globex' type=Last price=2044.75 volume=[COLOR="red"]170[/COLOR] time='17/05/2016 15:59:58' bid=2044.75 ask=2045 isReset=False
                [COLOR="red"]3[/COLOR]
                instrument='ES 06-16 Globex' type=Last price=2044.5 volume=[COLOR="red"]135[/COLOR] time='17/05/2016 15:59:58' bid=2044.5 ask=2044.75 isReset=False
                instrument='ES 06-16 Globex' type=Last price=2044.5 volume=3 time='17/05/2016 15:59:58' bid=2044.5 ask=2044.75 isReset=False
                [COLOR="lime"]1[/COLOR]
                OnBarUpdate: 2044.5
                instrument='ES 06-16 Globex' type=Last price=2044.5 volume=[COLOR="lime"]3[/COLOR] time='17/05/2016 15:59:58' bid=2044.5 ask=2044.75 isReset=False
                [COLOR="red"]2[/COLOR]
                instrument='ES 06-16 Globex' type=Last price=2044.75 volume=[COLOR="red"]167[/COLOR] time='17/05/2016 15:59:58' bid=2044.75 ask=2045 isReset=False
                [COLOR="red"]3[/COLOR]
                instrument='ES 06-16 Globex' type=Last price=2044.5 volume=[COLOR="red"]132[/COLOR] time='17/05/2016 15:59:58' bid=2044.5 ask=2044.75 isReset=False
                instrument='ES 06-16 Globex' type=Last price=2044.5 volume=4 time='17/05/2016 15:59:58' bid=2044.5 ask=2044.75 isReset=False
                [COLOR="lime"]1[/COLOR]
                OnBarUpdate: 2044.5
                instrument='ES 06-16 Globex' type=Last price=2044.5 volume=[COLOR="lime"]4[/COLOR] time='17/05/2016 15:59:58' bid=2044.5 ask=2044.75 isReset=False
                [COLOR="red"]2[/COLOR]
                instrument='ES 06-16 Globex' type=Last price=2044.75 volume=[COLOR="red"]164[/COLOR] time='17/05/2016 15:59:58' bid=2044.75 ask=2045 isReset=False
                [COLOR="red"]2[/COLOR]
                instrument='ES 06-16 Globex' type=Last price=2044.75 volume=[COLOR="red"]163[/COLOR] time='17/05/2016 15:59:58' bid=2044.75 ask=2045 isReset=False
                [COLOR="red"]3[/COLOR]
                instrument='ES 06-16 Globex' type=Last price=2044.5 volume=[COLOR="red"]128[/COLOR] time='17/05/2016 15:59:58' bid=2044.5 ask=2044.75 isReset=False
                [COLOR="red"]3[/COLOR]
                instrument='ES 06-16 Globex' type=Last price=2044.5 volume=[COLOR="red"]129[/COLOR] time='17/05/2016 15:59:59' bid=2044.5 ask=2044.75 isReset=False
                instrument='ES 06-16 Globex' type=Last price=2044.5 volume=1 time='17/05/2016 15:59:59' bid=2044.5 ask=2044.75 isReset=False
                [COLOR="lime"]1[/COLOR]
                OnBarUpdate: 2044.5
                instrument='ES 06-16 Globex' type=Last price=2044.5 volume=[COLOR="lime"]1[/COLOR] time='17/05/2016 15:59:59' bid=2044.5 ask=2044.75 isReset=False

                Comment


                  #9
                  Back to NT7

                  I guess there are enough bugs for you to handle at the moment. Should I send this to platform support?

                  I have to stop my strategy development in NT8 because these issues block me from using tick replay, which was why at the first place I wanted to migrate to NT8.

                  If there is no intention of fixing this in the next Beta releases the tick replay doesn't have much use.

                  Comment


                    #10
                    Hello ToMer_K,

                    Thank you for your response.

                    On Bug 1, can you attach the full test script to your response?
                    You can attach your indicator to your response by going to Tools > Export > NinjaScript > Add > select your Indicator > OK > Export. The file will be located under (My) Documents\NinjaTrader 8\bin\Custom\ExportNinjaScript.
                    Last edited by NinjaTrader_PatrickH; 07-21-2016, 06:16 AM.

                    Comment


                      #11
                      On Bug 2, in Tick Replay on historical bars you are going to see last events only for any added series. Please visit the following link for more information: http://ninjatrader.com/support/helpG...ick_replay.htm
                      5. Tick Replay ONLY replays the Last market data event, and only stores the best inside bid/ask price at the time of the last trade event. You can think of this as the equivalent of the bid/ask price at the time a trade was reported. As such, historical Bid/Ask market data events (such as bid/ask volume) do NOT replay during Tick Replay. To obtain those values, you need to use a historical bid/ask series or use the Playback connection with Market Replay

                      Comment


                        #12
                        Originally posted by NinjaTrader_PatrickH View Post
                        On Bug 2, in Tick Replay on historical bars you are going to see last events only for any added series. Please visit the following link for more information: http://ninjatrader.com/support/helpG...ick_replay.htm
                        Hi,
                        To obtain those values, you need to use a historical bid/ask series
                        I did use these data series.

                        In addition, you can see in my output that after each tick of these data series (represented as BarsInProgress number) there is an OnMarketData event.

                        If that is not enough you can also see that the volumes in these events are correlated to the volumes of bid and ask L1 updates.

                        About bug 1, it so easy to recreate, and as I told you I cannot share the code.
                        Nonetheless, I created a new code for you so we will not have to continue this thread for many more days

                        You will see all the instructions you need for catching these two bugs in the beginning of the strategy.
                        Attached Files

                        Comment


                          #13
                          Hi,
                          Is this clear enough or should I add further instructions?

                          Comment


                            #14
                            Hello,

                            Thank you for the reply.

                            The sample provided is currently being reviewed, once I have further reviewed what you have provided I will reply back.

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

                            Comment


                              #15
                              Hello ToMer_K,

                              Thank you for your patience.


                              Item # 1:

                              Tick Replay updates OnMarketData for each tick that occurs. OnBarUpdate() is based on the timestamp of the bar. If multiple bars come through with the exact same time stamp down to the millisecond then OnBarUpdate() will only see one event. In your specific case, you see more OnMarketData events as the OnBarUpdate would not be called for each tick that had the same timestamp down to the millisecond.


                              Item # 2:

                              Each event in Tick Replay will be a Last event for MarketDataType. This is expected.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by strategist007, Today, 07:51 PM
                              0 responses
                              2 views
                              0 likes
                              Last Post strategist007  
                              Started by StockTrader88, 03-06-2021, 08:58 AM
                              44 responses
                              3,967 views
                              3 likes
                              Last Post jhudas88  
                              Started by rbeckmann05, Today, 06:48 PM
                              0 responses
                              4 views
                              0 likes
                              Last Post rbeckmann05  
                              Started by rhyminkevin, Today, 04:58 PM
                              4 responses
                              55 views
                              0 likes
                              Last Post dp8282
                              by dp8282
                               
                              Started by iceman2018, Today, 05:07 PM
                              0 responses
                              6 views
                              0 likes
                              Last Post iceman2018  
                              Working...
                              X