OPEN-SOURCE SCRIPT
HTF Candle Direction Strategy V1

🔹 Title
HTF Candle Direction Strategy V1
🔹 Short Description
Higher Timeframe (HTF) bias-based strategy with optional EMA & volume filters and controlled daily execution.
🔹 Full Description
📌 Overview
HTF Candle Direction Strategy V1 is a simple yet powerful trend-following strategy that trades in the direction of a selected Higher Timeframe (HTF) candle.
The core idea is straightforward:
If the HTF candle is bullish → look for BUY trades
If the HTF candle is bearish → look for SELL trades
This helps traders align with the broader market trend while executing trades on lower timeframes.
⚙️ How It Works
The script fetches HTF Open and Close prices
Determines directional bias:
Bullish Bias → HTF Close > HTF Open
Bearish Bias → HTF Close < HTF Open
Trades are executed only when:
Signals are enabled
Selected direction (Buy/Sell) is enabled
Filters (if enabled) are satisfied
Only one trade per day is allowed
🔍 Features
✅ Higher Timeframe Bias Trading
Trade in alignment with HTF trend
Works on any timeframe combination
✅ Lookahead Mode (Backtesting vs Real Trading)
ON → Faster signals but repaints
OFF → Realistic, non-repainting behavior
✅ EMA Filter (Optional)
Confirms trend using EMA
Buy only above EMA
Sell only below EMA
✅ Volume Filter (Optional)
Trades only when volume is strong
Helps avoid weak market conditions
✅ One Trade Per Day Logic
Prevents overtrading
Keeps strategy disciplined
✅ Built-in Alerts
BUY & SELL alerts included
Ready for automation
✅ Live Dashboard
Displays:
HTF Bias
Lookahead status
EMA filter status
Volume filter status
📊 Dashboard Information
The dashboard (top-right) provides real-time status:
HTF Bias → Current market direction
Lookahead → ON (Repainting) / OFF (Safe)
EMA Filter → Enabled / Disabled
Volume Filter → Enabled / Disabled
⚠️ Important Notes
Lookahead ON = Repainting
Use only for backtesting or analysis
For real trading, always use:
👉 Lookahead OFF
Strategy takes only one trade per day, so performance depends on HTF accuracy
🎯 Best Use Cases
Intraday trading with HTF confirmation
Trend-following strategies
Index, Forex, Crypto markets
Scalping with higher timeframe bias
💡 Recommended Settings
HTF: 4H / Daily
EMA: 50 or 200
Lookahead: OFF (for live trading)
Volume Filter: Optional
🔔 Alerts
BUY Signal → HTF Bullish + filters satisfied
SELL Signal → HTF Bearish + filters satisfied
🚀 Final Notes
This strategy is designed for simplicity, clarity, and disciplined execution.
It avoids overtrading and focuses on high-probability directional setups.
⚠️ Disclaimer
This script is provided for educational and informational purposes only and should not be considered financial advice.
Trading in financial markets involves significant risk, and you may lose all or part of your capital. Past performance of this strategy does not guarantee future results.
This strategy uses higher timeframe data and optional lookahead logic. When lookahead is enabled, signals may repaint, meaning results shown on historical data may differ from real-time performance.
Users are strongly advised to:
Test the strategy on demo accounts before using real capital
Use proper risk management
Understand how the strategy works before trading
The author is not responsible for any financial losses or damages resulting from the use of this script.
HTF Candle Direction Strategy V1
🔹 Short Description
Higher Timeframe (HTF) bias-based strategy with optional EMA & volume filters and controlled daily execution.
🔹 Full Description
📌 Overview
HTF Candle Direction Strategy V1 is a simple yet powerful trend-following strategy that trades in the direction of a selected Higher Timeframe (HTF) candle.
The core idea is straightforward:
If the HTF candle is bullish → look for BUY trades
If the HTF candle is bearish → look for SELL trades
This helps traders align with the broader market trend while executing trades on lower timeframes.
⚙️ How It Works
The script fetches HTF Open and Close prices
Determines directional bias:
Bullish Bias → HTF Close > HTF Open
Bearish Bias → HTF Close < HTF Open
Trades are executed only when:
Signals are enabled
Selected direction (Buy/Sell) is enabled
Filters (if enabled) are satisfied
Only one trade per day is allowed
🔍 Features
✅ Higher Timeframe Bias Trading
Trade in alignment with HTF trend
Works on any timeframe combination
✅ Lookahead Mode (Backtesting vs Real Trading)
ON → Faster signals but repaints
OFF → Realistic, non-repainting behavior
✅ EMA Filter (Optional)
Confirms trend using EMA
Buy only above EMA
Sell only below EMA
✅ Volume Filter (Optional)
Trades only when volume is strong
Helps avoid weak market conditions
✅ One Trade Per Day Logic
Prevents overtrading
Keeps strategy disciplined
✅ Built-in Alerts
BUY & SELL alerts included
Ready for automation
✅ Live Dashboard
Displays:
HTF Bias
Lookahead status
EMA filter status
Volume filter status
📊 Dashboard Information
The dashboard (top-right) provides real-time status:
HTF Bias → Current market direction
Lookahead → ON (Repainting) / OFF (Safe)
EMA Filter → Enabled / Disabled
Volume Filter → Enabled / Disabled
⚠️ Important Notes
Lookahead ON = Repainting
Use only for backtesting or analysis
For real trading, always use:
👉 Lookahead OFF
Strategy takes only one trade per day, so performance depends on HTF accuracy
🎯 Best Use Cases
Intraday trading with HTF confirmation
Trend-following strategies
Index, Forex, Crypto markets
Scalping with higher timeframe bias
💡 Recommended Settings
HTF: 4H / Daily
EMA: 50 or 200
Lookahead: OFF (for live trading)
Volume Filter: Optional
🔔 Alerts
BUY Signal → HTF Bullish + filters satisfied
SELL Signal → HTF Bearish + filters satisfied
🚀 Final Notes
This strategy is designed for simplicity, clarity, and disciplined execution.
It avoids overtrading and focuses on high-probability directional setups.
⚠️ Disclaimer
This script is provided for educational and informational purposes only and should not be considered financial advice.
Trading in financial markets involves significant risk, and you may lose all or part of your capital. Past performance of this strategy does not guarantee future results.
This strategy uses higher timeframe data and optional lookahead logic. When lookahead is enabled, signals may repaint, meaning results shown on historical data may differ from real-time performance.
Users are strongly advised to:
Test the strategy on demo accounts before using real capital
Use proper risk management
Understand how the strategy works before trading
The author is not responsible for any financial losses or damages resulting from the use of this script.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.