From ticks to one OHLC candle
Take every tick for an instrument that falls inside a period, for example 14:05:00 to 14:05:59 UTC. The candle for that minute is defined by four values.
- Open: the price of the first tick in the period.
- High: the highest price of any tick in the period.
- Low: the lowest price of any tick in the period.
- Close: the price of the last tick in the period.
The candle is identified by the start of its period, its open time. A candle with open time 14:05 covers ticks from 14:05:00 up to, but not including, 14:06:00. This convention matters when you merge data from several sources: if one source labels candles by the start and another by the end, the whole chart is shifted by one period.
Which price feeds the candle also matters. For instruments represented by the last price, such as crypto, indices, commodities and bonds, there is only one price per tick. For instruments with two-sided quotes the candle has to be built from one chosen series. Candles in the FinaQuotes feed are built by one consistent rule; check the documentation for the price series used. The bid, ask and spread guide explains why this choice must match on your side too.
The 1-minute base and higher timeframes
Computing every timeframe directly from raw ticks is wasteful and risks small differences between timeframes. The usual approach, and the one used in the FinaQuotes feed, is to build one-minute candles from ticks and aggregate everything else from them.
Aggregation follows the same logic as building a candle from ticks. A 5-minute candle takes the open of its first 1-minute candle, the highest high and the lowest low among its 1-minute candles, and the close of its last 1-minute candle. A 1-hour candle does the same over sixty minutes, and so on up to the month.
The feed provides 9 timeframes: 1m, 5m, 15m, 30m, 1H, 4H, 1D, 1W and 1MN. Because all of them come from the same base, a 1-hour candle always agrees with the sixty 1-minute candles inside it.
Why boundaries are in UTC
Every candle boundary in the feed is aligned to UTC: hours start at :00 UTC, 4-hour candles start at 00:00, 04:00, 08:00 and so on, daily candles start at 00:00 UTC, and monthly candles on the first day of the month. Weekly boundaries follow the same principle; the exact convention is in the documentation.
Local time looks friendlier, but it breaks candles in several ways. Daylight saving time creates days of 23 and 25 hours and an hour that happens twice. Clients in different countries would each see a different daily candle for the same instrument. And a broker serving clients in many time zones would have to store one history per zone.
UTC has none of these problems. Store and exchange everything in UTC, and convert to the user time zone only at the moment of display. If you need a daily candle aligned to a local trading day, aggregate it on your side from the hourly or minute candles, and document the rule you used.
Sessions: stocks, forex and crypto
Markets do not all trade around the clock, and candles follow the market, not the calendar.
- Stocks: candles are built only during the trading hours of the exchange where the stock is listed. The schedule is daylight saving aware. A US regular session that opens at 09:30 New York time starts at 13:30 UTC in summer and 14:30 UTC in winter, and the candles move with it.
- Forex: trading runs 24 hours a day, five days a week. Candles are continuous through the week and stop over the weekend, so a chart shows a gap between the Friday close and the Sunday open.
- Crypto: trading runs 24/7, so crypto candles are continuous, including weekends and holidays.
- Metals, indices, commodities and bonds follow the hours of their own markets.
The per-class pages, such as stocks, forex and crypto, describe the coverage for each market.
Minutes without ticks
What should happen to a minute in which no price arrived? There are two common approaches. The first is no tick, no candle: the minute simply does not exist in the history. The second is forward fill: the provider creates a flat candle where open, high, low and close all equal the previous close.
A feed built on real ticks typically does not create a candle for a minute without ticks, and that is the approach to expect from FinaQuotes; check the documentation for the authoritative rule. The reason is honesty: a flat candle suggests that the market was checked and found unchanged, when in fact nothing was observed.
If your chart library needs a continuous series, fill gaps on the display side and keep the stored data as it came. That way you can always tell a real quiet minute from a missing one.
History depth by timeframe
Candle history is served over REST. Depth depends on the timeframe: years of daily history, months of intraday. The figures below are approximate and can differ between instruments, for example for a symbol added to the feed recently.
| Timeframe | Typical depth | Typical use |
|---|---|---|
| 1m | Up to 180 days | Intraday detail, recent replay |
| 5m, 15m, 30m | About 60 days | Intraday charts over weeks |
| 1H, 4H | About 2 years | Swing charts, recent analytics |
| 1D, 1W, 1MN | Several years | Long-term charts and backtests |
More detail is on the historical data page.
Corrections and late updates
Candles are not always final the moment their period ends. Two situations are worth designing for.
Late updates to the last candle. The forming candle changes with every tick until its period closes, and a tick stamped just before a boundary can arrive a moment after it. Treat candles as records keyed by instrument, timeframe and open time, and upsert them: if a candle with the same key arrives again, replace it instead of appending a second one. Apply a tick to the candle its timestamp belongs to, which may be the previous one.
Corrections after a source failure. Each asset class in the feed is served by several independent sources with automatic fallback. If a source fails or sends bad values, a backup takes over, and data for the affected period may be corrected afterwards, including stored candles. A client that caches history should be able to reload a recent range and overwrite what it has. Instrument silence is monitored, but a gap can remain in history if no source delivered prices for that period. The market data policy describes this in full.
Frequently asked questions
Why are daily candles in UTC and not in my local time?
Because UTC has no daylight saving changes and is the same for every client. Local daily candles would differ by country and break twice a year. Convert to local time only for display, or build your own local daily candles from hourly or minute data.
Why does a stock chart have gaps at night and at weekends?
Stock candles are built only during the trading hours of the listing exchange, so there are no candles while the exchange is closed. Forex has a weekend gap, while crypto trades 24/7 and has none.
Can the last candle change after I have drawn it?
Yes. The forming candle changes with each tick, and recent candles may be corrected after a source failure. Store candles keyed by instrument, timeframe and open time, and replace a candle when a newer version arrives.
Need the feed behind these guides?
Tell us what you are building and which asset classes you need. We reply within one business day with access details and pricing.