Zeal Terminal Open in Zeal Terminal

Pine Script v5 · Strategy

Hobbiecode - Five Day Low RSI Strategy

A Pine Script v5 strategy built on RSI (close, rsi_period). 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 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 - Five Day Low RSI Strategy 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 - Five Day Low RSI Strategy do on BTCUSDT 1D with default settings?
+3.68%
From 26 Jan 2024 to 21 Oct 2026, over 60 closed trades, against +102.5% for buy and hold. A backtest, not investment advice.
Does Hobbiecode - Five Day Low RSI 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: 60 before, 48 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 - Five Day Low RSI Strategy use a stop loss?
No
Every exit waits for a signal; nothing limits a losing trade before it fires.
Does Hobbiecode - Five Day Low RSI Strategy run in Zeal Terminal?
Yes
It compiles in 10 ms and runs 1,000 bars in 18 ms, in the browser.

BTCUSDT · 1D · default settings

  • RSI
  • Overbought 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,036,830$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
+3.68%
$36,829.90
Buy and hold
+102.5%
same period
Closed trades
60
42 won · 18 lost
Profitable
70.0%
of closed trades
Profit factor
1.64
gross profit ÷ gross loss
Max drawdown
2.00%
−$20,218.00

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 12

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 datalowlowprice datarsi_valRSI→ rsi_valconditionEntryconditionEntryconditionentry:BuyOpen Buystrategy.entryclose:BuyClose Buystrategy.closeplot:24RSIplothline:25Overbought Levelhline

Order rules

OrderFires whenBy defaultLine
Open Buy long(conditionEntry)On16
Close Buy(strategy.position_size > 0 and rsi_val > rsi_upper)On19
Close Buy(strategy.position_size > 0 and ta.barssince(conditionEntry) >= 5)On22

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+3.7%+102.5%6070%1.642.0%26 Jan 2024 – 21 Oct 2026
BTCUSDT 4h+0.7%+5.5%6265%1.481.0%8 May 2026 – 21 Oct 2026
ETHUSDT 1D−0.2%+9.8%5357%0.620.2%26 Jan 2024 – 21 Oct 2026
ETHUSDT 4h+0.0%+8.4%5364%1.280.0%8 May 2026 – 21 Oct 2026
SOLUSDT 1D+0.0%+16.7%5866%1.100.0%26 Jan 2024 – 21 Oct 2026
SOLUSDT 4h+0.0%+21.5%6363%1.190.0%8 May 2026 – 21 Oct 2026
BNBUSDT 1D+0.0%+148.3%5874%2.080.0%26 Jan 2024 – 21 Oct 2026
BNBUSDT 4h+0.0%+17.1%6065%1.270.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 market1979%$32,187.90
Sideways market2463%−$5,768.12
Falling market1771%$10,410.10

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 60 trades are reshuffled 5,000 times. The bar spans the 5th to 95th percentile, 1.1% to 2.7%; the tick is what actually happened, 1.6%. Order luck alone moves it this much.

