OPEN-SOURCE SCRIPT

Daybreak Strategy [Achira Meegasthanne]

856
Daybreak Strategy

Daybreak Strategy is an Opening Range Breakout (ORB) strategy designed to capture potential directional moves based on the high and low of the 9:00 opening candle on the 1-hour timeframe.

The strategy places breakout stop orders above and below the opening range, with the entry distance dynamically adjusted using ATR and the selected Sensitivity.

🔹 KEY FEATURES

⏱️ 1-HOUR TIMEFRAME

The strategy is specifically designed to operate on the 1-hour timeframe.

The opening range is taken from the 9:00 candle, making the 1H timeframe important for the intended ORB calculation.

📊 OPENING RANGE BREAKOUT

The strategy records:

• Opening Range High
• Opening Range Low
• Opening Range Range
• Opening Range Midpoint

These levels are displayed in the on-chart dashboard and used to establish potential breakout entries.

🟢 LONG BREAKOUT

A Long stop order is placed above the Opening Range High.

The entry level is calculated using:

Opening Range High + ATR × Sensitivity

This allows the breakout distance to adapt to current market volatility.

🔴 SHORT BREAKOUT

A Short stop order is placed below the Opening Range Low.

The entry level is calculated using:

Opening Range Low − ATR × Sensitivity

This provides a volatility-adjusted downside breakout level.

⚙️ CUSTOMIZABLE SETTINGS

The strategy provides several user-controlled settings:

• Sensitivity
• Take Profit
• Stop Loss
• Up Color
• Down Color
• Dashboard
• Dashboard Size
• Dashboard Color

The default Sensitivity is 0.5.

🎯 TAKE PROFIT & STOP LOSS

Each Long and Short entry uses predefined Take Profit and Stop Loss values.

Default settings:

• Take Profit = 40 ticks
• Stop Loss = 25 ticks

These values can be adjusted according to the user's preferred testing configuration.

📈 ATR-BASED ENTRY

The strategy uses a 14-period ATR to dynamically calculate the distance between the opening range and the breakout entry level.

This allows the entry distance to respond to changing market volatility.

🌅 DAILY OPENING RANGE

The opening range is reset at the beginning of each new trading day.

The 9:00 candle high and low are captured once per day and used as the day's Opening Range levels.

🔄 ONE-TIME ORDER PLACEMENT

The strategy places the Long and Short breakout orders only once after the Opening Range has been established.

This prevents repeated placement of the same breakout orders during the session.

⏰ END-OF-DAY ORDER CANCELLATION

Untriggered Long and Short stop orders are cancelled during the defined end-of-session period around 21:30–22:00.

This prevents remaining breakout orders from continuing indefinitely after the intended trading session.

📍 VISUAL BREAKOUT LEVELS

The Opening Range High and Opening Range Low are plotted on the chart as step-style levels.

• Buy Stop level = Opening Range High
• Sell Stop level = Opening Range Low

These levels make the daily breakout structure easy to identify visually.

📋 TRADING DASHBOARD

The strategy includes an on-chart dashboard displaying important Opening Range information.

The dashboard can show:

• Current Bias
• Opening Range High
• Opening Range Low
• Opening Range Range
• Opening Range Mid

The dashboard also displays a message when the strategy is not being used on the 1-hour timeframe.

🧭 MARKET BIAS

The strategy determines a directional bias from the 9:00 opening candle.

The dashboard displays either:

Long

or

Short

based on the opening candle's relationship between its Close and Open.

📊 PERFORMANCE STATISTICS

The strategy includes a statistics dashboard containing:

• Total Trades
• Win Rate
• Starting Capital
• Ending Capital
• Average Win
• Average Loss
• Profit Factor
• Max Runup
• Return
• Max Drawdown

These statistics provide a quick overview of the strategy's historical backtest performance.

💰 PROFIT & LOSS ANALYSIS

The performance section uses the strategy's calculated trading results to display:

• Net Profit
• Gross Profit
• Gross Loss
• Winning Trades
• Losing Trades
• Return Percentage
• Profit Factor

This allows users to evaluate the historical performance directly from the chart.

🧠 HOW IT WORKS

1. Detect New Trading Day

The strategy resets the Opening Range variables at the beginning of each new day.

2. Capture the 9:00 Candle

The high and low of the 9:00 candle are recorded as the day's Opening Range High and Opening Range Low.

3. Calculate ATR

A 14-period ATR is used to measure current market volatility.

4. Calculate Breakout Levels

Long and Short stop orders are positioned around the Opening Range using ATR multiplied by Sensitivity.

5. Wait for Breakout

A Long position can be triggered when price reaches the upper breakout level.

A Short position can be triggered when price reaches the lower breakout level.

6. Apply Risk Management

Take Profit and Stop Loss values are applied to the corresponding position.

7. Cancel Remaining Orders

Untriggered breakout orders are cancelled during the defined end-of-day session.

8. Display Performance

The dashboard provides Opening Range information and historical strategy statistics.

📌 CORE CONCEPT

9:00 Opening Range → ATR Adjustment → Breakout Stop Orders → Take Profit / Stop Loss → End-of-Day Management

⚠️ IMPORTANT DISCLAIMER

This strategy is provided for market analysis, backtesting, and educational purposes.

Historical strategy performance does not guarantee future results.

Backtest statistics such as Win Rate, Profit Factor, Return, and Max Drawdown can vary significantly depending on the market, timeframe, trading session, and selected inputs.

Always perform your own analysis, apply proper risk management, and thoroughly test the strategy before using it with real capital.

Capture the opening range. Wait for the breakout. Let volatility define the entry.

免責事項

これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。