Zeal Terminal Open in Zeal Terminal

Pine Script v5 · Strategy

Breakeven Line Demo

A Pine Script v5 strategy with no technical-analysis calculation. It has 3 order rules, 2 entries among them, and trades long and short with the default settings. Exits wait for a signal; there is no stop loss. Each trade commits 0.27% of equity and pays no 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 Breakeven Line Demo repaint?
No
No repainting patterns were found in the source, and a live tick-by-tick replay matched history on 2 of 2 trades.
How did Breakeven Line Demo do on BTCUSDT 1D with default settings?
+0.25%
From 26 Jan 2024 to 21 Oct 2026, over 7 closed trades, against +102.5% for buy and hold. A backtest, not investment advice.
Does Breakeven Line Demo run in Pine Script v6?
No
The v6 version does not run in Zeal Terminal's engine: Pine Script v6 Error at @L27:C28: 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 Breakeven Line Demo use a stop loss?
No
Every exit waits for a signal; nothing limits a losing trade before it fires.
Does Breakeven Line Demo run in Zeal Terminal?
Yes
It compiles in 15 ms and runs 1,000 bars in 40 ms, in the browser.

BTCUSDT · 1D · default settings

  • 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 (0)
0.0050,000100,000AprJulOct2025AprJulOct2026AprJulOct$10,036$20,253Equity from $10,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. Zeal Terminal's engine currently reads an order side written as direction = strategy.long, direction = strategy.short as a short, whatever it says; this page passes the same side as strategy.long or strategy.short (lines 11, 13) so the engine trades the way the script says.
Net profit
+0.25%
$25.35
Buy and hold
+102.5%
same period
Closed trades
7
5 won · 2 lost
Profitable
71.4%
of closed trades
Profit factor
2.95
gross profit ÷ gross loss
Max drawdown
1.11%
−$111.44

One run with the author's default settings, $10,000 starting capital, commission as the script sets it. A long position was still open at the last bar. 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

    Every exit waits for a signal. Nothing limits a losing trade before the exit condition fires.

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

The script declares no settings.

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.

closecloseprice dataopenopenprice databreakEvenLinebreakEvenLinevaluesevenRedssevenRedsconditionsevenGreenssevenGreensconditionred, greenred · green2 conditionsbreakEvenLineColorColourbreakEvenLineColorentry:BuyOpen Buystrategy.entryentry:SellOpen Sellstrategy.entryclose_all:Closeclose_all Closestrategy.close_allplot:27plotplot

Order rules

OrderFires whenBy defaultLine
Open Buy longsevenRedsOn11
Open Sell shortsevenGreensOn13
Close Close(hour == 5 and minute == 0 ) or (hour == 11 and minute == 0) or (hour == 17 and minute == 0 ) or (hour == 23 and minute == 0)On15

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, and the live replay matched history.

2/2trades identical when replayed liveThe last 300 bars, from 26 Dec 2025, were fed to the engine as live ticks, four per bar, and compared with the historical run. Orders are decided once per closed bar, so nothing can change mid-bar.
  • 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 1D+0.3%+102.5%771%2.951.1%26 Jan 2024 – 21 Oct 2026
BTCUSDT 4h−0.1%+5.5%1242%0.400.3%8 May 2026 – 21 Oct 2026
ETHUSDT 1D+0.9%+9.8%7100%—0.4%26 Jan 2024 – 21 Oct 2026
ETHUSDT 4h+0.1%+8.4%560%6.750.1%8 May 2026 – 21 Oct 2026
SOLUSDT 1D+1.3%+16.7%7100%—0.2%26 Jan 2024 – 21 Oct 2026
SOLUSDT 4h+0.8%+21.5%5100%—0.1%8 May 2026 – 21 Oct 2026
BNBUSDT 1D0.0%+148.3%00%—1.7%26 Jan 2024 – 21 Oct 2026
BNBUSDT 4h+0.3%+17.1%6100%—0.1%8 May 2026 – 21 Oct 2026

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

The trades

By market direction

At entry, last 90 barsTradesWonP&L
Rising market450%$6.31
Sideways market3100%$19.04
Falling market0—$0.00

Rising and falling mean the market moved more than 15% over the 90 bars before entry.

How bad could the drawdown be?

0.1%

The 95th percentile of the worst drawdown when the same 7 trades are reshuffled 5,000 times. The bar spans the 5th to 95th percentile, 0.1% to 0.1%; the tick is what actually happened, 0.1%. Order luck alone moves it this much.

0%1%
All 7 trades
SideEntryExitBarsP&L
short12 Feb 2024 48,300.007 Jun 2026 60,884.60846−$7.03
short13 Feb 2024 49,917.307 Jun 2026 60,884.60845−$5.93
short12 Nov 2024 88,648.007 Jun 2026 60,884.60572$8.42
short7 Jan 2025 102,236.007 Jun 2026 60,884.60516$10.85
short26 Apr 2025 94,638.707 Jun 2026 60,884.60407$9.58
short16 Mar 2026 72,815.307 Jun 2026 60,884.6083$4.42
short17 Mar 2026 74,884.707 Jun 2026 60,884.6082$5.04

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?

No

The v6 version does not run in Zeal Terminal's engine: Pine Script v6 Error at @L27:C28: 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.

⋯// © Eliza123123-//@version=5+//@version=6strategy("Breakeven Line Demo", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value = 0.27,⋯

Where it runs

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

Zeal Terminal's engine currently reads an order side written as direction = strategy.long, direction = strategy.short as a short, whatever it says; this page passes the same side as strategy.long or strategy.short (lines 11, 13) so the engine trades the way the script says.

“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/// © Eliza123123//@version=5strategy("Breakeven Line Demo", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value = 0.27, pyramiding=999, initial_capital=10000, commission_type=strategy.commission.percent, commission_value=0.00)// Generic signal (not a viable strategy don't use, just some code I wrote quick for demo purposes only)red = open > close, green = open < closesevenReds = red and red[1] and red[2] and red[3] and red[4] and red[5] and red[6]sevenGreens = green and green[1] and green[2] and green[3] and green[4] and green[5] and green[6]if sevenReds    strategy.entry('Buy', direction=strategy.long)if sevenGreens    strategy.entry('Sell', direction=strategy.short)if (hour == 5 and minute == 0 ) or (hour == 11 and minute == 0) or (hour == 17 and minute == 0 ) or (hour == 23 and minute == 0)     strategy.close_all("Close")// Breakeven line for visualising breakeven price on stacked orders.  var breakEvenLine = 0.0if strategy.opentrades > 0     breakEvenLine := strategy.position_avg_priceelse    breakEvenLine := 0.0color breakEvenLineColor = naif strategy.position_size > 0    breakEvenLineColor := #15FF00if strategy.position_size < 0    breakEvenLineColor := #FF000Dplot(breakEvenLine, color = breakEvenLine and breakEvenLine[1] > 0 ? breakEvenLineColor : na, linewidth = 2, style = plot.style_circles)