Moving Average MTF**Moving Average MTF (Multi-Timeframe)**
This indicator plots three fully customizable moving averages, each calculated from an independent timeframe of your choice. Instead of being limited to the timeframe of your chart, each MA pulls data directly from its assigned timeframe — giving you a layered view of trend across multiple time horizons simultaneously.
By default the three MAs are set to 15 minutes, 1 hour, and 4 hours, all using a 50-period SMA. This makes the indicator best suited for use on a 5-minute chart, where all three timeframes sit above your chart and give you a clear short, medium, and macro trend stack in a single view.
---
**Settings**
Each of the three MAs has its own independent group of controls:
- **Show MA** — Toggles the MA line on or off without removing it from the settings.
- **Show Label** — Toggles the end-of-line label that appears to the right of the last candle. The label displays the MA type, length, timeframe, and current value.
- **Length** — The number of candles used to calculate the MA, based on its assigned timeframe. Default is 50 for all three.
- **Timeframe** — The timeframe the MA is calculated from, regardless of what timeframe your chart is on. You can type any valid timeframe directly into this field.
- **Type** — The moving average algorithm. Choose from SMA, EMA, WMA, VWMA, RMA, or HMA.
- **Line Style** — Choose between Solid, Stepline, or Circles.
- **Line Thickness** — Controls the width of the line from 1 to 10.
- **Color** — Full color picker to set each MA to any color you prefer.
---
**How to Use**
Keep your chart timeframe at or below the lowest MA timeframe you have set. With the defaults of 15min, 1h, and 4h, running the indicator on a 5-minute chart gives you the most meaningful read. When all three MAs are stacked and sloping in the same direction, trend is aligned across all three timeframes — the highest conviction environment for a trade. When they are tangled or conflicting, the market is in an indecisive state and it is generally best to wait for clarity.
---
**Important Note**
If your chart timeframe is higher than any of the MA timeframes you have set, that MA will still display but the value will not be meaningful. The indicator will not produce errors — it is purely a logical consideration. Always ensure your chart timeframe sits below your lowest MA timeframe for accurate results.
Indicador Pine Script®






















