Login Page - Create Account

Support Board


Date/Time: Thu, 02 May 2024 13:22:18 +0000



[Programming Help] - ACSIL - Discrepencies in T&S Records Sequence Numbers Between 2 instances of Sierra Chart

View Count: 977

[2017-07-14 07:38:32]
Zosimus - Posts: 345
When I run a study that I wrote that processes T&S entries on 2 different machines simultaneously I see differences in the values generated by the study.

In order to check what is wrong I ran this simple T&S iteration code on 2 different machines simultaneously and got totally different Sequence numbers.
The results of both iterations are attached.

Both instances of Sierra use Rithimic and are set to to hold 5000 records of T&S (and have the same update interval).

The code I used for the iteration is:

if (sc.SetDefaults)
  {
    sc.GraphName = "T&S_Test";

    sc.FreeDLL = 1;
    sc.AutoLoop = 1;
    sc.GraphRegion = 0;
    sc.UpdateAlways = 1;  

    return;
  }
  if(sc.Index == sc.ArraySize - 1){
    
    SCTimeAndSalesArray TimeSales;
    sc.GetTimeAndSales(TimeSales);
    
    if (TimeSales.Size() == 0)  return;
    int64_t& LastProcessedSequence = sc.GetPersistentInt64(1);
    SCString str;
    
    if (LastProcessedSequence != 0){    
        
        for (int TSIndex = 0; TSIndex < TimeSales.Size() ; ++TSIndex){
          if(TimeSales[TSIndex].Sequence < LastProcessedSequence)
            continue;          
          if (TimeSales[TSIndex].Type == SC_TS_BID || TimeSales[TSIndex].Type == SC_TS_ASK ){            
            int Sequnce = TimeSales[TSIndex].Sequence;
            str.Format("TTSIndex= %i Sequence = %i",TSIndex, Sequnce);
            sc.AddMessageToLog(str,0);
          }
        }
    }
    LastProcessedSequence = TimeSales[TimeSales.Size()-1 ].Sequence;
  }

Date Time Of Last Edit: 2017-07-14 12:20:46
imageSC_Log_1.PNG / V - Attached On 2017-07-14 07:33:25 UTC - Size: 149.15 KB - 276 views
imageSC_Log_2.PNG / V - Attached On 2017-07-14 07:33:30 UTC - Size: 149.15 KB - 289 views
[2017-07-14 12:37:13]
Sierra Chart Engineering - Posts: 104368
Sequence numbers are calculated within Sierra Chart itself. They will be different between different instances of Sierra Chart.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2017-07-14 13:31:16]
Zosimus - Posts: 345
Another (probably stupid) question:
If my SC stores 5000 records of Time and sales which record would hold the most recent data 0 or 4999 ?
[2017-07-14 13:42:11]
Sierra Chart Engineering - Posts: 104368
The last record 4999.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account