OPEN-SOURCE SCRIPT
已更新 SN Trader

📌 SN Trader – ATR Trailing Stop with EMA Confirmation (Scalping Strategy)
SN Trader is a precision-built ATR-based trailing stop strategy enhanced with EMA 9 & EMA 26 trend confirmation, designed for high-probability intraday and scalping trades, especially effective on XAUUSD (Gold) and other volatile instruments.
This script is a strategy (not just an indicator), meaning it supports backtesting, performance analysis, alerts, and automated trading via webhooks.
🔍 Core Concept
The strategy combines three powerful components:
ATR Trailing Stop (UT Bot logic)
Dynamically adapts to volatility
Acts as both trend filter and dynamic support/resistance
EMA 9 & EMA 26 Trend Confirmation
Filters out low-quality signals
Ensures trades align with short-term momentum
Crossover-Based Entry & Exit Logic
Prevents over-trading
Keeps entries clean and disciplined
This fusion makes SN Trader suitable for manual traders, systematic traders, and algo traders.
📈 Trading Logic (How It Works)
✅ BUY (Long Entry)
A BUY trade is triggered only when:
Price crosses above the ATR trailing stop (UT Buy signal)
EMA 9 crosses above EMA 26
Price is trading above the ATR trailing stop
❌ SELL (Short Entry)
A SELL trade is triggered only when:
Price crosses below the ATR trailing stop (UT Sell signal)
EMA 9 crosses below EMA 26
Price is trading below the ATR trailing stop
🔁 Exit Rules
Long trades close automatically when a Sell signal appears
Short trades close automatically when a Buy signal appears
No repainting logic is used
⚙️ Inputs & Customization
ATR Settings
Key Value – Controls signal sensitivity
Lower value = more trades (aggressive)
Higher value = fewer trades (conservative)
ATR Period – Volatility calculation window
Candle Source
Option to calculate signals using:
Regular candles
Heikin Ashi candles (for smoother trends)
EMA Settings
Default:
EMA Fast: 9
EMA Slow: 26
Can be adjusted to suit different markets or timeframes
🕒 Recommended Usage
Parameter Recommendation
Timeframe 5-Minute (Scalping)
Markets XAUUSD, Indices, Crypto, Forex
Sessions London & New York
Market Type Trending / Volatile
⚠️ Avoid ranging or extremely low-volatility conditions for best results.
📊 Visual Elements
EMA 9 – Green line
EMA 26 – Red line
ATR Trailing Stop – Blue line
BUY / SELL labels on chart
Clean, minimal overlay for fast decision-making
🔔 Alerts & Automation
Because this script is a strategy, it supports:
TradingView Strategy Order Fill Alerts
Webhook alerts for:
MT4 / MT5 bridges
Crypto exchanges
Custom algo execution systems
This makes SN Trader suitable for fully automated trading workflows.
🛑 Risk Disclaimer
This strategy does not include fixed stop-loss or take-profit by default.
Users are strongly encouraged to:
Apply broker-level SL/TP
Avoid high-impact news events
Forward-test before live deployment
Trading involves risk. Past performance does not guarantee future results.
👤 Access & Distribution
This script may be shared as:
Invite-only
Protected source
Redistribution, resale, or modification without permission is prohibited.
⭐ Final Notes
SN Trader is built for traders who value:
Discipline over noise
Confirmation over impulse
Structure over randomness
Whether used for manual scalping, strategy testing, or algo execution, this script provides a robust and professional trading framework.
SN Trader is a precision-built ATR-based trailing stop strategy enhanced with EMA 9 & EMA 26 trend confirmation, designed for high-probability intraday and scalping trades, especially effective on XAUUSD (Gold) and other volatile instruments.
This script is a strategy (not just an indicator), meaning it supports backtesting, performance analysis, alerts, and automated trading via webhooks.
🔍 Core Concept
The strategy combines three powerful components:
ATR Trailing Stop (UT Bot logic)
Dynamically adapts to volatility
Acts as both trend filter and dynamic support/resistance
EMA 9 & EMA 26 Trend Confirmation
Filters out low-quality signals
Ensures trades align with short-term momentum
Crossover-Based Entry & Exit Logic
Prevents over-trading
Keeps entries clean and disciplined
This fusion makes SN Trader suitable for manual traders, systematic traders, and algo traders.
📈 Trading Logic (How It Works)
✅ BUY (Long Entry)
A BUY trade is triggered only when:
Price crosses above the ATR trailing stop (UT Buy signal)
EMA 9 crosses above EMA 26
Price is trading above the ATR trailing stop
❌ SELL (Short Entry)
A SELL trade is triggered only when:
Price crosses below the ATR trailing stop (UT Sell signal)
EMA 9 crosses below EMA 26
Price is trading below the ATR trailing stop
🔁 Exit Rules
Long trades close automatically when a Sell signal appears
Short trades close automatically when a Buy signal appears
No repainting logic is used
⚙️ Inputs & Customization
ATR Settings
Key Value – Controls signal sensitivity
Lower value = more trades (aggressive)
Higher value = fewer trades (conservative)
ATR Period – Volatility calculation window
Candle Source
Option to calculate signals using:
Regular candles
Heikin Ashi candles (for smoother trends)
EMA Settings
Default:
EMA Fast: 9
EMA Slow: 26
Can be adjusted to suit different markets or timeframes
🕒 Recommended Usage
Parameter Recommendation
Timeframe 5-Minute (Scalping)
Markets XAUUSD, Indices, Crypto, Forex
Sessions London & New York
Market Type Trending / Volatile
⚠️ Avoid ranging or extremely low-volatility conditions for best results.
📊 Visual Elements
EMA 9 – Green line
EMA 26 – Red line
ATR Trailing Stop – Blue line
BUY / SELL labels on chart
Clean, minimal overlay for fast decision-making
🔔 Alerts & Automation
Because this script is a strategy, it supports:
TradingView Strategy Order Fill Alerts
Webhook alerts for:
MT4 / MT5 bridges
Crypto exchanges
Custom algo execution systems
This makes SN Trader suitable for fully automated trading workflows.
🛑 Risk Disclaimer
This strategy does not include fixed stop-loss or take-profit by default.
Users are strongly encouraged to:
Apply broker-level SL/TP
Avoid high-impact news events
Forward-test before live deployment
Trading involves risk. Past performance does not guarantee future results.
👤 Access & Distribution
This script may be shared as:
Invite-only
Protected source
Redistribution, resale, or modification without permission is prohibited.
⭐ Final Notes
SN Trader is built for traders who value:
Discipline over noise
Confirmation over impulse
Structure over randomness
Whether used for manual scalping, strategy testing, or algo execution, this script provides a robust and professional trading framework.
版本注释
📈 SN Trader – ATR Trailing Stop Buy/Sell IndicatorSN Trader is a trend-following trading indicator based on an ATR Trailing Stop mechanism, designed to generate clear Buy and Sell signals with dynamic volatility-based stops. It works effectively for scalping, intraday, and swing trading across Forex, Indices, Crypto, and Commodities.
🔹 How It Works
Uses Average True Range (ATR) to calculate a dynamic trailing stop.
The Key Value input controls sensitivity:
Lower value → Faster, more sensitive signals
Higher value → Smoother, fewer signals
Automatically adapts to market volatility.
Optional Heikin Ashi candle source for smoother trend detection.
🔹 Buy & Sell Logic
Buy Signal
Price closes above the ATR Trailing Stop
EMA crosses above the trailing stop
Sell Signal
Price closes below the ATR Trailing Stop
EMA crosses below the trailing stop
Signals are plotted directly on the chart using Buy / Sell labels for easy visual confirmation.
🔹 Visual Features
🟢 Green bars → Bullish trend
🔴 Red bars → Bearish trend
🟦 Neutral when no clear position
Clear trailing stop line for trend direction
🔹 Alerts
Built-in alert conditions:
SN Long – Buy signal
SN Short – Sell signal
These alerts can be connected to:
Manual trading
Webhooks
Automated trading systems
🔹 Best Use Cases
✔️ Trend-following strategies
✔️ XAUUSD, Forex pairs, Crypto
✔️ Works well on 5 min, 15 min, 1H, and higher timeframes
✔️ Can be combined with EMA, RSI, or price action for confirmation
⚠️ Disclaimer
This indicator is for educational and informational purposes only. It does not guarantee profits. Always use proper risk management, stop-loss, and confirm signals before trading live markets.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。