Zeal Terminal Open in Zeal Terminal

Pine Script v4 · Strategy

Suchit RSI CCI

A Pine Script v4 strategy built on CCI (hl2, 14), SMA or RSI (close, 14, 50) and RSI (close, 14). It has 4 order rules, 2 entries among them, and trades long and short 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 Suchit RSI CCI repaint?
No
No repainting patterns were found in the source, and a live tick-by-tick replay matched history on 16 of 16 trades.
How did Suchit RSI CCI do on BTCUSDT 1D with default settings?
+11.40%
From 26 Jan 2024 to 21 Oct 2026, over 68 closed trades, against +102.5% for buy and hold. A backtest, not investment advice.
Can Suchit RSI CCI 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 Suchit RSI CCI use a stop loss?
No
Every exit waits for a signal; nothing limits a losing trade before it fires.
Does Suchit RSI CCI run in Zeal Terminal?
Yes
It compiles in 17 ms and runs 1,000 bars in 27 ms, in the browser.

BTCUSDT · 1D · default settings

  • 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 (0)
0.0050,000100,000AprJulOct2025AprJulOct2026AprJulOctCCI$110,013$202,527Equity from $100,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
+11.40%
$11,400.80
Buy and hold
+102.5%
same period
Closed trades
68
24 won · 44 lost
Profitable
35.3%
of closed trades
Profit factor
1.07
gross profit ÷ gross loss
Max drawdown
54.74%
−$64,430.80

One run with the author's default settings, $100,000 starting capital, commission as the script sets it. A short 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 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.

  • Note

    Uses an argument v6 removed

    when = on line 36, 37, 38, 39. 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 sma → ta.sma, cci → ta.cci, rsi → ta.rsi.
  • 4 strategy calls use the when = argument (line 36, 37, 38, 39). It is deprecated in v5 and removed in v6, where each call moves inside an if block.

v4 → v5

Verified

Same 68 trades and the same P&L on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine.

  • Line 3: //@version=4 → //@version=5
  • Line 5: sma → ta.sma
  • Line 9: sma → ta.sma
  • Line 14: cci → ta.cci
  • Line 16: sma → ta.sma
  • Line 16: rsi → ta.rsi
  • Line 18: rsi → ta.rsi
⋯// © SuchitRaju-//@version=4+//@version=5strategy("MA RSI CCI")-price_up = if(close > open and close > sma(hl2,14))+price_up = if(close > open and close > ta.sma(hl2,14))    1⋯    0-price_down = if(open > close and close < sma(hl2,14))+price_down = if(open > close and close < ta.sma(hl2,14))    1⋯// -cci_indicator = cci(hl2, 14)+cci_indicator = ta.cci(hl2, 14)// plot(cci_indicator, color=color.blue)-rsi_slow = sma(rsi(close, 14), 50)+rsi_slow = ta.sma(ta.rsi(close, 14), 50)// plot(rsi_slow, color=color.red)-rsi_fast = rsi(close, 14)+rsi_fast = ta.rsi(close, 14)// plot(rsi_fast, color=color.green)⋯

Clean v5

VerifiedDownload the v5 script

Same 68 trades and the same P&L on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine.

  • Line 36: when = isCrossover → if block
  • Line 37: when = isCrossunder → if block
  • Line 38: when = isCrossunder → if block
  • Line 39: when = isCrossover → if block
⋯// strategy.close("Short", when = isCrossover and price_up)-strategy.entry("Long", strategy.long, 1, when = isCrossover)+if isCrossover+    strategy.entry("Long", strategy.long, 1)-strategy.entry("Short", strategy.short, 1, when = isCrossunder)+if isCrossunder+    strategy.entry("Short", strategy.short, 1)-strategy.close("Long", when = isCrossunder)+if isCrossunder+    strategy.close("Long")-strategy.close("Short", when = isCrossover)+if isCrossover+    strategy.close("Short")

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: 68 before, 29 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.

⋯// © SuchitRaju-//@version=5+//@version=6strategy("MA RSI CCI")⋯

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

  • CCI (cci, ta.cci in v5)hl2, 14cci_indicator · line 14
  • SMA / RSI (sma, ta.sma in v5)rsi(close, 14), 50rsi_slow · line 16
  • RSI (rsi, ta.rsi in v5)close, 14rsi_fast · line 18

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.

hl2hl2price dataclosecloseprice dataopenopenprice datacci_indicatorCCI→ cci_indicatorrsi_slowSMA / RSI→ rsi_slowrsi_fastRSI→ rsi_fastprice_up, price_downprice_up · price_down2 conditionsisCrossover, isCrossunderColourisCrossover · isCrossunderentry:LongOpen Longstrategy.entryentry:ShortOpen Shortstrategy.entryclose:LongClose Longstrategy.closeclose:ShortClose Shortstrategy.close

