OPEN-SOURCE SCRIPT

HMA 200 + EMA 20 Crossover Strategy

788
This strategy combines a long-term trend filter using the Hull Moving Average (HMA 200) with a short-term entry trigger using the Exponential Moving Average (EMA 20).

📈 Entry Logic:
Buy Entry: When price is above the HMA 200 and crosses above the EMA 20.

Sell Entry: When price is below the HMA 200 and crosses below the EMA 20.

The strategy closes the current position and reverses on the opposite signal.

⚙️ Strategy Settings (Backtest Configuration):
Position size: 10% of equity per trade

Commission: 0.1% per trade (to simulate broker fees)

Slippage: 2 ticks (to reflect realistic fill conditions)

✅ Purpose:
This script is designed to identify high-probability trades in the direction of the overall trend, avoiding whipsaw conditions. It is useful for traders looking for a dynamic crossover-based system that filters trades based on longer-term momentum.

🔎 Make sure to test across multiple assets and timeframes. For best results, apply this strategy to liquid trending markets like major FX pairs, indices, or high-cap stocks.

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.