OPEN-SOURCE SCRIPT

Fixed High Timeframe Moving Averages

124
Fixed High Timeframe Moving Averages (W/D/4H)

Summary
This indicator plots essential, high-timeframe (HTF) Moving Averages onto your chart, **no matter which timeframe you are currently viewing**.

It is designed for traders who need multi-timeframe context at a glance. Stop switching charts to see where the 200-Week or 50-Day MA is—now you can see all critical HTF levels directly on your 5-minute (or any other) chart.

---

Who it’s for
Traders who rely on moving averages but like to work on lower chart timeframes while keeping higher timeframe context in sight. If you scalp on 1–15m yet want Weekly/Daily/4H MAs always visible, this is for you.

---

What it shows
Pinned (“fixed”) moving averages from higher timeframes—Weekly (20/100/200), Daily (50/100/200/365) and 4H (200)—rendered on any chart timeframe. Your favorite HTF MAs stay on screen no matter what TF you’re currently analyzing.

---

Features
* **MA types:** SMA, EMA, VWMA, Hull.
* **Fully configurable:** toggle each line, set periods, colors, and thickness.
* **Two alert modes (see below):** intrabar vs confirmed HTF close.
* **Works on any symbol & chart TF** using `request.security` to fetch HTF data.

---

Alerts & Modes
This indicator solves the biggest problem with MTF alerts: false signals. You can choose one of two modes:

1. **Intrabar mode** — compares current chart price to the HTF MA. Triggers as soon as price crosses the HTF line; great for early signals but may update until the HTF bar closes.
2. **Confirmed mode** — checks HTF close vs HTF MA. Signals only on the higher-TF bar close; fewer false starts, no intrabar repainting on that TF.

Per-line *Cross Above / Cross Below* conditions are provided for all enabled MAs (e.g., “20W — Cross Above”, “365D — Cross Below”, etc.).

**How to use alerts:** add the script → “Create Alert” → pick any condition from the script’s list.

---

Why this helps
* Keeps Weekly/Daily structure visible while you execute on LTF.
* Classic anchors (e.g., 200D, 20W/100W/200W) are popular for trend bias, dynamic support/resistance, and pullback context.
* Lets you standardize MA references across all your lower-TF playbooks.

---

Notes on confirmation & repainting
* Intrabar signals can change until the higher-TF bar closes (that’s expected with multi-TF data).
* Confirmed mode waits for the HTF close—cleaner, but later. Choose what fits your workflow.

---

Quick setup
1. Pick `MA Type` (SMA/EMA/VWMA/Hull).
2. Enable the HTF lines you want (Weekly 20/100/200; Daily 50/100/200/365; 4H 200).
3. Choose `Alert Mode` (Intrabar vs Confirmed).
4. Style colors/widths to taste and set alerts on the lines you care about.

---

Good practice
* Combine HTF MAs with price action (swings, structure, liquidity grabs) rather than using them in isolation.
* Always validate signals in your execution TF and use a risk plan tailored to volatility.
* Protect your capital: position sizing, stops, and disciplined risk management matter more than any single line on the chart.

---

Disclaimer
For educational/informational purposes only; not financial advice. Trading involves risk—manage it responsibly.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.