Login Page - Create Account

Support Board


Date/Time: Thu, 14 May 2026 10:17:24 +0000



[Programming Help] - Computing bar index N's timestamp from a scid file outside of Sierra Chart

View Count: 147

[2026-05-06 01:40:09]
cmack1011 - Posts: 194
Hi:
I'm building an external Python tool that needs to read historical bar data from .scid files and align it with bar indices used in my custom ACSIL studies. I've hit a question I can't resolve from the documentation.

Background:
I have an ACSIL study that processes intraday bars and writes a CSV row at the end of each "phase" (a user-marked time range on the chart). The CSV stores start_bar_index and end_bar_index as integers — the values from sc.BaseDateTimeIn's array index.
Separately, I have a Python tool that reads the same ticker's .scid file directly. I want to extract the same OHLCV bar data my ACSIL study saw, given a stored start_bar_index.

What I tried:
I assumed bar index N corresponded to the timestamp of the first .scid record + N × bar period (10 seconds for my charts). I verified this against my CSV's stored phase start_time (chart-displayed time, Chicago timezone) for 211 historical phases across 32 tickers.
The hypothesis is rejected — diffs range from -1.5 million to -20 million seconds. The pattern suggests SC's bar index 0 is anchored somewhere other than the first .scid record. Per-ticker, the offset is mostly consistent (a few seconds variation for some tickers, days of variation for others — possibly indicating session-skip gaps), but it varies dramatically across tickers.

My questions:

What determines bar index 0's wall-clock timestamp for an intraday chart? Is it the first .scid record, the start of the first session of a configurable date, or something else?

When SC is configured to skip session gaps (e.g., overnight, weekends), does this affect bar indexing? Specifically, if a .scid file has continuous tick data across 24 hours, but SC is set to display only the regular session, does bar index N skip overnight gaps?

Is there a programmatic way (from outside Sierra Chart, reading only the .scid file plus chart configuration) to determine the wall-clock timestamp of bar index N?

Alternatively — does ACSIL provide a way for a custom study to write the wall-clock timestamp of each bar to disk efficiently, so I can build my own bar-index → timestamp lookup table?

Is there a simpler way to achieve my goal — pairing externally-stored bar indices with .scid bar data — that I'm missing?

Thanks for any guidance.

Date Time Of Last Edit: 2026-05-06 01:40:51
[2026-05-06 13:18:05]
John - SC Support - Posts: 46122
What determines bar index 0's wall-clock timestamp for an intraday chart? Is it the first .scid record, the start of the first session of a configurable date, or something else?

Bar indices within the Sierra Chart software are determined from the chart itself. The first bar loaded in the chart has an index of 0.


Given the above, you would need to save the time of the bar and line that up with the timestamp of the trade from the .scid file. You can not use the Indices.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2026-05-06 19:02:14]
cmack1011 - Posts: 194
Can I ask a different question in this string?

I'm building an external Python tool that reads .scid intraday tick files and reconstructs OHLC bars on a fixed time interval (10-second bars). I want my Python-generated bars to match the bars Sierra Chart shows on screen for the same symbol and timeframe. My goal is to read .scid files in Python and produce OHLC bars that exactly match what an ACSIL custom study would see in sc.High, sc.Low, sc.Open, sc.Close arrays.
I'm seeing systematic differences between my Python-reconstructed bars and the bars displayed in Sierra Chart, particularly in pre-market periods. The differences are small (1-3%) during regular session hours, but much larger in low-liquidity pre-market periods.
My Python reader currently includes every record in the .scid file when computing bar OHLC and volume. I suspect Sierra Chart may be filtering certain trade conditions or record types when building its internal bar arrays.
My questions:

When Sierra Chart constructs bar OHLC values for an intraday chart from a .scid file, are any trade conditions or record types filtered out by default? For example, are out-of-sequence trades, late trades, opening/closing prints, dark pool reports, or odd-lot trades excluded from the bar high/low/open/close calculations?

Are there chart settings or symbol settings that control which records contribute to bar OHLC vs which are ignored? If so, where are these settings located?

For a tick whose timestamp falls exactly on a bar boundary (e.g., a tick at 11:05:00.000 for 10-second bars starting at 11:05:00), does that tick go into the bar starting at 11:05:00 or the bar ending at 11:05:00? Is the bar interval [start, end) or (start, end]?
Beyond the .scid file, does Sierra Chart pull intraday OHLC data from any other source files (e.g., .depth, .dly) that I would need to incorporate to reproduce SC's bars exactly?

Is there a documented reference for the bar-construction algorithm that I could consult to ensure my Python reader produces matching results?


Thanks for any guidance.

[2026-05-13 20:56:41]
Sierra_Chart Engineering - Posts: 23752
When Sierra Chart constructs bar OHLC values for an intraday chart from a .scid file, are any trade conditions or record types filtered out by default? For example, are out-of-sequence trades, late trades, opening/closing prints, dark pool reports, or odd-lot trades excluded from the bar high/low/open/close calculations?

The .scid file contains only data that is used in the charts. Any record types that are reported that should not be part of the chart, as defined by the exchanges, are not saved in the .scid file.

The only exception is odd lot trades which is controlled by this setting:
Chart Settings: Include Odd Lot Equity Trades (Chart >> Chart Settings >> Chart Data >> Chart Data menu)


Are there chart settings or symbol settings that control which records contribute to bar OHLC vs which are ignored? If so, where are these settings located?

The settings that would have an impact on this are the following:
Chart Settings: New Bar at Session Start (Chart >> Chart Settings >> Session Times >> Intraday Chart Session Times menu)

Chart Settings: Split Data Records (applies to Number of Trades, Volume and Range charts) (Chart >> Chart Settings >> Chart Data >> Chart Data menu)

Chart Settings: Trades Combining Method (Chart >> Chart Settings >> Chart Data >> Chart Data menu)


For a tick whose timestamp falls exactly on a bar boundary (e.g., a tick at 11:05:00.000 for 10-second bars starting at 11:05:00), does that tick go into the bar starting at 11:05:00 or the bar ending at 11:05:00? Is the bar interval [start, end) or (start, end]?

A bar starts at the defined starting time (i.e. 11:05:00 is the start time of the bar). A bar ends when a new bar starts at the next starting time increment. So a 5 minute bar that starts at 11:05:00 would contain all trades having times between and including 11:05:00 and 11:09:59.999999. A time of 11:10:00 would start a new bar.


Beyond the .scid file, does Sierra Chart pull intraday OHLC data from any other source files (e.g., .depth, .dly) that I would need to incorporate to reproduce SC's bars exactly?

No.


Is there a documented reference for the bar-construction algorithm that I could consult to ensure my Python reader produces matching results?

No.
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: 2026-05-13 20:59:14

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

Login

Login Page - Create Account