Zeal Terminal Open in Zeal Terminal

Pine Script v4 · Strategy

RSI Trend Crypto

A Pine Script v4 strategy built on RSI (close, 14), Crossover (rsi, 35) and Crossunder (rsi, 75). It has 3 order rules, 1 entry among them, and trades long only with the default settings. Exits wait for a signal; there is no stop loss. Each trade commits 100% of equity and pays 0.2 commission. 4 settings; defaults include RSI Long Cross 35, RSI Close Position 75 and RSI Emergency Close Position 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 RSI Trend Crypto repaint?
No
No repainting patterns were found in the source. The live replay was not measured: it had no trades to compare.
How did RSI Trend Crypto do on BTCUSDT 1D with default settings?
+19.58%
From 26 Jan 2024 to 21 Oct 2026, over 3 closed trades, against +102.5% for buy and hold. A backtest, not investment advice.
Can RSI Trend Crypto be converted to Pine Script v5?
No
The automatic step from v4 to v5 changes the results, so no v5 download is offered; the edits are shown below.
Does RSI Trend Crypto use a stop loss?
No
Every exit waits for a signal; nothing limits a losing trade before it fires.
Does RSI Trend Crypto run in Zeal Terminal?
Yes
It compiles in 12 ms and runs 1,000 bars in 26 ms, in the browser.

BTCUSDT · 1D · default settings

  • Plot
  • 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 (4)
40,00060,00080,000100,000120,000AprJulOct2025AprJulOct2026AprJulOctPlot$119,573$202,527Equity from $100,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
+19.58%
$19,580.40
Buy and hold
+102.5%
same period
Closed trades
3
2 won · 1 lost
Profitable
66.7%
of closed trades
Profit factor
1.48
gross profit ÷ gross loss
Max drawdown
44.47%
−$71,253.60

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

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

  • Check

    Every trade uses all the equity

    default_qty_value is 100% of equity.

  • Note

    No slippage

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

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 rsi → ta.rsi, crossover → ta.crossover, crossunder → ta.crossunder.

v4 → v5

Differs

Trades differ: 3 before, 3 after on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine.

  • Line 3: //@version=4 → //@version=5
  • Line 11: rsi → ta.rsi
  • Line 13: crossover → ta.crossover
  • Line 14: crossunder → ta.crossunder
  • Line 15: crossunder → ta.crossunder
⋯// © FieryTrading-//@version=4+//@version=5strategy("RSI Trend Crypto", overlay=false, pyramiding=1, commission_value=0.2, default_qty_type=strategy.percent_of_equity, default_qty_value=100)⋯// RSI-rsi = rsi(close, 14)+rsi = ta.rsi(close, 14)// Conditions-long = crossover(rsi, RSIlong)+long = ta.crossover(rsi, RSIlong)-longclose = crossunder(rsi, RSIclose)+longclose = ta.crossunder(rsi, RSIclose)-emergency = crossunder(rsi, Emergencyclose)+emergency = ta.crossunder(rsi, Emergencyclose)// Plots⋯

Clean v5

Verified

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

  • Line 6: input() → input.bool()
  • Line 7: input() → input.int()
  • Line 8: input() → input.int()
  • Line 9: input() → input.int()
⋯// Input-UseEmergency = input(false, "Use Emergency Exit?")+UseEmergency = input.bool(false, "Use Emergency Exit?")-RSIlong = input(35, "RSI Long Cross")+RSIlong = input.int(35, "RSI Long Cross")-RSIclose = input(75, "RSI Close Position")+RSIclose = input.int(75, "RSI Close Position")-Emergencyclose = input(10, "RSI Emergency Close Position")+Emergencyclose = input.int(10, "RSI Emergency Close Position")// RSI⋯

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: 3 before, 3 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.

⋯// © FieryTrading-//@version=5+//@version=6strategy("RSI Trend Crypto", overlay=false, pyramiding=1, commission_value=0.2, default_qty_type=strategy.percent_of_equity, default_qty_value=100)⋯

Settings

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

SettingDefaultType and rangeFeeds
Use Emergency Exit?falseboolclose Long line 31
RSI Long Cross35intlong plot
RSI Close Position75intlongclose plot
RSI Emergency Close Position10intemergency

