OPEN-SOURCE SCRIPT

jrhTrendRev4EMA

109
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.

면책사항

해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.