OPEN-SOURCE SCRIPT

3 EMA Trend Strategy (Locks Trailing Stop Tightening)

3 186
3 EMA Trend Strategy (with Trailing Stop Tightening)

This open-source strategy uses three Exponential Moving Averages (7, 21, 35) to detect bullish alignment and trigger long entries during strong upward trends.

* Entry Logic:

A long trade is triggered when EMA 7 > EMA 21 > EMA 35. This alignment signals a confirmed uptrend.

* Exit Logic:

The strategy uses a trailing stop mechanism.

An initial stop (e.g., 10%) follows the high since entry.

Once profit reaches a customizable threshold (e.g., 20%), the trailing stop tightens (e.g., to 5%) to help lock in gains.

* Backtest Settings (default):

Starting capital: $10,000

Commission: 0.1%

Slippage: 1 tick

Position sizing: 100% of equity per trade (can be reduced to lower risk)

* Customization:

All trailing logic and EMA settings are configurable.

Designed for swing trading and adaptable for multiple timeframes.

⚠️ This is for educational purposes only. Always test on different symbols and timeframes before using in live environments.

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.