EMA Distance Oscillator

## 📈 **EMA Distance Oscillator**
**Author:** *Your Name or Alias*
**Category:** Trend Strength / Momentum
**Timeframes:** Optimized for 1–5min, works on all
---
### 🔍 **What It Does**
The **EMA Distance Oscillator** is a dual-purpose tool that helps visualize **momentum shifts**, **trend strength**, and **EMA divergence/convergence** in real time.
It plots two separate signals:
#### 1. 🟩 Histogram Bars
A zero-centered histogram that shows the **difference between two EMAs** (default: EMA 48 and EMA 200).
- Color-coded based on:
- Whether the EMA spread is **above or below zero**
- Whether the spread is **increasing or decreasing**
- Helps visualize **trend acceleration** or **loss of momentum**
#### 2. 📉 Delta Line
A smooth line showing the **difference between a second EMA pair** (default: EMA 13 and EMA 48).
- Color-coded:
- **White** when rising (spread widening)
- **Gray** when falling (spread tightening)
---
### ⚙️ **Customizable Inputs**
You have full control over:
- EMA lengths for **both histogram and line**
- Smoothing for each plot
- Colors for each bar state and line condition
- Momentum thresholds (±1 by default, adjustable)
---
### 🧠 **How to Use It**
- Use the **bar histogram** to quickly spot moments when short-term and long-term EMAs are diverging or converging
- Use the **delta line** to track smoother shifts in short-term momentum
- Look for:
- Expanding green bars = uptrend gaining strength
- Shrinking bars = potential reversals or cooldowns
- Line crossing zero = EMA crossover (fast vs slow)
- **Threshold lines** at +1 / -1 help mark **high-momentum zones** (fully customizable)
---
### 🧭 **Pro Tips**
- Try with EMA 13/48 for the line and EMA 48/200 for the histogram on 1–5min charts
- Add alerts (optional) for when:
- Histogram changes color (momentum flip)
- Line crosses zero
- Threshold levels are breached
---
Let me know if you want me to help prep alert conditions or auto-generate different versions (e.g., strategy version, simplified mode, mobile-friendly layout, etc).
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Để truy cập nhanh vào biểu đồ, hãy thêm tập lệnh này vào mục yêu thích của bạn — tìm hiểu thêm tại đây.
Thông báo miễn trừ trách nhiệm
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Để truy cập nhanh vào biểu đồ, hãy thêm tập lệnh này vào mục yêu thích của bạn — tìm hiểu thêm tại đây.