Order rules

OrderFires whenBy defaultLine
Open Long longisCrossoverOn36
Open Short shortisCrossunderOn37
Close LongisCrossunderOn38
Close ShortisCrossoverOn39

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.

16/16trades 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+11.4%+102.5%6835%1.0754.7%26 Jan 2024 – 21 Oct 2026
BTCUSDT 4h+16.0%+5.5%7332%1.4311.5%8 May 2026 – 21 Oct 2026
ETHUSDT 1D+0.3%+9.8%7033%1.032.6%26 Jan 2024 – 21 Oct 2026
ETHUSDT 4h−0.2%+8.4%7524%0.890.9%8 May 2026 – 21 Oct 2026
SOLUSDT 1D+0.0%+16.7%6143%1.100.1%26 Jan 2024 – 21 Oct 2026
SOLUSDT 4h+0.0%+21.5%6332%1.180.0%8 May 2026 – 21 Oct 2026
BNBUSDT 1D−0.2%+148.3%7436%0.860.6%26 Jan 2024 – 21 Oct 2026
BNBUSDT 4h+0.1%+17.1%7332%1.150.1%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 market2429%−$38,939.90
Sideways market2854%$64,080.70
Falling market1613%−$13,740.10

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

How bad could the drawdown be?

59.6%

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

