OPEN-SOURCE SCRIPT
Zaktualizowano

Breakouts With Timefilter Strategy [LuciTech]

990
Credit:

veryfid for ATR SL -
ATR Stop Loss Finder

@TradesLuci1 for Breakouts (Entry Logic) -
Breakouts with timefilter [LuciTech]


Overview:

This strategy harnesses pivot-based breakouts enhanced with a configurable time filter and robust risk management to deliver precise trade signals. Designed for traders seeking clean breakout entries with controlled risk, it overlays breakout signals, entry, stop-loss, and take-profit levels directly on the chart. Operating across any timeframe, it combines customizable pivot detection, volatility-adjusted stops, and dynamic position sizing for structured trading outcomes.

Features:

The strategy identifies breakouts using pivot highs for bullish trades and pivot lows for bearish trades, based on a customizable lookback period. Signals trigger on a price close above a pivot high or below a pivot low, with an option to display only the latest breakout. An optional time filter restricts trades to a user-defined window, marked by a background fill. Risk management integrates stop-loss options (ATR-based, candle-based, or fixed points), a risk-reward ratio for take-profit, and position sizing tied to equity risk percentage. Visuals include breakout triangles, plotted entry/stop-loss/take-profit lines with shaded zones, and optional ATR lines, all customizable in colour.

How It Works:

Trades activate when price closes above a pivot high (long) or below a pivot low (short), within the time filter if enabled. Stop-loss is calculated using ATR (smoothed with RMA, SMA, EMA, or WMA), the prior candle’s high/low, or a fixed points value, adjustable by multiplier or length. Take-profit is set by multiplying the stop-loss distance by the risk-reward ratio. Position size dynamically adjusts based on a percentage of equity and stop-loss distance. Breakout signals appear as triangles, with lines connecting pivots to breakout bars, while active trades display entry, stop-loss, and take-profit levels with shaded risk/reward zones.

Settings:

Breakout Detection: Pivot Length (default customizable) for pivot high/low lookback.
Risk Management: Risk % (default 1%) for equity risked, Risk:Reward (default 3) for take-profit, SL Type (ATR, Candle, Points), ATR Length (default 14), ATR Multiplier (default 1.5), Smoothing (RMA, SMA, EMA, WMA), Candle Length (default 0, prior candle), Fixed Points (custom).
Time Filter: Enable Time Filter (default false), Start Hour/Minute (default custom), End Hour/Minute (default custom), Fill Background (default grey).
Visuals: Bull/Bear breakout colours (default custom), Entry/SL/TP line colours (default grey/red/green), toggle for ATR lines and fill display.

Interpretation:

Breakout signals highlight momentum shifts as price breaches pivot levels, with triangles and connecting lines providing clear entry cues. Stop-loss levels (ATR, candle, or points-based) define risk, while take-profit targets align with the risk-reward ratio for structured exits. Shaded areas between entry and stop-loss/take-profit visualize risk and reward zones. Optional ATR lines reflect volatility-adjusted stops, and the time filter, when active, focuses trading within key hours, emphasized by a background fill. This setup suits traders aiming for disciplined, breakout-driven trades with precise risk control.
Informacje o Wersji
Updated Description:

Overview
This strategy is designed for traders looking to capture clean breakout opportunities while maintaining precise risk control. It identifies trade setups based on pivot breakouts, ensuring entries align with market momentum. The system integrates a configurable time filter to focus trades within specific sessions and employs dynamic position sizing to manage risk effectively.

By combining pivot-based breakout logic with volatility-adjusted stop-loss placement, this strategy adapts to different market conditions and works across multiple timeframes. The visual elements—entry markers, stop-loss/take-profit zones, and pivot structures—help traders interpret setups at a glance.

Core Concepts & Methodology
This strategy relies on pivot high/low breakouts, a widely used concept in technical trading. A breakout is confirmed when price closes above a pivot high (bullish) or below a pivot low (bearish). This method helps traders identify moments when price structure shifts, signaling a potential trend continuation.

Trades are only executed when a candle closes beyond the pivot level, filtering out false breakouts. The strategy includes a built-in risk management system where stop-loss placement is determined dynamically using ATR-based levels, prior candle highs/lows, or fixed point values. A risk-reward multiplier is applied to calculate take-profit targets. Additionally, an optional time filter allows traders to restrict entries to specific sessions, helping to avoid low-liquidity periods.

How It Works
The script identifies pivot highs and lows based on a customizable lookback period. A long trade is triggered when price closes above a pivot high, and a short trade is triggered when price closes below a pivot low. If the time filter is enabled, trades will only execute within the defined session window.

Stop-loss placement is calculated using one of three methods: ATR (adjustable with different smoothing options such as RMA, SMA, EMA, or WMA), the prior candle’s high/low, or a fixed point value. The take-profit level is determined by multiplying the stop-loss distance by the risk-reward ratio. Position sizing is dynamically adjusted based on the percentage of equity risked per trade.

Breakout signals are displayed as triangles on the chart. Entry, stop-loss, and take-profit levels are plotted with customizable lines, while shaded zones visually represent risk and reward. ATR lines can be enabled to provide additional insight into volatility-adjusted stop placement. If the time filter is active, the background is shaded during the allowed trading hours.

Settings & Customization
Users can configure the pivot length to adjust breakout sensitivity. Risk management settings allow traders to modify the risk percentage per trade, risk-reward ratio, and stop-loss type. ATR length, smoothing method, and multipliers can be adjusted to refine stop placement. The time filter can be enabled or disabled, with customizable start and end times to define active trading hours. Visual elements such as breakout colors, entry/stop-loss/take-profit line colors, and ATR line display options are fully customizable.

Why This Strategy Is Unique
Unlike generic breakout strategies, this system incorporates multiple layers of risk control, ensuring structured trade execution. The dynamic stop-loss system adapts to volatility, improving trade sustainability. The ability to restrict trading hours enhances efficiency by focusing on optimal market conditions. By combining breakout logic, adaptive stop placement, and equity-based position sizing, this strategy provides traders with a complete framework for disciplined and risk-managed trading.
Informacje o Wersji
Added a toggleable moving average filter to refine breakout signals. When enabled, the script only allows bullish breakouts if the price is above the selected moving average and bearish breakouts if the price is below it. Users can choose from SMA, EMA, WMA, VWMA, and HMA to match their strategy. If the filter is turned off, breakouts are detected as usual without MA confirmation.

Wyłączenie odpowiedzialności

Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.