Pine Script v5 · Strategy
Pro Trading Art Open Range Breakout Strategy
A Pine Script v5 strategy with no technical-analysis calculation. It has 5 order rules, 2 entries among them, and trades long and short with the default settings. Exits use a stop loss and a profit target. Each trade is one contract and pays no commission. 19 settings; defaults include Open Range % 0.4, Start Hour 9 and Start Minute 15.
Generated from the script's code by a template: every clause is a fact read from the source. Not written by a person or a model, and not taken from the author's description.
- Does Pro Trading Art Open Range Breakout Strategy repaint?
- No
- No repainting patterns were found in the source. The live replay was not measured: it had no trades to compare.
- How did Pro Trading Art Open Range Breakout Strategy do on BTCUSDT 1D with default settings?
- Not measured
- It closed no trades there from 26 Jan 2024 to 21 Oct 2026 with the default settings, so there is no result to report. Its entry conditions never all held on this data. It closed no trades on the other markets either. A backtest, not investment advice.
- What alerts does Pro Trading Art Open Range Breakout Strategy have?
- 2
- longMsg; shortMsg.
- Does Pro Trading Art Open Range Breakout Strategy run in Pine Script v6?
- Not tested
- Neither version placed a trade on any of the 8 markets, so there was nothing to compare. The v6 version is shown for reference and is not offered as a download.
- Does Pro Trading Art Open Range Breakout Strategy use a stop loss?
- Yes
- strategy.exit sets a stop on line 98, 100.
BTCUSDT · 1D · default settings
- Plot
- Plot
- Winning trade
- Losing trade
- Equity
- Buy and hold
- Net profit
- 0.00%
- $0.00
- Buy and hold
- +102.5%
- same period
- Closed trades
- 0
- 0 won · 0 lost
- Profitable
- 0.0%
- of closed trades
- Profit factor
- —
- gross profit ÷ gross loss
- Max drawdown
- 0.00%
- $0.00
One run with the author's default settings, $1,000,000 starting capital, commission as the script sets it. A single backtest says little about future results and is not a recommendation. Backtests are simulations on historical data and are not investment advice.
Review
What a careful reader of this script would point out, found by checking the source and the backtest.
-
Check
1 setting does nothing
“Stop Hour” is declared but never read.
-
Check
No commission
The backtest assumes free trading. Results on any real exchange will be lower.
-
Note
No slippage
Fills are assumed at the exact open price. Add slippage in the properties for a more realistic test.
Settings
Every input the script declares, with its default and what it feeds. Bounds are the ones the script enforces.
| Setting | Default | Type and range | Feeds |
|---|---|---|---|
| Indicator Settings | |||
| Open Range % | 0.4 | float · step 0.1 | validOpen |
| Start Trade AT | |||
| Start Hour | 9 | int | isStart |
| Start Minute | 15 | int | isStart |
| Stop New Trade At | |||
| Stop Hour | 14 | int | unused |
| Close All Trade At | |||
| End Hour | 15 | int | isEnd |
| End Minute | 0 | int | isEnd |
| Close All Trade | true | bool | close_all line 103 |
| Plot Range | |||
| Show High | true | bool | plot |
| Show Low | true | bool | plot |
| Strategy Settings | |||
| Buffer | 0.0 | float | High Low |
| Trade Gap | 100 | float | line 89 line 91 |
| Min Profit Point After Trade Gap | 50 | float | longSL shortSL |
| Trade Mode | Percent | string · options ["Point", "Percent"] | line 79 line 84 |
| Stop Loss Point Or Percent | 1 | float | longSL shortSL |
| Target Point Or Percent | 2 | float | longTarget shortTarget |
| Alert Message Settings | |||
| Long MSG | Long | string | entry Long alert |
| Short SMG | Short | string | entry Short alert |
| Long Exit SMG | Long Exit | string | exit Long Exit |
| Short Exit MSG | Short Exit | string | exit Short Exit |
What it calculates
No technical-analysis calculation: the script works on prices and settings directly.
Signal flow
How price data and settings reach the orders. Each box is a name in the script, or several computed the same way; each arrow is a value one of them reads. Hover a box for its members.
Order rules
| Order | Fires when | By default | Line |
|---|---|---|---|
| Open Long long | longCondition and validOpen | On | 94 |
| Open Short short | shortCondition and validOpen | On | 96 |
| Exit Long Exit stop and limit | strategy.position_size > 0 | On | 98 |
| Exit Short Exit stop and limit | strategy.position_size < 0 | On | 100 |
| Close | isEnd and isCloseAll | On | 104 |
Each order is guarded by the setting shown. “Off” orders never fire unless that setting is switched on.
Alerts
| Alert | Call | Message | Line |
|---|---|---|---|
| (no title) | alert | longMsg | 110 |
| (no title) | alert | shortMsg | 112 |
Does it repaint?
No
No repainting patterns in the source.
- ClearHigher-timeframe dataThe script requests no other symbol or timeframe.
- ClearFuture-bar referencesNo negative history offsets such as close[-1].
- ClearIntrabar recalculationNo varip, calc_on_every_tick or realtime-only state. Orders are decided once per closed bar.
- ClearOrder timingOrders fill at the next bar's open, after the signal bar has closed.
The checks read the source; the replay runs it. Together they catch the common causes, not every possible one.
Other markets
The same script with default settings on 8 Binance markets. Each row is a separate backtest over the most recent 1,000 bars.
| Market | Net | Buy and hold | Trades | Won | Profit factor | Max drawdown | Period |
|---|---|---|---|---|---|---|---|
| BTCUSDT 1D | 0.0% | +102.5% | 0 | 0% | — | 0.0% | 26 Jan 2024 – 21 Oct 2026 |
| BTCUSDT 4h | 0.0% | +5.5% | 0 | 0% | — | 0.0% | 8 May 2026 – 21 Oct 2026 |
| ETHUSDT 1D | 0.0% | +9.8% | 0 | 0% | — | 0.0% | 26 Jan 2024 – 21 Oct 2026 |
| ETHUSDT 4h | 0.0% | +8.4% | 0 | 0% | — | 0.0% | 8 May 2026 – 21 Oct 2026 |
| SOLUSDT 1D | 0.0% | +16.7% | 0 | 0% | — | 0.0% | 26 Jan 2024 – 21 Oct 2026 |
| SOLUSDT 4h | 0.0% | +21.5% | 0 | 0% | — | 0.0% | 8 May 2026 – 21 Oct 2026 |
| BNBUSDT 1D | 0.0% | +148.3% | 0 | 0% | — | 0.0% | 26 Jan 2024 – 21 Oct 2026 |
| BNBUSDT 4h | 0.0% | +17.1% | 0 | 0% | — | 0.0% | 8 May 2026 – 21 Oct 2026 |
Backtests are simulations on historical data and are not investment advice.
Similar scripts
No other indicator or strategy here shares enough of its calculations.
Upgrade and export
Written in Pine Script v5. The clean-v5 step types the settings and moves when = into if blocks, which v6 requires; it is run before and after like any upgrade.
- No v6-only features. v6 is not needed to run this script.
Clean v5
VerifiedNothing to change.
Does it run in Pine Script v6?
Not tested
Neither version placed a trade on any of the 8 markets, so there was nothing to compare. The v6 version is shown for reference and is not offered as a download. It differs from the v5 version by 1 edit.
⋯// © protradingart-//@version=5+//@version=6strategy('Pro Trading Art Open Range Breakout Strategy', 'PTA - Open Range Breakout Strategy', overlay=true)⋯Where it runs
| Engine | Compiles | Runs | Matches TradingView |
|---|---|---|---|
| Zeal Terminal · OpenPineScript v2 | Yes 49 ms | Yes 1,000 bars in 63 ms | Not measured |
| PineTS | Not tested | Not tested | Not measured |
“Matches TradingView” needs this script's own output exported from TradingView and compared bar by bar, which has not been done for this script. The engine is built on OpenPineScript, whose conformance results are in its conformance report.
Source
Copied verbatim from the author's published script, with its licence header intact. The author may have updated the original since this snapshot.
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/// © protradingart//@version=5strategy('Pro Trading Art Open Range Breakout Strategy', 'PTA - Open Range Breakout Strategy', overlay=true)//#region ///////////// User INput Section ////////////////////////////openRange = input.float(0.4, "Open Range %", step=0.1, group="=============== Indicator Settings ===============")///////////////////////////////////// Start, Stop & Close Time Input Section /////////////////////////////////////////////////startH = input.int(9, "Start Hour", inline='start', group="========= Start Trade AT =========")startM = input.int(15, "Start Minute", inline='start', group="========= Start Trade AT =========")stopNewTrade = input.int(14, "Stop Hour", inline='start', group="========= Stop New Trade At =========")endH = input.int(15, "End Hour", inline='end', group="========= Close All Trade At =========")endM = input.int(0, "End Minute", inline='end', group="========= Close All Trade At =========")isCloseAll = input.bool(true, "Close All Trade", group="========= Close All Trade At =========")isHighV = input.bool(true, "Show High", inline="range", group="========= Plot Range =========")isLowV = input.bool(true, "Show Low", inline="range", group="========= Plot Range =========")buffer = input.float(0.0, "Buffer", group="========= Strategy Settings =========")tradeGap = input.float(100, "Trade Gap", group="========= Strategy Settings =========")gapBook = input.float(50, "Min Profit Point After Trade Gap", group="========= Strategy Settings =========")//#endregion///////////////////////////////////// Configure isStart & isEnd /////////////////////////////////////////////////isStart = hour == startH and minute == startMisEnd = hour == endH and minute == endMvar High = 0.0var Low = 0.0if isStart Low := low - buffer High := high + bufferplot(isHighV ? High : na, color=color.lime)plot(isLowV ? Low : na, color=color.red)validOpen = math.abs((High - Low)/Low*100) >= openRange//#region ////////////////////// Session ///////////////////////////////////var start = falseif isStart start := trueif isEnd start := falsevar longCondition = falsevar shortCondition = falsevar isLongTrade = falsevar isShortTrade = falseif strategy.position_size > 0 isLongTrade := trueif strategy.position_size < 0 isShortTrade := true if close > High and start longCondition := trueif close < Low and start shortCondition := trueif isLongTrade longCondition := falseif isShortTrade shortCondition := false if isEnd isLongTrade := false isShortTrade := false longCondition := false shortCondition := false//#endregion////////////////////////////////////////////////////////////////////////////////////////////////////////////////Message alert inputsalertGroup = "========= Alert Message Settings ========="longMsg = input.string("Long", "Long MSG", group = alertGroup)shortMsg = input.string("Short", "Short SMG", group = alertGroup)longExitMsg = input.string("Long Exit", "Long Exit SMG", group = alertGroup)shortExitMsg = input.string("Short Exit", "Short Exit MSG", group = alertGroup)//#region ////////////////////////////////////////// Execute Trade Section ////////////////////////////////////////////////////////tradeMode = input.string("Percent", "Trade Mode", options=["Point", "Percent"], group="========= Strategy Settings =========")sl = input.float(1, "Stop Loss Point Or Percent", group="========= Strategy Settings =========")target = input.float(2, "Target Point Or Percent", group="========= Strategy Settings =========")entry_price = strategy.opentrades.entry_price(strategy.opentrades - 1) longSL = 0.0shortSL = 0.0longTarget = 0.0shortTarget = 0.0if tradeMode == "Percent" longSL := entry_price - entry_price * sl/100 shortSL := entry_price + entry_price * sl/100 longTarget := entry_price + entry_price * target/100 shortTarget := entry_price - entry_price * target/100if tradeMode == "Point" longSL := entry_price - sl shortSL := entry_price + sl longTarget := entry_price + target shortTarget := entry_price - targetif strategy.position_size > 0 and close[1] > (entry_price + tradeGap) longSL := entry_price + gapBookif strategy.position_size < 0 and close[1] < (entry_price - tradeGap) shortSL := entry_price - gapBookif longCondition and validOpen strategy.entry("Long", strategy.long, alert_message=longMsg)if shortCondition and validOpen strategy.entry("Short", strategy.short, alert_message=shortMsg)if strategy.position_size > 0 strategy.exit("Long Exit", "Long", stop=longSL, limit= longTarget, comment_loss="Long SL", comment_profit="Long Profit", alert_message=longExitMsg)if strategy.position_size < 0 strategy.exit("Short Exit", "Short", stop=shortSL, limit= shortTarget, comment_loss="Short SL", comment_profit="Short Profit", alert_message=shortExitMsg) if isEnd and isCloseAll strategy.close_all(comment="Closing Bell") //#endregion //#region ////////////////////////////////////////// Alert Section ////////////////////////////////////////////////////////if longCondition and validOpen alert(longMsg, alert.freq_once_per_bar_close)if shortCondition and validOpen alert(shortMsg, alert.freq_once_per_bar_close)//#endregion