OPEN-SOURCE SCRIPT

Low Volatility Breakout + TP/SL Levels

159
█ OVERVIEW
"Low Volatility Breakout + TP/SL Levels" is a breakout indicator designed to detect and trade breakouts from periods of low volatility (consolidation). Unlike classic strategies based on fixed support/resistance levels, this indicator dynamically identifies consolidations characterized by small candle bodies and only generates a signal when the breakout occurs with a large, decisive candle. It also automatically plots 3 Take Profit levels and a Stop Loss (with two calculation modes), making it a complete breakout trading tool.

█ CONCEPTS
The strongest market moves most often start after a prolonged period of very low volatility — when candles become small and the market "falls asleep". The indicator first detects such consolidations (small bodies for at least X bars), draws a box around them, and then waits for a breakout with a candle significantly larger than the average. Additional filters (e.g., the box height cannot exceed the average candle body by too much) eliminate false consolidations and volatility traps. Immediately after the breakout, TP1, TP2, TP3, and SL levels are plotted.

█ FEATURES
Dynamic detection of low-volatility consolidations
- candles with small bodies (< average body × consolidationMultiplier)
- minimum number of bars in consolidation: confirmBars (default 5)

Automatic drawing of consolidation boxes
- green (bullish) or red (bearish) with transparent background (85)
- adjustable border thickness (border_width 1–5)
- box height filter (boxHeightMultiplier, default 6.0 × average body) – removes overly stretched/false consolidations

Breakout conditions
- current candle must be larger than average body × threshold (default 1.5)
- must be the largest candle in the entire consolidation
- must close above the highest high (long) or below the lowest low (short)

Breakout signals
- small green triangles below the bar (long)
- small red triangles above the bar (short)

Automatic Take Profit and Stop Loss levels (drawn 5 bars forward)
- two calculation modes:
  • Candle Multiplier – based on average true range (high-low) over tp_sl_length period
  • Percentage – fixed percentage from breakout close price (percentages must be manually adjusted to the asset and timeframe)
- 3 TP levels (default 2×, 3×, 4× or 2%, 3%, 4%)
- 1 SL level (default 2× or 1.5%)

Live TP/SL price table (top-right corner)
- displays exact current values of SL, TP1, TP2, TP3 immediately after each new signal
- colors identical to drawn lines (red background for SL, green for TP levels)
- updates automatically with every new breakout

Built-in alerts
- “Bullish Breakout Alert” and “Bearish Breakout Alert”

█ HOW TO USE
Add the indicator to your TradingView chart → Indicators → search “Low Volatility Breakout + TP/SL Levels”.

After each valid breakout you will immediately see:
- the colored box
- signal triangle
- horizontal TP/SL lines
- updated table in the top-right corner showing precise price levels for the current trade

Key settings to adjust:

Consolidation Settings
- Volatility Window (length) – period for average body calculation (default 20)
- Consolidation Multiplier – how small bodies must be to count as consolidation (default 2.0)
- Breakout Multiplier – minimum size of breakout candle (default 1.5)
- Box Height Multiplier – maximum allowed box height (default 6.0)
- Min Consolidation Bars – minimum bars required (default 5)

Risk Management Settings
- Choose TP/SL mode: Candle Multiplier or Percentage
- Adjust TP1–3 and SL multipliers/percentages to match your risk management style

Signal interpretation:
- Green triangle below bar + green box + green TP levels in table = long signal
- Red triangle above bar + red box + red SL level in table = short signal
- Boxes remain on chart until broken — they highlight accumulation/distribution zones

█ APPLICATIONS
- Trading breakouts from consolidation on all markets and timeframes
- Recommended to trade in the direction of the higher-timeframe trend or with additional confirmations (e.g., key level breaks). Aggressive mode (trading both directions) is also possible — provided box and TP/SL settings are properly optimized
- Experiment with different TP/SL ratios — higher reward-to-risk setups (e.g., SL 1×, TP3 6–8×) with lower win rate are often more profitable in the long run
- Strongly encourage testing various box parameters (consolidationMultiplier, boxHeightMultiplier, confirmBars) — small changes can dramatically affect signal frequency and quality

█ NOTES
Always test and optimize parameters for the specific instrument and timeframe.

免责声明

这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。