What is a timeframe in trading? Candles explained
By Oalgo · Last reviewed
A timeframe (also written "time frame") is the length of time one candle covers. On a 5-minute timeframe each candle shows five minutes of prices, on a 1-day timeframe one day. It is written 5m, 1h or 1d.
What does a candle show?
#- Open: the first price of the period.
- High: the highest price of the period.
- Low: the lowest price of the period.
- Close: the last price of the period. It is only known when the candle ends, which is why a rule that reads it can be caught out by lookahead bias.
How does the timeframe change a rule?
#Indicators and rules count candles, not minutes. A 14-period RSI looks back 14 candles, so how far back that reaches depends on the timeframe.
| Timeframe | Candles in one day | A 14-candle indicator looks back |
|---|---|---|
| 1m | 1,440 | 14 minutes |
| 5m | 288 | 70 minutes |
| 15m | 96 | 3.5 hours |
| 1h | 24 | 14 hours |
| 4h | 6 | 56 hours |
| 1d | 1 | 14 days |
A short timeframe gives many candles and, for many rules, many trades, and each trade pays fees and slippage. A long timeframe gives few candles, so a backtest needs a longer date range to hold enough trades.
Which timeframes can you set in Oalgo?
#In Oalgo you set the timeframe in the strategy settings of the builder, as a number and a unit: minutes, hours or days, up to one week. The quick choices are 1m, 5m, 15m, 1h, 4h and 1d. A new strategy starts at 5m.
What can a timeframe not tell you?
#A rule that looks one way on one timeframe can look different on another, because it is a different set of candles. No timeframe is right for every rule. Run the same rule on more than one and compare the reports.
Read next
- What is backtesting?Backtesting runs your rules on past prices to see how they would have behaved. Learn what it shows, what it cannot show, and how to read the report.
- What is slippage? Why a fill differs from the chart priceSlippage is the gap between the price a trade was expected to fill at and the price it got. Learn why it happens and how a backtest counts it as a cost.