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.
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน