OPEN-SOURCE SCRIPT

SMA Crossover Strategy with TP/SL

353
📊 Strategy Description: SMA Crossover Strategy with TP/SL
This is a Simple Moving Average (SMA) Crossover Strategy designed to help traders identify trend reversals and manage trades with proper risk-reward logic.

🔹 Entry Logic:
Buy Signal: When the Fast SMA crosses above the Slow SMA → indicating a bullish trend.

Sell Signal: When the Fast SMA crosses below the Slow SMA → indicating a bearish trend.

🔹 Exit Logic:
Take Profit: The strategy exits the position when price reaches a user-defined profit target.

Stop Loss: The trade is closed if price moves against the position beyond the specified stop-loss limit.

⚙️ Parameters:
Fast SMA Length: Number of candles used for fast moving average (default: 10)

Slow SMA Length: Number of candles used for slow moving average (default: 30)

Take Profit (%): Profit target in percentage (default: 0.10%)

Stop Loss (%): Maximum allowed loss per trade (default: 0.10%)

✅ Additional Features:
Strategy backtesting supported

Visual arrows for Buy/Sell signals

Bar coloring based on trend

Alert conditions for Buy/Sell crossover signals

🧠 Suggested Use:
Works best on 1 min, 5 hour, or daily timeframes.

Can be applied to stocks, crypto, forex, or indices.

Ideal for trend-following traders who want automation with risk control.

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.