OPEN-SOURCE SCRIPT
Dynamic Sigmoid ATR-Normalized EMA Distance Oscillator

Dynamic Sigmoid ATR-Normalized EMA Distance Oscillator
Overview
This indicator is built to evaluate trend strength and trend sustainability, not to prioritize mean-reversion calls.
It measures directional pressure relative to a long-term EMA, scales that pressure by current volatility, and maps the result into a stable 0-100 oscillator using a sigmoid transform.
The key advantage is dynamic adaptation: center and regime bands are not static references only, they adjust to evolving oscillator behavior.
This helps separate healthy trend continuation from weak, noisy movement.
Mathematical Construction (No Code Description)
1) Trend baseline:
A long-horizon exponential moving average defines structural direction.
2) Signed distance:
Distance = Price - EMA
Positive values imply price is structurally above baseline; negative values imply below-baseline pressure.
3) Volatility normalization:
Normalized Distance = Distance / ATR
This makes the signal scale-aware across different volatility environments.
4) Nonlinear compression:
Sigmoid(x) = 1 / (1 + e^(-k*x))
The multiplier k controls response sharpness.
The output is then scaled to 0-100.
5) Dynamic center:
Center = EMA of oscillator values (adaptive midpoint).
Optional fixed midpoint mode is available for a classic 50-line reference.
6) Dynamic regime bands:
Upper Band = Center + (StdDev of oscillator * multiplier)
Lower Band = Center - (StdDev of oscillator * multiplier)
These bands expand/contract with oscillator volatility, making the framework regime-aware.
How to Read It (Trend-Focused)
- Oscillator above dynamic center: bullish pressure dominates current regime.
- Oscillator below dynamic center: bearish pressure dominates current regime.
- Persistent distance from center: trend continuation probability is generally stronger.
- Oscillator flattening back toward center: trend sustainability may be weakening.
Long and Short Signal Framework
Long setup concept:
1) Oscillator crosses above dynamic center.
2) Oscillator remains above center for multiple bars (persistence confirmation).
3) Pullbacks that hold above center and re-expand upward can be treated as continuation entries.
Short setup concept:
1) Oscillator crosses below dynamic center.
2) Oscillator remains below center for multiple bars.
3) Bounces that fail near center and rotate down can be treated as continuation entries.
Strength confirmation:
- Rising histogram above zero supports long continuation quality.
- Falling histogram below zero supports short continuation quality.
Example Use Cases (Educational)
Example A - Long trend continuation:
- Market transitions from neutral to bullish as oscillator crosses and holds above center.
- Dynamic upper band begins rising, indicating expanding bullish regime capacity.
- Dips in oscillator that stay above center suggest trend remains structurally intact.
Example B - Short trend continuation:
- Oscillator breaks below center and stays suppressed under it.
- Lower band trends down while histogram remains negative.
- Failed recoveries toward center often mark lower-risk continuation timing.
Example C - Potential trend fatigue:
- Price makes a new directional push, but oscillator fails to sustain distance from center.
- Histogram contracts progressively.
- This can indicate weakening impulse and the need for tighter risk control.
Why Dynamic Components Matter
- A fixed 50-level alone can be too rigid when regime characteristics shift.
- Dynamic center adapts to the oscillator's local equilibrium.
- Dynamic bands adapt to oscillator variance, helping contextualize what is truly "extended" in current conditions.
Inputs (Configurable Parameters)
- EMA Length: structural trend anchor sensitivity.
- ATR Length: volatility normalization depth.
- Sigmoid Multiplier: nonlinear response intensity.
- Use Dynamic Center: adaptive center or fixed 50 reference.
- Center Length: smoothness of adaptive center behavior.
- Band Length: lookback horizon for oscillator variance.
- Band Stdev Multiplier: adaptive band width.
- Visual toggles: gradient and table display options.
Risk and Implementation Notes
- This is an analytical framework, not a guaranteed signal engine.
- Choppy markets can still produce false transitions.
- Parameter calibration should be done per symbol and timeframe with independent testing.
- Position sizing, stop logic, and risk limits remain essential.
Publishing and Compliance Notes
- Educational and analytical content only; not financial advice.
- No guaranteed returns, no performance promises, no misleading language.
- Real-world outcomes vary by market conditions, execution, and risk management.
Overview
This indicator is built to evaluate trend strength and trend sustainability, not to prioritize mean-reversion calls.
It measures directional pressure relative to a long-term EMA, scales that pressure by current volatility, and maps the result into a stable 0-100 oscillator using a sigmoid transform.
The key advantage is dynamic adaptation: center and regime bands are not static references only, they adjust to evolving oscillator behavior.
This helps separate healthy trend continuation from weak, noisy movement.
Mathematical Construction (No Code Description)
1) Trend baseline:
A long-horizon exponential moving average defines structural direction.
2) Signed distance:
Distance = Price - EMA
Positive values imply price is structurally above baseline; negative values imply below-baseline pressure.
3) Volatility normalization:
Normalized Distance = Distance / ATR
This makes the signal scale-aware across different volatility environments.
4) Nonlinear compression:
Sigmoid(x) = 1 / (1 + e^(-k*x))
The multiplier k controls response sharpness.
The output is then scaled to 0-100.
5) Dynamic center:
Center = EMA of oscillator values (adaptive midpoint).
Optional fixed midpoint mode is available for a classic 50-line reference.
6) Dynamic regime bands:
Upper Band = Center + (StdDev of oscillator * multiplier)
Lower Band = Center - (StdDev of oscillator * multiplier)
These bands expand/contract with oscillator volatility, making the framework regime-aware.
How to Read It (Trend-Focused)
- Oscillator above dynamic center: bullish pressure dominates current regime.
- Oscillator below dynamic center: bearish pressure dominates current regime.
- Persistent distance from center: trend continuation probability is generally stronger.
- Oscillator flattening back toward center: trend sustainability may be weakening.
Long and Short Signal Framework
Long setup concept:
1) Oscillator crosses above dynamic center.
2) Oscillator remains above center for multiple bars (persistence confirmation).
3) Pullbacks that hold above center and re-expand upward can be treated as continuation entries.
Short setup concept:
1) Oscillator crosses below dynamic center.
2) Oscillator remains below center for multiple bars.
3) Bounces that fail near center and rotate down can be treated as continuation entries.
Strength confirmation:
- Rising histogram above zero supports long continuation quality.
- Falling histogram below zero supports short continuation quality.
Example Use Cases (Educational)
Example A - Long trend continuation:
- Market transitions from neutral to bullish as oscillator crosses and holds above center.
- Dynamic upper band begins rising, indicating expanding bullish regime capacity.
- Dips in oscillator that stay above center suggest trend remains structurally intact.
Example B - Short trend continuation:
- Oscillator breaks below center and stays suppressed under it.
- Lower band trends down while histogram remains negative.
- Failed recoveries toward center often mark lower-risk continuation timing.
Example C - Potential trend fatigue:
- Price makes a new directional push, but oscillator fails to sustain distance from center.
- Histogram contracts progressively.
- This can indicate weakening impulse and the need for tighter risk control.
Why Dynamic Components Matter
- A fixed 50-level alone can be too rigid when regime characteristics shift.
- Dynamic center adapts to the oscillator's local equilibrium.
- Dynamic bands adapt to oscillator variance, helping contextualize what is truly "extended" in current conditions.
Inputs (Configurable Parameters)
- EMA Length: structural trend anchor sensitivity.
- ATR Length: volatility normalization depth.
- Sigmoid Multiplier: nonlinear response intensity.
- Use Dynamic Center: adaptive center or fixed 50 reference.
- Center Length: smoothness of adaptive center behavior.
- Band Length: lookback horizon for oscillator variance.
- Band Stdev Multiplier: adaptive band width.
- Visual toggles: gradient and table display options.
Risk and Implementation Notes
- This is an analytical framework, not a guaranteed signal engine.
- Choppy markets can still produce false transitions.
- Parameter calibration should be done per symbol and timeframe with independent testing.
- Position sizing, stop logic, and risk limits remain essential.
Publishing and Compliance Notes
- Educational and analytical content only; not financial advice.
- No guaranteed returns, no performance promises, no misleading language.
- Real-world outcomes vary by market conditions, execution, and risk management.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
For help and support, feel free to contact:
wa.me/905469061306
wa.me/905469061306
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
For help and support, feel free to contact:
wa.me/905469061306
wa.me/905469061306
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.