Pine Script v4 · Strategy
CoinruleCombinedCryptoStrat
A Pine Script v4 strategy built on RSI (close, lengthRSI), Crossover (9, 50) and Crossunder (close, 100). 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 2% of equity and pays 0.35% commission. 16 settings; defaults include Oversold 35, Overbought 70 and Additional Timescale 60.
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 CoinruleCombinedCryptoStrat repaint?
- Yes
- At least one pattern in the source can repaint: higher-timeframe data.
- How did CoinruleCombinedCryptoStrat do on BTCUSDT 1D with default settings?
- +17.63%
- From 26 Jan 2024 to 21 Oct 2026, over 98 closed trades, against +102.5% for buy and hold. A backtest, not investment advice.
- Can CoinruleCombinedCryptoStrat 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 CoinruleCombinedCryptoStrat use a stop loss?
- No
- Every exit waits for a signal; nothing limits a losing trade before it fires.
- Does CoinruleCombinedCryptoStrat run in Zeal Terminal?
- Yes
- It compiles in 14 ms and runs 1,000 bars in 44 ms, in the browser.
BTCUSDT · 1D · default settings
- signal
- fast
- slow
- mid
- Winning trade
- Losing trade
- Equity
- Buy and hold
Needs BINANCE:BTCUSDT 60 data, not available: a lower timeframe than the chart; the engine does not evaluate intrabar data Values that depend on it are empty on this chart.
- Net profit
- +17.63%
- $1,762.50
- Buy and hold
- +102.5%
- same period
- Closed trades
- 98
- 77 won · 21 lost
- Profitable
- 78.6%
- of closed trades
- Profit factor
- 4.33
- gross profit ÷ gross loss
- Max drawdown
- 20.74%
- −$2,397.18
One run with the author's default settings, $10,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
4 settings do nothing
“Long ma fast”, “Long ma slow”, “Lookback Long Period”, “Lookback Short Period” are declared but never read.
-
Check
No stop loss
Every exit waits for a signal. Nothing limits a losing trade before the exit condition fires.
-
Note
13 settings have no label
In the settings dialog oversold (line 9), overbought (line 10), SellPct (line 16), ExitPct (line 17), movingaverage_signal (line 19), movingaverage_fast (line 20), movingaverage_slow (line 21), movingaverage_mid (line 22), long_ma_signal (line 23), long_ma_fast (line 24), long_ma_slow (line 25), long_ma_mid (line 26), Stop_loss (line 41) 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 37, 46, 47. The upgraded version below moves each call inside an if block.
-
Note
Uses long =, which v5 renamed line 37
long = on line 37. v5 writes it as direction = strategy.long or strategy.short.
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, security → request.security, crossover → ta.crossover, crossunder → ta.crossunder.
- 3 strategy calls use the when = argument (line 37, 46, 47). It is deprecated in v5 and removed in v6, where each call moves inside an if block.
v4 → v5
VerifiedSame 98 trades and the same P&L on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine.
- Line 3: //@version=4 → //@version=5
- Line 7: rsi → ta.rsi
- Line 19: sma → ta.sma
- Line 20: sma → ta.sma
- Line 21: sma → ta.sma
- Line 22: sma → ta.sma
11 more edits
- Line 23: security → request.security
- Line 23: sma → ta.sma
- Line 24: security → request.security
- Line 24: sma → ta.sma
- Line 25: security → request.security
- Line 25: sma → ta.sma
- Line 26: security → request.security
- Line 26: sma → ta.sma
- Line 35: crossover → ta.crossover
- Line 37: long = true → direction = strategy.long
- Line 44: crossunder → ta.crossunder
⋯// © syfuslokust-//@version=4+//@version=5strategy(shorttitle='CoinruleCombinedCryptoStrat',title='CoinruleCombinedCryptoStrat', overlay=true, initial_capital = 10000, pyramiding = 1000, process_orders_on_close=true, default_qty_type = strategy.percent_of_equity, default_qty_value = 2, commission_type=strategy.commission.percent, commission_value=0.35)⋯lengthRSI = 14-RSI = rsi(close, lengthRSI)+RSI = ta.rsi(close, lengthRSI)//Normal⋯//MA inputs and calculations-movingaverage_signal = sma(close, input(9))+movingaverage_signal = ta.sma(close, input(9))-movingaverage_fast = sma(close, input(50))+movingaverage_fast = ta.sma(close, input(50))-movingaverage_slow = sma(close, input(200))+movingaverage_slow = ta.sma(close, input(200))-movingaverage_mid= sma(close, input(100))+movingaverage_mid= ta.sma(close, input(100))-long_ma_signal = security(syminfo.tickerid, res, sma(close, input(9)), lookahead=barmerge.lookahead_on)+long_ma_signal = request.security(syminfo.tickerid, res, ta.sma(close, input(9)), lookahead=barmerge.lookahead_on)-long_ma_fast = security(syminfo.tickerid, res, sma(close, input(50)), lookahead=barmerge.lookahead_on)+long_ma_fast = request.security(syminfo.tickerid, res, ta.sma(close, input(50)), lookahead=barmerge.lookahead_on)-long_ma_slow = security(syminfo.tickerid, res, sma(close, input(200)), lookahead=barmerge.lookahead_on)+long_ma_slow = request.security(syminfo.tickerid, res, ta.sma(close, input(200)), lookahead=barmerge.lookahead_on)-long_ma_mid= security(syminfo.tickerid, res, sma(close, input(100)), lookahead=barmerge.lookahead_on)+long_ma_mid= request.security(syminfo.tickerid, res, ta.sma(close, input(100)), lookahead=barmerge.lookahead_on)//Look Back⋯//MA-bullish = crossover(movingaverage_signal, movingaverage_fast)+bullish = ta.crossover(movingaverage_signal, movingaverage_fast)//Execute buy-strategy.entry(id="long", long = true, when = (RSI < oversold) and movingaverage_signal < movingaverage_mid, comment="BuyIn")+strategy.entry(id="long", direction = strategy.long, when = (RSI < oversold) and movingaverage_signal < movingaverage_mid, comment="BuyIn")//when = crossover(close, movingaverage_signal) and movingaverage_signal < movingaverage_slow and RSI < oversold)⋯//MA-bearish = crossunder(close, long_ma_mid)+bearish = ta.crossunder(close, long_ma_mid)//Execute sell⋯Same 98 trades and the same P&L on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine.
- Line 9: input() → input.int()
- Line 10: input() → input.int()
- Line 11: input() → input.string()
- Line 16: input() → input.int()
- Line 17: input() → input.int()
- Line 19: input() → input.int()
13 more edits
- Line 20: input() → input.int()
- Line 21: input() → input.int()
- Line 22: input() → input.int()
- Line 23: input() → input.int()
- Line 24: input() → input.int()
- Line 25: input() → input.int()
- Line 26: input() → input.int()
- Line 28: input() → input.int()
- Line 29: input() → input.int()
- Line 37: when = (RSI < oversold) and movingaverage_signal < movingaverage_mid → if block
- Line 41: input() → input.int()
- Line 46: when = RSI > overbought and movingaverage_fast > movingaverage_mid → if block
- Line 47: when = bearish → if block
⋯//Normal-oversold = input(35)+oversold = input.int(35)-overbought = input(70)+overbought = input.int(70)-res = input(title="Additional Timescale", defval="60", options=["5", "15", "60", "360", "1D"])+res = input.string(title="Additional Timescale", defval="60", options=["5", "15", "60", "360", "1D"])//ALGO⋯//sell pct-SellPct = input(15)+SellPct = input.int(15)-ExitPct = input(50)+ExitPct = input.int(50)//MA inputs and calculations-movingaverage_signal = ta.sma(close, input(9))+movingaverage_signal = ta.sma(close, input.int(9))-movingaverage_fast = ta.sma(close, input(50))+movingaverage_fast = ta.sma(close, input.int(50))-movingaverage_slow = ta.sma(close, input(200))+movingaverage_slow = ta.sma(close, input.int(200))-movingaverage_mid= ta.sma(close, input(100))+movingaverage_mid= ta.sma(close, input.int(100))-long_ma_signal = request.security(syminfo.tickerid, res, ta.sma(close, input(9)), lookahead=barmerge.lookahead_on)+long_ma_signal = request.security(syminfo.tickerid, res, ta.sma(close, input.int(9)), lookahead=barmerge.lookahead_on)-long_ma_fast = request.security(syminfo.tickerid, res, ta.sma(close, input(50)), lookahead=barmerge.lookahead_on)+long_ma_fast = request.security(syminfo.tickerid, res, ta.sma(close, input.int(50)), lookahead=barmerge.lookahead_on)-long_ma_slow = request.security(syminfo.tickerid, res, ta.sma(close, input(200)), lookahead=barmerge.lookahead_on)+long_ma_slow = request.security(syminfo.tickerid, res, ta.sma(close, input.int(200)), lookahead=barmerge.lookahead_on)-long_ma_mid= request.security(syminfo.tickerid, res, ta.sma(close, input(100)), lookahead=barmerge.lookahead_on)+long_ma_mid= request.security(syminfo.tickerid, res, ta.sma(close, input.int(100)), lookahead=barmerge.lookahead_on)//Look Back-inp_lkb = input(12, title='Lookback Long Period')+inp_lkb = input.int(12, title='Lookback Long Period')-inp_lkb_2 = input(2, title='Lookback Short Period')+inp_lkb_2 = input.int(2, title='Lookback Short Period') ⋯//Execute buy-strategy.entry(id="long", direction = strategy.long, when = (RSI < oversold) and movingaverage_signal < movingaverage_mid, comment="BuyIn")+if (RSI < oversold) and movingaverage_signal < movingaverage_mid+ strategy.entry(id="long", direction = strategy.long, comment="BuyIn")//when = crossover(close, movingaverage_signal) and movingaverage_signal < movingaverage_slow and RSI < oversold)⋯//RSI-Stop_loss= ((input (4))/100)+Stop_loss= ((input.int (4))/100)longStopPrice = strategy.position_avg_price * (1 - Stop_loss)⋯//Execute sell-strategy.close("long", qty_percent = SellPct, when = RSI > overbought and movingaverage_fast > movingaverage_mid, comment="SmallSell")+if RSI > overbought and movingaverage_fast > movingaverage_mid+ strategy.close("long", qty_percent = SellPct, comment="SmallSell")-strategy.close("long", qty_percent = ExitPct, when = bearish, comment="StopLoss")+if bearish+ strategy.close("long", qty_percent = ExitPct, comment="StopLoss")//strategy.close("long", qty_percent = ExitPct, when = bearish )⋯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: 98 before, 98 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.
⋯// © syfuslokust-//@version=5+//@version=6strategy(shorttitle='CoinruleCombinedCryptoStrat',title='CoinruleCombinedCryptoStrat', overlay=true, initial_capital = 10000, pyramiding = 1000, process_orders_on_close=true, default_qty_type = strategy.percent_of_equity, default_qty_value = 2, commission_type=strategy.commission.percent, commission_value=0.35)⋯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 |
|---|---|---|---|
| Oversold (no label in the script) | 35 | int | entry long |
| Overbought (no label in the script) | 70 | int | close long |
| Additional Timescale | 60 | string · options ["5", "15", "60", "360", "1D"] | long_ma_signal long_ma_fast long_ma_slow long_ma_mid |
| Sell Pct (no label in the script) | 15 | int | close long |
| Exit Pct (no label in the script) | 50 | int | close long |
| Movingaverage signal (no label in the script) | 9 | int | bullish entry long signal |
| Movingaverage fast (no label in the script) | 50 | int | bullish close long fast |
| Movingaverage slow (no label in the script) | 200 | int | slow |
| Movingaverage mid (no label in the script) | 100 | int | entry long close long mid |
| Long ma signal (no label in the script) | 9 | int | long signal |
| Long ma fast (no label in the script) | 50 | int | unused |
| Long ma slow (no label in the script) | 200 | int | unused |
| Long ma mid (no label in the script) | 100 | int | bearish long slow |
| Lookback Long Period | 12 | int | unused |
| Lookback Short Period | 2 | int | unused |
| Stop loss (no label in the script) | 4 | int | longStopPrice |
What it calculates
- RSI (
rsi,ta.rsiin v5)close, lengthRSIRSI · line 7 - Crossover (
crossover,ta.crossoverin v5)Movingaverage signal (9), Movingaverage fast (50)bullish · line 35 - Crossunder (
crossunder,ta.crossunderin v5)close, Long ma mid (100)bearish · line 44
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 long long | (RSI < oversold) and movingaverage_signal < movingaverage_mid | On | 37 |
| Close long | RSI > overbought and movingaverage_fast > movingaverage_mid | On | 46 |
| Close long | bearish | On | 47 |
Each order is guarded by the setting shown. “Off” orders never fire unless that setting is switched on.
Does it repaint?
Yes
At least one pattern in the source can repaint; it is marked Check below.
- CheckHigher-timeframe data4 security call(s) use lookahead_on (line 23, 24, 25, 26). Without a [1] offset this reads future bars in history.
- 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 timingprocess_orders_on_close = true: orders fill at the signal bar's close.
The checks read the source; the replay runs it. Together they catch the common causes, not every possible one.
Other markets
Not run on other markets: the script requests BINANCE:BTCUSDT 60, and that data is not available here (a lower timeframe than the chart; the engine does not evaluate intrabar data). Its results would rest on empty values.
The trades
By market direction
| At entry, last 90 bars | Trades | Won | P&L |
|---|---|---|---|
| Rising market | 0 | — | $0.00 |
| Sideways market | 36 | 94% | $1,018.85 |
| Falling market | 62 | 69% | $754.58 |
Rising and falling mean the market moved more than 15% over the 90 bars before entry.
How bad could the drawdown be?
1.1%
The 95th percentile of the worst drawdown when the same 98 trades are reshuffled 5,000 times. The bar spans the 5th to 95th percentile, 0.5% to 1.1%; the tick is what actually happened, 4.4%. Order luck alone moves it this much.
All 98 trades
| Side | Entry | Exit | Bars | P&L |
|---|---|---|---|---|
| long | 23 Jun 2024 63,210.00 | 29 Oct 2024 72,736.40 | 128 | $28.54 |
| long | 24 Jun 2024 60,293.30 | 29 Oct 2024 72,736.40 | 127 | $39.55 |
| long | 25 Jun 2024 61,806.00 | 29 Oct 2024 72,736.40 | 126 | $7.74 |
| long | 25 Jun 2024 61,806.00 | 30 Oct 2024 72,344.70 | 127 | $25.01 |
| long | 26 Jun 2024 60,865.00 | 30 Oct 2024 72,344.70 | 126 | $36.03 |
| long | 28 Jun 2024 60,427.80 | 30 Oct 2024 72,344.70 | 124 | $4.14 |
| long | 28 Jun 2024 60,427.80 | 6 Nov 2024 75,572.00 | 131 | $43.00 |
| long | 4 Jul 2024 57,050.00 | 6 Nov 2024 75,572.00 | 125 | $40.94 |
| long | 4 Jul 2024 57,050.00 | 7 Nov 2024 75,857.90 | 126 | $22.02 |
| long | 5 Jul 2024 56,628.80 | 7 Nov 2024 75,857.90 | 125 | $60.39 |
| long | 5 Jul 2024 56,628.80 | 8 Nov 2024 76,509.80 | 126 | $5.29 |
| long | 7 Jul 2024 55,857.80 | 8 Nov 2024 76,509.80 | 124 | $70.33 |
| long | 7 Jul 2024 55,857.80 | 9 Nov 2024 76,677.50 | 125 | $0.99 |
| long | 8 Jul 2024 56,714.60 | 9 Nov 2024 76,677.50 | 124 | $61.30 |
| long | 8 Jul 2024 56,714.60 | 10 Nov 2024 80,370.00 | 125 | $7.94 |
| long | 4 Aug 2024 58,161.00 | 10 Nov 2024 80,370.00 | 98 | $51.51 |
| long | 4 Aug 2024 58,161.00 | 11 Nov 2024 88,648.00 | 99 | $31.28 |
| long | 5 Aug 2024 54,018.80 | 11 Nov 2024 88,648.00 | 98 | $43.11 |
| long | 5 Aug 2024 54,018.80 | 12 Nov 2024 87,952.00 | 99 | $65.56 |
| long | 5 Aug 2024 54,018.80 | 13 Nov 2024 90,375.20 | 100 | $14.38 |
| long | 6 Aug 2024 56,022.00 | 13 Nov 2024 90,375.20 | 99 | $42.82 |
| long | 6 Aug 2024 56,022.00 | 14 Nov 2024 87,325.60 | 100 | $43.63 |
| long | 6 Aug 2024 56,022.00 | 15 Nov 2024 91,032.10 | 101 | $28.96 |
| long | 7 Aug 2024 55,134.20 | 15 Nov 2024 91,032.10 | 100 | $12.90 |
| long | 7 Aug 2024 55,134.20 | 16 Nov 2024 90,586.90 | 101 | $35.76 |
| long | 7 Aug 2024 55,134.20 | 17 Nov 2024 89,856.00 | 102 | $29.77 |
| long | 7 Aug 2024 55,134.20 | 18 Nov 2024 90,464.10 | 103 | $25.75 |
| long | 7 Aug 2024 55,134.20 | 19 Nov 2024 92,310.80 | 104 | $20.80 |
| long | 6 Sep 2024 53,963.00 | 19 Nov 2024 92,310.80 | 74 | $2.31 |
| long | 6 Sep 2024 53,963.00 | 20 Nov 2024 94,286.60 | 75 | $21.27 |
| long | 6 Sep 2024 53,963.00 | 21 Nov 2024 98,317.10 | 76 | $19.90 |
| long | 6 Sep 2024 53,963.00 | 22 Nov 2024 98,892.00 | 77 | $17.14 |
| long | 6 Sep 2024 53,963.00 | 23 Nov 2024 97,672.40 | 78 | $14.17 |
| long | 6 Sep 2024 53,963.00 | 24 Nov 2024 97,900.00 | 79 | $12.11 |
| long | 6 Sep 2024 53,963.00 | 17 Dec 2024 106,134.00 | 102 | $12.23 |
| long | 6 Sep 2024 53,963.00 | 18 May 2025 106,454.00 | 254 | $69.76 |
| long | 24 Feb 2025 91,552.90 | 18 May 2025 106,454.00 | 83 | $33.93 |
| long | 24 Feb 2025 91,552.90 | 20 May 2025 106,850.00 | 85 | $0.25 |
| long | 25 Feb 2025 88,680.40 | 20 May 2025 106,850.00 | 84 | $43.37 |
| long | 26 Feb 2025 84,250.10 | 20 May 2025 106,850.00 | 83 | $14.79 |
| long | 26 Feb 2025 84,250.10 | 21 May 2025 109,644.00 | 84 | $47.70 |
| long | 27 Feb 2025 84,708.60 | 21 May 2025 109,644.00 | 83 | $18.58 |
| long | 27 Feb 2025 84,708.60 | 22 May 2025 111,696.00 | 84 | $47.99 |
| long | 28 Feb 2025 84,349.90 | 22 May 2025 111,696.00 | 83 | $12.45 |
| long | 28 Feb 2025 84,349.90 | 10 Jul 2025 116,010.00 | 132 | $60.31 |
| long | 28 Feb 2025 84,349.90 | 11 Jul 2025 117,528.00 | 133 | $6.04 |
| long | 1 Mar 2025 86,064.50 | 11 Jul 2025 117,528.00 | 132 | $45.19 |
| long | 1 Mar 2025 86,064.50 | 12 Jul 2025 117,420.00 | 133 | $33.24 |
| long | 9 Mar 2025 80,734.40 | 12 Jul 2025 117,420.00 | 125 | $11.61 |
| long | 9 Mar 2025 80,734.40 | 13 Jul 2025 119,087.00 | 126 | $45.04 |
| long | 9 Mar 2025 80,734.40 | 14 Jul 2025 119,841.00 | 127 | $39.05 |
| long | 9 Mar 2025 80,734.40 | 17 Jul 2025 119,178.00 | 130 | $6.24 |
| long | 10 Mar 2025 78,595.90 | 17 Jul 2025 119,178.00 | 129 | $27.89 |
| long | 10 Mar 2025 78,595.90 | 27 Aug 2026 80,249.60 | 535 | $2.27 |
| long | 8 Apr 2025 76,322.40 | 27 Aug 2026 80,249.60 | 506 | $9.57 |
| long | 4 Nov 2025 101,497.00 | 27 Aug 2026 80,249.60 | 296 | −$50.19 |
| long | 6 Nov 2025 101,346.00 | 27 Aug 2026 80,249.60 | 294 | −$49.91 |
| long | 14 Nov 2025 94,594.00 | 27 Aug 2026 80,249.60 | 286 | −$36.59 |
| long | 15 Nov 2025 95,596.20 | 27 Aug 2026 80,249.60 | 285 | −$38.68 |
| long | 16 Nov 2025 94,261.40 | 27 Aug 2026 80,249.60 | 284 | −$35.88 |
| long | 17 Nov 2025 92,215.10 | 27 Aug 2026 80,249.60 | 283 | −$31.43 |
| long | 18 Nov 2025 92,960.80 | 27 Aug 2026 80,249.60 | 282 | −$33.07 |
| long | 19 Nov 2025 91,555.00 | 27 Aug 2026 80,249.60 | 281 | −$24.23 |
| long | 19 Nov 2025 91,555.00 | 28 Aug 2026 77,845.90 | 282 | −$6.86 |
| long | 20 Nov 2025 86,637.20 | 28 Aug 2026 77,845.90 | 281 | −$24.63 |
| long | 21 Nov 2025 85,129.40 | 28 Aug 2026 77,845.90 | 280 | −$20.94 |
| long | 22 Nov 2025 84,739.70 | 28 Aug 2026 77,845.90 | 279 | −$19.97 |
| long | 23 Nov 2025 86,830.00 | 28 Aug 2026 77,845.90 | 278 | −$25.11 |
| long | 24 Nov 2025 88,300.00 | 28 Aug 2026 77,845.90 | 277 | −$28.63 |
| long | 25 Nov 2025 87,370.00 | 28 Aug 2026 77,845.90 | 276 | −$26.40 |
| long | 1 Dec 2025 86,286.00 | 28 Aug 2026 77,845.90 | 270 | −$23.77 |
| long | 29 Jan 2026 84,650.20 | 28 Aug 2026 77,845.90 | 211 | −$9.83 |
| long | 29 Jan 2026 84,650.20 | 29 Aug 2026 78,230.00 | 212 | −$9.35 |
| long | 30 Jan 2026 84,260.50 | 29 Aug 2026 78,230.00 | 211 | −$17.68 |
| long | 31 Jan 2026 78,741.10 | 29 Aug 2026 78,230.00 | 210 | −$2.97 |
| long | 1 Feb 2026 76,968.20 | 29 Aug 2026 78,230.00 | 209 | $2.04 |
| long | 2 Feb 2026 78,738.60 | 29 Aug 2026 78,230.00 | 208 | −$2.96 |
| long | 3 Feb 2026 75,770.20 | 29 Aug 2026 78,230.00 | 207 | $5.50 |
| long | 4 Feb 2026 73,165.80 | 29 Aug 2026 78,230.00 | 206 | $8.60 |
| long | 4 Feb 2026 73,165.80 | 31 Aug 2026 78,581.30 | 208 | $5.02 |
| long | 5 Feb 2026 62,909.90 | 31 Aug 2026 78,581.30 | 207 | $48.55 |
| long | 6 Feb 2026 70,580.30 | 31 Aug 2026 78,581.30 | 206 | $22.38 |
| long | 7 Feb 2026 69,289.40 | 31 Aug 2026 78,581.30 | 205 | $26.53 |
| long | 8 Feb 2026 70,330.40 | 31 Aug 2026 78,581.30 | 204 | $23.18 |
| long | 9 Feb 2026 70,138.00 | 31 Aug 2026 78,581.30 | 203 | $11.02 |
| long | 9 Feb 2026 70,138.00 | 3 Sep 2026 81,270.40 | 206 | $17.09 |
| long | 10 Feb 2026 68,841.30 | 3 Sep 2026 81,270.40 | 205 | $36.07 |
| long | 11 Feb 2026 67,082.50 | 3 Sep 2026 81,270.40 | 204 | $41.93 |
| long | 12 Feb 2026 66,272.20 | 3 Sep 2026 81,270.40 | 203 | $44.67 |
| long | 17 Feb 2026 67,503.50 | 3 Sep 2026 81,270.40 | 198 | $21.78 |
| long | 17 Feb 2026 67,503.50 | 21 Sep 2026 86,620.00 | 216 | $26.29 |
| long | 18 Feb 2026 66,461.00 | 21 Sep 2026 86,620.00 | 215 | $60.43 |
| long | 19 Feb 2026 67,003.70 | 21 Sep 2026 86,620.00 | 214 | $58.55 |
| long | 23 Feb 2026 64,656.00 | 21 Sep 2026 86,620.00 | 210 | $64.51 |
| long | 23 Feb 2026 64,656.00 | 22 Sep 2026 86,208.60 | 211 | $2.13 |
| long | 24 Feb 2026 64,058.20 | 22 Sep 2026 86,208.60 | 210 | $67.50 |
| long | 3 Jun 2026 64,142.80 | 22 Sep 2026 86,208.60 | 111 | $67.20 |
| long | 4 Jun 2026 63,886.00 | 22 Sep 2026 86,208.60 | 110 | $57.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.
| Script | Shares | Type | Net | Trades | Max drawdown |
|---|---|---|---|---|---|
| CoinruleCombinedCryptoStrat this page | — | v4 strategy | +17.6% | 98 | 20.7% |
| 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 14 ms | With a workaround 1,000 bars in 44 ms | Not measured |
| PineTS | No v5 and v6 only | — | Not measured |
Zeal Terminal's engine currently reads an order side written as long = true as a short, whatever it says; this page passes the same side as strategy.long or strategy.short (line 37) so the engine trades the way the script says.
The engine and this page's reading of the source count a different number of settings, so one of them has missed one.
“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/// © syfuslokust//@version=4strategy(shorttitle='CoinruleCombinedCryptoStrat',title='CoinruleCombinedCryptoStrat', overlay=true, initial_capital = 10000, pyramiding = 1000, process_orders_on_close=true, default_qty_type = strategy.percent_of_equity, default_qty_value = 2, commission_type=strategy.commission.percent, commission_value=0.35)// RSI inputs and calculationslengthRSI = 14RSI = rsi(close, lengthRSI)//Normaloversold = input(35)overbought = input(70)res = input(title="Additional Timescale", defval="60", options=["5", "15", "60", "360", "1D"])//ALGO//oversold= input(26)//overbought= input(80)//sell pctSellPct = input(15)ExitPct = input(50)//MA inputs and calculationsmovingaverage_signal = sma(close, input(9))movingaverage_fast = sma(close, input(50))movingaverage_slow = sma(close, input(200))movingaverage_mid= sma(close, input(100))long_ma_signal = security(syminfo.tickerid, res, sma(close, input(9)), lookahead=barmerge.lookahead_on)long_ma_fast = security(syminfo.tickerid, res, sma(close, input(50)), lookahead=barmerge.lookahead_on)long_ma_slow = security(syminfo.tickerid, res, sma(close, input(200)), lookahead=barmerge.lookahead_on)long_ma_mid= security(syminfo.tickerid, res, sma(close, input(100)), lookahead=barmerge.lookahead_on)//Look Backinp_lkb = input(12, title='Lookback Long Period')inp_lkb_2 = input(2, title='Lookback Short Period') perc_change(lkb) => overall_change = ((close[0] - close[lkb]) / close[lkb]) * 100//Entry //MAbullish = crossover(movingaverage_signal, movingaverage_fast)//Execute buystrategy.entry(id="long", long = true, when = (RSI < oversold) and movingaverage_signal < movingaverage_mid, comment="BuyIn")//when = crossover(close, movingaverage_signal) and movingaverage_signal < movingaverage_slow and RSI < oversold)//Exit//RSIStop_loss= ((input (4))/100)longStopPrice = strategy.position_avg_price * (1 - Stop_loss)//MAbearish = crossunder(close, long_ma_mid)//Execute sellstrategy.close("long", qty_percent = SellPct, when = RSI > overbought and movingaverage_fast > movingaverage_mid, comment="SmallSell")strategy.close("long", qty_percent = ExitPct, when = bearish, comment="StopLoss")//strategy.close("long", qty_percent = ExitPct, when = bearish )//when = (crossunder(low, movingaverage_signal) and movingaverage_fast > movingaverage_slow and RSI > overbought) or (movingaverage_signal < movingaverage_fast and crossunder(low, movingaverage_fast)) or (low < longStopPrice))//PLOTplot(movingaverage_signal, color=color.white, linewidth=2, title="signal")plot(movingaverage_fast, color=color.orange, linewidth=2, title="fast")plot(movingaverage_slow, color=color.purple, linewidth=2, title="slow")plot(movingaverage_mid, color=color.blue, linewidth=2, title="mid")plot(long_ma_signal, color=color.yellow, linewidth=1, title="long signal")plot(long_ma_mid, color=color.red, linewidth=1, title="long slow")