Candle Breakout Strategy by hashem-trader

By hashem-trader

Performance Metrics

Description

Short description (one-liner)Candle Breakout Strategy — identifies a user-specified candle (UTC time), draws its high/low range, then enters on breakouts with configurable stop-loss, take-profit (via Risk:Reward) and optional alerts.Full description (ready-to-paste)Candle Breakout StrategyVersion 1.0 — Strategy script (Pine v5)OverviewThe Candle Breakout Strategy automatically captures a single "range candle" at a user-specified UTC time, draws its high/low as a visible box and dashed level lines, and waits for a breakout. When price closes above the range high it enters a Long; when price closes below the range low it enters a Short. Stop-loss is placed at the opposite range boundary and take-profit is calculated with a user-configurable Risk:Reward multiplier. Alerts for entries can be enabled.This strategy is intended for breakout style trading where a clearly defined intraday range is established at a fixed time. It is simple, transparent and easy to adapt to multiple symbols and timeframes.How it works (step-by-step)On every bar the script checks the current UTC time.When the first bar that matches the configured Target Hour:Target Minute (UTC) appears, the script records that candle’s high and low. This defines the breakout range.A box and dashed lines are drawn on the chart to display the range and extended to the right while the range is active.The script then waits for price to close outside the box:Close > Range High → Long entryClose Stop Loss: Take Profit: Short alert:🔴 SHORT SIGNALEntry Price: Stop Loss: Take Profit: Use TradingView's alert dialog to create alerts based on the script — select the script’s alert condition or use the alert() messages.Recommended usage & tipsTimeframe: This strategy works on any timeframe but the definition of "candle at target time" depends on the chart timeframe. For intraday breakout styles, use 1m — 60m charts depending on the session you want to capture.Target Time: Choose a time that is meaningful for the instrument (e.g., market open, economic release, session overlap). All times are handled in UTC.Position Sizing: The script’s example uses strategy.percent_of_equity with 100% default — change default_qty_value or strategy settings to suit your risk management.Filtering: Consider combining this breakout with trend filters (EMA, ADX, etc.) to reduce false breakouts.Backtesting: Always backtest over a sufficiently large and recent sample. Pay attention to slippage and commission settings in TradingView’s strategy tester.Known behavior & limitationsThe script registers the breakout on close outside the recorded range. If you prefer intrabar breakout rules (e.g., high/low breach without close), you must adjust the condition accordingly.The recorded range is taken from a single candle at the exact configured UTC time. If there are missing bars or the chart timeframe doesn't align, the intended candle may differ — choose the target time and chart timeframe consistently.Only a single active position is allowed at a time (the script checks strategy.position_size == 0 before entries).Example setupsEURUSD (Forex): Target Time 07:00 UTC — captures London open range.Nifty / Index: Target Time 09:15 UTC — captures local session open range.Crypto: Target Time 00:00 UTC — captures daily reset candle for breakout.Risk disclaimerThis script is educational and provided as-is. Past performance is not indicative of future results. Use proper risk management, test on historical data, and consider slippage and commissions. Do not trade real capital without sufficient testing.Change logv1.0 — Initial release: range capture, box and level drawing, long/short entry by close breakout, SL at opposite boundary, TP via Risk:Reward, alerts, info table.If you want, I can also:Provide a short README version (2–3 lines) for the TradingView “Short description” field.Add a couple of suggested alert templates for the TradingView alert dialog (if you want alerts that include variable placeholders).Convert the disclaimer into multiple language versions.

Browse all 5,900+ TradingView Pine Script strategies

View on TradingView