PROTECTED SOURCE SCRIPT
已更新 EMA – Long & Short (% filter, grey skips, alert with %)

**Adaptive EMA Crossover — Fast / Slow with Distance Filter**
> A clean, no-nonsense trend-flip tool that refines the classic fast/slow-EMA crossover.
> Get **one decisive alert per meaningful move** while skipping the whipsaw noise that clutters tight ranges.
---
### 🔑 What it does
1. **Plots a user-defined *Fast EMA* (blue) and *Slow EMA* (red)** — choose any periods that suit your market and timeframe.
2. **Detects every crossover on the candle close.**
* **Fast EMA > Slow EMA → Long candidate**
* **Fast EMA < Slow EMA → Short candidate**
3. **Distance filter** — a new signal fires only when price has moved *X %* (absolute) away from the **previous same-side trigger**.
* Green ▲ / Red ▼ = valid entry (filter passed)
* Grey ▲ / Grey ▼ = filtered out (too close to last signal)
4. **Signed-% label** on each valid triangle shows how far price is from the last trigger of that side (negative for shorts occurring lower).
5. **Webhook-ready alerts**
* Separate `LONG trigger` and `SHORT trigger` conditions
* Alert text auto-injects the live price and signed % distance.
---
### ⚙️ Inputs
| Input | Default | Purpose |
| ------------------------------------------------ | --------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| **Fast EMA length** | 8 | Period of the fast EMA (edit to taste) |
| **Slow EMA length** | 55 | Period of the slow EMA (edit to taste) |
| **Min ABS % change from last same-side trigger** | **0.5 %** | `0 %` → alert on **every** crossover`0.5 %` → wait for at least ±0.5 % move before a new alert on the same side |
*(All calculations use closing price.)*
---
### 🖥️ How to use
1. **Add to chart**, set your preferred EMA lengths and % filter.
2. Create two TradingView alerts:
* Condition → `LONG trigger`
* Condition → `SHORT trigger`
* Keep the preset message so the % value auto-fills.
3. Combine with your own exit logic (e.g., reverse crossover, ATR trail, manual structure).
---
### 📝 Notes & Tips
* The filter is **absolute** — a -0.6 % drop qualifies just like a +0.6 % rise.
* First long and first short after adding the script always fire (no prior reference).
* Hide markers or labels in *Style* if you only need alerts.
* Works on **any market**: crypto, forex, equities, futures, indices.
---
Always back-test and manage risk before trading live.
> A clean, no-nonsense trend-flip tool that refines the classic fast/slow-EMA crossover.
> Get **one decisive alert per meaningful move** while skipping the whipsaw noise that clutters tight ranges.
---
### 🔑 What it does
1. **Plots a user-defined *Fast EMA* (blue) and *Slow EMA* (red)** — choose any periods that suit your market and timeframe.
2. **Detects every crossover on the candle close.**
* **Fast EMA > Slow EMA → Long candidate**
* **Fast EMA < Slow EMA → Short candidate**
3. **Distance filter** — a new signal fires only when price has moved *X %* (absolute) away from the **previous same-side trigger**.
* Green ▲ / Red ▼ = valid entry (filter passed)
* Grey ▲ / Grey ▼ = filtered out (too close to last signal)
4. **Signed-% label** on each valid triangle shows how far price is from the last trigger of that side (negative for shorts occurring lower).
5. **Webhook-ready alerts**
* Separate `LONG trigger` and `SHORT trigger` conditions
* Alert text auto-injects the live price and signed % distance.
---
### ⚙️ Inputs
| Input | Default | Purpose |
| ------------------------------------------------ | --------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| **Fast EMA length** | 8 | Period of the fast EMA (edit to taste) |
| **Slow EMA length** | 55 | Period of the slow EMA (edit to taste) |
| **Min ABS % change from last same-side trigger** | **0.5 %** | `0 %` → alert on **every** crossover`0.5 %` → wait for at least ±0.5 % move before a new alert on the same side |
*(All calculations use closing price.)*
---
### 🖥️ How to use
1. **Add to chart**, set your preferred EMA lengths and % filter.
2. Create two TradingView alerts:
* Condition → `LONG trigger`
* Condition → `SHORT trigger`
* Keep the preset message so the % value auto-fills.
3. Combine with your own exit logic (e.g., reverse crossover, ATR trail, manual structure).
---
### 📝 Notes & Tips
* The filter is **absolute** — a -0.6 % drop qualifies just like a +0.6 % rise.
* First long and first short after adding the script always fire (no prior reference).
* Hide markers or labels in *Style* if you only need alerts.
* Works on **any market**: crypto, forex, equities, futures, indices.
---
Always back-test and manage risk before trading live.
發行說明
Updated to and a longer time frame bias.受保護腳本
此腳本以閉源形式發佈。 不過,您可以自由且不受任何限制地使用它 — 在此處了解更多資訊。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
受保護腳本
此腳本以閉源形式發佈。 不過,您可以自由且不受任何限制地使用它 — 在此處了解更多資訊。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。