Zeal Terminal Open in Zeal Terminal

Pine Script v5 · Strategy

Hobbiecode - RSI + Close previous day

A Pine Script v5 strategy built on RSI (close, rsi_period). It has 2 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 is one contract 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 Hobbiecode - RSI + Close previous day repaint?
No
No repainting patterns were found in the source, and a live tick-by-tick replay matched history on 19 of 19 trades.
How did Hobbiecode - RSI + Close previous day do on BTCUSDT 1D with default settings?
+1.18%
From 26 Jan 2024 to 21 Oct 2026, over 63 closed trades, against +102.5% for buy and hold. A backtest, not investment advice.
Does Hobbiecode - RSI + Close previous day 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: 63 before, 58 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 Hobbiecode - RSI + Close previous day use a stop loss?
No
Every exit waits for a signal; nothing limits a losing trade before it fires.
Does Hobbiecode - RSI + Close previous day run in Zeal Terminal?
Yes
It compiles in 8 ms and runs 1,000 bars in 15 ms, in the browser.

BTCUSDT · 1D · default settings

  • RSI
  • Oversold Level
  • 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$1,011,770$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. Lines are what the script plots.
Net profit
+1.18%
$11,771.10
Buy and hold
+102.5%
same period
Closed trades
63
43 won · 20 lost
Profitable
68.3%
of closed trades
Profit factor
1.15
gross profit ÷ gross loss
Max drawdown
4.19%
−$43,503.20

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

  • RSIclose, rsi_periodrsi_val · line 11

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 datahighhighprice datarsi_valRSI→ rsi_valentry:BuyOpen Buystrategy.entryclose:BuyClose Buystrategy.closeplot:19RSIplothline:20Oversold Levelhline

Order rules

OrderFires whenBy defaultLine
Open Buy long(rsi_val < rsi_lower)On14
Close Buy(strategy.position_size > 0 and close > ta.highest(high[1], 1))On17

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.

19/19trades 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+1.2%+102.5%6368%1.154.2%26 Jan 2024 – 21 Oct 2026
BTCUSDT 4h+0.2%+5.5%5871%1.101.6%8 May 2026 – 21 Oct 2026
ETHUSDT 1D+0.1%+9.8%5867%1.190.1%26 Jan 2024 – 21 Oct 2026
ETHUSDT 4h−0.0%+8.4%5671%0.960.0%8 May 2026 – 21 Oct 2026
SOLUSDT 1D−0.0%+16.7%6157%0.680.0%26 Jan 2024 – 21 Oct 2026
SOLUSDT 4h+0.0%+21.5%6566%1.470.0%8 May 2026 – 21 Oct 2026
BNBUSDT 1D+0.1%+148.3%6571%1.790.0%26 Jan 2024 – 21 Oct 2026
BNBUSDT 4h−0.0%+17.1%6265%0.930.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 market2370%$31,042.20
Sideways market2458%−$14,551.10
Falling market1681%−$4,720.11

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

How bad could the drawdown be?

4.1%

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

