Zeal Terminal Open in Zeal Terminal

Pine Script v5 · Strategy

Crypto High Potential Strategy

A Pine Script v5 strategy built on EMA (closeHA, 200), RSI (closeHA, 14) and SAR (0.02, 0.02). It has 8 order rules, 4 entries among them, and trades long and short with the default settings; 2 entries are switched off until a setting enables them. Exits use a stop loss. Each trade is 0.5 contracts and pays no commission. 13 settings; defaults include Risk per Trade % 2, min of pips (00001.00) for each position 50 and Swing High 10.

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 Crypto High Potential 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 Crypto High Potential 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 code limits trading to a date window, which can leave this period out. It closed no trades on the other markets either. A backtest, not investment advice.
Does Crypto High Potential 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 Crypto High Potential Strategy use a stop loss?
Yes
strategy.exit sets a stop on line 68, 73.
Does Crypto High Potential Strategy run in Zeal Terminal?
Yes
It compiles in 41 ms and runs 1,000 bars in 80 ms, in the browser.

BTCUSDT · 1D · default settings

  • ParabolicSAR
  • EMA
  • Winning trade
  • Losing trade
  • Equity
  • Buy and hold
40,00060,00080,000100,000120,000AprJulOct2025AprJulOct2026AprJulOct$1,000$2,025Equity from $1,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. Data the page supplies at the chart's own timeframe (another symbol, or Heikin-Ashi) reaches the script one bar later in Zeal Terminal's engine than on TradingView. The live re-run is not offered here: the script requests heikinashi:SYMBOL D, heikinashi:BINANCE:BTCUSDT D, which this page cannot load in your browser.
Table drawn by the script, as it stood on the last bar
SymboleNet ProfitTradesPeriod
BTCUSDT0.00 %030 day
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 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 commission

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

  • Note

    2 settings have no label

    In the settings dialog start (line 28), increment (line 29) show an empty name. The labels on this page come from the variable names.

  • Note

    The long side is off by default line 55

    Its orders only fire after “do not take too small positions” is switched on. The figures on this page cover long and short trades only.

  • Note

    The short side is off by default line 64

    Its orders only fire after “do not take too small positions” is switched on. The figures on this page cover long and short trades only.

Settings

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

SettingDefaultType and rangeFeeds
Money Management
Risk per Trade %2floatriskt
do not take too small positionsThis parameter is used to avoid positions that have a stoploss that is too short and that the spreads of the broker take all the gainsfalseboolentry long entry short line 51 line 60
min of pips (00001.00) for each position50floatentry long entry short line 52 line 61
Backtest Time Period
Filter Date Range of BacktesttrueboolinTradeWindow
Start DateThis start date is in the time zone of the exchange " + "where the chart's instrument trades. It doesn't use the time " + "zone of the chart or of your computer.timestamp("1 June 2022")timeinTradeWindow periodzone
End DateThis end date is in the time zone of the exchange " + "where the chart's instrument trades. It doesn't use the time " + "zone of the chart or of your computer.timestamp("1 July 2022")timeinTradeWindow periodzone
Stop Loss
Swing HighNumber of candles in which the parameter targets the highest10intswingHigh
Swing LowNumber of candles in which the parameter targets the lowest point10intswingLow
EMA
Ema Period200intema
RSI
RSI Period14intrsi
Parabolic SAR
Start (no label in the script)0.02floatSAR
Increment (no label in the script)0.02floatSAR
Max Value0.2floatSAR

What it calculates

  • EMAcloseHA, Ema Period (200)ema · line 31
  • RSIcloseHA, RSI Period (14)rsi · line 32
  • SARStart (0.02), Increment (0.02), Max Value (0.2)SAR · line 33
  • HighestcloseHA, Swing High (10)swingHigh · line 44
  • LowestcloseHA, Swing Low (10)swingLow · line 45

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.

