# Master Reversion Pro (MR Pro) — User Guide

A TradingView (Pine Script v5) **mean-reversion** indicator. It waits for price to
stretch far away from its moving average, then trades the snap-back — with a
stop-loss and two targets drawn for every signal.

> **Tool file:** `master-reversion-pro.pine` · **Platform:** TradingView · **Cost:** Free

---

## 🇰🇭 ការណែនាំរហ័ស (Khmer quick start)

1. បើក TradingView → ចុច **Pine Editor** ខាងក្រោមក្រាហ្វ។
2. លុបកូដគំរូ → **paste** កូដ `.pine` ទាំងអស់ → ចុច **Save**។
3. ចុច **Add to chart** → តំបន់ពណ៌ និងស្លាក **BUY / SELL** នឹងបង្ហាញ។
4. **តំបន់ពណ៌មិនមែនជាចំណុចចូល** — ត្រូវរង់ចាំស្លាក BUY/SELL សិន។
5. ចូល **BUY** ពេលតម្លៃត្រឡប់ឡើងលើបន្ទាត់ស (mean) · ចូល **SELL** ពេលធ្លាក់ក្រោមវិញ។
6. ដាក់ **SL** តាមបន្ទាត់ក្រហម និងចេញនៅ **TP1** (បៃតង) · ទុកខ្លះដល់ **TP2**។
7. កុំប្រថុយលើសពី **1–2%** នៃទុនក្នុងមួយ trade។

---

## 1. What it does

- A **Z-Score** measures how far price has stretched from the mean (a 75-period MA)
  in standard deviations. Past ±1, price is officially "stretched".
- A colored **zone** opens on the stretched side and trails with price:
  **red above** price = stretched up (sell setup), **green below** price = stretched
  down (buy setup).
- Each zone prints a **Confidence %** — how extreme the stretch was relative to your
  Sensitivity setting. Zones below **Min Confidence %** are skipped.
- An optional **volume filter** rejects zones that form on thin volume.
- The signal fires **only on the snap-back**: **▲ BUY** when price closes back *above*
  the mean, **▼ SELL** when it closes back *below*.
- Every signal draws **Entry**, **SL** (red dashed), **TP1** and **TP2** (green dashed)
  from ATR, plus a panel with live stats.

## 2. Install on TradingView (30 seconds)

1. Open any chart on [tradingview.com](https://www.tradingview.com).
2. Click **Pine Editor** at the bottom of the screen.
3. Delete the sample code, then **paste the whole `master-reversion-pro.pine` file**.
4. Click **Save** (name it anything) → **Add to chart**.
5. To get notified, right-click the chart → **Add alert** → Condition:
   **Master Reversion Pro** → choose *BUY signal*, *SELL signal*, or a zone alert.

## 3. How to read it

| You see | It means |
|---|---|
| White line | The mean (MA 75) — everything is measured from it |
| Red zone above price | Price stretched **up**. A sell is being set up — **do not sell yet** |
| Green zone below price | Price stretched **down**. A buy is being set up — **do not buy yet** |
| **%** label at the zone start | Confidence — how extreme the stretch was |
| **▲ BUY** label | Price closed back above the mean → long entry |
| **▼ SELL** label | Price closed back below the mean → short entry |
| Panel: "⚪ Waiting" | No stretch worth trading — stay out |
| Panel: "✗ Weak" volume | The volume filter is blocking new zones right now |

**The zone is the warning, the label is the trade.** A stretched market can stretch
further; the whole point of waiting for the mean cross is to let the snap-back prove
itself first.

## 4. Trading rules (keep it simple)

**Long (BUY)**
1. A green zone is open below price (price stretched down).
2. Wait for the **▲ BUY** label — price has closed back above the white mean line.
3. Enter at the close of the signal bar (or the open of the next).
4. Stop-loss = the **red dashed** line. Take profit at **TP1**; leave a runner to **TP2**.

**Short (SELL)** — the mirror image of the above.

**Exit early if:** price closes back beyond the mean against you before TP1 — the
reversion thesis is dead.

## 5. Best settings by style

| Style | Timeframe | MA Length | Sensitivity | SL / TP1 (ATR ×) |
|---|---|---|---|---|
| Fast intraday | M5 – M15 | 50 | 30 | 1.2 / 1.2 |
| Intraday (recommended) | M15 – H1 | 75 | 22 | 1.5 / 1.5 |
| Swing | H4 – D1 | 100 | 15 | 2.0 / 3.0 |

- **Sensitivity** higher = lower threshold = more signals, lower quality.
  Raise **Min Confidence %** to filter them back out.
- **TP2** defaults to 3.0× ATR — a runner, not a target you should wait for on every trade.
- Good markets: ranging majors (EURUSD, USDJPY), XAUUSD, and indices.
  Mean reversion struggles in a strong one-way trend.

## 6. Risk management (the part that keeps you funded)

- Risk a **fixed 1–2%** per trade. Size the position from the SL distance, not a fixed lot.
- In a strong trend, take **only** the signals pointing with the higher-timeframe direction.
  Counter-trend reversion is where this style loses money.
- Move the stop to break-even once **TP1** is reached.
- Two clean, high-confidence setups beat ten forced ones.

## 7. FAQ

**No signals appearing?** Price hasn't stretched far enough, confidence is under your
minimum, or the volume filter is blocking the zone. Check the panel — it tells you which.

**A zone appeared but nothing happened.** That's by design. The zone closes without a
signal if price never crosses back through the mean.

**Are the panel's stats a backtest?** No. They count signals since the indicator loaded
on that chart, scoring a trade as a win when TP1 is hit before SL. Real fills, spread
and slippage will differ.

**Signals look late?** They confirm on the bar **close** on purpose (no repainting).
Wait for the candle to close.

**Can I use it to auto-trade?** It's an indicator, not a bot. Use the alerts to trade
manually or to feed a webhook.

---

*Educational tool only. Trading FX/CFDs on margin is high-risk and may not suit every investor. Test on a demo account first.*
