PROTECTED SOURCE SCRIPT
Reversal Strategy v1

This is a mean-reversion / reversal pyramiding strategy based on the Reversal Finder indicator by NS91
It looks for large candles that break recent highs or lows, then close back inside the candle range, which often signals exhaustion and a potential reversal.
When a signal appears:
This makes it suitable for:
Settings Functions
Lookback period for highs and lows. Defines how far back the script looks to detect previous highs or lows. Used to detect liquidity sweeps / false breakouts
SMA length for candle range.
Length of the SMA used to calculate the average candle range. Helps define what counts as a “large” candle
Range multiple.
Multiplier applied to the average candle range. Candle must be at least this large to qualify as a reversal signal
Range threshold (%).
Controls where the candle must close within its range. Example: 50% means the close must be at least halfway back inside the candle. Higher = stronger rejection requirement
Max Pyramid Entries.
Maximum number of open trades allowed in the same direction, ensure pyramiding is activated and defined in settings Properties
Cooldown Between Entries (bars).
Forces a minimum number of bars between new entries. Prevents over-stacking trades too quickly
Enable Take Profit.
Turns TP logic on or off
Take Profit (%).
TP distance measured from the average position price. Updates dynamically as the average price changes
Enable Stop Loss.
Turns SL logic on or off
Stop Loss (%).
SL distance measured from the average position price
Exit on Opposing Signal.
If enabled: Long positions close when a short signal appears.
Short positions close when a long signal appears. Useful for fast-moving or choppy markets
It looks for large candles that break recent highs or lows, then close back inside the candle range, which often signals exhaustion and a potential reversal.
When a signal appears:
- It enters against the move (long after a downside sweep, short after an upside sweep)
- It allows multiple pyramid entries, but only at better prices than the current average
- It draws stepped lines showing the average entry price and take-profit level
- It exits using precise TP / SL based on the average position price
- It can optionally close trades early if an opposite signal appears
This makes it suitable for:
- Ranging markets
- Liquidity sweeps
- Scalping or short-term mean reversion
- Controlled with pyramiding (with protection)
Settings Functions
Lookback period for highs and lows. Defines how far back the script looks to detect previous highs or lows. Used to detect liquidity sweeps / false breakouts
SMA length for candle range.
Length of the SMA used to calculate the average candle range. Helps define what counts as a “large” candle
Range multiple.
Multiplier applied to the average candle range. Candle must be at least this large to qualify as a reversal signal
Range threshold (%).
Controls where the candle must close within its range. Example: 50% means the close must be at least halfway back inside the candle. Higher = stronger rejection requirement
Max Pyramid Entries.
Maximum number of open trades allowed in the same direction, ensure pyramiding is activated and defined in settings Properties
Cooldown Between Entries (bars).
Forces a minimum number of bars between new entries. Prevents over-stacking trades too quickly
Enable Take Profit.
Turns TP logic on or off
Take Profit (%).
TP distance measured from the average position price. Updates dynamically as the average price changes
Enable Stop Loss.
Turns SL logic on or off
Stop Loss (%).
SL distance measured from the average position price
Exit on Opposing Signal.
If enabled: Long positions close when a short signal appears.
Short positions close when a long signal appears. Useful for fast-moving or choppy markets
Mã được bảo vệ
Tập lệnh này được đăng dưới dạng mã nguồn đóng. Tuy nhiên, bạn có thể sử dụng tự do và không giới hạn – tìm hiểu thêm tại đây.
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ã được bảo vệ
Tập lệnh này được đăng dưới dạng mã nguồn đóng. Tuy nhiên, bạn có thể sử dụng tự do và không giới hạn – tìm hiểu thêm tại đây.
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.