Support Board
Date/Time: Mon, 23 Jun 2025 14:48:41 +0000
Post From: Mechanics of GetTimeAndSales/*IndexesForBar() When Switching Symbols Mid-bar?
[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
Thank you in advance.
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); |