Zeal Terminal Open in Zeal Terminal

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
Prerendered with the defaults. Change anything and run it here. The script runs in your browser.
Settings (19)
0.0050,000100,000AprJulOct2025AprJulOct2026AprJulOct$1,000,000$2,025,273Equity from $1,000,000
Binance BTCUSDT 1D candles, 26 Jan 2024 to 21 Oct 2026, 1,000 bars, default settings. Triangles mark entries; circles mark exits. Lines are what the script plots.
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.

SettingDefaultType and rangeFeeds
Indicator Settings
Open Range %0.4float · step 0.1validOpen
Start Trade AT
Start Hour9intisStart
Start Minute15intisStart
Stop New Trade At
Stop Hour14intunused
Close All Trade At
End Hour15intisEnd
End Minute0intisEnd
Close All Tradetrueboolclose_all line 103
Plot Range
Show Hightrueboolplot
Show Lowtrueboolplot
Strategy Settings
Buffer0.0floatHigh Low
Trade Gap100floatline 89 line 91
Min Profit Point After Trade Gap50floatlongSL shortSL
Trade ModePercentstring · options ["Point", "Percent"]line 79 line 84
Stop Loss Point Or Percent1floatlongSL shortSL
Target Point Or Percent2floatlongTarget shortTarget
Alert Message Settings
Long MSGLongstringentry Long alert
Short SMGShortstringentry Short alert
Long Exit SMGLong Exitstringexit Long Exit
Short Exit MSGShort Exitstringexit 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.

highhighprice databufferBuffersetting · 0.0lowlowprice dataslStop Loss Point Or Perc…setting · 1gapBookMin Profit Point After …setting · 50targetTarget Point Or Percentsetting · 2endHEnd Hoursetting · 15endMEnd Minutesetting · 0openRangeOpen Range %setting · 0.4startHStart Hoursetting · 9startMStart Minutesetting · 15longMsgLong MSGsetting · LongshortMsgShort SMGsetting · ShortHighHighvalueLowLowvalueentry_priceentry_pricevaluelongSL, shortSLlongSL · shortSL2 valueslongTarget, shortTargetlongTarget · shortTarget2 valuesisEndisEndconditionvalidOpenvalidOpenconditionisStartisStartconditionentry:LongOpen Longstrategy.entryentry:ShortOpen Shortstrategy.entryexit:Long Exitexit Long Exitstrategy.exitexit:Short Exitexit Short Exitstrategy.exitclose_all:close_all strategy.close_allplot:28plotplotplot:29plotplotalert:110alertalertalert:112alertalert

Order rules

OrderFires whenBy defaultLine
Open Long longlongCondition and validOpenOn94
Open Short shortshortCondition and validOpenOn96
Exit Long Exit stop and limitstrategy.position_size > 0On98
Exit Short Exit stop and limitstrategy.position_size < 0On100
Close isEnd and isCloseAllOn104

Each order is guarded by the setting shown. “Off” orders never fire unless that setting is switched on.

Alerts

AlertCallMessageLine
(no title)alertlongMsg110
(no title)alertshortMsg112

Does it repaint?

No

No repainting patterns in the source.

Not measuredNo trades to compareThe last 300 bars, from 26 Dec 2025, were fed to the engine as live ticks, but neither the live nor the historical run produced any trades in them, so the replay says nothing either way.
  • 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.

MarketNetBuy and holdTradesWonProfit factorMax drawdownPeriod
BTCUSDT 1D0.0%+102.5%00%—0.0%26 Jan 2024 – 21 Oct 2026
BTCUSDT 4h0.0%+5.5%00%—0.0%8 May 2026 – 21 Oct 2026
ETHUSDT 1D0.0%+9.8%00%—0.0%26 Jan 2024 – 21 Oct 2026
ETHUSDT 4h0.0%+8.4%00%—0.0%8 May 2026 – 21 Oct 2026
SOLUSDT 1D0.0%+16.7%00%—0.0%26 Jan 2024 – 21 Oct 2026
SOLUSDT 4h0.0%+21.5%00%—0.0%8 May 2026 – 21 Oct 2026
BNBUSDT 1D0.0%+148.3%00%—0.0%26 Jan 2024 – 21 Oct 2026
BNBUSDT 4h0.0%+17.1%00%—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

Verified

Nothing 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

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 49 msYes 1,000 bars in 63 msNot measured
PineTSNot testedNot testedNot 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