Pine Script v4 · Strategy
Momentum Explosion 2CCI RSI
A Pine Script v4 strategy built on EMA (close, 8), SMA (close, 26) and CCI (close, 34). It has 2 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 Momentum Explosion 2CCI RSI repaint?
- No
- No repainting patterns were found in the source. The live replay was not measured: it had no trades to compare.
- How did Momentum Explosion 2CCI RSI do on BTCUSDT 1D with default settings?
- +24.06%
- From 26 Jan 2024 to 21 Oct 2026, over 6 closed trades, against +102.5% for buy and hold. A backtest, not investment advice.
- Can Momentum Explosion 2CCI 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 Momentum Explosion 2CCI RSI use a stop loss?
- No
- Every exit waits for a signal; nothing limits a losing trade before it fires.
- Does Momentum Explosion 2CCI RSI run in Zeal Terminal?
- Yes
- It compiles in 9 ms and runs 1,000 bars in 20 ms, in the browser.
BTCUSDT · 1D · default settings
- EMA
- SMA
- Winning trade
- Losing trade
- Equity
- Buy and hold
- Net profit
- +24.06%
- $24,061.80
- Buy and hold
- +102.5%
- same period
- Closed trades
- 6
- 3 won · 3 lost
- Profitable
- 50.0%
- of closed trades
- Profit factor
- 1.61
- gross profit ÷ gross loss
- Max drawdown
- 42.31%
- −$47,602.90
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 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.
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 ema → ta.ema, sma → ta.sma, cci → ta.cci, rsi → ta.rsi, crossover → ta.crossover, mom → ta.mom, crossunder → ta.crossunder.
Same 6 trades and the same P&L on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine.
- Line 13: //@version=4 → //@version=5
- Line 15: ema → ta.ema
- Line 16: sma → ta.sma
- Line 17: cci → ta.cci
- Line 18: cci → ta.cci
- Line 19: rsi → ta.rsi
4 more edits
- Line 25: crossover → ta.crossover
- Line 25: mom → ta.mom
- Line 28: crossunder → ta.crossunder
- Line 28: mom → ta.mom
⋯//RSI 26 < 48.-//@version=4+//@version=5strategy("Momentum Explosion 2CCI RSI", overlay=true)-ema8 = ema(close,8)+ema8 = ta.ema(close,8)-sma26 = sma(close,26)+sma26 = ta.sma(close,26)-cci34 = cci(close,34)+cci34 = ta.cci(close,34)-cci55 = cci(close,55)+cci55 = ta.cci(close,55)-rsi26 = rsi(close,26)+rsi26 = ta.rsi(close,26)//plot(ema8)⋯//plot(rsi26,color=color.red)-longCondition = crossover(ema8, sma26) and mom(sma26,5)>0 and cci34>0 and cci55>0 and rsi26>48+longCondition = ta.crossover(ema8, sma26) and ta.mom(sma26,5)>0 and cci34>0 and cci55>0 and rsi26>48if (longCondition) strategy.entry("My Long Entry Id", strategy.long)-shortCondition = crossunder(ema8, sma26) and mom(sma26,5)<0 and cci34<0 and cci55<0 and rsi26<48+shortCondition = ta.crossunder(ema8, sma26) and ta.mom(sma26,5)<0 and cci34<0 and cci55<0 and rsi26<48if (shortCondition)⋯Clean v5
VerifiedNothing 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: 6 before, 6 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.
⋯//RSI 26 < 48.-//@version=5+//@version=6strategy("Momentum Explosion 2CCI RSI", overlay=true)⋯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
- EMA (
ema,ta.emain v5)close, 8ema8 · line 15 - SMA (
sma,ta.smain v5)close, 26sma26 · line 16 - CCI (
cci,ta.cciin v5)close, 34cci34 · line 17 - CCI (
cci,ta.cciin v5)close, 55cci55 · line 18 - RSI (
rsi,ta.rsiin v5)close, 26rsi26 · line 19
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 My Long Entry Id long | (longCondition) | On | 27 |
| Open My Short Entry Id short | (shortCondition) | On | 30 |
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.
- 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 | +24.1% | +102.5% | 6 | 50% | 1.61 | 42.3% | 26 Jan 2024 – 21 Oct 2026 |
| BTCUSDT 4h | −20.0% | +5.5% | 10 | 20% | 0.41 | 35.9% | 8 May 2026 – 21 Oct 2026 |
| ETHUSDT 1D | +1.5% | +9.8% | 4 | 50% | 2.07 | 2.6% | 26 Jan 2024 – 21 Oct 2026 |
| ETHUSDT 4h | −0.3% | +8.4% | 4 | 50% | 0.72 | 1.0% | 8 May 2026 – 21 Oct 2026 |
| SOLUSDT 1D | −0.0% | +16.7% | 5 | 40% | 0.78 | 0.1% | 26 Jan 2024 – 21 Oct 2026 |
| SOLUSDT 4h | +0.0% | +21.5% | 6 | 67% | 2.37 | 0.0% | 8 May 2026 – 21 Oct 2026 |
| BNBUSDT 1D | −0.0% | +148.3% | 2 | 0% | 0.00 | 0.8% | 26 Jan 2024 – 21 Oct 2026 |
| BNBUSDT 4h | +0.1% | +17.1% | 3 | 33% | 1.56 | 0.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 bars | Trades | Won | P&L |
|---|---|---|---|
| Rising market | 2 | 100% | $15,108.60 |
| Sideways market | 4 | 25% | $8,953.25 |
| 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?
34.5%
The 95th percentile of the worst drawdown when the same 6 trades are reshuffled 5,000 times. The bar spans the 5th to 95th percentile, 24.8% to 34.5%; the tick is what actually happened, 32.5%. Order luck alone moves it this much.
All 6 trades
| Side | Entry | Exit | Bars | P&L |
|---|---|---|---|---|
| long | 26 Mar 2024 69,880.00 | 31 Mar 2025 82,390.00 | 370 | $12,510.00 |
| short | 31 Mar 2025 82,390.00 | 11 Jun 2025 110,274.00 | 72 | −$27,884.40 |
| long | 11 Jun 2025 110,274.00 | 20 Aug 2025 112,873.00 | 70 | $2,598.56 |
| short | 20 Aug 2025 112,873.00 | 2 Oct 2025 118,595.00 | 43 | −$5,722.04 |
| long | 2 Oct 2025 118,595.00 | 15 Oct 2025 113,028.00 | 13 | −$5,566.86 |
| short | 15 Oct 2025 113,028.00 | 10 Aug 2026 64,901.60 | 299 | $48,126.50 |
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 |
|---|---|---|---|---|---|
| Momentum Explosion 2CCI RSI this page | — | v4 strategy | +24.1% | 6 | 42.3% |
| MACD, RSI, & RVOL Strategy by BobBarker42069 | rsi ema sma | v4 strategy | +32.6% | 1 | 1.5% |
| Suchit RSI CCI by SuchitRaju | cci sma rsi | v4 strategy | +11.4% | 68 | 54.7% |
| IFR2 - RSI2 by jocker.soad | rsi sma ema | v4 strategy | No trades on this market | ||
| Vin's Playzone Strategy by Vvaz_ | ema rsi sma | v5 strategy | −908.1% | 21 | 3,570.5% |
| 3 x EMA + Stochastic RSI + ATR by tomimarson | ema rsi sma | v4 strategy | −42.3% | 18 | 44.8% |
Where it runs
| Engine | Compiles | Runs | Matches TradingView |
|---|---|---|---|
| Zeal Terminal · OpenPineScript v2 | Yes 9 ms | Yes 1,000 bars in 20 ms | Not measured |
| PineTS | No 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/// © capam//BUY//EMA 8 crosses upward SMA 26.//CCI 34 periods > 0//CCI 55 periods > 0//RSI 26 > 48.//Sell//EMA 8 crosses downward SMA 26.//CCI 34 periods < 0//CCI 55 periods < 0//RSI 26 < 48.//@version=4strategy("Momentum Explosion 2CCI RSI", overlay=true)ema8 = ema(close,8)sma26 = sma(close,26)cci34 = cci(close,34)cci55 = cci(close,55)rsi26 = rsi(close,26)//plot(ema8)//plot(sma26)//plot(cci34,color=color.green)//plot(cci55,color=color.orange)//plot(rsi26,color=color.red)longCondition = crossover(ema8, sma26) and mom(sma26,5)>0 and cci34>0 and cci55>0 and rsi26>48if (longCondition) strategy.entry("My Long Entry Id", strategy.long)shortCondition = crossunder(ema8, sma26) and mom(sma26,5)<0 and cci34<0 and cci55<0 and rsi26<48if (shortCondition) strategy.entry("My Short Entry Id", strategy.short)