Daily Breakout + Daily Shadow By Rouro — Strategy by rouro33
By rouro33
Performance Metrics
- Author: rouro33
- Symbol: OANDA:XAUUSD
- Timeframe: 5 minutes
- Net P&L: +8,375.00 USD (+0.84%)
- Win Rate: 78.6%
- Profit Factor: 6.241
- Max Drawdown: 1,608.50 USD (0.16%)
- Total Trades: 14
- Sharpe Ratio: 0.203
Description
This script is a Pine v5 strategy designed to detect daily candle body breakouts and execute them on any intraday timeframe, while also providing:Daily Data RetrievalUsing request.security(..., "D", ...) it fetches the OHLC and timestamp of the daily candle, regardless of the chart’s current timeframe.Calculation of Yesterday’s and Day-Before-Yesterday’s Bodiesb1High and b1Low → the high/low of yesterday’s daily candle bodyb2High and b2Low → the high/low of the previous day’s bodyDetection of the First Intraday Bar After a New DayBy using ta.change(time("D")), it marks the start of each new trading day.Drawing the Previous Day’s “Shadow” on the ChartIt overlays a box (box.new) and two wick lines (line.new) with configurable colors and transparency, so you can clearly see the full range of yesterday’s candle on any intraday chart.Automatic End-of-Day Position ClosureIt will automatically close any open position at the start of the next day to avoid unintended rollovers.Entry SignalsOn the very first intraday bar after the daily close:Long if yesterday’s close broke above the body of the day before yesterdayShort if yesterday’s close broke below the body of the day before yesterday…which triggers a strategy.entry at the intraday open.Fully Customizable Stop-Loss and Take-ProfitSL options:Opposite end of yesterday’s bodyFixed pips from entryA risk-reward ratio on yesterday’s wickOptional “safety SL” in fixed pips that overrides the aboveTP options:Fixed pipsYesterday’s wick extreme (high/low)Partial exit on the wick (TP1), then second exit (TP2) either:At a multiplied RROr at the daily close (“Close of Day”)You can also choose to move SL to breakeven after TP1 is hit.Live Metrics TableIn the upper-right corner it displays in real time:Start of backtest (date of first trade)Number of ✅ Winning trades and ❌ Losing tradesTotal number of tradesWin rate (%)Profit FactorAll within a fixed table layout so it never runs out of rows or columns.