OPEN-SOURCE SCRIPT
byquan AlphaTrend + Supertrend Combo

🔍 Overview
The AlphaTrend + SuperTrend Combo is a smart confirmation-based trading indicator that blends two powerful trend-following systems — AlphaTrend and SuperTrend — into one unified tool.
Its main purpose is to filter out false breakouts and improve entry accuracy by waiting for both indicators to confirm a signal within a specified number of candles.
This combination gives traders high-confidence BUY and SELL signals, clearly marked on the chart, with optional alert notifications.
⚙️ How It Works
🧠 1. AlphaTrend Logic
The AlphaTrend component calculates dynamic support and resistance bands based on Average True Range (ATR) and Money Flow Index (MFI) or RSI (if no volume data).
It identifies momentum shifts using:
upT = Lower ATR band
downT = Upper ATR band
Depending on whether the MFI (or RSI) is above or below 50, AlphaTrend adapts to bullish or bearish conditions.
Signals:
✅ Buy Signal → When AlphaTrend crosses above its past level (momentum turning up).
❌ Sell Signal → When AlphaTrend crosses below its past level (momentum turning down).
📈 2. SuperTrend Logic
The SuperTrend indicator uses ATR to track trend direction based on price and volatility.
A green SuperTrend implies a bullish trend.
A red SuperTrend implies a bearish trend.
It triggers signals when trend direction changes:
✅ SuperTrend Buy → Price breaks above the SuperTrend line.
❌ SuperTrend Sell → Price drops below the SuperTrend line.
Users can choose whether to use the standard ATR or a smoothed ATR version for calculation (changeATR option).
🔄 3. Combo Confirmation Logic
The indicator’s core strength is signal confirmation.
When one indicator (AlphaTrend or SuperTrend) gives a signal, it waits for the other to confirm within a certain number of candles — defined by the “Wait Bars” input.
Example:
AlphaTrend gives a Buy → within the next 3 candles, if SuperTrend also turns bullish → confirmed BUY.
SuperTrend gives a Sell → within the next 3 candles, if AlphaTrend confirms → confirmed SELL.
This filtering greatly reduces false signals caused by volatility or short-term noise.
🧭 Inputs & Settings
Parameter Description
Wait Bars Number of candles to wait for confirmation from the other indicator.
Show Labels Toggle visibility of BUY/SELL labels on chart.
AlphaTrend Multiplier / Period / Source Adjusts AlphaTrend’s sensitivity.
Use RSI (no volume) If true, replaces MFI with RSI for instruments without volume data (e.g., crypto indexes).
SuperTrend ATR Period / Multiplier Controls SuperTrend sensitivity and reactivity.
Use Standard ATR? If disabled, uses smoothed ATR instead.
SuperTrend Source Usually hl2, but can be customized.
📊 Signals & Visualization
🟢 BUY Label: Both indicators confirm an uptrend.
🔴 SELL Label: Both indicators confirm a downtrend.
Labels appear directly on the chart (abovebar for SELL, belowbar for BUY).
Alerts are automatically triggered for both confirmed directions.
🔔 Alerts
Two alert conditions are built in:
"Combo BUY: AlphaTrend + SuperTrend confirmed!"
"Combo SELL: AlphaTrend + SuperTrend confirmed!"
You can use these in TradingView’s alert system to receive push notifications or email alerts.
💡 Trading Tips
✅ Works best on trending markets (crypto, forex, stocks).
✅ Use on 15m–4h timeframes for optimal balance between speed and reliability.
✅ Combine with volume or higher timeframe trend filters for stronger entries.
✅ Adjust Wait Bars (2–5) depending on volatility.
⚖️ Summary
The AlphaTrend + SuperTrend Combo helps traders trade confidently by requiring dual confirmation before signaling a trade.
Key Features:
Combines two proven trend systems.
Reduces false entries through confirmation logic.
Visual BUY/SELL markers.
Built-in alerts for both signals.
Customizable sensitivity and timeframe adaptability.
🎯 Trade only when AlphaTrend and SuperTrend agree — let the market confirm your direction.
The AlphaTrend + SuperTrend Combo is a smart confirmation-based trading indicator that blends two powerful trend-following systems — AlphaTrend and SuperTrend — into one unified tool.
Its main purpose is to filter out false breakouts and improve entry accuracy by waiting for both indicators to confirm a signal within a specified number of candles.
This combination gives traders high-confidence BUY and SELL signals, clearly marked on the chart, with optional alert notifications.
⚙️ How It Works
🧠 1. AlphaTrend Logic
The AlphaTrend component calculates dynamic support and resistance bands based on Average True Range (ATR) and Money Flow Index (MFI) or RSI (if no volume data).
It identifies momentum shifts using:
upT = Lower ATR band
downT = Upper ATR band
Depending on whether the MFI (or RSI) is above or below 50, AlphaTrend adapts to bullish or bearish conditions.
Signals:
✅ Buy Signal → When AlphaTrend crosses above its past level (momentum turning up).
❌ Sell Signal → When AlphaTrend crosses below its past level (momentum turning down).
📈 2. SuperTrend Logic
The SuperTrend indicator uses ATR to track trend direction based on price and volatility.
A green SuperTrend implies a bullish trend.
A red SuperTrend implies a bearish trend.
It triggers signals when trend direction changes:
✅ SuperTrend Buy → Price breaks above the SuperTrend line.
❌ SuperTrend Sell → Price drops below the SuperTrend line.
Users can choose whether to use the standard ATR or a smoothed ATR version for calculation (changeATR option).
🔄 3. Combo Confirmation Logic
The indicator’s core strength is signal confirmation.
When one indicator (AlphaTrend or SuperTrend) gives a signal, it waits for the other to confirm within a certain number of candles — defined by the “Wait Bars” input.
Example:
AlphaTrend gives a Buy → within the next 3 candles, if SuperTrend also turns bullish → confirmed BUY.
SuperTrend gives a Sell → within the next 3 candles, if AlphaTrend confirms → confirmed SELL.
This filtering greatly reduces false signals caused by volatility or short-term noise.
🧭 Inputs & Settings
Parameter Description
Wait Bars Number of candles to wait for confirmation from the other indicator.
Show Labels Toggle visibility of BUY/SELL labels on chart.
AlphaTrend Multiplier / Period / Source Adjusts AlphaTrend’s sensitivity.
Use RSI (no volume) If true, replaces MFI with RSI for instruments without volume data (e.g., crypto indexes).
SuperTrend ATR Period / Multiplier Controls SuperTrend sensitivity and reactivity.
Use Standard ATR? If disabled, uses smoothed ATR instead.
SuperTrend Source Usually hl2, but can be customized.
📊 Signals & Visualization
🟢 BUY Label: Both indicators confirm an uptrend.
🔴 SELL Label: Both indicators confirm a downtrend.
Labels appear directly on the chart (abovebar for SELL, belowbar for BUY).
Alerts are automatically triggered for both confirmed directions.
🔔 Alerts
Two alert conditions are built in:
"Combo BUY: AlphaTrend + SuperTrend confirmed!"
"Combo SELL: AlphaTrend + SuperTrend confirmed!"
You can use these in TradingView’s alert system to receive push notifications or email alerts.
💡 Trading Tips
✅ Works best on trending markets (crypto, forex, stocks).
✅ Use on 15m–4h timeframes for optimal balance between speed and reliability.
✅ Combine with volume or higher timeframe trend filters for stronger entries.
✅ Adjust Wait Bars (2–5) depending on volatility.
⚖️ Summary
The AlphaTrend + SuperTrend Combo helps traders trade confidently by requiring dual confirmation before signaling a trade.
Key Features:
Combines two proven trend systems.
Reduces false entries through confirmation logic.
Visual BUY/SELL markers.
Built-in alerts for both signals.
Customizable sensitivity and timeframe adaptability.
🎯 Trade only when AlphaTrend and SuperTrend agree — let the market confirm your direction.
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。