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 de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.