OPEN-SOURCE SCRIPT
Session Liquidity Sweep + Trend Confirmation

This strategy aims to capture high-probability intraday trades by combining liquidity sweeps with a trend confirmation filter. It is designed for traders who want a systematic approach to trade breakouts during specific market sessions while controlling risk with ATR-based stops.
How it Works:
Session Filter: Trades are only considered during a defined session (default 9:30 - 11:00). This helps avoid low-volume periods that can lead to false signals.
Trend Confirmation: The strategy uses a 50-period EMA to identify the market trend. Long trades are only taken in an uptrend, and short trades in a downtrend.
Liquidity Sweep Detection:
ATR-Based Risk Management:
Position Sizing: Default position size is 5% of equity per trade, making it suitable for risk-conscious trading.
Inputs:
Visuals:
Why Use This Strategy:
Important Notes:
Assumes 0.05% commission and 1-pip slippage. Adjust according to your broker.
Not financial advice; intended for educational, backtesting, or paper trading purposes.
Always test strategies thoroughly before applying to live accounts.
How it Works:
Session Filter: Trades are only considered during a defined session (default 9:30 - 11:00). This helps avoid low-volume periods that can lead to false signals.
Trend Confirmation: The strategy uses a 50-period EMA to identify the market trend. Long trades are only taken in an uptrend, and short trades in a downtrend.
Liquidity Sweep Detection:
- A long entry occurs when price dips below the prior N-bar low but closes back above it, indicating a potential liquidity sweep that stops being triggered before the trend continues upward.
- A short entry occurs when price spikes above the prior N-bar high but closes below it, signaling a potential sweep of stops before the downward trend resumes.
ATR-Based Risk Management:
- Stop loss is calculated using the Average True Range (ATR) multiplied by a configurable factor (default 1.5).
- Take profit is set based on a risk-reward ratio (default 2.5x).
Position Sizing: Default position size is 5% of equity per trade, making it suitable for risk-conscious trading.
Inputs:
- Session Start/End (HHMM)
- Liquidity Lookback Period (number of bars to define prior high/low)
- ATR Length for stop calculation
- ATR Stop Multiplier
- Risk-Reward Ratio
- EMA Trend Filter Length
Visuals:
- Prior Liquidity High (red)
- Prior Liquidity Low (green)
- EMA Trend (blue)
Why Use This Strategy:
- Captures stop-hunt moves often triggered by larger market participants.
- Only trades with trend confirmation, reducing false signals.
- Provides automatic ATR-based stop loss and take profit for consistent risk management.
- Easy to adjust session time, ATR, EMA length, and risk-reward to suit your trading style.
Important Notes:
Assumes 0.05% commission and 1-pip slippage. Adjust according to your broker.
Not financial advice; intended for educational, backtesting, or paper trading purposes.
Always test strategies thoroughly before applying to live accounts.
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน