Zeal Terminal Open in Zeal Terminal

Pine Script v4 · Strategy

STRATEGY TESTER ENGINE - ON CHART DISPLAY - PLUG & PLAY

A Pine Script v4 strategy built on Change (strategy.losstrades) and Lowest (dd, 200). It has 4 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. 4 settings; defaults include Point 1., Order Size 1 and Martingale Multiplier 2..

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 STRATEGY TESTER ENGINE - ON CHART DISPLAY - PLUG & PLAY repaint?
No
No repainting patterns were found in the source, and a live tick-by-tick replay matched history on 299 of 299 trades.
How did STRATEGY TESTER ENGINE - ON CHART DISPLAY - PLUG & PLAY do on BTCUSDT 1D with default settings?
+496.94%
From 26 Jan 2024 to 21 Oct 2026, over 997 closed trades, against +102.5% for buy and hold. A backtest, not investment advice.
Can STRATEGY TESTER ENGINE - ON CHART DISPLAY - PLUG & PLAY be converted to Pine Script v5?
Yes
The upgrade takes 1 step, from v4; each was run before and after on the same candles with identical results, and the v5 script can be downloaded below.
Does STRATEGY TESTER ENGINE - ON CHART DISPLAY - PLUG & PLAY use a stop loss?
Yes
strategy.exit sets a stop on line 26, 29.
Does STRATEGY TESTER ENGINE - ON CHART DISPLAY - PLUG & PLAY run in Zeal Terminal?
Yes
It compiles in 21 ms and runs 1,000 bars in 114 ms, in the browser.

BTCUSDT · 1D · default settings

  • Current Profit(%)
  • Maximum Gained(%)
  • Starting Cap(%)
  • Current Drawdown(%)
  • Max Drawdown(%)
  • Gross Loss(%)
  • Gross Gain(%)
  • Profit Factor
  • Total CLosed Trades
  • Trades Won
  • Trades Lost
  • Profit Percentage(%)
  • 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 (4)
40,00060,00080,000100,000120,000AprJulOct2025AprJulOct2026AprJulOctCurrent Profit(%)$597$203Equity from $100
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
+496.94%
$496.94
Buy and hold
+102.5%
same period
Closed trades
997
498 won · 499 lost
Profitable
49.9%
of closed trades
Profit factor
1.21
gross profit ÷ gross loss
Max drawdown
732.30%
−$1,442.64

One run with the author's default settings, $100 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 commission

    The backtest assumes free trading. Results on any real exchange will be lower.

  • Note

    1 setting has no label

    In the settings dialog point (line 5) shows an empty name. The labels on this page come from the variable names.

  • Note

    No slippage

    Fills are assumed at the exact open price. Add slippage in the properties for a more realistic test.

  • Note

    Uses transp =, which v5 removed line 61

    transp = on line 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73. v5 folds the transparency into the colour with color.new(c, transp).

Upgrade and export

Written in Pine Script v4. The upgrade to v5 takes 1 step, one per version, each applied to the result of the one before. A last clean-v5 pass then types the settings and moves when = into if blocks, which v6 requires. Every step runs before and after on the same candles in Zeal Terminal's engine; a step whose results differ is shown but not offered as a download. Upgrades preserve behaviour: bugs are fixed in the Review, never silently here.

  • Upgrading to v5 renames change → ta.change, max → math.max, lowest → ta.lowest.

v4 → v5

Verified

Same 997 trades and the same P&L on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine.

  • Line 3: //@version=4 → //@version=5
  • Line 15: change → ta.change
  • Line 16: change → ta.change
  • Line 38: in is reserved in v5: renamed in_
  • Line 43: max → math.max
  • Line 45: max → math.max
