Login Page - Create Account

Support Board


Date/Time: Mon, 23 Jun 2025 10:22:29 +0000



Mechanics of GetTimeAndSales/*IndexesForBar() When Switching Symbols Mid-bar?

View Count: 613

[2022-02-17 13:52:28]
frozentundra - Posts: 95
Greetings!

Regarding these two functions:

GetTimeSales()
GetTimeSalesArrayIndexesForBarIndex()

How do these two functions behave in the scenario where:

1. Market is open and live
2. I switch to a new symbol (equities), for example from AAPL to NVDA
3. SC needs to download data for the new symbol because I haven't loaded it yet today or in a while

It almost seems like the Time & Sales data I'm getting back when switching to a new symbol intrabar during live market hours is missing the latest prints from the latest bar?
If you could help me understand the mechanics of how these two functions work in that scenario, maybe I can code around it?

Should I expect them to return the absolute most recent T&S prints as soon as I switch to the symbol?
Should those prints get downloaded historically?
Do I not get those prints at all during the current bar?
Something else?


Code snippet:

// grab latest time and sales data for the most recent bar
c_SCTimeAndSalesArray TimeSales;
sc.GetTimeAndSales(TimeSales);
int BeginIdx = 0;
int EndIdx = 0;
// MAKE SURE TO UPDATE GLOBAL SETTINGS -> NUM TIME AND SALES RECORDS!
sc.GetTimeSalesArrayIndexesForBarIndex(sc.Index, BeginIdx, EndIdx);
Thank you in advance.
[2022-02-23 20:58:33]
Sierra_Chart Engineering - Posts: 19984
Should I expect them to return the absolute most recent T&S prints as soon as I switch to the symbol?
Yes


Should those prints get downloaded historically?
No


Do I not get those prints at all during the current bar?
The way this works is that when the real-time market data subscribed to, the time and sales data is stored from that point in time using data from the real-time data feed. Additionally the data is remembered between data feed connections. It is only cleared on a restart of Sierra Chart. And there is a limit as to the number of records stored.
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, use the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2022-02-23 20:59:12

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

Login

Login Page - Create Account