0%5%
All 63 trades
SideEntryExitBarsP&L
long24 Feb 2024 50,744.2025 Feb 2024 51,568.201$824.06
long17 Mar 2024 65,300.6025 Mar 2024 67,210.008$1,909.36
long3 Apr 2024 65,464.005 Apr 2024 68,487.802$3,023.81
long13 Apr 2024 67,116.5023 Apr 2024 66,819.3010−$297.20
long28 Apr 2024 63,462.004 May 2024 62,882.006−$579.97
long9 May 2024 61,193.0010 May 2024 63,074.001$1,880.97
long12 Jun 2024 67,314.2017 Jun 2024 66,676.905−$637.37
long19 Jun 2024 65,175.301 Jul 2024 62,772.0012−$2,403.31
long4 Jul 2024 60,208.607 Jul 2024 58,230.103−$1,978.44
long25 Jul 2024 65,376.0027 Jul 2024 67,908.002$2,531.99
long31 Jul 2024 66,188.009 Aug 2024 61,686.009−$4,502.00
long28 Aug 2024 59,415.003 Sep 2024 59,132.106−$282.88
long7 Sep 2024 53,963.009 Sep 2024 54,869.902$906.98
long1 Oct 2024 63,327.605 Oct 2024 62,086.004−$1,241.60
long10 Oct 2024 60,636.0012 Oct 2024 62,540.002$1,903.98
long24 Oct 2024 66,668.6025 Oct 2024 68,198.301$1,529.62
long4 Nov 2024 68,776.007 Nov 2024 75,572.003$6,796.00
long26 Nov 2024 93,010.0028 Nov 2024 95,863.102$2,853.10
long19 Dec 2024 100,204.0025 Dec 2024 98,663.606−$1,540.43
long31 Dec 2024 92,792.103 Jan 2025 96,984.803$4,192.74
long10 Jan 2025 92,552.5015 Jan 2025 96,560.905$4,008.36
long27 Jan 2025 102,620.0011 Feb 2025 97,430.8015−$5,189.19
long18 Feb 2025 95,780.0021 Feb 2025 98,305.003$2,525.00
long25 Feb 2025 91,552.902 Mar 2025 86,064.505−$5,488.34
long10 Mar 2025 80,734.5013 Mar 2025 83,680.103$2,945.64
long29 Mar 2025 84,424.402 Apr 2025 85,158.404$733.97
long7 Apr 2025 78,430.0010 Apr 2025 82,615.203$4,185.22
long30 May 2025 105,590.002 Jun 2025 105,643.003$53.18
long6 Jun 2025 101,509.008 Jun 2025 105,552.002$4,043.46
long13 Jun 2025 105,672.0017 Jun 2025 106,795.004$1,122.79
long21 Jun 2025 103,298.0024 Jun 2025 105,334.003$2,035.96
long2 Jul 2025 105,681.003 Jul 2025 108,850.001$3,168.46
long21 Jul 2025 117,265.0023 Jul 2025 119,954.002$2,689.32
long1 Aug 2025 115,764.004 Aug 2025 114,209.003−$1,555.26
long19 Aug 2025 116,227.0023 Aug 2025 116,936.004$708.95
long26 Aug 2025 110,112.003 Sep 2025 111,240.008$1,128.03
long23 Sep 2025 112,651.0025 Sep 2025 113,307.002$656.02
long26 Sep 2025 108,994.0029 Sep 2025 112,164.003$3,169.47
long11 Oct 2025 112,774.0013 Oct 2025 114,959.002$2,184.32
long16 Oct 2025 110,763.0020 Oct 2025 108,643.004−$2,120.51
long30 Oct 2025 110,021.0010 Nov 2025 104,723.0011−$5,298.35
long14 Nov 2025 99,692.0024 Nov 2025 86,830.0010−$12,862.00
long2 Dec 2025 86,286.003 Dec 2025 91,277.901$4,991.87
long15 Dec 2025 88,172.2022 Dec 2025 88,658.907$486.71
long10 Jan 2026 90,641.3012 Jan 2026 91,013.702$372.39
long19 Jan 2026 93,673.1028 Jan 2026 89,250.009−$4,423.15
long30 Jan 2026 84,650.2014 Feb 2026 68,854.0015−$15,796.20
long19 Feb 2026 66,461.0021 Feb 2026 68,020.002$1,559.00
long24 Feb 2026 64,656.0026 Feb 2026 67,988.002$3,332.03
long9 Mar 2026 65,971.2010 Mar 2026 68,432.201$2,460.96
long20 Mar 2026 69,930.0024 Mar 2026 70,906.404$976.44
long28 Mar 2026 66,407.301 Apr 2026 68,284.504$1,877.21
long30 Apr 2026 75,780.002 May 2026 78,231.102$2,451.13
long14 May 2026 79,313.6021 May 2026 77,552.207−$1,761.37
long23 May 2026 75,539.508 Jun 2026 63,332.0016−$12,207.50
long19 Jun 2026 62,958.0021 Jun 2026 64,298.002$1,340.00
long25 Jun 2026 61,078.003 Jul 2026 61,560.008$482.00
long14 Jul 2026 62,334.5015 Jul 2026 65,044.001$2,709.47
long25 Jul 2026 64,140.0027 Jul 2026 65,400.002$1,260.00
long11 Aug 2026 63,970.0018 Aug 2026 64,532.107$562.10
long10 Sep 2026 78,306.4015 Sep 2026 78,189.205−$117.23
long29 Sep 2026 83,500.005 Oct 2026 86,530.006$3,029.99
long8 Oct 2026 83,321.8012 Oct 2026 83,773.104$451.31

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
Hobbiecode - RSI + Close previous day this page—v5 strategy+1.2%634.2%
Triple RSI strategy by Trade_by_DBrsiv5 strategy+3.2%23.3%
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%
Cheat Code- Example 1; Short-Term; Follow the Trend by CheatCode1rsiv5 strategy−1.0%25.7%

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

⋯// Exit on close if today’s close is higher than yesterday’s high.-//@version=5+//@version=6strategy("Hobbiecode - RSI + Close previous day", overlay=true)⋯

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 8 msYes 1,000 bars in 15 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/// © hobbiecode// If RSI(2) is less than 15, then enter at the close.// Exit on close if today’s close is higher than yesterday’s high.//@version=5strategy("Hobbiecode - RSI + Close previous day", overlay=true)// RSI parametersrsi_period = 2rsi_lower = 15// Calculate RSIrsi_val = ta.rsi(close, rsi_period)// Check if RSI is lower than the defined thresholdif (rsi_val < rsi_lower)    strategy.entry("Buy", strategy.long)// Check if today's close is higher than yesterday's highif (strategy.position_size > 0 and close > ta.highest(high[1], 1))    strategy.close("Buy")// Plot RSI on chartplot(rsi_val, title="RSI", color=color.red)hline(rsi_lower, title="Oversold Level", color=color.blue)