17 more edits
  • Line 47: max → math.max
  • Line 49: max → math.max
  • Line 51: max → math.max
  • Line 53: lowest → ta.lowest
  • Line 61: transp = 0 → color.new(#2196f3, 0)
  • Line 62: transp = 0 → color.new(css, 0)
  • Line 63: transp = 0 → color.new(color.white, 0)
  • Line 64: transp = 0 → color.new(color.fuchsia, 0)
  • Line 65: transp = 0 → color.new(color.red, 0)
  • Line 66: transp = 0 → color.new(color.red, 0)
  • Line 67: transp = 0 → color.new(color.green, 0)
  • Line 68: transp = 0 → color.new(color.orange, 0)
  • Line 69: transp = 0 → color.new(color.aqua, 0)
  • Line 70: transp = 0 → color.new(color.green, 0)
  • Line 71: transp = 0 → color.new(color.red, 0)
  • Line 72: transp = 0 → color.new(color.lime, 0)
  • Line 73: transp = 55 → color.new(eq <= 0 and dd <= -100 ? color.red : na, 55)
⋯// © alexgrover-//@version=4+//@version=5strategy("Grid System With Fake Martingale",process_orders_on_close=true, initial_capital=100)⋯size = 0.-lossnew = change(strategy.losstrades)+lossnew = ta.change(strategy.losstrades)-win = change(strategy.wintrades)+win = ta.change(strategy.wintrades)if anti⋯gain = strategy.grossprofit //GROSS LOSS SINCE START-in = strategy.initial_capital-100 //STARTING CAPITAL IN PERCENT+in_ = strategy.initial_capital-100 //STARTING CAPITAL IN PERCENTtotal = strategy.closedtrades⋯rmax = 0.-rmax := max(eq,nz(rmax[1]))+rmax := math.max(eq,nz(rmax[1]))lmax = 0.-lmax := max(loss,nz(loss[1]))+lmax := math.max(loss,nz(loss[1]))gmax = 0.-gmax := max(gain,nz(gain[1]))+gmax := math.max(gain,nz(gain[1]))inmax = 0.-inmax := max(in,nz(in[1]))+inmax := math.max(in_,nz(in_[1]))tmax = 0.-tmax := max(total,nz(total[1]))+tmax := math.max(total,nz(total[1]))dd = -((rmax-eq)/rmax*100) //CURRENT DRAWDOWN-ddm = lowest(dd,200) //MAX DRAWDOWN+ddm = ta.lowest(dd,200) //MAX DRAWDOWNpfactor = gmax/lmax //PROFIT FACTOR⋯//-----css = eq > in ? #0cb51a : #e65100+css = eq > in_ ? #0cb51a : #e65100css2 = eq > loss ? color.blue : color.blue⋯css4 = dd > ddm ? color.orange : na-a = plot(eq,"Current Profit(%)",#2196f3,2,transp=0)+a = plot(eq,"Current Profit(%)",color.new(#2196f3, 0),2)-b = plot(rmax,"Maximum Gained(%)",css,2,transp=0)+b = plot(rmax,"Maximum Gained(%)",color.new(css, 0),2)-c = plot(inmax, "Starting Cap(%)", color.white,2,transp=0)+c = plot(inmax, "Starting Cap(%)", color.new(color.white, 0),2)-d = plot(dd, "Current Drawdown(%)", color.fuchsia,2,transp=0)+d = plot(dd, "Current Drawdown(%)", color.new(color.fuchsia, 0),2)-e = plot(ddm, "Max Drawdown(%)", color.red,2,transp=0)+e = plot(ddm, "Max Drawdown(%)", color.new(color.red, 0),2)-plot(lmax, "Gross Loss(%)", color.red,2,transp=0)+plot(lmax, "Gross Loss(%)", color.new(color.red, 0),2)-plot(gmax, "Gross Gain(%)", color.green,2,transp=0)+plot(gmax, "Gross Gain(%)", color.new(color.green, 0),2)-plot(pfactor, "Profit Factor", color.orange,2,transp=0)+plot(pfactor, "Profit Factor", color.new(color.orange, 0),2)-plot(tmax,"Total CLosed Trades", color.aqua,2,transp=0)+plot(tmax,"Total CLosed Trades", color.new(color.aqua, 0),2)-plot(winners,"Trades Won", color.green,2,transp=0)+plot(winners,"Trades Won", color.new(color.green, 0),2)-plot(losers, "Trades Lost", color.red,2,transp=0)+plot(losers, "Trades Lost", color.new(color.red, 0),2)-plot(ppercent,"Profit Percentage(%)", color.lime,2,transp=0)+plot(ppercent,"Profit Percentage(%)", color.new(color.lime, 0),2)-bgcolor(eq <= 0 and dd <= -100 ? color.red : na,title= "LIQUIDATION",transp=55)+bgcolor(color.new(eq <= 0 and dd <= -100 ? color.red : na, 55),title= "LIQUIDATION")fill(a,b,css,80)⋯

Clean v5

VerifiedDownload the v5 script

Same 997 trades and the same P&L on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine.

  • Line 5: input() → input.float()
  • Line 6: input() → input.int()
  • Line 7: input() → input.float()
  • Line 8: input() → input.bool()
⋯strategy("Grid System With Fake Martingale",process_orders_on_close=true, initial_capital=100)-point = input(1.)+point = input.float(1.)-os    = input(1,"Order Size")+os    = input.int(1,"Order Size")-mf    = input(2.,"Martingale Multiplier")+mf    = input.float(2.,"Martingale Multiplier")-anti  = input(false,"Anti Martingale")+anti  = input.bool(false,"Anti Martingale")//------------------------------------------------------------------------------⋯

Does it run in Pine Script v6?

No

The v6 version runs in Zeal Terminal's engine, but its results differ from the v5 version: Trades differ: 997 before, 0 after on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine. It is shown for reference and is not offered as a download. It differs from the v5 version by 1 edit.

⋯// © alexgrover-//@version=5+//@version=6strategy("Grid System With Fake Martingale",process_orders_on_close=true, initial_capital=100)⋯

Settings

Every input the script declares, with its default and what it feeds. Bounds are the ones the script enforces.

SettingDefaultType and rangeFeeds
Point (no label in the script)1.floatbaseline upper lower
Order Size1intsize entry Buy entry Sell
Martingale Multiplier2.floatsize
Anti Martingalefalseboolline 17

What it calculates

  • Change (change, ta.change in v5)strategy.losstradeslossnew · line 15
  • Change (change, ta.change in v5)strategy.wintradeswin · line 16
  • Lowest (lowest, ta.lowest in v5)dd, 200ddm · line 53

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 datapointPointsetting · 1.mfMartingale Multipliersetting · 2.osOrder Sizesetting · 1lossnewChange→ lossnewwinChange→ winddmLowest→ ddmbaselinebaselinevaluesizesizevalueupper, lowerupper · lower2 valueseq, loss, gain, in, total, winners, loserseq · loss +57 valuesrmax, ddrmax · dd2 valueslmaxlmaxvaluegmaxgmaxvalueinmaxinmaxvaluetmaxtmaxvaluepfactorpfactorvalueppercentppercentvaluecss, css2, css3, css4Colourcss · css2 +2entry:BuyOpen Buystrategy.entryexit:buy/tp/slexit buy/tp/slstrategy.exitentry:SellOpen Sellstrategy.entryexit:sell/tp/slexit sell/tp/slstrategy.exitplot:61Current Profit(%)plotplot:62Maximum Gained(%)plotplot:63Starting Cap(%)plotplot:64Current Drawdown(%)plotplot:65Max Drawdown(%)plotplot:66Gross Loss(%)plotplot:67Gross Gain(%)plotplot:68Profit Factorplotplot:69Total CLosed Tradesplotplot:70Trades Wonplotplot:71Trades Lostplotplot:72Profit Percentage(%)plotbgcolor:73LIQUIDATIONbgcolorfill:74Fillfill × 4fill:75Fillfill × 4fill:76Fillfill × 4fill:77Fillfill × 4

Order rules

OrderFires whenBy defaultLine
Open Buy longbaseline > baseline[1] and strategy.opentrades == 0On25
Exit buy/tp/sl stop and limitbaseline > baseline[1] and strategy.opentrades == 0On26
Open Sell shortbaseline < baseline[1] and strategy.opentrades == 0On28
Exit sell/tp/sl stop and limitbaseline < baseline[1] and strategy.opentrades == 0On29

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.

299/299trades 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 timingprocess_orders_on_close = true: orders fill at the signal bar's close.

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+496.9%+102.5%99750%1.21732.3%26 Jan 2024 – 21 Oct 2026
BTCUSDT 4h+521.3%+5.5%99452%1.2953.8%8 May 2026 – 21 Oct 2026
ETHUSDT 1D−1,801.0%+9.8%49050%0.351,130.8%26 Jan 2024 – 21 Oct 2026
ETHUSDT 4h+289.0%+8.4%59249%1.19137.6%8 May 2026 – 21 Oct 2026
SOLUSDT 1D−206.0%+16.7%9054%0.32189.5%26 Jan 2024 – 21 Oct 2026
SOLUSDT 4h+39.0%+21.5%9159%1.6316.7%8 May 2026 – 21 Oct 2026
BNBUSDT 1D−207.0%+148.3%12040%0.77630.7%26 Jan 2024 – 21 Oct 2026
BNBUSDT 4h−252.0%+17.1%1718%0.08433.0%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 market34350%$280.94
Sideways market43050%$99.00
Falling market22450%$117.00

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

How bad could the drawdown be?

3,369.8%

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

0%3,875%
The first 150 of 997 trades
SideEntryExitBarsP&L
long27 Jan 2024 42,120.6028 Jan 2024 42,119.601−$1.00
short28 Jan 2024 42,031.1029 Jan 2024 42,029.101$2.00
long29 Jan 2024 43,302.7030 Jan 2024 43,303.701$1.00
short30 Jan 2024 42,941.1031 Jan 2024 42,940.101$1.00
short31 Jan 2024 42,580.001 Feb 2024 42,579.001$1.00
long1 Feb 2024 43,082.902 Feb 2024 43,083.901$1.00
long2 Feb 2024 43,200.003 Feb 2024 43,201.001$1.00
short3 Feb 2024 43,011.104 Feb 2024 43,012.101−$1.00
short4 Feb 2024 42,582.905 Feb 2024 42,580.901$2.00
long5 Feb 2024 42,708.706 Feb 2024 42,707.701−$1.00
long6 Feb 2024 43,098.907 Feb 2024 43,096.901−$2.00
long7 Feb 2024 44,349.608 Feb 2024 44,345.601−$4.00
long8 Feb 2024 45,288.709 Feb 2024 45,280.701−$8.00
long9 Feb 2024 47,132.8010 Feb 2024 47,116.801−$16.00
long10 Feb 2024 47,751.1011 Feb 2024 47,719.101−$32.00
long11 Feb 2024 48,300.0012 Feb 2024 48,236.001−$64.00
long12 Feb 2024 49,917.3013 Feb 2024 50,045.301$128.00
short13 Feb 2024 49,699.6014 Feb 2024 49,698.601$1.00
long14 Feb 2024 51,795.2015 Feb 2024 51,794.201−$1.00
long15 Feb 2024 51,880.0016 Feb 2024 51,878.001−$2.00
long16 Feb 2024 52,124.1017 Feb 2024 52,128.101$4.00
short17 Feb 2024 51,642.6018 Feb 2024 51,641.601$1.00
long18 Feb 2024 52,137.7019 Feb 2024 52,138.701$1.00
short19 Feb 2024 51,774.7020 Feb 2024 51,773.701$1.00
long20 Feb 2024 52,258.8021 Feb 2024 52,259.801$1.00
short21 Feb 2024 51,849.4022 Feb 2024 51,850.401−$1.00
short22 Feb 2024 51,288.4023 Feb 2024 51,290.401−$2.00
short23 Feb 2024 50,744.2024 Feb 2024 50,740.201$4.00
long24 Feb 2024 51,568.2025 Feb 2024 51,567.201−$1.00
long25 Feb 2024 51,728.8026 Feb 2024 51,726.801−$2.00
long26 Feb 2024 54,476.5027 Feb 2024 54,472.501−$4.00
long27 Feb 2024 57,037.3028 Feb 2024 57,029.301−$8.00
long28 Feb 2024 62,432.1029 Feb 2024 62,448.101$16.00
short29 Feb 2024 61,131.001 Mar 2024 61,130.001$1.00
long1 Mar 2024 62,387.902 Mar 2024 62,388.901$1.00
short2 Mar 2024 61,987.303 Mar 2024 61,986.301$1.00
long3 Mar 2024 63,114.004 Mar 2024 63,113.001−$1.00
long4 Mar 2024 68,245.705 Mar 2024 68,247.701$2.00
short5 Mar 2024 63,724.006 Mar 2024 63,723.001$1.00
long6 Mar 2024 66,074.007 Mar 2024 66,073.001−$1.00
long7 Mar 2024 66,823.208 Mar 2024 66,821.201−$2.00
long8 Mar 2024 68,124.209 Mar 2024 68,120.201−$4.00
long9 Mar 2024 68,313.3010 Mar 2024 68,305.301−$8.00
long10 Mar 2024 68,955.9011 Mar 2024 68,939.901−$16.00
long11 Mar 2024 72,078.1012 Mar 2024 72,110.101$32.00
short12 Mar 2024 71,452.0013 Mar 2024 71,451.001$1.00
long13 Mar 2024 73,072.4014 Mar 2024 73,073.401$1.00
short14 Mar 2024 71,388.9015 Mar 2024 71,389.901−$1.00
short15 Mar 2024 69,499.9016 Mar 2024 69,501.901−$2.00
short16 Mar 2024 65,300.6017 Mar 2024 65,296.601$4.00
long17 Mar 2024 68,393.5018 Mar 2024 68,394.501$1.00
short18 Mar 2024 67,610.0019 Mar 2024 67,611.001−$1.00
short19 Mar 2024 61,937.4020 Mar 2024 61,935.401$2.00
long20 Mar 2024 67,840.5021 Mar 2024 67,841.501$1.00
short21 Mar 2024 65,501.3022 Mar 2024 65,502.301−$1.00
short22 Mar 2024 63,796.6023 Mar 2024 63,794.601$2.00
long23 Mar 2024 63,990.0024 Mar 2024 63,989.001−$1.00
long24 Mar 2024 67,210.0025 Mar 2024 67,208.001−$2.00
long25 Mar 2024 69,880.0026 Mar 2024 69,876.001−$4.00
long26 Mar 2024 69,988.0027 Mar 2024 69,980.001−$8.00
short27 Mar 2024 69,470.0028 Mar 2024 69,454.001$16.00
long28 Mar 2024 70,780.6029 Mar 2024 70,781.601$1.00
short29 Mar 2024 69,850.5030 Mar 2024 69,849.501$1.00
short30 Mar 2024 69,582.2031 Mar 2024 69,581.201$1.00
long31 Mar 2024 71,280.001 Apr 2024 71,281.001$1.00
short1 Apr 2024 69,649.802 Apr 2024 69,650.801−$1.00
short2 Apr 2024 65,464.003 Apr 2024 65,462.001$2.00
long3 Apr 2024 65,963.304 Apr 2024 65,962.301−$1.00
long4 Apr 2024 68,487.805 Apr 2024 68,489.801$2.00
short5 Apr 2024 67,820.606 Apr 2024 67,819.601$1.00
long6 Apr 2024 68,896.007 Apr 2024 68,895.001−$1.00
long7 Apr 2024 69,360.408 Apr 2024 69,358.401−$2.00
long8 Apr 2024 71,620.009 Apr 2024 71,624.001$4.00
short9 Apr 2024 69,146.0010 Apr 2024 69,145.001$1.00
long10 Apr 2024 70,631.1011 Apr 2024 70,632.101$1.00
short11 Apr 2024 70,006.2012 Apr 2024 70,007.201−$1.00
short12 Apr 2024 67,116.5013 Apr 2024 67,118.501−$2.00
short13 Apr 2024 63,924.5014 Apr 2024 63,920.501$4.00
long14 Apr 2024 65,661.8015 Apr 2024 65,662.801$1.00
short15 Apr 2024 63,420.0016 Apr 2024 63,421.001−$1.00
long16 Apr 2024 63,793.4017 Apr 2024 63,795.401$2.00
short17 Apr 2024 61,277.4018 Apr 2024 61,276.401$1.00
long18 Apr 2024 63,470.1019 Apr 2024 63,471.101$1.00
long19 Apr 2024 63,818.0020 Apr 2024 63,817.001−$1.00
long20 Apr 2024 64,940.6021 Apr 2024 64,938.601−$2.00
long22 Apr 2024 66,819.3023 Apr 2024 66,823.301$4.00
short23 Apr 2024 66,414.0024 Apr 2024 66,415.001−$1.00
short24 Apr 2024 64,289.6025 Apr 2024 64,291.601−$2.00
long25 Apr 2024 64,498.3026 Apr 2024 64,502.301$4.00
short26 Apr 2024 63,770.0027 Apr 2024 63,771.001−$1.00
short27 Apr 2024 63,462.0028 Apr 2024 63,460.001$2.00
short28 Apr 2024 63,118.6029 Apr 2024 63,119.601−$1.00
long29 Apr 2024 63,866.0030 Apr 2024 63,868.001$2.00
short30 Apr 2024 60,672.001 May 2024 60,673.001−$1.00
short1 May 2024 58,365.002 May 2024 58,367.001−$2.00
long2 May 2024 59,060.603 May 2024 59,056.601−$4.00
long3 May 2024 62,882.004 May 2024 62,874.001−$8.00
long4 May 2024 63,892.005 May 2024 63,908.001$16.00
long5 May 2024 64,012.006 May 2024 64,011.001−$1.00
short6 May 2024 63,165.207 May 2024 63,163.201$2.00
short7 May 2024 62,312.108 May 2024 62,313.101−$1.00
short8 May 2024 61,193.009 May 2024 61,191.001$2.00
long9 May 2024 63,074.0010 May 2024 63,075.001$1.00
short10 May 2024 60,800.0011 May 2024 60,799.001$1.00
long11 May 2024 60,826.0012 May 2024 60,825.001−$1.00
long12 May 2024 61,484.0013 May 2024 61,482.001−$2.00
long13 May 2024 62,940.1014 May 2024 62,944.101$4.00
short14 May 2024 61,577.5015 May 2024 61,576.501$1.00
long15 May 2024 66,206.5016 May 2024 66,207.501$1.00
short16 May 2024 65,235.2017 May 2024 65,234.201$1.00
long17 May 2024 67,024.0018 May 2024 67,025.001$1.00
short18 May 2024 66,915.2019 May 2024 66,916.201−$1.00
short19 May 2024 66,274.0020 May 2024 66,272.001$2.00
long20 May 2024 71,446.6021 May 2024 71,447.601$1.00
short21 May 2024 70,148.3022 May 2024 70,149.301−$1.00
short22 May 2024 69,166.6023 May 2024 69,168.601−$2.00
short23 May 2024 67,969.6024 May 2024 67,973.601−$4.00
long24 May 2024 68,550.0025 May 2024 68,542.001−$8.00
long25 May 2024 69,290.6026 May 2024 69,306.601$16.00
short26 May 2024 68,507.7027 May 2024 68,506.701$1.00
long27 May 2024 69,436.4028 May 2024 69,437.401$1.00
short28 May 2024 68,398.4029 May 2024 68,399.401−$1.00
short29 May 2024 67,652.4030 May 2024 67,650.401$2.00
long30 May 2024 68,352.2031 May 2024 68,353.201$1.00
short31 May 2024 67,540.001 Jun 2024 67,539.001$1.00
long1 Jun 2024 67,766.902 Jun 2024 67,765.901−$1.00
short2 Jun 2024 67,765.603 Jun 2024 67,763.601$2.00
long3 Jun 2024 68,809.904 Jun 2024 68,808.901−$1.00
long4 Jun 2024 70,537.805 Jun 2024 70,535.801−$2.00
long5 Jun 2024 71,108.006 Jun 2024 71,112.001$4.00
short6 Jun 2024 70,799.107 Jun 2024 70,800.101−$1.00
short7 Jun 2024 69,355.608 Jun 2024 69,353.601$2.00
short8 Jun 2024 69,310.509 Jun 2024 69,309.501$1.00
long9 Jun 2024 69,648.1010 Jun 2024 69,647.101−$1.00
short10 Jun 2024 69,540.0011 Jun 2024 69,542.001−$2.00
short11 Jun 2024 67,314.2012 Jun 2024 67,310.201$4.00
long12 Jun 2024 68,264.0013 Jun 2024 68,265.001$1.00
short13 Jun 2024 66,773.0014 Jun 2024 66,774.001−$1.00
short14 Jun 2024 66,044.0015 Jun 2024 66,042.001$2.00
long15 Jun 2024 66,228.3016 Jun 2024 66,227.301−$1.00
long16 Jun 2024 66,676.9017 Jun 2024 66,678.901$2.00
short17 Jun 2024 66,504.3018 Jun 2024 66,505.301−$1.00
short18 Jun 2024 65,175.3019 Jun 2024 65,173.301$2.00
short19 Jun 2024 64,974.4020 Jun 2024 64,973.401$1.00
short20 Jun 2024 64,870.0021 Jun 2024 64,871.001−$1.00
short21 Jun 2024 64,143.6022 Jun 2024 64,141.601$2.00
long22 Jun 2024 64,262.0023 Jun 2024 64,263.001$1.00
short23 Jun 2024 63,210.0024 Jun 2024 63,211.001−$1.00
short24 Jun 2024 60,293.3025 Jun 2024 60,291.301$2.00
long25 Jun 2024 61,806.0026 Jun 2024 61,807.001$1.00

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
STRATEGY TESTER ENGINE - ON CHART DISPLAY - PLUG & PLAY this page—v4 strategy+496.9%997732.3%
I11L - Reversal Trading Ideas by Larry Connors by I11Llowestv5 strategy+101.7%11958.8%
Exponential Stochastic Strategy by faytterrolowestv5 strategy+64.1%8542.2%
Scalping Support Resistance Strategy by HPotterlowestv5 strategydoes not run in Zeal Terminal
Alex Days HiLo Rajib by 14rajiblowestv4 strategyNo trades on this market
Donchian Strat EXMO by pskoroplaslowestv4 strategy+12.1%2268.0%

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 21 msYes 1,000 bars in 114 msNot measured
PineTSNo v5 and v6 only—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. PineTS runs Pine Script v5 and v6 only.

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 work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License https://creativecommons.org/licenses/by-sa/4.0/// © alexgrover//@version=4strategy("Grid System With Fake Martingale",process_orders_on_close=true, initial_capital=100)point = input(1.)os    = input(1,"Order Size")mf    = input(2.,"Martingale Multiplier")anti  = input(false,"Anti Martingale")//------------------------------------------------------------------------------baseline = 0.baseline := nz(close > baseline[1] + point or close < baseline[1] - point ?   close : baseline[1],close)//------------------------------------------------------------------------------size = 0.lossnew = change(strategy.losstrades)win = change(strategy.wintrades)if anti    size := win ? size[1]*mf : lossnew ? 1 : nz(size[1],os)else    size := lossnew ? size[1]*mf : win ? 1 : nz(size[1],os)upper = baseline + point*sizelower = baseline - point*size//------------------------------------------------------------------------------if baseline > baseline[1] and strategy.opentrades == 0    strategy.entry("Buy",strategy.long,qty=os)    strategy.exit("buy/tp/sl","Buy",stop=lower,limit=upper)if baseline < baseline[1] and strategy.opentrades == 0    strategy.entry("Sell",strategy.short,qty=os)    strategy.exit("sell/tp/sl","Sell",stop=upper,limit=lower)        //------------------------------------------------------------------------------// STRATEGY TESTER ENGINE - ON CHART DISPLAY - PLUG & PLAY//@FiatDropout   eq = strategy.equity //+ strategy.openprofit //USE THIS IF YOU NEED TO CHECK MAX GAINED BASED ON UNREALISED PnL and CANDLE MOVEMENT. THIS WILL CHANGE DD CALCCULATION AS WELL // CURRENT EQUITYloss = strategy.grossloss //GROSS LOSS SINCE START gain = strategy.grossprofit //GROSS LOSS SINCE STARTin = strategy.initial_capital-100 //STARTING CAPITAL IN PERCENTtotal = strategy.closedtradeswinners = strategy.wintradeslosers = strategy.losstradesrmax = 0.rmax := max(eq,nz(rmax[1]))lmax = 0.lmax := max(loss,nz(loss[1]))gmax = 0.gmax := max(gain,nz(gain[1]))inmax = 0.inmax := max(in,nz(in[1]))tmax = 0.tmax := max(total,nz(total[1]))dd = -((rmax-eq)/rmax*100) //CURRENT DRAWDOWNddm = lowest(dd,200) //MAX DRAWDOWNpfactor = gmax/lmax //PROFIT FACTORppercent = winners/total*100 //PROFIT PERCENTAGE//----css = eq > in ? #0cb51a : #e65100css2 = eq > loss ? color.blue : color.bluecss3 = dd > 0 ? color.red : color.redcss4 = dd > ddm ? color.orange : naa = plot(eq,"Current Profit(%)",#2196f3,2,transp=0)b = plot(rmax,"Maximum Gained(%)",css,2,transp=0)c = plot(inmax, "Starting Cap(%)", color.white,2,transp=0)d = plot(dd, "Current Drawdown(%)", color.fuchsia,2,transp=0)e = plot(ddm, "Max Drawdown(%)", color.red,2,transp=0)plot(lmax, "Gross Loss(%)", color.red,2,transp=0)plot(gmax, "Gross Gain(%)", color.green,2,transp=0)plot(pfactor, "Profit Factor", color.orange,2,transp=0)plot(tmax,"Total CLosed Trades", color.aqua,2,transp=0)plot(winners,"Trades Won", color.green,2,transp=0)plot(losers, "Trades Lost", color.red,2,transp=0)plot(ppercent,"Profit Percentage(%)", color.lime,2,transp=0)bgcolor(eq <= 0 and dd <= -100 ? color.red : na,title= "LIQUIDATION",transp=55)fill(a,b,css,80)fill(a,c,css2,60)fill(c,d,css3,35)fill(d,e,css4,30)