Multi-timeframe flows
Read an indicator from another timeframe in one flow, which blocks support it, and which export targets can carry it.
A multi-timeframe flow reads an indicator value from a different timeframe than the chart. A common use is to check the trend on a higher timeframe and take entries on the chart timeframe.
Use the Multi Timeframe block
The Multi Timeframe block is in the palette. It takes one input and gives one output. Connect its output to a Compare or Cross block, as you would an indicator block.
- Add the block and set Indicator and Timeframe in the Properties panel.
- Set the Period and, where it applies, the method, band or line.
- Connect its output to a Compare or Cross block next to values from the chart timeframe, for example the Price block.
| Property | Choices |
|---|---|
| Indicator | Moving Average, RSI, CCI, ATR, MACD, ADX, Stochastic, Williams %R, Momentum, Bollinger Bands, Parabolic SAR, Ichimoku |
| Timeframe | M5, M15, M30, H1, H4, D1, W1, MN1 (default H4) |
| Symbol | Empty means the chart symbol. A symbol name reads that symbol instead. |
| Period | 1 to 999 (default 20) |
| Method | SMA, EMA, SMMA, LWMA (Moving Average) |
| Band | Main, Upper, Lower (Bollinger Bands) |
| Line | Tenkan-sen, Kijun-sen, Senkou Span A, Senkou Span B, Chikou Span (Ichimoku) |
| Shift | 0 to 100. How many bars back on that timeframe the value is read from. 0 is the bar still forming; 1 is the last closed bar. A block you add from the palette starts at 1. A block in a saved flow, a template or a shared link that has no Shift keeps reading 0. |
| Variable name | The name of the value (default mtf_value) |
Some indicators use fixed settings on this block. MACD uses 12, 26, 9. Stochastic uses 3 and 3 with an SMA. Bollinger Bands use a deviation of 2.0. Parabolic SAR uses 0.02 and 0.2. Ichimoku uses 9, 26, 52. Moving Average, Bollinger Bands, RSI, CCI, ATR, ADX, Stochastic, Williams %R and Momentum use the Period field.
Guided mode places this block when you choose a higher-timeframe trend filter. See Guided mode. Several templates use it too, for example a 50-period moving average on H4 against a fast and a slow EMA on the chart timeframe. Open the Templates gallery to find them.
Other blocks with a timeframe
Many indicator blocks have their own Timeframe property. Its default, “Current”, means the chart timeframe. The Multi Timeframe block is the block that is made for reading another timeframe, and it is the one the export marks below describe.
Some options that use another timeframe are MT5 only and are refused with a reason on the other targets: the High-Low Range Filter on another timeframe, the New Bar Filter on a chosen timeframe, and the Time Exit counted in bars of a chosen timeframe.
Export targets
The mark for this feature is read from the Builder’s own table.
| Target | Multi Timeframe block |
|---|---|
| MT5 | Supported |
| MT4 | Supported |
| TradingView Pine | Supported with a Shift of 1 or more. A Shift of 0 is refused |
| cTrader | Not exported |
| Python | Marked as supported, but the Python exporter does not cover this block yet, so it is refused |
Details:
- cTrader. The block is refused with this reason: how the higher-timeframe bar index maps is not confirmed in the official docs.
- Python. The Python exporter only exports parts whose trades were checked against the in-house validator, and the Multi Timeframe block is not on that list. It is refused with the reason “The Python exporter does not cover this part yet”. An indicator with a timeframe other than Current is refused too.
- Pine. The other timeframe is read with
request.security. Read only confirmed bars, because an unconfirmed higher-timeframe bar can look ahead. - Forming bar. Pine and Python decide at bar close and cannot read the forming bar (shift 0). Pine can export this block with shift 1 or more. A block you add from the palette already uses 1. A block that reads 0 (from guided mode, a template or an older saved flow) is refused by Pine with the advice to use a shift of 1 or more: set Shift to 1 in the Properties panel. Python refuses the block whatever the shift, as above.
A refusal is shown with its reason before you export. See Targets that cannot export a block and Export to TradingView Pine.
Things to know
- The value on a higher timeframe can still change at shift 0. On MT5 and MT4 a shift of 0 reads the bar that is still forming on that timeframe, so the H4 value can change until the H4 bar closes. A shift of 1 reads the last closed H4 bar, which does not change.
- The backtest is approximate. The Builder backtest simulates a flow that reads another timeframe with an approximation. A MetaTrader 5 run will differ.