OPEN-SOURCE SCRIPT

Liquidity + Engulfment Strategy

Updated
This strategy identifies potential trading opportunities by combining bullish and bearish engulfing candle patterns with liquidity seal-off points. The logic is based on the concept of engulfing candles, which signal a shift in market sentiment, and liquidity lines, which represent local price extremes (highs and lows) that can indicate potential reversal or continuation points.

Key Features:

Mode Selection
The strategy allows for three modes: "Both", "Bullish Only", and "Bearish Only". Users can choose whether to trade both directions, only bullish setups, or only bearish setups.

Time Range
Users can define a specific time range for when the strategy is active, enabling tailored analysis and trade execution over a desired period.

Engulfing Candles
Bullish Engulfing: A candle that closes above the high of the previous bearish candle, signaling potential upward momentum.
Bearish Engulfing: A candle that closes below the low of the previous bullish candle, indicating a potential downtrend.

Liquidity Seal-Off Points
The strategy detects local highs and local lows within a specified lookback period, which can serve as critical support and resistance points.
A bullish signal is triggered when the price touches a lower liquidity point (local low), and a bearish signal is triggered at a higher liquidity point (local high).

Signal Confirmation
Signals are only triggered when both an engulfing candle and the price action at a liquidity seal-off point align. This helps filter out weaker signals.
Consecutive signals are prevented by locking the trade direction after an initial signal and waiting for the liquidity line to be broken before re-triggering a signal.

Entry and Exit Conditions
The strategy can enter both long (bullish) or short (bearish) positions based on the mode and signals.
Exit is based on opposing signals or reaching predefined stop-loss and take-profit levels.

Alerts
The strategy supports alert conditions to notify users when bullish engulfing after a lower liquidity touch or bearish engulfing after an upper liquidity touch is detected.
Release Notes
Take profit logic updated
Release Notes
Pre-determined stop loss and take profit options updated.
Release Notes
Updates made

Declaration of the drawings on the chart: Two vertical lines are drawn on the chart to reflect the start and end time/date selected for this strategy test.

Slippage added to strategy test: a realistic slippage value has been applied to this strategy test.

More trades evaluated: this strategy test now uses a larger number of trades for transparency; the results are now more realistic compared to on the originally released strategy test results.
Candlestick analysisChart patternsTrend Analysis

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer