Zeal Terminal Open in Zeal Terminal

Pine Script v5 · Strategy

Open Drive

A Pine Script v5 strategy built on Highest (5), Lowest (5) and SMA (close, 3). It has 4 order rules, 2 entries among them, and trades long and short with the default settings. Exits use a profit target and no stop loss. Each trade is one contract and pays 3.8 commission. It has no settings.

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 Open Drive repaint?
No
No repainting patterns were found in the source. The live replay was not measured: it had no trades to compare.
How did Open Drive 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 code limits trading to a session window, which can leave these candles out. On BTCUSDT 4h it did trade; that row of the markets table below has its figures. A backtest, not investment advice.
Does Open Drive run in Pine Script v6?
No
The v6 version does not run in Zeal Terminal's engine: Pine Script v6 Error at @L90:C3: cannot use 'float' as a condition — Pine Script v6 does not cast 'int' or 'float' to 'bool' implicitly. Wrap it in bool(). The v6 version is shown for reference and is not offered as a download.
Does Open Drive use a stop loss?
No
Its exits set a profit target but no stop.
Does Open Drive run in Zeal Terminal?
Yes
It compiles in 32 ms and runs 1,000 bars in 48 ms, in the browser.

BTCUSDT · 1D · default settings

  • OD_up
  • OD_down
  • 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 (0)
40,00060,00080,000100,000120,000AprJulOct2025AprJulOct2026AprJulOctOD_up$40,000$81,011Equity from $40,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. The engine's host API cannot yet declare a chart's symbol and timeframe, so this page sets them on the engine directly for each market.
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, $40,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

    No stop loss

    strategy.exit is used without a stop, loss or trailing stop.

  • 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.

The script declares no settings.

What it calculates

  • Highest5fbhi · line 19
  • Lowest5fblo · line 20
  • SMAclose, 3ma · line 71

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.

closecloseprice datalowlowprice datahighhighprice datafbhiHighest→ fbhifbloLowest→ fblomaSMA→ maeu_sev, eu_eig, us_one, us_twoeu_sev · eu_eig +24 valuesfbrfbrvaluebsbsvaluessssvalueentry:elOpen elstrategy.entryexit:exexit exstrategy.exitentry:esOpen esstrategy.entryplot:51OD_upplotplot:69OD_downplot

Order rules

OrderFires whenBy defaultLine
Open el longOD_UpOn103
Exit ex limitta.barssince(OD_Up)> 3On105
Open es shortOD_DownOn108
Exit ex limitta.barssince(OD_Down)> 3On110

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

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 4h−13.1%+5.5%633%0.1416.7%8 May 2026 – 21 Oct 2026
ETHUSDT 1D0.0%+9.8%00%—0.0%26 Jan 2024 – 21 Oct 2026
ETHUSDT 4h−0.4%+8.4%520%0.360.5%8 May 2026 – 21 Oct 2026
SOLUSDT 1D0.0%+16.7%00%—0.0%26 Jan 2024 – 21 Oct 2026
SOLUSDT 4h−0.1%+21.5%30%0.000.1%8 May 2026 – 21 Oct 2026
BNBUSDT 1D0.0%+148.3%00%—0.0%26 Jan 2024 – 21 Oct 2026
BNBUSDT 4h−0.4%+17.1%40%0.000.4%8 May 2026 – 21 Oct 2026

Backtests are simulations on historical data and are not investment advice.

Similar scripts

Indicators and strategies built from the same calculations, run on BTCUSDT 1D with their own defaults so they can be compared directly.

ScriptSharesTypeNetTradesMax drawdown
Open Drive this page—v5 strategy0.0%00.0%
ChBrkOutStrategySMA by anshuanshu333sma highest lowestv4 strategy−4.5%4220.9%
KDJ Strategy @ionvolution by ionvolutionsma highest lowestv5 strategyNo trades on this market
Trading range display with Box by potatoshopsma highest lowestv5 strategy+0.7%273.9%
Trend Bounce [racer8] by racer8highest lowest smav4 strategy+2.4%2232.2%
Lawyers Trend Pro Strategy by ErdemDemirsma lowest highestv4 strategy+12.1%10241.7%

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?

No

The v6 version does not run in Zeal Terminal's engine: Pine Script v6 Error at @L90:C3: cannot use 'float' as a condition — Pine Script v6 does not cast 'int' or 'float' to 'bool' implicitly. Wrap it in bool(). The v6 version is shown for reference and is not offered as a download. It differs from the v5 version by 1 edit.

⋯// © Marcns_-//@version=5+//@version=6// a script that highlights open drives around cash market opens throughout the day⋯

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 32 msWith a workaround 1,000 bars in 48 msNot measured
PineTSNot testedNot testedNot measured

The engine's host API cannot yet declare a chart's symbol and timeframe, so this page sets them on the engine directly for each market.

“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/// © Marcns_//@version=5// a script that highlights open drives around cash market opens throughout the day// this indicator identifies the following cash open, open drives 0700 - 0715 / 0800 - 0815 / 1300 - 1315 / 1430 - 1445 // an open drive is when a cash market opens and price runs either up or down away from the opening price, often this will be the high or the low the remainer of the session or day// and often identify a trend sessionstrategy("Open Drive", commission_type =  strategy.commission.cash_per_contract, commission_value = 3.8, initial_capital = 40000 )// open drive filter times - all times GMTeu_sev = time(timeframe.period, "0700-0715", "GB")eu_eig = time(timeframe.period, "0800-0815", "GB")us_one = time(timeframe.period, "1300-1315", "GB")us_two = time(timeframe.period, "1430-1445", "GB")// identify bar that opens at low and closes at high + vice versa // bar needs to open at one extreme and close at another TrndExThreshold_Open = 0.15TrndExThreshold_Close = 0.15// add a bar range expansion filter - range of bar correlates to volume, high volume = wider range. This script will be able to filter for a break of a 5 bar range +100% or -100%fbhi = ta.highest(5)fblo = ta.lowest(5)fbr = (fbhi - fblo)RangeEx_up = 0.0if high >= (fbhi[1] + fbr[1])    RangeEx_up := 1.0else    na// range ex downRangeEx_do = 0.0if low <= (fblo[1] - fbr[1])     RangeEx_do := 1.0else    na//#1 open within 5% of lowOpenAtLow = 0.0 if (close > open) and (open-low) / (high-low) < TrndExThreshold_Open    OpenAtLow := 1.0else     na //#2 close within 5% of high    CloseAtHigh = 0.0if (close > open) and (high-close) / (high-low) < TrndExThreshold_Close    CloseAtHigh := 1.0else    na OD_Up = 0.0if (OpenAtLow + CloseAtHigh + RangeEx_up == 3.0) and ( eu_sev or eu_eig or us_one or us_two)    OD_Up := 1else    naplot(OD_Up, title = "OD_up")OpenAtHigh = 0.0 if (close < open) and (high-open) / (high-low) < TrndExThreshold_Open    OpenAtHigh := 1.0else     na //#2 close within 5% of high    CloseAtLow = 0.0if (close < open) and (close-low) / (high-low) < TrndExThreshold_Close    CloseAtLow := 1.0else    na OD_Down = 0.0if (OpenAtHigh + CloseAtLow + RangeEx_do == 3.0) and ( eu_sev or eu_eig or us_one or us_two)    OD_Down := -1else    naplot(OD_Down, title = "OD_down", color = color.red)//3smama = ta.sma(close,3)// one time framing - highlight bars the make a series of lower highs or higher lows to identify trend // one time frame up otf_u = 0.0if close > ma and close[1] > ma[1]    otf_u := 1else    na// one time frame down otf_d = 0.0if close < ma and close[1] < ma[1]    otf_d := 1else    na//bgcolor(otf_u ? color.rgb(76, 175, 79, 70) : na)//bgcolor(otf_d ? color.rgb(255, 82, 82, 66) : na)// record high and low of entry bar into variable for absolute stop// buy stopbs = 0.0if OD_Up    bs := low[1]else    na// sell stopss = 0.0if OD_Down    ss := high[1]else    na// strategy entry and exits // longif OD_Up    strategy.entry("el", strategy.long, 2)if ta.barssince(OD_Up)> 3     strategy.exit(id = "ex" , from_entry = "el", limit = close)// short if OD_Down    strategy.entry("es", strategy.short, 2)if ta.barssince(OD_Down)> 3    strategy.exit(id = "ex" , from_entry = "es", limit = close)