Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi-Instrument approach + Tick Replay

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

    Multi-Instrument approach + Tick Replay

    Hello NT8 support.
    I have created an indicator that implements multi-instrument approach. I have NQ 1 minute primary chart. The code below adds the secondary chart.
    Code:
    protected override void OnStateChange()
    {
          if (State == State.SetDefaults)
          {
                // some initialization
          }
          else if (State == State.Configure)
          {
                AddDataSeries("ES 06-24");
          }
    }
    
    protected override void OnBarUpdate()
    {
          // Some logic
    }
    An additional ES 1 minute chart is expected to be created and it seems to be working.
    "Some logic" makes some actions with both bar series. The important thing that the primary chart has Tick Replay option enabled so that the logic has access to tick by tick data in historical mode. And I have a feeling that Tick Replay option is not enabled by default for the secondary chart and nothing is said about it in the documentation... Can you confirm my guess and if it is confirmed here is a question. Is there a way to enable Tick Replay option for the secondary chart?

    Thank you.
    Last edited by PopovDS; 06-03-2024, 02:54 PM.

    #2
    Hello PopovDS,

    I am not sure what you mean by secondary chart, are you referring to the AddDataSeries? If the chart has tick replay enabled that will be for each instrument the script adds in its code as well. The easiest way to see this is by using a print:

    Code:
    protected override void OnBarUpdate()
    {
        Print(BarsInProgress + " - " + Time[0]);
    }

    Comment


      #3
      Hello Jesse.
      Thank you for your response.
      Yes, the secondary chart is meant to be one added with using AddChartData method.
      Thank you for the confirmation, it is what I wanted to know. Here is the next question.
      Let's suppose the market provides the following sequence of ticks in realtime in my multi-instrument indicator in OnBarUpdate method:
      Tick #1 NQ
      Tick #2 NQ
      Tick #3 NQ
      Tick #1 ES
      Tick #4 NQ
      Tick #2 ES
      Tick #3 ES
      Tick #5 NQ
      ...
      At some moment I press F5 (reload script) or Ctrl+Shift+R (reload historical data). Tick Replay option is enabled. Is there a guarantee that I will get the same sequence of ticks in historical mode?

      Comment


        #4
        Hello PopovDS,

        No, there are multiple items that could cause differences. When you press F5 some new realtime ticks will be lost during loading and processing so that could cause differences going forward after that. Two different instruments are being used so the order of processing is based on the available data and the timestamps for that data. You could have instances of duplicate timestamps which could change the order of processing those ticks. You can also see differences with price data depending on what part of tick replay is being used, tick replay has ask and bid prices only for the last event which is less granular than in realtime.

        To have an exact replication of what happened in realtime you could use the record market data for playback feature and then use the playback connection to replay the live data. When you record the data from your own connection that will be the exact same events that you saw in realtime recorded on your PC to be played back at a later time.


        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        62 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        134 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        75 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        45 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        50 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X