OPEN-SOURCE SCRIPT

DEMA Trend Oscillator Strategy

723
📌 Overview
The DEMA Trend Oscillator Strategy is a dynamic trend-following approach based on the Normalized DEMA Oscillator SD.
It adapts in real-time to market volatility with the goal of improving entry accuracy and optimizing risk management.

⚠️ This strategy is provided for educational and research purposes only.
Past performance does not guarantee future results.

🎯 Strategy Objectives
The main goal of this strategy is to respond quickly to sudden price movements and trend reversals,
by combining momentum-based signals with volatility filters.
It is designed to be user-friendly for traders of all experience levels.

✨ Key Features
  • Normalized DEMA Oscillator: A momentum indicator that normalizes DEMA values on a 0–100 scale, allowing intuitive identification of trend strength
  • Two-Bar Confirmation Filter: Requires two consecutive bullish or bearish candles to reduce noise and enhance entry reliability
  • ATR x2 Trailing Stop: In addition to fixed stop-loss levels, a trailing stop based on 2× ATR is used to maximize profits during strong trends


📊 Trading Rules
Long Entry:
  • Normalized DEMA > 55 (strong upward momentum)
  • Candle low is above the upper SD band
  • Two consecutive bullish candles appear


Short Entry:
  • Normalized DEMA < 45 (downward momentum)
  • Candle high is below the lower SD band
  • Two consecutive bearish candles appear


Exit Conditions:
  • Take-profit at a risk-reward ratio of 1.5
  • Stop-loss triggered if price breaks below (long) or above (short) the SD band
  • Trailing stop activated based on 2× ATR to secure and extend profits


💰 Risk Management Parameters
  • Symbol & Timeframe: Any (AUDUSD 5M example)
  • Account size (virtual): $3000
  • Commission: 0.4PIPS(0.0004)
  • Slippage: 2 pips
  • Risk per trade: 5%
  • Number of trades (backtest):534

All parameters can be adjusted based on broker specifications and individual trading profiles.

⚙️ Trading Parameters & Considerations
Indicator: Normalized DEMA Oscillator SD
Parameter settings:
  • DEMA Period (len_dema): 40
  • Base Length: 20
  • Long Threshold: 55
  • Short Threshold: 45
  • Risk-Reward Ratio: 1.5
  • ATR Multiplier for Trailing Stop: 2.0


🖼 Visual Support
The chart displays the following visual elements:
  • Upper and lower SD bands (±2 standard deviations)
  • Entry signals shown as directional arrows



🔧 Strategy Improvements & Uniqueness
This strategy is inspired by “Normalized DEMA Oscillator SD” by QuantEdgeB,
but introduces enhancements such as a two-bar confirmation filter and an ATR-based trailing stop.
Compared to conventional trend-following strategies, it offers superior noise filtering and profit optimization.

✅ Summary
The DEMA Trend Oscillator Strategy is a responsive and practical trend-following method
that combines momentum detection with adaptive risk management.
Its visual clarity and logical structure make it a powerful and repeatable tool
for traders seeking consistent performance in trending markets.

⚠️ Always apply appropriate risk management. This strategy is based on historical data and does not guarantee future results.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.