OPEN-SOURCE SCRIPT
SMA Crossover Strategy with TP/SL

📊 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.
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.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.