Zeal Terminal Open in Zeal Terminal

Pine Script v5 · Strategy

SRJ RSI Outperformer Strategy

A Pine Script v5 strategy built on RSI (close, 14) and SMA (rsi1, 14). It has 2 order rules, 1 entry among them, and trades long only with the default settings. Exits use a stop loss and a profit target. Each trade is one contract and pays no commission. 6 settings; defaults include Length Of Fast RSI 14, Length Of Slow RSI 28 and Length Of Moving Average 14.

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 SRJ RSI Outperformer Strategy repaint?
No
No repainting patterns were found in the source, and a live tick-by-tick replay matched history on 1 of 1 trades.
How did SRJ RSI Outperformer Strategy do on BTCUSDT 1D with default settings?
+0.64%
From 26 Jan 2024 to 21 Oct 2026, over 8 closed trades, against +102.5% for buy and hold. A backtest, not investment advice.
Does SRJ RSI Outperformer Strategy 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: 8 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.
Does SRJ RSI Outperformer Strategy use a stop loss?
Yes
strategy.exit sets a stop on line 27.
Does SRJ RSI Outperformer Strategy run in Zeal Terminal?
Yes
It compiles in 9 ms and runs 1,000 bars in 20 ms, in the browser.

BTCUSDT · 1D · default settings

  • SMA
  • SMA
  • 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 (6)
0.0050,000100,000AprJulOct2025AprJulOct2026AprJulOctRSI$1,006,400$2,025,273Equity from $1,000,000
Binance BTCUSDT 1D candles, 26 Jan 2024 to 21 Oct 2026, 1,000 bars, default settings. Triangles mark entries; circles mark exits. The script plots nothing itself; the lines and the lower pane are its own calculations, drawn for reference.
Net profit
+0.64%
$6,396.54
Buy and hold
+102.5%
same period
Closed trades
8
2 won · 6 lost
Profitable
25.0%
of closed trades
Profit factor
1.23
gross profit ÷ gross loss
Max drawdown
2.44%
−$24,964.90

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

    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.

SettingDefaultType and rangeFeeds
Length Of Fast RSI14int · min 1rsi1
Length Of Slow RSI28int · min 1rsi2
Length Of Moving Average14int · min 1ma1 ma2
Length Of Deciding Moving Average100int · min 1longcondition exitcondition
Target Profit Percentage20int · min 1exit Long Exit
Stoploss Percentage10int · min 1exit Long Exit

What it calculates

  • RSIclose, Length Of Fast RSI (14)rsi1 · line 11
  • RSIclose, Length Of Slow RSI (28)rsi2 · line 12
  • SMArsi1, Length Of Moving Average (14)ma1 · line 15
  • SMAdivergence2, Length Of Moving Average (14)ma2 · line 16

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 datasrcperiod1Length Of Fast RSIsetting · 14srcperiod2Length Of Slow RSIsetting · 28srcperiod3Length Of Moving Averagesetting · 14srcperiod4Length Of Deciding Movi…setting · 100rsi1RSI→ rsi1rsi2RSI→ rsi2ma1SMA→ ma1ma2SMA→ ma2divergence1divergence1valuedivergence2divergence2valuelongconditionlongconditionconditionexitconditionexitconditionconditionentry:Long EntryOpen Long Entrystrategy.entryexit:Long Exitexit Long Exitstrategy.exit

Order rules

OrderFires whenBy defaultLine
Open Long Entry long(longcondition)On23
Exit Long Exit stop and limit(exitcondition)On27

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.

1/1trades 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.6%+102.5%825%1.232.4%26 Jan 2024 – 21 Oct 2026
BTCUSDT 4h+0.8%+5.5%933%2.070.6%8 May 2026 – 21 Oct 2026
ETHUSDT 1D+0.2%+9.8%667%4.500.0%26 Jan 2024 – 21 Oct 2026
ETHUSDT 4h+0.0%+8.4%1233%2.110.0%8 May 2026 – 21 Oct 2026
SOLUSDT 1D+0.0%+16.7%743%1.480.0%26 Jan 2024 – 21 Oct 2026
SOLUSDT 4h+0.0%+21.5%838%2.680.0%8 May 2026 – 21 Oct 2026
BNBUSDT 1D+0.0%+148.3%850%3.300.0%26 Jan 2024 – 21 Oct 2026
BNBUSDT 4h+0.0%+17.1%1242%1.870.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 market425%−$10,197.00
Sideways market425%$16,593.50
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?

2.7%

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

0%3%
All 8 trades
SideEntryExitBarsP&L
long21 May 2024 71,446.6015 Jun 2024 66,044.0025−$5,402.63
long24 Aug 2024 64,037.2027 Aug 2024 62,834.003−$1,203.24
long16 Oct 2024 67,074.106 Dec 2024 96,945.6051$29,871.50
long24 Jan 2025 103,910.003 Feb 2025 97,700.6010−$6,209.76
long7 Jul 2025 109,204.002 Aug 2025 113,298.0026$4,094.07
long15 Sep 2025 115,268.0023 Sep 2025 112,651.008−$2,617.02
long4 Oct 2025 122,232.0011 Oct 2025 112,774.007−$9,457.72
long27 Sep 2026 84,433.109 Oct 2026 81,754.5012−$2,678.65

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
SRJ RSI Outperformer Strategy this page—v5 strategy+0.6%82.4%
RSI SMA Crossover Strategy by reeesrsi smav5 strategy+39.8%4230.8%
Short In Downtrend Below MA100 (Coinrule) by Coinrulesma rsiv4 strategy−34.5%9945.4%
Simple RSI and SMA Long and Short (by Coinrule) by Coinrulersi smav5 strategy−3.0%217.7%
Maximized Moving Average Crossing (by Coinrule) by Coinrulesma rsiv4 strategy−6.6%913.3%
RSI Mean Reversion Strategy by Zeal Terminalrsi smav5 strategy+2.2%161.6%

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 runs in Zeal Terminal's engine, but its results differ from the v5 version: Trades differ: 8 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.

⋯// © Sapt_Jash-//@version=5+//@version=6strategy("SRJ RSI Outperformer Strategy", overlay=true)⋯

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 9 msYes 1,000 bars in 20 msNot measured
PineTSNot testedNot testedNot 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.

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/// © Sapt_Jash//@version=5strategy("SRJ RSI Outperformer Strategy", overlay=true)srcperiod1 = input.int(14, minval=1, title="Length Of Fast RSI")srcperiod2 = input.int(28, minval=1, title="Length Of Slow RSI")srcperiod3 = input.int(14, minval=1, title="Length Of Moving Average")srcperiod4 = input.int(100, minval=1, title="Length Of Deciding Moving Average")srcperiod5 = input.int(20, minval=1, title="Target Profit Percentage")srcperiod6 = input.int(10, minval=1, title="Stoploss Percentage")rsi1 = ta.rsi(close, srcperiod1)rsi2 = ta.rsi(close, srcperiod2)divergence1 = (rsi2/rsi1)divergence2 = (rsi1/divergence1)ma1 = ta.sma(rsi1, srcperiod3)ma2 = ta.sma(divergence2, srcperiod3)//Long Conditions//longcondition = (ta.crossover(ma2, ma1) and (close > ta.sma(close, srcperiod4)))    //Exit onditions//exitcondition = (ta.crossunder(ma2, ma1) or (ta.crossunder(close, ta.sma(close, srcperiod4))))if (longcondition)    strategy.entry("Long Entry", strategy.long)    if (exitcondition)        strategy.exit("Long Exit", profit = close * (1+(srcperiod5/100)), loss = close * (1-(srcperiod6/100)))