What it calculates

  • RSI (rsi, ta.rsi in v5)close, 14rsi · line 11
  • Crossover (crossover, ta.crossover in v5)rsi, RSI Long Cross (35)long · line 13
  • Crossunder (crossunder, ta.crossunder in v5)rsi, RSI Close Position (75)longclose · line 14
  • Crossunder (crossunder, ta.crossunder in v5)rsi, RSI Emergency Close Position (10)emergency · line 15

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 dataRSIlongRSI Long Crosssetting · 35RSIcloseRSI Close Positionsetting · 75EmergencycloseRSI Emergency Close Pos…setting · 10rsiRSI→ rsilongCrossover→ longlongcloseCrossunder→ longcloseemergencyCrossunder→ emergencyentry:LongOpen Longstrategy.entryclose:LongClose Longstrategy.closeplot:17plotplotplot:18plotplotplot:19plotplot

Order rules

OrderFires whenBy defaultLine
Open Long longlongOn28
Close LonglongcloseOn30
Close Longemergency and UseEmergency==trueOn32

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 1D+19.6%+102.5%367%1.4844.5%26 Jan 2024 – 21 Oct 2026
BTCUSDT 4h−0.5%+5.5%250%0.9127.6%8 May 2026 – 21 Oct 2026
ETHUSDT 1D−10.0%+9.8%450%0.8562.7%26 Jan 2024 – 21 Oct 2026
ETHUSDT 4h+20.4%+8.4%475%1.9834.2%8 May 2026 – 21 Oct 2026
SOLUSDT 1D−15.0%+16.7%450%0.8369.5%26 Jan 2024 – 21 Oct 2026
SOLUSDT 4h+8.6%+21.5%450%1.5431.0%8 May 2026 – 21 Oct 2026
BNBUSDT 1D+9.4%+148.3%250%1.2244.1%26 Jan 2024 – 21 Oct 2026
BNBUSDT 4h+26.4%+17.1%3100%105.4916.8%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 market1100%$47,267.30
Sideways market250%−$27,687.00
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?

25.4%

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

0%29%
All 3 trades
SideEntryExitBarsP&L
long3 May 2024 59,060.6015 Nov 2024 87,325.60196$47,267.30
long3 Mar 2025 94,270.0010 May 2025 102,972.0068$12,952.00
long6 Nov 2025 103,885.0029 Aug 2026 77,845.90296−$40,639.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
RSI Trend Crypto this page—v4 strategy+19.6%344.5%
Triple RSI strategy by Trade_by_DBrsiv5 strategy+3.2%23.3%
Hobbiecode - RSI + Close previous day by hobbiecodersiv5 strategy+1.2%634.2%
dirt cheap yet elegant RSI Strategy by SparkyFlaryrsiv4 strategy−11.4%820.5%
RSI Classic Strategy (by Coinrule) by Coinrulersiv4 strategy+7.5%67.2%
RSITrendStrategy by email_analystsrsiv4 strategy+69.2%2238.6%

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 12 msYes 1,000 bars in 26 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 source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/// © FieryTrading//@version=4strategy("RSI Trend Crypto", overlay=false, pyramiding=1, commission_value=0.2, default_qty_type=strategy.percent_of_equity, default_qty_value=100)// InputUseEmergency = input(false, "Use Emergency Exit?")RSIlong = input(35, "RSI Long Cross")RSIclose = input(75, "RSI Close Position")Emergencyclose = input(10, "RSI Emergency Close Position")// RSIrsi = rsi(close, 14)// Conditionslong = crossover(rsi, RSIlong)longclose = crossunder(rsi, RSIclose)emergency = crossunder(rsi, Emergencyclose)// Plotsplot(rsi, color=color.white, linewidth=2)plot(RSIlong, color=color.green)plot(RSIclose, color=color.red)// Alert messages // When using a bot remember to use "{{strategy.order.alert_message}}" in your alert// You can edit the alert message freely to suit your needsLongAlert = 'RSI Long Cross: LONG'CloseAlert = 'RSI Close Position'EmergencyAlert = 'RSI Emergency Close'// Strategyif long    strategy.entry("Long", strategy.long, alert_message=LongAlert)if longclose    strategy.close("Long", alert_message=CloseAlert)if emergency and UseEmergency==true    strategy.close("Long", alert_message=EmergencyAlert)