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).
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Untuk akses pantas pada carta, tambah skrip ini kepada kegemaran anda โ ketahui lebih lanjut di sini.
Penafian
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Untuk akses pantas pada carta, tambah skrip ini kepada kegemaran anda โ ketahui lebih lanjut di sini.