emaVEma Periodsetting · 200rsiVRSI Periodsetting · 14high · low · closehigh · low · closeprice datastartStartsetting · 0.02incrementIncrementsetting · 0.02maximumMax Valuesetting · 0.2swingHighVSwing Highsetting · 10swingLowVSwing Lowsetting · 10closecloseprice datariskRisk per Trade %setting · 2backtestEndDateEnd Datesetting · timestamp("1 July 2…backtestStartDateStart Datesetting · timestamp("1 June 2…timetimeprice datalowlowprice datasecuritymin of pips (00001.00) …setting · 50emaEMA→ emarsiRSI→ rsiSARSAR→ SARswingHighHighest→ swingHighswingLowLowest→ swingLowcloseHAcloseHAvaluerisktrisktvaluerisk_longrisk_longvaluerisk_shortrisk_shortvaluestopLossstopLossvalueentry_price, profitprc, tblentry_price · profitprc…3 valueslotBlotBvaluelotSlotSvalueminpminpvalueperiodzoneperiodzonevalueinTradeWindowinTradeWindowconditionlongcondition, shortconditionlongcondition · shortco…2 conditionsmyColor, colorresultColourmyColor · colorresultentry:longOpen longstrategy.entryentry:shortOpen shortstrategy.entryexit:long exitexit long exitstrategy.exitexit:short exitexit short exitstrategy.exitclose:longClose longstrategy.closeclose:shortClose shortstrategy.closeplot:79entry priceplotplot:80stopLossplotfill:81Fillfillplot:82ParabolicSARplotplot:83EMAplot

Order rules

OrderFires whenBy defaultLine
Open long longminp > securityOn53
Open long long_xOff “do not take too small positions”55
Open short shortminp > securityOn62
Open short short_xOff “do not take too small positions”64
Exit long exit stopstrategy.position_size > 0On68
Exit short exit stopstrategy.position_size < 0On73
Close longcloseHA[1] < SAR and close > strategy.position_avg_priceOn75
Close shortcloseHA[1] > SAR and close < strategy.position_avg_priceOn78

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 data1 request.security call(s), none with lookahead on.
  • 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

Higher-timeframe data for request.security(): heikinashi:SYMBOL D (Binance BTCUSDT 1d, as Heikin-Ashi by the engine), heikinashi:BINANCE:BTCUSDT D (Binance BTCUSDT 1d, as Heikin-Ashi by the engine), fetched from Binance's public market data for each market.

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
Crypto High Potential Strategy this page—v5 strategy0.0%00.0%
STRATEGY R18-F-BTC by SenatorVonShaftema highest lowest rsiv4 strategy−8.6%1114.4%
M0PB (Momentum Pullback) by Marcns_rsi ema highest lowestv5 strategy+51.3%317.5%
sma RSI & sudden buy and sell Strategy v1 by samwillingtonema rsi highest lowestv5 strategy+7.6%153.7%
PlanB Quant Investing 101 v2 by fillipponersi highest lowestv4 strategyNo trades on this market
CC Trend strategy 2- Downtrend Short by CheatCode1ema highest lowestv5 strategyNo trades on this market

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.

  • 3 settings use the untyped input() (line 28, 29, 30). It still compiles in v6; input.int, input.float or input.source state the type.
  • No v6-only features. v6 is not needed to run this script.

Clean v5

Not verified

Neither version placed a trade on any of the 8 markets, so there was nothing to compare.

  • Line 28: input() → input.float()
  • Line 29: input() → input.float()
  • Line 30: input() → input.float()
⋯rsiV = input.int(14, title="RSI Period", group="RSI")-start = input(0.02, group="Parabolic SAR")+start = input.float(0.02, group="Parabolic SAR")-increment = input(0.02, group="Parabolic SAR")+increment = input.float(0.02, group="Parabolic SAR")-maximum = input(0.2, "Max Value", group="Parabolic SAR")+maximum = input.float(0.2, "Max Value", group="Parabolic SAR")ema = ta.ema(closeHA, emaV)⋯

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.

⋯// © maxencetajet-//@version=5+//@version=6strategy("HA_RSI", overlay=true, initial_capital=1000, default_qty_type=strategy.fixed, default_qty_value=0.5, slippage=25)⋯

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 41 msWith a workaround 1,000 bars in 80 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. Data the page supplies at the chart's own timeframe (another symbol, or Heikin-Ashi) reaches the script one bar later in Zeal Terminal's engine than on TradingView.

“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/// © maxencetajet//@version=5strategy("HA_RSI", overlay=true, initial_capital=1000, default_qty_type=strategy.fixed, default_qty_value=0.5, slippage=25)closeHA = request.security(ticker.heikinashi(syminfo.tickerid), timeframe.period, close)risk = input.float(2, title="Risk per Trade %", group="Money Management")_x = input.bool(false, title="do not take too small positions", group="Money Management", tooltip="This parameter is used to avoid positions that have a stoploss that is too short and that the spreads of the broker take all the gains")security = input.float(50, title='min of pips (00001.00) for each position', group="Money Management")riskt = risk / 100 + 1useDateFilter = input.bool(true, title="Filter Date Range of Backtest",     group="Backtest Time Period")backtestStartDate = input.time(timestamp("1 June 2022"),      title="Start Date", group="Backtest Time Period",     tooltip="This start date is in the time zone of the exchange " +      "where the chart's instrument trades. It doesn't use the time " +      "zone of the chart or of your computer.")backtestEndDate = input.time(timestamp("1 July 2022"),     title="End Date", group="Backtest Time Period",     tooltip="This end date is in the time zone of the exchange " +      "where the chart's instrument trades. It doesn't use the time " +      "zone of the chart or of your computer.")inTradeWindow = not useDateFilter or (time >= backtestStartDate and     time < backtestEndDate)swingHighV = input.int(10, title="Swing High", group="Stop Loss", tooltip="Number of candles in which the parameter targets the highest")swingLowV = input.int(10, title="Swing Low", group="Stop Loss", tooltip="Number of candles in which the parameter targets the lowest point")emaV = input.int(200, title="Ema Period", group="EMA")rsiV = input.int(14, title="RSI Period", group="RSI")start = input(0.02, group="Parabolic SAR")increment = input(0.02, group="Parabolic SAR")maximum = input(0.2, "Max Value", group="Parabolic SAR")ema = ta.ema(closeHA, emaV)rsi = ta.rsi(closeHA, rsiV)SAR = ta.sar(start, increment, maximum)myColor = SAR < low?color.green:color.redlongcondition = closeHA > ema and rsi > 50 and closeHA[1] > SAR and closeHA[1] < SAR[1] shortcondition = closeHA < ema and rsi < 50 and closeHA[1] < SAR and closeHA[1] > SAR[1]float risk_long = nafloat risk_short = nafloat stopLoss = nafloat entry_price = nafloat takeProfit = narisk_long := risk_long[1]risk_short := risk_short[1]swingHigh = ta.highest(closeHA, swingHighV)swingLow = ta.lowest(closeHA, swingLowV)lotB = (strategy.equity*riskt-strategy.equity)/(closeHA - swingLow)lotS = (strategy.equity*riskt-strategy.equity)/(swingHigh - closeHA)if strategy.position_size == 0 and longcondition and inTradeWindow    risk_long := (close - swingLow) / close    minp = close - swingLow    if _x        if minp > security            strategy.entry("long", strategy.long, qty=lotB, comment="Buy " + str.tostring(close) + "")    else         strategy.entry("long", strategy.long, qty=lotB, comment="Buy " + str.tostring(close) + "")        if strategy.position_size == 0 and shortcondition and inTradeWindow    risk_short := (swingHigh - close) / close      minp = swingHigh - close    if _x        if minp > security            strategy.entry("short", strategy.short, qty=lotS, comment="Sell " + str.tostring(close) + "")    else         strategy.entry("short", strategy.short, qty=lotS, comment="Sell " + str.tostring(close) + "")if strategy.position_size > 0    stopLoss := strategy.position_avg_price * (1 - risk_long)    entry_price := strategy.position_avg_price    strategy.exit("long exit", "long", stop = stopLoss)    if strategy.position_size < 0     stopLoss := strategy.position_avg_price * (1 + risk_short)    entry_price := strategy.position_avg_price    strategy.exit("short exit", "short", stop = stopLoss)if closeHA[1] < SAR and close > strategy.position_avg_price    strategy.close("long", comment="Exit Long")    if closeHA[1] > SAR and close < strategy.position_avg_price    strategy.close("short", comment="Exit Short")p_ep = plot(entry_price, color=color.new(color.white, 0), linewidth=2, style=plot.style_linebr, title='entry price')p_sl = plot(stopLoss, color=color.new(color.red, 0), linewidth=2, style=plot.style_linebr, title='stopLoss')fill(p_sl, p_ep, color.new(color.red, transp=85))plot(SAR, "ParabolicSAR", style=plot.style_circles, color=myColor, linewidth=1)plot(ema, color=color.white, linewidth=2, title="EMA")colorresult = strategy.netprofit > 0 ? color.green : color.red  profitprc = strategy.netprofit / strategy.initial_capital * 100periodzone = (backtestEndDate - backtestStartDate) / 3600 / 24 / 1000var tbl = table.new(position.top_right, 4, 2, border_width=3)table.cell(tbl, 0, 0, "Symbole",  bgcolor = #9B9B9B, width = 6, height = 6)table.cell(tbl, 1, 0, "Net Profit", bgcolor = #9B9B9B, width = 6, height = 6)table.cell(tbl, 2, 0, "Trades", bgcolor = #9B9B9B, width = 6, height = 6)table.cell(tbl, 3, 0, "Period",  bgcolor = #9B9B9B, width = 6, height = 6)    table.cell(tbl, 0, 1, str.tostring(syminfo.ticker),  bgcolor = #E8E8E8, width = 6, height = 6)table.cell(tbl, 1, 1, str.tostring(profitprc, format.mintick) + " %", bgcolor = colorresult,   width = 6, height = 6)table.cell(tbl, 2, 1, str.tostring(strategy.closedtrades), bgcolor = colorresult,   width = 6, height = 6)table.cell(tbl, 3, 1, str.tostring(periodzone) + " day", bgcolor = colorresult,   width = 6, height = 6)