0%69%
All 68 trades
SideEntryExitBarsP&L
short3 Apr 2024 65,464.006 May 2024 64,012.0033$1,451.99
long6 May 2024 64,012.009 May 2024 61,193.003−$2,818.97
short9 May 2024 61,193.0014 May 2024 62,940.105−$1,747.06
long14 May 2024 62,940.1012 Jun 2024 67,314.2029$4,374.14
short12 Jun 2024 67,314.2015 Jul 2024 60,797.9033$6,516.32
long15 Jul 2024 60,797.903 Aug 2024 61,498.3019$700.43
short3 Aug 2024 61,498.3014 Aug 2024 60,587.2011$911.18
long14 Aug 2024 60,587.2016 Aug 2024 57,541.102−$3,046.11
short16 Aug 2024 57,541.1022 Aug 2024 61,156.006−$3,614.98
long22 Aug 2024 61,156.0028 Aug 2024 59,415.006−$1,741.03
short28 Aug 2024 59,415.0013 Sep 2024 58,132.3016$1,282.69
long13 Sep 2024 58,132.302 Oct 2024 60,804.9019$2,672.61
short2 Oct 2024 60,804.9013 Oct 2024 63,206.2011−$2,401.31
long13 Oct 2024 63,206.204 Nov 2024 68,776.0022$5,569.76
short4 Nov 2024 68,776.007 Nov 2024 75,572.003−$6,796.00
long7 Nov 2024 75,572.0027 Nov 2024 91,965.2020$16,393.20
short27 Nov 2024 91,965.2030 Nov 2024 97,460.003−$5,494.84
long30 Nov 2024 97,460.004 Dec 2024 95,849.704−$1,610.31
short4 Dec 2024 95,849.709 Dec 2024 101,110.005−$5,259.91
long9 Dec 2024 101,110.0011 Dec 2024 96,593.002−$4,516.60
short11 Dec 2024 96,593.0017 Dec 2024 106,059.006−$9,465.65
long17 Dec 2024 106,059.0020 Dec 2024 97,461.903−$8,596.79
short20 Dec 2024 97,461.907 Jan 2025 102,236.0018−$4,773.74
long7 Jan 2025 102,236.009 Jan 2025 95,060.602−$7,174.99
short9 Jan 2025 95,060.6016 Jan 2025 100,497.007−$5,436.74
long16 Jan 2025 100,497.0028 Jan 2025 102,083.0012$1,585.48
short28 Jan 2025 102,083.0031 Jan 2025 104,723.003−$2,640.11
long31 Jan 2025 104,723.002 Feb 2025 100,636.002−$4,087.28
short2 Feb 2025 100,636.0021 Feb 2025 98,305.0019$2,330.65
long21 Feb 2025 98,305.0023 Feb 2025 96,551.002−$1,754.00
short23 Feb 2025 96,551.0020 Mar 2025 86,845.9025$9,705.08
long20 Mar 2025 86,845.9030 Mar 2025 82,648.5010−$4,197.40
short30 Mar 2025 82,648.503 Apr 2025 82,516.304$132.25
long3 Apr 2025 82,516.307 Apr 2025 78,430.004−$4,086.28
short7 Apr 2025 78,430.0013 Apr 2025 85,276.906−$6,846.91
long13 Apr 2025 85,276.9030 May 2025 105,590.0047$20,312.80
short30 May 2025 105,590.0030 Jun 2025 108,357.0031−$2,767.18
long30 Jun 2025 108,357.0030 Jul 2025 117,951.0030$9,593.82
short30 Jul 2025 117,951.0011 Aug 2025 119,294.0012−$1,343.52
long11 Aug 2025 119,294.0019 Aug 2025 116,227.008−$3,067.22
short19 Aug 2025 116,227.0011 Sep 2025 113,960.0023$2,267.05
long11 Sep 2025 113,960.0023 Sep 2025 112,651.0012−$1,309.01
short23 Sep 2025 112,651.001 Oct 2025 114,049.008−$1,397.95
long1 Oct 2025 114,049.0011 Oct 2025 112,774.0010−$1,274.45
short11 Oct 2025 112,774.0027 Oct 2025 114,559.0016−$1,784.92
long27 Oct 2025 114,559.0031 Oct 2025 108,323.004−$6,236.54
short31 Oct 2025 108,323.0028 Nov 2025 91,333.9028$16,988.90
long28 Nov 2025 91,333.902 Dec 2025 86,286.004−$5,047.93
short2 Dec 2025 86,286.003 Dec 2025 91,277.901−$4,991.87
long3 Dec 2025 91,277.9016 Dec 2025 86,432.1013−$4,845.80
short16 Dec 2025 86,432.1023 Dec 2025 88,620.807−$2,188.71
long23 Dec 2025 88,620.8021 Jan 2026 88,427.7029−$193.13
short21 Jan 2026 88,427.7027 Feb 2026 67,485.2037$20,942.50
long27 Feb 2026 67,485.2028 Feb 2026 65,872.101−$1,613.10
short28 Feb 2026 65,872.103 Mar 2026 68,830.103−$2,957.97
long3 Mar 2026 68,830.1028 Mar 2026 66,407.3025−$2,422.78
short28 Mar 2026 66,407.307 Apr 2026 68,853.7010−$2,446.38
long7 Apr 2026 68,853.7030 Apr 2026 75,780.0023$6,926.34
short30 Apr 2026 75,780.002 May 2026 78,231.102−$2,451.13
long2 May 2026 78,231.1016 May 2026 79,113.2014$882.07
short16 May 2026 79,113.204 Jul 2026 62,583.3049$16,529.90
long4 Jul 2026 62,583.301 Aug 2026 62,887.9028$304.62
short1 Aug 2026 62,887.906 Aug 2026 64,665.205−$1,777.36
long6 Aug 2026 64,665.2012 Aug 2026 63,600.006−$1,065.23
short12 Aug 2026 63,600.0019 Aug 2026 64,725.407−$1,125.41
long19 Aug 2026 64,725.4010 Sep 2026 78,306.4022$13,581.00
short10 Sep 2026 78,306.4019 Sep 2026 80,883.909−$2,577.43
long19 Sep 2026 80,883.908 Oct 2026 83,321.8019$2,437.95

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
Suchit RSI CCI this page—v4 strategy+11.4%6854.7%
Momentum Explosion 2CCI RSI by capamsma cci rsiv4 strategy+24.1%642.3%
CCI Level Zone by Naruephatcci sma rsiv5 strategyNo trades on this market
SRJ RSI Outperformer Strategy by Sapt_Jashrsi smav5 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%

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 17 msYes 1,000 bars in 27 msNot measured
PineTSNo v5 and v6 only—Not 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. 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/// © SuchitRaju//@version=4strategy("MA RSI CCI")price_up = if(close > open and close > sma(hl2,14))    1else    0price_down = if(open > close and close < sma(hl2,14))    1else    0// cci_indicator = cci(hl2, 14)// plot(cci_indicator, color=color.blue)rsi_slow = sma(rsi(close, 14), 50)// plot(rsi_slow, color=color.red)rsi_fast = rsi(close, 14)// plot(rsi_fast, color=color.green)isCrossover = if(rsi_fast > rsi_slow and cci_indicator > 0)    1else    0// plotshape(isCrossover, style = shape.arrowup, color = color.green, size = size.huge)isCrossunder = if(rsi_fast < rsi_slow and cci_indicator < 0)    1else    0// plotshape(isCrossunder, style = shape.arrowup, color = color.red, size = size.huge)// start = timestamp("GMT-5", 2016,9,1,0,0)// end = timestamp("GMT-5", 2017,9,1,0,0)// strategy.entry("Long", strategy.long, 1, when = isCrossover and price_up)// strategy.entry("Short", strategy.short, 1, when = isCrossunder and price_down)// strategy.close("Long", when = isCrossunder and price_down)// strategy.close("Short", when = isCrossover and price_up)strategy.entry("Long", strategy.long, 1, when = isCrossover)strategy.entry("Short", strategy.short, 1, when = isCrossunder)strategy.close("Long", when = isCrossunder)strategy.close("Short", when = isCrossover)