0%3%
All 60 trades
SideEntryExitBarsP&L
long17 Mar 2024 65,300.6018 Mar 2024 68,393.501$3,092.83
long20 Mar 2024 61,937.4021 Mar 2024 67,840.501$5,903.10
long3 Apr 2024 65,464.005 Apr 2024 68,487.802$3,023.81
long13 Apr 2024 67,116.5018 Apr 2024 61,277.405−$5,839.14
long1 May 2024 60,672.004 May 2024 62,882.003$2,210.00
long12 Jun 2024 67,314.2017 Jun 2024 66,676.905−$637.37
long24 Jun 2024 63,210.0028 Jun 2024 61,706.504−$1,503.55
long5 Jul 2024 57,050.007 Jul 2024 58,230.102$1,180.11
long1 Aug 2024 64,628.006 Aug 2024 54,018.805−$10,609.20
long16 Aug 2024 57,541.1017 Aug 2024 58,874.601$1,333.54
long28 Aug 2024 59,415.002 Sep 2024 57,301.805−$2,113.23
long7 Sep 2024 53,963.009 Sep 2024 54,869.902$906.98
long2 Oct 2024 60,804.905 Oct 2024 62,086.003$1,281.08
long4 Nov 2024 68,776.006 Nov 2024 69,372.002$596.02
long27 Nov 2024 91,965.2028 Nov 2024 95,863.101$3,897.95
long20 Dec 2024 97,461.9025 Dec 2024 98,663.605$1,201.72
long31 Dec 2024 92,792.102 Jan 2025 94,591.802$1,799.73
long9 Jan 2025 95,060.6011 Jan 2025 94,726.102−$334.51
long3 Feb 2025 97,700.604 Feb 2025 101,329.001$3,627.92
long25 Feb 2025 91,552.902 Mar 2025 86,064.505−$5,488.34
long10 Mar 2025 80,734.5012 Mar 2025 82,933.002$2,198.51
long30 Mar 2025 82,648.502 Apr 2025 85,158.403$2,509.82
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.007 Jun 2025 104,288.001$2,779.74
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
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.0029 Aug 2025 112,567.003$2,454.92
long30 Aug 2025 108,377.002 Sep 2025 109,237.003$860.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
long17 Oct 2025 108,194.0020 Oct 2025 108,643.003$448.50
long31 Oct 2025 108,323.002 Nov 2025 110,098.002$1,775.23
long5 Nov 2025 101,497.008 Nov 2025 103,339.003$1,841.86
long14 Nov 2025 99,692.0019 Nov 2025 92,960.805−$6,731.20
long21 Nov 2025 86,637.2024 Nov 2025 86,830.003$192.78
long2 Dec 2025 86,286.003 Dec 2025 91,277.901$4,991.87
long15 Dec 2025 88,172.2020 Dec 2025 88,136.905−$35.21
long20 Jan 2026 92,631.0025 Jan 2026 89,225.305−$3,405.65
long26 Jan 2026 86,670.4027 Jan 2026 88,347.101$1,676.72
long30 Jan 2026 84,650.204 Feb 2026 75,770.205−$8,879.95
long6 Feb 2026 62,909.907 Feb 2026 70,580.301$7,670.39
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.3031 Mar 2026 66,797.403$390.10
long29 Apr 2026 76,342.802 May 2026 78,231.103$1,888.35
long17 May 2026 78,148.1021 May 2026 77,552.204−$595.81
long23 May 2026 75,539.5024 May 2026 76,752.001$1,212.50
long29 May 2026 73,617.503 Jun 2026 66,760.805−$6,856.68
long4 Jun 2026 64,142.808 Jun 2026 63,332.004−$810.74
long19 Jun 2026 62,958.0021 Jun 2026 64,298.002$1,340.00
long25 Jun 2026 61,078.0030 Jun 2026 60,260.205−$817.80
long12 Aug 2026 63,600.0017 Aug 2026 62,900.005−$700.01
long11 Sep 2026 76,568.7015 Sep 2026 78,189.204$1,620.47
long16 Sep 2026 75,644.5019 Sep 2026 80,883.903$5,239.38
long8 Oct 2026 83,321.8011 Oct 2026 82,988.403−$333.46

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 - Five Day Low RSI Strategy this page—v5 strategy+3.7%602.0%
PlanB Quant Investing 101 v2 by fillipponersi lowestv4 strategyNo trades on this market
STRATEGY R18-F-BTC by SenatorVonShaftlowest rsiv4 strategy−8.6%1114.4%
RSI Divergence Strategy by faytterrorsi lowestv5 strategy+102.9%412.0%
Dynamic Stop Loss Demo by Tindtilylowest rsiv5 strategydoes not run in Zeal Terminal
Stochastic RSI by Zeal Terminalrsi lowestv5 indicatorindicator

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

⋯// There is a time stop of five days if the sell criterium is not triggered.-//@version=5+//@version=6strategy("Hobbiecode - Five Day Low RSI Strategy", overlay=true)⋯

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 10 msYes 1,000 bars in 18 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 today’s close is below yesterday’s five-day low, go long at the close.// Sell at the close when the two-day RSI closes above 50.// There is a time stop of five days if the sell criterium is not triggered.//@version=5strategy("Hobbiecode - Five Day Low RSI Strategy", overlay=true)// RSI parametersrsi_period = 2rsi_upper = 50// Calculate RSIrsi_val = ta.rsi(close, rsi_period)// Check if today's close is below yesterday's 5 day lowconditionEntry = close < ta.lowest(low[1], 5) and strategy.position_size < 1if (conditionEntry)    strategy.entry("Buy", strategy.long)// Check if RSI closes above 50if (strategy.position_size > 0 and rsi_val > rsi_upper)    strategy.close("Buy")// If position held for more than 5 days without sell criteria, then close positionif (strategy.position_size > 0 and ta.barssince(conditionEntry) >= 5)    strategy.close("Buy")// Plot RSI on chartplot(rsi_val, title="RSI", color=color.red)hline(rsi_upper, title="Overbought Level", color=color.blue)