OPEN-SOURCE SCRIPT
Güncellendi

EMA with Adaptive Straight Segments

178
This script transforms a traditional Exponential Moving Average (EMA) into a series of straight-line segments, making trend direction clearer and easier to follow. Instead of plotting every curve of the EMA, it connects key points with angled steps, giving a trend-line style look that removes noise and highlights slope.

What makes this version special is its adaptive segmentation:

Segment length automatically adjusts based on market volatility (ATR%).

In low volatility, segments stretch longer to smooth things out.

In high volatility, segments shorten to stay responsive to price swings.

Features:

Clean, step-style EMA representation.

Adjustable minimum/maximum segment lengths.

Customisable number of historical segments.

Optional display of the original EMA for comparison.

HUD label showing current ATR%, segment length, and segment count.

This tool is especially useful if, like me, you prefer structural analysis over noisy indicators. It keeps your chart tidy while still reflecting the true slope of the EMA. I find 50 and 200 are the most useful.
Sürüm Notları
Added double EMA for crosses
Sürüm Notları
✨ Update: Forward Projection Modes Added (with the Help of Janet my AI)

This update takes the original Adaptive EMA Straight Segments idea and gives you three ways to project into the future:

🔹 Finite Projection – plots a straight forecast line for a chosen number of bars (up to 500).
🔹 Infinite Projection – extends the forecast line infinitely to the right (great for trend continuation).
🔹 Ghost Projection – dotted “ghost” points showing step-by-step EMA projections up to 24 bars ahead, without repainting. Perfect for visualizing short-term continuation.

Other improvements:

Forward extension settings added in indicator inputs.

Toggle which EMA (#1 or #2) to ghost, avoiding Pine’s 64-plot limit.

Clean HUD showing ATR%, segment length, and active projection mode.

This makes the tool flexible for both visual forecasting and backward structural clarity.
Sürüm Notları
Clear example chart

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.