OPEN-SOURCE SCRIPT
jrhTrendRev4EMA

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.
# 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.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.