Band Very Slow Moving Average (supfabio)

At its core, the script plots a **Very Slow Moving Average (SMA)** and two **percentage bands** (Upper/Lower) that expand/contract based on your chosen offset. The MA and bands **share the same trend color**, so you can instantly see whether the baseline is rising or falling without needing extra indicators.
### What you get on the chart
* **Very Slow MA (SMA)** as the main baseline (right scale).
* **Upper/Lower Bands** at a configurable % distance from the MA.
* Optional **band fill** and **trend background** for faster visual scanning.
* Optional **BUY / SELL labels** when price closes outside the bands (mean-reversion / exhaustion style context).
* Optional **CLOSE reference markers + horizontal target lines** to help you visualize potential “return-to-mean” or reaction levels.
### How the signals work (high level)
This indicator is **not a strategy** and does not “predict” the market. Instead, it highlights **conditions**:
* **BUY label**: when price closes **below the lower band** (potential downside extension).
* **SELL label**: when price closes **above the upper band** (potential upside extension).
* An optional **“Only first candle beyond band (cross)”** mode helps reduce repeated labels by triggering only on the first decisive move beyond the band.
* A **cooldown** option can further reduce repeated same-direction signals.
### CLOSE reference lines (visual guidance, not a promise)
When enabled, the script can draw **horizontal dotted reference lines** derived from the MA’s turning structure (using confirmed swing logic) and manage them to keep the chart readable. As price action evolves, these lines may:
* Extend with time while the “case” is active (dotted),
* Flip to **solid** when a valid touch/confirmation occurs (based on your settings),
* And optionally print a small **CLOSE marker** on the level.
To prevent clutter near the current price, the indicator includes a **“Merge dotted lines within ticks (near price)”** setting that consolidates nearby dotted levels into a cleaner view.
### Inputs you’ll care about
* **MA Length**: controls how “slow” the baseline is.
* **Band offset (%)**: sets the distance of the upper/lower band from the MA.
* **Signals**: toggle labels, cross-only behavior, and cooldown.
* **Close module**: toggle close markers/lines and adjust confirmation behavior.
* **Merge dotted lines (ticks)**: keeps the chart readable when multiple levels form close together.
### Alerts
The script supports alerts for:
* **BUY / SELL**
* **BUY_CLOSE / SELL_CLOSE**
These are meant to help with notifications and workflow automation. Always validate signals in your own process before acting.
### Notes & limitations
* Designed for **standard OHLC candles/bars**. Results may be misleading on non-standard chart types.
* Any swing/turn-based logic can appear **after confirmation**, which means some elements naturally print with a delay.
* This tool is best used as **context** alongside your own confirmation rules (structure, trend, volume, risk management).
**Disclaimer:** This indicator is for educational and informational purposes only and does not constitute financial advice. Trading involves risk; always test settings and use proper risk management.
สคริปต์แบบเฉพาะผู้ได้รับเชิญเท่านั้น
เฉพาะผู้ใช้งานที่ผู้เขียนอนุมัตเท่านั้นจึงจะสามารถเข้าถึงสคริปต์นี้ได้ คุณจะต้องขอและได้รับอนุญาตก่อนใช้งาน ซึ่งโดยทั่วไปจะได้รับอนุญาตหลังจากชำระเงินแล้ว สำหรับรายละเอียดเพิ่มเติม โปรดทำตามคำแนะนำของผู้เขียนด้านล่าง หรือติดต่อ supfabio โดยตรง
TradingView ไม่แนะนำให้จ่ายเงินหรือใช้สคริปต์ เว้นแต่คุณจะเชื่อถือผู้เขียนและเข้าใจวิธีการทำงานของสคริปต์นั้นอย่างถ่องแท้ คุณยังสามารถหาทางเลือกแบบโอเพนซอร์สฟรีได้ใน สคริปต์ชุมชนของเรา
คำแนะนำของผู้เขียน
คำจำกัดสิทธิ์ความรับผิดชอบ
สคริปต์แบบเฉพาะผู้ได้รับเชิญเท่านั้น
เฉพาะผู้ใช้งานที่ผู้เขียนอนุมัตเท่านั้นจึงจะสามารถเข้าถึงสคริปต์นี้ได้ คุณจะต้องขอและได้รับอนุญาตก่อนใช้งาน ซึ่งโดยทั่วไปจะได้รับอนุญาตหลังจากชำระเงินแล้ว สำหรับรายละเอียดเพิ่มเติม โปรดทำตามคำแนะนำของผู้เขียนด้านล่าง หรือติดต่อ supfabio โดยตรง
TradingView ไม่แนะนำให้จ่ายเงินหรือใช้สคริปต์ เว้นแต่คุณจะเชื่อถือผู้เขียนและเข้าใจวิธีการทำงานของสคริปต์นั้นอย่างถ่องแท้ คุณยังสามารถหาทางเลือกแบบโอเพนซอร์สฟรีได้ใน สคริปต์ชุมชนของเรา