PROTECTED SOURCE SCRIPT
已更新 0-5 Box Strategy Tester v4

🟩 0-5 Box Strategy Tester v4 — Explained Simply
This script is a modular hourly breakout strategy designed to help traders test and trade breakouts (or pullbacks) from the first 5-minute range of any selected hour. It supports both long and short positions and is optimized for scalping or intraday strategies.
🔑 Core Strategy Logic
Box Formation: At the start of every hour, the script tracks the high and low of the first 5 minutes (e.g., from 9:00 to 9:04).
Trade Trigger: Once price breaks out above or below this 5-minute box (either instantly or after a pullback), it can trigger a long or short entry depending on your settings.
Entry Type: Supports two main styles:
Breakout entry: Buy/sell as soon as price breaks the box.
Pullback re-entry: Wait for price to break the box, pull back, then re-enter on a limit order.
🧪 Smart Entry Filters (Optional but Powerful)
You can refine your trades using several filters:
✅ Previous Hour Direction – Only trade in the direction of the last hour’s candle (bullish/bearish).
🔄 Reversal Filter – Only trade against the previous hour’s direction.
💧 Liquidity Sweep – Require the previous hour’s high or low to be swept first (liquidity-based entry).
🔁 Q2 Confirmation (15–30 min logic) – Confirm price action in the second quarter of the hour (like retests or wick-based logic).
🕒 Max Entry Time – Prevent late trades within the hour (e.g., no entries after minute 45).
📦 Max Range % – Avoid trading during overly volatile hours by filtering out wide boxes.
🕘 Flexible Hour Selection
You can choose to:
Trade all hours
Or select specific hours manually (like 4AM, 9AM, etc.)
📉 Risk & Position Sizing Options
Supports stop-loss and take-profit by:
Points
Percentage
Risk:Reward Ratio
Choose fixed contract size or auto-size based on dollar risk.
📊 Built-In Analytics
The strategy tracks and displays:
Win rate
PnL (total, by hour, by day)
Average drawdown
Risk metrics (Expectancy, Profit Factor, Payoff Ratio)
Hour-by-hour stats (how each hour performs historically)
Day-of-week performance
Visual tables on chart for easy analysis
🧠 Use Cases
This strategy is ideal for:
Futures traders (like NQ/ES/GC) who trade specific sessions (e.g., NY open, London)
Scalpers looking for tight breakouts or pullbacks
Systematic traders backtesting precision setups
Traders using confluence like session breaks, liquidity sweeps, and inside-hour confirmations
This script is a modular hourly breakout strategy designed to help traders test and trade breakouts (or pullbacks) from the first 5-minute range of any selected hour. It supports both long and short positions and is optimized for scalping or intraday strategies.
🔑 Core Strategy Logic
Box Formation: At the start of every hour, the script tracks the high and low of the first 5 minutes (e.g., from 9:00 to 9:04).
Trade Trigger: Once price breaks out above or below this 5-minute box (either instantly or after a pullback), it can trigger a long or short entry depending on your settings.
Entry Type: Supports two main styles:
Breakout entry: Buy/sell as soon as price breaks the box.
Pullback re-entry: Wait for price to break the box, pull back, then re-enter on a limit order.
🧪 Smart Entry Filters (Optional but Powerful)
You can refine your trades using several filters:
✅ Previous Hour Direction – Only trade in the direction of the last hour’s candle (bullish/bearish).
🔄 Reversal Filter – Only trade against the previous hour’s direction.
💧 Liquidity Sweep – Require the previous hour’s high or low to be swept first (liquidity-based entry).
🔁 Q2 Confirmation (15–30 min logic) – Confirm price action in the second quarter of the hour (like retests or wick-based logic).
🕒 Max Entry Time – Prevent late trades within the hour (e.g., no entries after minute 45).
📦 Max Range % – Avoid trading during overly volatile hours by filtering out wide boxes.
🕘 Flexible Hour Selection
You can choose to:
Trade all hours
Or select specific hours manually (like 4AM, 9AM, etc.)
📉 Risk & Position Sizing Options
Supports stop-loss and take-profit by:
Points
Percentage
Risk:Reward Ratio
Choose fixed contract size or auto-size based on dollar risk.
📊 Built-In Analytics
The strategy tracks and displays:
Win rate
PnL (total, by hour, by day)
Average drawdown
Risk metrics (Expectancy, Profit Factor, Payoff Ratio)
Hour-by-hour stats (how each hour performs historically)
Day-of-week performance
Visual tables on chart for easy analysis
🧠 Use Cases
This strategy is ideal for:
Futures traders (like NQ/ES/GC) who trade specific sessions (e.g., NY open, London)
Scalpers looking for tight breakouts or pullbacks
Systematic traders backtesting precision setups
Traders using confluence like session breaks, liquidity sweeps, and inside-hour confirmations
發行說明
Fixed load times受保護腳本
此腳本以閉源形式發佈。 不過,您可以自由且不受任何限制地使用它 — 在此處了解更多資訊。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
受保護腳本
此腳本以閉源形式發佈。 不過,您可以自由且不受任何限制地使用它 — 在此處了解更多資訊。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。