Pine Script v4 · Strategy
DUAL RSI
A Pine Script v4 strategy built on RSI (ohlc4, 16). It has 6 order rules, 2 entries among them, and trades long only with the default settings. Exits use a stop loss. Each trade is one contract and pays no commission. 3 settings; defaults include Fast RSILen 16, Slow RSILen 31 and Over Sold 91.
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 DUAL RSI repaint?
- No
- No repainting patterns were found in the source, and a live tick-by-tick replay matched history on 30 of 30 trades.
- How did DUAL RSI do on BTCUSDT 1D with default settings?
- +12.92%
- From 26 Jan 2024 to 21 Oct 2026, over 113 closed trades, against +102.5% for buy and hold. A backtest, not investment advice.
- Can DUAL RSI be converted to Pine Script v5?
- Yes
- The upgrade takes 1 step, from v4; each was run before and after on the same candles with identical results, and the v5 script can be downloaded below.
- Does DUAL RSI use a stop loss?
- Yes
- strategy.exit sets a stop on line 29, 33.
- Does DUAL RSI run in Zeal Terminal?
- Yes
- It compiles in 12 ms and runs 1,000 bars in 30 ms, in the browser.
BTCUSDT · 1D · default settings
- StopLossLine
- Winning trade
- Losing trade
- Equity
- Buy and hold
- Net profit
- +12.92%
- $12,920.50
- Buy and hold
- +102.5%
- same period
- Closed trades
- 113
- 54 won · 35 lost
- Profitable
- 47.8%
- of closed trades
- Profit factor
- 1.08
- gross profit ÷ gross loss
- Max drawdown
- 47.88%
- −$65,850.80
One run with the author's default settings, $100,000 starting capital, commission as the script sets it. A long position was still open at the last bar. 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
3 settings have no label
In the settings dialog FastRSILen (line 11), SlowRSILen (line 12), overSold (line 13) show an empty name. The labels on this page come from the variable names.
-
Note
No slippage
Fills are assumed at the exact open price. Add slippage in the properties for a more realistic test.
-
Note
Uses an argument v6 removed
when = on line 24, 31. The upgraded version below moves each call inside an if block.
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, sma → ta.sma.
- 2 strategy calls use the when = argument (line 24, 31). It is deprecated in v5 and removed in v6, where each call moves inside an if block.
v4 → v5
VerifiedSame 113 trades and the same P&L on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine.
- Line 1: //@version=4 → //@version=5
- Line 14: rsi → ta.rsi
- Line 15: rsi → ta.rsi
- Line 16: sma → ta.sma
- Line 24: strategy.entry(…, true) → strategy.entry(…, strategy.long)
- Line 31: strategy.entry(…, true) → strategy.entry(…, strategy.long)
-// @version=4+// @version=5// © HermanBrummer⋯overSold = input( 91 )-FastRsi = rsi(ohlc4, FastRSILen)+FastRsi = ta.rsi(ohlc4, FastRSILen)-SlowRsi = rsi(ohlc4, SlowRSILen)+SlowRsi = ta.rsi(ohlc4, SlowRSILen)-aboveMaFilter = close > sma(close, 200)+aboveMaFilter = close > ta.sma(close, 200)StopLossLine = strategy.position_avg_price * .90⋯// FAST_BUY-strategy.entry("Fast Enter", true, when=FastBuy)+strategy.entry("Fast Enter", strategy.long, when=FastBuy) ⋯// // /// SLOW_BUY-strategy.entry("Slow Enter", true, when=SlowBuy)+strategy.entry("Slow Enter", strategy.long, when=SlowBuy) ⋯Same 113 trades and the same P&L on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine.
- Line 11: input() → input.int()
- Line 12: input() → input.int()
- Line 13: input() → input.int()
- Line 24: when = FastBuy → if block
- Line 31: when = SlowBuy → if block
⋯/// SLOW RSI EXITS AT 68 RSI LEVEL-FastRSILen = input( 16 )+FastRSILen = input.int( 16 )-SlowRSILen = input( 31 )+SlowRSILen = input.int( 31 )-overSold = input( 91 )+overSold = input.int( 91 )FastRsi = ta.rsi(ohlc4, FastRSILen)⋯// FAST_BUY-strategy.entry("Fast Enter", strategy.long, when=FastBuy)+if FastBuy+ strategy.entry("Fast Enter", strategy.long) ⋯// // /// SLOW_BUY-strategy.entry("Slow Enter", strategy.long, when=SlowBuy)+if SlowBuy+ strategy.entry("Slow Enter", strategy.long) ⋯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: 113 before, 51 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.
-// @version=5+// @version=6// © HermanBrummer⋯Settings
Every input the script declares, with its default and what it feeds. Bounds are the ones the script enforces.
| Setting | Default | Type and range | Feeds |
|---|---|---|---|
| Fast RSILen (no label in the script) | 16 | int | FastRsi |
| Slow RSILen (no label in the script) | 31 | int | SlowRsi |
| Over Sold (no label in the script) | 91 | int | FastBuy SlowBuy |
What it calculates
- RSI (
rsi,ta.rsiin v5)ohlc4, Fast RSILen (16)FastRsi · line 14 - RSI (
rsi,ta.rsiin v5)ohlc4, Slow RSILen (31)SlowRsi · 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.
Order rules
| Order | Fires when | By default | Line |
|---|---|---|---|
| Open Fast Enter long | FastBuyFastRsi < overSold and aboveMaFilter | On | 24 |
| Close Fast Enter | FastRsi > 70 | On | 27 |
| Exit Stop Loss stop | every bar | On | 29 |
| Open Slow Enter long | SlowBuySlowRsi < overSold and aboveMaFilter | On | 31 |
| Exit Stop Loss stop | every bar | On | 33 |
| Close Slow Enter | SlowRsi > 68 | On | 35 |
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.
- 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.
| Market | Net | Buy and hold | Trades | Won | Profit factor | Max drawdown | Period |
|---|---|---|---|---|---|---|---|
| BTCUSDT 1D | +12.9% | +102.5% | 113 | 48% | 1.08 | 47.9% | 26 Jan 2024 – 21 Oct 2026 |
| BTCUSDT 4h | +34.5% | +5.5% | 96 | 42% | 3.96 | 10.0% | 8 May 2026 – 21 Oct 2026 |
| ETHUSDT 1D | +0.6% | +9.8% | 119 | 39% | 1.08 | 3.3% | 26 Jan 2024 – 21 Oct 2026 |
| ETHUSDT 4h | +1.4% | +8.4% | 75 | 51% | 2.87 | 0.5% | 8 May 2026 – 21 Oct 2026 |
| SOLUSDT 1D | −0.1% | +16.7% | 98 | 39% | 0.82 | 0.2% | 26 Jan 2024 – 21 Oct 2026 |
| SOLUSDT 4h | +0.0% | +21.5% | 128 | 45% | 1.43 | 0.0% | 8 May 2026 – 21 Oct 2026 |
| BNBUSDT 1D | −0.1% | +148.3% | 111 | 41% | 0.94 | 1.0% | 26 Jan 2024 – 21 Oct 2026 |
| BNBUSDT 4h | +0.2% | +17.1% | 78 | 47% | 1.71 | 0.2% | 8 May 2026 – 21 Oct 2026 |
Backtests are simulations on historical data and are not investment advice.
Settings heatmap
Two settings that feed the entry signal, moved around their defaults. The best in-sample pair (Fast RSILen 10, Slow RSILen 19) made +20.1% before 26 Dec 2025 and +21.7% after it, worse than the defaults' +40.4% after. Tuning on the past did not carry forward. 31% of the 64 combinations made money in-sample and 100% out-of-sample.
| Slow RSILen ↓ · Fast RSILen → | 8 | 10 | 11 | 14 | 16 | 19 | 22 | 27 |
|---|---|---|---|---|---|---|---|---|
| 16 | −18% | −3% | −3% | −15% | −8% | −3% | −23% | −25% |
| 19 | +13% | +20% | +18% | +8% | +10% | −2% | −21% | −23% |
| 22 | +6% | +19% | +19% | +5% | +9% | +13% | −21% | −23% |
| 26 | −1% | +13% | +13% | −6% | −0% | +3% | −15% | −18% |
| 31 | −41% | −35% | −34% | −30% | −27% | −42% | −39% | −42% |
| 37 | −1% | +13% | +13% | +12% | +14% | +2% | +1% | −11% |
| 43 | −21% | −8% | −8% | −9% | −7% | −18% | −10% | −22% |
| 53 | −27% | −28% | −27% | −38% | −30% | −32% | −25% | −28% |
| Slow RSILen ↓ · Fast RSILen → | 8 | 10 | 11 | 14 | 16 | 19 | 22 | 27 |
|---|---|---|---|---|---|---|---|---|
| 16 | +29% | +22% | +24% | +20% | +20% | +20% | +20% | +30% |
| 19 | +29% | +22% | +22% | +19% | +19% | +19% | +19% | +30% |
| 22 | +29% | +22% | +22% | +19% | +19% | +19% | +19% | +30% |
| 26 | +45% | +39% | +44% | +43% | +43% | +43% | +43% | +40% |
| 31 | +44% | +37% | +42% | +40% | +40% | +40% | +40% | +40% |
| 37 | +36% | +31% | +31% | +30% | +30% | +30% | +30% | +30% |
| 43 | +4% | +4% | +4% | +4% | +4% | +4% | +4% | +9% |
| 53 | +4% | +4% | +4% | +4% | +4% | +4% | +4% | +9% |
Net P&L of trades opened in each period, as a share of starting capital. marks the defaults and the best in-sample cell. Hover a cell for its trade count. Backtests are simulations on historical data and are not investment advice.
The trades
By market direction
| At entry, last 90 bars | Trades | Won | P&L |
|---|---|---|---|
| Rising market | 73 | 47% | $8,965.15 |
| Sideways market | 40 | 50% | $3,955.36 |
| Falling market | 0 | — | $0.00 |
Rising and falling mean the market moved more than 15% over the 90 bars before entry.
How bad could the drawdown be?
47.6%
The 95th percentile of the worst drawdown when the same 113 trades are reshuffled 5,000 times. The bar spans the 5th to 95th percentile, 23.4% to 47.6%; the tick is what actually happened, 43.1%. Order luck alone moves it this much.
All 113 trades
| Side | Entry | Exit | Bars | P&L |
|---|---|---|---|---|
| long | 24 Aug 2024 64,037.20 | 1 Sep 2024 57,633.50 | 8 | −$6,403.73 |
| long | 24 Aug 2024 64,037.20 | 1 Sep 2024 57,633.50 | 8 | −$6,403.73 |
| long | 25 Sep 2024 64,262.70 | 29 Sep 2024 65,858.00 | 4 | $1,595.30 |
| long | 25 Sep 2024 64,262.70 | 11 Nov 2024 80,370.00 | 47 | $16,107.30 |
| long | 29 Sep 2024 65,858.00 | 11 Nov 2024 80,370.00 | 43 | $14,512.00 |
| long | 12 Nov 2024 88,648.00 | 13 Nov 2024 87,952.00 | 1 | −$696.00 |
| long | 12 Nov 2024 88,648.00 | 13 Nov 2024 87,952.00 | 1 | −$696.00 |
| long | 13 Nov 2024 87,952.00 | 13 Nov 2024 87,952.00 | 0 | $0.00 |
| long | 14 Nov 2024 90,375.20 | 15 Nov 2024 87,325.60 | 1 | −$3,049.62 |
| long | 14 Nov 2024 90,375.20 | 15 Nov 2024 87,325.60 | 1 | −$3,049.62 |
| long | 15 Nov 2024 87,325.60 | 15 Nov 2024 87,325.60 | 0 | $0.00 |
| long | 16 Nov 2024 91,032.10 | 17 Nov 2024 90,588.00 | 1 | −$444.10 |
| long | 16 Nov 2024 91,032.10 | 17 Nov 2024 90,588.00 | 1 | −$444.10 |
| long | 17 Nov 2024 90,588.00 | 17 Nov 2024 90,588.00 | 0 | $0.00 |
| long | 18 Nov 2024 89,856.00 | 19 Nov 2024 90,464.10 | 1 | $608.09 |
| long | 18 Nov 2024 89,856.00 | 19 Nov 2024 90,464.10 | 1 | $608.09 |
| long | 19 Nov 2024 90,464.10 | 19 Nov 2024 90,464.10 | 0 | $0.00 |
| long | 20 Nov 2024 92,310.80 | 21 Nov 2024 94,286.60 | 1 | $1,975.76 |
| long | 20 Nov 2024 92,310.80 | 21 Nov 2024 94,286.60 | 1 | $1,975.76 |
| long | 21 Nov 2024 94,286.60 | 21 Nov 2024 94,286.60 | 0 | $0.00 |
| long | 22 Nov 2024 98,317.10 | 23 Nov 2024 98,892.00 | 1 | $574.88 |
| long | 22 Nov 2024 98,317.10 | 23 Nov 2024 98,892.00 | 1 | $574.88 |
| long | 23 Nov 2024 98,892.00 | 23 Nov 2024 98,892.00 | 0 | $0.00 |
| long | 24 Nov 2024 97,672.40 | 25 Nov 2024 97,900.10 | 1 | $227.65 |
| long | 24 Nov 2024 97,672.40 | 25 Nov 2024 97,900.10 | 1 | $227.65 |
| long | 25 Nov 2024 97,900.10 | 25 Nov 2024 97,900.10 | 0 | $0.00 |
| long | 26 Nov 2024 93,010.00 | 27 Nov 2024 91,965.20 | 1 | −$1,044.85 |
| long | 26 Nov 2024 93,010.00 | 29 Nov 2024 95,644.00 | 3 | $2,633.98 |
| long | 28 Nov 2024 95,863.10 | 29 Nov 2024 95,644.00 | 1 | −$219.12 |
| long | 29 Nov 2024 95,644.00 | 30 Nov 2024 97,460.00 | 1 | $1,816.01 |
| long | 30 Nov 2024 97,460.00 | 1 Dec 2024 96,408.00 | 1 | −$1,052.01 |
| long | 1 Dec 2024 96,408.00 | 1 Dec 2024 96,408.00 | 0 | $0.00 |
| long | 1 Dec 2024 96,408.00 | 2 Dec 2024 97,185.20 | 1 | $777.18 |
| long | 2 Dec 2024 97,185.20 | 3 Dec 2024 95,840.60 | 1 | −$1,344.56 |
| long | 3 Dec 2024 95,840.60 | 3 Dec 2024 95,840.60 | 0 | $0.00 |
| long | 3 Dec 2024 95,840.60 | 4 Dec 2024 95,849.70 | 1 | $9.08 |
| long | 4 Dec 2024 95,849.70 | 5 Dec 2024 98,587.30 | 1 | $2,737.63 |
| long | 5 Dec 2024 98,587.30 | 5 Dec 2024 98,587.30 | 0 | $0.00 |
| long | 5 Dec 2024 98,587.30 | 6 Dec 2024 96,945.60 | 1 | −$1,641.69 |
| long | 6 Dec 2024 96,945.60 | 7 Dec 2024 99,740.80 | 1 | $2,795.21 |
| long | 7 Dec 2024 99,740.80 | 7 Dec 2024 99,740.80 | 0 | $0.00 |
| long | 7 Dec 2024 99,740.80 | 8 Dec 2024 99,832.00 | 1 | $91.15 |
| long | 8 Dec 2024 99,832.00 | 9 Dec 2024 101,110.00 | 1 | $1,277.61 |
| long | 9 Dec 2024 101,110.00 | 9 Dec 2024 101,110.00 | 0 | $0.00 |
| long | 9 Dec 2024 101,110.00 | 10 Dec 2024 97,276.50 | 1 | −$3,833.12 |
| long | 10 Dec 2024 97,276.50 | 16 Dec 2024 104,464.00 | 6 | $7,187.51 |
| long | 11 Dec 2024 96,593.00 | 16 Dec 2024 104,464.00 | 5 | $7,870.99 |
| long | 16 Dec 2024 104,464.00 | 17 Dec 2024 106,059.00 | 1 | $1,594.66 |
| long | 17 Dec 2024 106,059.00 | 18 Dec 2024 106,134.00 | 1 | $75.09 |
| long | 18 Dec 2024 106,134.00 | 18 Dec 2024 106,134.00 | 0 | $0.00 |
| long | 18 Dec 2024 106,134.00 | 19 Dec 2024 100,204.00 | 1 | −$5,929.73 |
| long | 19 Dec 2024 100,204.00 | 25 Feb 2025 88,949.60 | 68 | −$11,254.40 |
| long | 20 Dec 2024 97,461.90 | 25 Feb 2025 88,949.60 | 67 | −$8,512.22 |
| long | 26 Feb 2025 88,680.40 | 28 Feb 2025 79,812.40 | 2 | −$8,868.04 |
| long | 26 Feb 2025 88,680.40 | 28 Feb 2025 79,812.40 | 2 | −$8,868.04 |
| long | 1 Mar 2025 84,349.90 | 7 Apr 2025 75,914.90 | 37 | −$8,435.00 |
| long | 1 Mar 2025 84,349.90 | 7 Apr 2025 75,914.90 | 37 | −$8,435.00 |
| long | 23 Apr 2025 93,443.00 | 24 Apr 2025 93,691.10 | 1 | $248.08 |
| long | 23 Apr 2025 93,443.00 | 10 May 2025 102,972.00 | 17 | $9,529.00 |
| long | 24 Apr 2025 93,691.10 | 10 May 2025 102,972.00 | 16 | $9,280.92 |
| long | 11 May 2025 104,810.00 | 12 May 2025 104,118.00 | 1 | −$691.53 |
| long | 11 May 2025 104,810.00 | 12 May 2025 104,118.00 | 1 | −$691.53 |
| long | 12 May 2025 104,118.00 | 12 May 2025 104,118.00 | 0 | $0.00 |
| long | 13 May 2025 102,791.00 | 14 May 2025 104,104.00 | 1 | $1,312.40 |
| long | 13 May 2025 102,791.00 | 20 May 2025 105,574.00 | 7 | $2,782.41 |
| long | 14 May 2025 104,104.00 | 20 May 2025 105,574.00 | 6 | $1,470.01 |
| long | 21 May 2025 106,850.00 | 22 May 2025 109,644.00 | 1 | $2,793.99 |
| long | 21 May 2025 106,850.00 | 22 May 2025 109,644.00 | 1 | $2,793.99 |
| long | 22 May 2025 109,644.00 | 22 May 2025 109,644.00 | 0 | $0.00 |
| long | 23 May 2025 111,696.00 | 24 May 2025 107,318.00 | 1 | −$4,377.92 |
| long | 23 May 2025 111,696.00 | 24 May 2025 107,318.00 | 1 | −$4,377.92 |
| long | 24 May 2025 107,318.00 | 24 May 2025 107,318.00 | 0 | $0.00 |
| long | 25 May 2025 107,762.00 | 26 May 2025 109,004.00 | 1 | $1,242.30 |
| long | 25 May 2025 107,762.00 | 27 May 2025 109,435.00 | 2 | $1,672.88 |
| long | 26 May 2025 109,004.00 | 27 May 2025 109,435.00 | 1 | $430.58 |
| long | 28 May 2025 108,938.00 | 12 Jul 2025 117,528.00 | 45 | $8,589.49 |
| long | 28 May 2025 108,938.00 | 14 Jul 2025 119,087.00 | 47 | $10,148.50 |
| long | 12 Jul 2025 117,528.00 | 14 Jul 2025 119,087.00 | 2 | $1,558.99 |
| long | 15 Jul 2025 119,841.00 | 16 Jul 2025 117,758.00 | 1 | −$2,083.09 |
| long | 15 Jul 2025 119,841.00 | 10 Oct 2025 106,920.00 | 87 | −$12,921.50 |
| long | 16 Jul 2025 117,758.00 | 10 Oct 2025 106,920.00 | 86 | −$10,838.40 |
| long | 11 Oct 2025 112,774.00 | 4 Nov 2025 101,497.00 | 24 | −$11,277.50 |
| long | 11 Oct 2025 112,774.00 | 4 Nov 2025 101,497.00 | 24 | −$11,277.50 |
| long | 20 Aug 2026 69,334.80 | 21 Aug 2026 73,027.00 | 1 | $3,692.24 |
| long | 20 Aug 2026 69,334.80 | 22 Aug 2026 78,338.00 | 2 | $9,003.25 |
| long | 21 Aug 2026 73,027.00 | 22 Aug 2026 78,338.00 | 1 | $5,311.01 |
| long | 23 Aug 2026 77,074.90 | 24 Aug 2026 77,734.00 | 1 | $659.06 |
| long | 23 Aug 2026 77,074.90 | 24 Aug 2026 77,734.00 | 1 | $659.06 |
| long | 24 Aug 2026 77,734.00 | 24 Aug 2026 77,734.00 | 0 | $0.00 |
| long | 25 Aug 2026 78,992.80 | 26 Aug 2026 78,539.10 | 1 | −$453.63 |
| long | 25 Aug 2026 78,992.80 | 26 Aug 2026 78,539.10 | 1 | −$453.63 |
| long | 26 Aug 2026 78,539.10 | 26 Aug 2026 78,539.10 | 0 | $0.00 |
| long | 27 Aug 2026 79,023.80 | 28 Aug 2026 80,249.60 | 1 | $1,225.84 |
| long | 27 Aug 2026 79,023.80 | 28 Aug 2026 80,249.60 | 1 | $1,225.84 |
| long | 28 Aug 2026 80,249.60 | 28 Aug 2026 80,249.60 | 0 | $0.00 |
| long | 29 Aug 2026 77,845.90 | 30 Aug 2026 78,230.00 | 1 | $384.12 |
| long | 29 Aug 2026 77,845.90 | 30 Aug 2026 78,230.00 | 1 | $384.12 |
| long | 30 Aug 2026 78,230.00 | 30 Aug 2026 78,230.00 | 0 | $0.00 |
| long | 31 Aug 2026 77,682.00 | 1 Sep 2026 78,581.30 | 1 | $899.30 |
| long | 31 Aug 2026 77,682.00 | 1 Sep 2026 78,581.30 | 1 | $899.30 |
| long | 1 Sep 2026 78,581.30 | 1 Sep 2026 78,581.30 | 0 | $0.00 |
| long | 2 Sep 2026 77,439.00 | 4 Sep 2026 81,270.40 | 2 | $3,831.36 |
| long | 2 Sep 2026 77,439.00 | 4 Sep 2026 81,270.40 | 2 | $3,831.36 |
| long | 4 Sep 2026 81,270.40 | 4 Sep 2026 81,270.40 | 0 | $0.00 |
| long | 5 Sep 2026 79,660.80 | 6 Sep 2026 79,831.80 | 1 | $170.98 |
| long | 5 Sep 2026 79,660.80 | 6 Sep 2026 79,831.80 | 1 | $170.98 |
| long | 6 Sep 2026 79,831.80 | 6 Sep 2026 79,831.80 | 0 | $0.00 |
| long | 7 Sep 2026 80,341.80 | 8 Sep 2026 79,112.00 | 1 | −$1,229.83 |
| long | 7 Sep 2026 80,341.80 | 22 Sep 2026 86,620.00 | 15 | $6,278.18 |
| long | 8 Sep 2026 79,112.00 | 22 Sep 2026 86,620.00 | 14 | $7,508.01 |
| long | 23 Sep 2026 86,208.60 | 24 Sep 2026 84,397.60 | 1 | −$1,810.97 |
| long | 23 Sep 2026 86,208.60 | 24 Sep 2026 84,397.60 | 1 | −$1,810.97 |
| long | 24 Sep 2026 84,397.60 | 24 Sep 2026 84,397.60 | 0 | $0.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.
| Script | Shares | Type | Net | Trades | Max drawdown |
|---|---|---|---|---|---|
| DUAL RSI this page | — | v4 strategy | +12.9% | 113 | 47.9% |
| Triple RSI strategy by Trade_by_DB | rsi | v5 strategy | +3.2% | 2 | 3.3% |
| Hobbiecode - RSI + Close previous day by hobbiecode | rsi | v5 strategy | +1.2% | 63 | 4.2% |
| dirt cheap yet elegant RSI Strategy by SparkyFlary | rsi | v4 strategy | −11.4% | 8 | 20.5% |
| RSI Classic Strategy (by Coinrule) by Coinrule | rsi | v4 strategy | +7.5% | 6 | 7.2% |
| RSITrendStrategy by email_analysts | rsi | v4 strategy | +69.2% | 22 | 38.6% |
Where it runs
| Engine | Compiles | Runs | Matches TradingView |
|---|---|---|---|
| Zeal Terminal · OpenPineScript v2 | Yes 12 ms | With a workaround 1,000 bars in 30 ms | Not measured |
| PineTS | No v5 and v6 only | — | Not measured |
Zeal Terminal's engine currently reads an order side written as true as a short, whatever it says; this page passes the same side as strategy.long or strategy.short (lines 24, 31) so the engine trades the way the script says.
“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.
// @version=4// © HermanBrummer// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/strategy("DUAL RSI", "RSI", 1, pyramiding=2)/// USES TWO RSI'S BOTH OF THEM CAN TRADE IN THE SAME DIRECTION AT THE SAME TIME -- ONE SLOW RSI, AND ONE FAST RSI/// BOTH RSI'S HAVE DIFFERENT LENGHTS ONE IS FAST AND HAS A SETTTING OF 16 ONE IS SLOW AND HAS A SETTING OF 31/// BOTH RSI'S HAVE DIFERENT EXIT PARAMETERS/// PYRAMIDING ALLOWS THE SYSTEM TO BUY ONE DO ONE SLOW RSI AND ONE FAST RSI BUY ON THE SAME DAY/// FASTRSI EXITS AT 70 RSI LEVEL/// SLOW RSI EXITS AT 68 RSI LEVELFastRSILen = input( 16 )SlowRSILen = input( 31 )overSold = input( 91 )FastRsi = rsi(ohlc4, FastRSILen)SlowRsi = rsi(ohlc4, SlowRSILen)aboveMaFilter = close > sma(close, 200)StopLossLine = strategy.position_avg_price * .90plot(StopLossLine, "StopLossLine", #ff0000)// plot(FastRsi, "FastRsi", color.yellow, 2)// plot(SlowRsi, "SlowRsi", color.purple, 2)FastBuy = FastRsi < overSold and aboveMaFilter //and strategy.position_size != 1SlowBuy = SlowRsi < overSold and aboveMaFilter //and strategy.position_size != 1// FAST_BUYstrategy.entry("Fast Enter", true, when=FastBuy) if FastRsi > 70 /// SELLS IF RSI == 75 strategy.close("Fast Enter", comment="Fast Exit") strategy.exit("Stop Loss", "Fast Enter", stop=StopLossLine) // // /// SLOW_BUYstrategy.entry("Slow Enter", true, when=SlowBuy) strategy.exit("Stop Loss", "Slow Enter", stop=StopLossLine) if SlowRsi > 68 /// SELLS IF RSI == 68 strategy.close("Slow Enter", comment="Slow Exit")