OPEN-SOURCE SCRIPT

jrhTrendRev4EMA

112
How it Works


# jrhTrendRev4EMA — Documentation

A trend reversal indicator built around 4 fully configurable EMAs, producing two independent signal types: a **Reversal Signal** (confirmed crossover between two chosen EMAs) and a **Trend Cross Signal** (simple crossover between two chosen EMAs). This is an updated version of the original `jrhTrendRev`, which used fixed Fast/Slow/Long EMA roles — this version replaces that with 4 general-purpose EMAs you assign to either signal type yourself.

---

## How the indicator is structured

There are two independent signal engines running side by side:

1. **Reversal Signal** — the original Fast/Slow crossover logic, with a 2-bar confirmation filter to reduce whipsaw. Default sources: EMA 1 vs EMA 2.
2. **Trend Cross Signal** — the original 20/200-style crossover logic, no confirmation filter (fires immediately on cross). Default sources: EMA 2 vs EMA 4.

Both signal engines pull their EMA values from the same pool of 4 EMAs you configure in the first input group — you choose which EMA feeds "Source A" and "Source B" for each signal independently, via dropdowns.

---

## Parameter Group: EMAs

Four identical rows, each controlling one EMA line.

| Parameter | Type | Default | What it does |
|---|---|---|---|
| Show (checkbox) | Toggle | On (all 4) | Shows/hides that EMA's plotted line on the chart. Turning it off does **not** remove it from being usable as a signal source — it just hides the visual line. |
| Length | Integer | EMA1: 10, EMA2: 20, EMA3: 50, EMA4: 200 | The EMA period. Shorter = more reactive/closer to price. Longer = smoother/slower. |
| Color | Color picker | EMA1: Blue, EMA2: Red, EMA3: Yellow, EMA4: Orange | The plotted line's color. Purely visual — has no effect on signal logic. |

**Example:** If you want a 9/21 EMA pair instead of the default 10/20, just change EMA1's Length to 9 and EMA2's Length to 21. Both signal engines automatically use the new values on their next recalculation — no need to touch the signal source dropdowns, since they reference the EMA *slot* (EMA 1, EMA 2, etc.), not the length itself.

免責事項

これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。