Zeal Terminal Open in Zeal Terminal

Pine Script v5 · Strategy

RSI with Slow and Fast MA Crossing Strategy (by Coinrule)

A Pine Script v5 strategy built on RSI (close, 14), EMA (close, 9) and Crossover (buyFastEMA, buySlowEMA). It has 2 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 30% of equity and pays 0.1% commission. 2 settings; defaults include Length 14.

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 RSI with Slow and Fast MA Crossing Strategy (by Coinrule) repaint?
No
No repainting patterns were found in the source, and a live tick-by-tick replay matched history on 1 of 1 trades.
How did RSI with Slow and Fast MA Crossing Strategy (by Coinrule) do on BTCUSDT 1D with default settings?
−2.78%
From 26 Jan 2024 to 21 Oct 2026, over 4 closed trades, against +102.5% for buy and hold. A backtest, not investment advice.
Does RSI with Slow and Fast MA Crossing Strategy (by Coinrule) run in Pine Script v6?
Yes
Same 4 trades and the same P&L on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine. Both versions were run on Zeal Terminal's engine, and the results are identical. The v6 script can be downloaded below.
Does RSI with Slow and Fast MA Crossing Strategy (by Coinrule) use a stop loss?
No
Every exit waits for a signal; nothing limits a losing trade before it fires.
Does RSI with Slow and Fast MA Crossing Strategy (by Coinrule) run in Zeal Terminal?
Yes
It compiles in 25 ms and runs 1,000 bars in 30 ms, in the browser.

BTCUSDT · 1D · default settings

  • EMA
  • EMA
  • Crossover
  • EMA
  • EMA
  • Crossover
  • Winning trade
  • Losing trade
  • Equity
  • Buy and hold
0.0050,000100,000AprJulOct2025AprJulOct2026AprJulOctRSI$9,722$20,253Equity from $10,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. The live re-run is not offered here: the script requests BINANCE:BTCUSDT 60, which this page cannot load in your browser.

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
−2.78%
−$277.58
Buy and hold
+102.5%
same period
Closed trades
4
1 won · 3 lost
Profitable
25.0%
of closed trades
Profit factor
0.65
gross profit ÷ gross loss
Max drawdown
4.57%
−$462.93

One run with the author's default settings, $10,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

    1 setting does nothing

    “Show Date Range” is 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

    1 setting has no label

    In the settings dialog length (line 16) shows 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 32. The upgraded version below moves each call inside an if block.

Settings

Every input the script declares, with its default and what it feeds. Bounds are the ones the script enforces.

SettingDefaultType and rangeFeeds
Show Date Rangetrueboolunused
Length (no label in the script)14intvrsi

What it calculates

  • RSIclose, Length (14)vrsi · line 17
  • EMAclose, 9buyFastEMA · line 19
  • EMAclose, 50buySlowEMA · line 20
  • CrossoverbuyFastEMA, buySlowEMAbuyCondition1 · line 21
  • EMAclose, 9sellFastEMA · line 26
  • EMAclose, 50sellSlowEMA · line 27
  • CrossoversellSlowEMA, sellFastEMAcondition · line 30

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 datalengthLengthsetting · 14timetimeprice datavrsiRSI→ vrsibuyFastEMAEMA→ buyFastEMAbuySlowEMAEMA→ buySlowEMAbuyCondition1Crossover→ buyCondition1sellFastEMAEMA→ sellFastEMAsellSlowEMAEMA→ sellSlowEMAconditionCrossover→ conditiontimePeriodtimePeriodconditionnotInTradenotInTradeconditionentry:LongOpen Longstrategy.entryclose:LongClose Longstrategy.closeplot:28plotplotplot:29plotplot

Order rules

OrderFires whenBy defaultLine
Open Long long((vrsi > vrsi[1]+increase) and buyCondition1 and vrsi < 70 and timePeriod)On24
Close Longcondition and timePeriodOn32

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.

1/1trades 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 data2 request.security call(s), none with lookahead on.
  • 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 barsTradesWonP&L
Rising market0—$0.00
Sideways market425%−$277.58
Falling market0—$0.00

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

How bad could the drawdown be?

7.7%

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

0%9%
All 4 trades
SideEntryExitBarsP&L
long19 Jul 2024 66,660.004 Aug 2024 58,161.0016−$387.72
long22 Apr 2025 93,443.0025 Aug 2025 110,112.00125$507.62
long1 Oct 2025 118,595.0015 Oct 2025 110,763.0014−$206.15
long13 Jan 2026 95,414.0021 Jan 2026 89,454.708−$191.33

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
RSI with Slow and Fast MA Crossing Strategy (by Coinrule) this page—v5 strategy−2.8%44.6%
RSI Cross [xaurr] by livetrendrsi emav4 strategy+24.4%5335.3%
Bitpanda Coinrule Template by joshuajcoop01rsi emav5 strategy−2.8%44.6%
RSI of VWAP by mohaneersi emav4 strategyNo trades on this market
EMA SCALPEUR + RSi - SHORT by YukalMoonrsi emav5 strategyNo trades on this market
BTC Sentiment analysis RSI 2xEMA by exlux99rsi emav4 strategyNo trades on this market

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.

  • 1 strategy call uses the when = argument (line 32). It is deprecated in v5 and removed in v6, where each call moves inside an if block.
  • 2 settings use the untyped input() (line 12, 16). It still compiles in v6; input.int, input.float or input.source state the type.
  • No v6-only features. v6 is not needed to run this script.

Clean v5

VerifiedDownload the v5 script

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

  • Line 12: input() → input.bool()
  • Line 16: input() → input.int()
  • Line 32: when = condition and timePeriod → if block
⋯         commission_value=0.1)-showDate = input(defval=true, title='Show Date Range')+showDate = input.bool(defval=true, title='Show Date Range')timePeriod = time >= timestamp(syminfo.timezone, 2020, 1, 1, 0, 0)⋯// RSI-length = input(14)+length = input.int(14)vrsi = ta.rsi(close, length)⋯//sellCondition1 = request.security(syminfo.tickerid, "60", condition)-strategy.close('Long', when = condition and timePeriod)+if condition and timePeriod+    strategy.close('Long')

Does it run in Pine Script v6?

Yes

Same 4 trades and the same P&L on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine. Both versions were run on Zeal Terminal's engine, and the results are identical. It differs from the v5 version by 1 edit.

Download the v6 script

⋯// © Coinrule-//@version=5+//@version=6strategy("RSI with Slow and Fast MA Crossing Strategy (by Coinrule)",⋯

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 25 msYes 1,000 bars in 30 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/// © Coinrule//@version=5strategy("RSI with Slow and Fast MA Crossing Strategy (by Coinrule)",         overlay=true,         initial_capital=10000,         process_orders_on_close=true,         default_qty_type=strategy.percent_of_equity,         default_qty_value=30,         commission_type=strategy.commission.percent,         commission_value=0.1)showDate = input(defval=true, title='Show Date Range')timePeriod = time >= timestamp(syminfo.timezone, 2020, 1, 1, 0, 0)notInTrade = strategy.position_size <= 0// RSIlength = input(14)vrsi = ta.rsi(close, length)// Moving  Averages for Buy ConditionbuyFastEMA = ta.ema(close, 9)buySlowEMA = ta.ema(close, 50)buyCondition1 = ta.crossover(buyFastEMA, buySlowEMA)increase = 5if ((vrsi > vrsi[1]+increase) and buyCondition1 and vrsi < 70 and timePeriod)    strategy.entry("Long", strategy.long)// Moving  Averages for Sell ConditionsellFastEMA = ta.ema(close, 9)sellSlowEMA = ta.ema(close, 50)plot(request.security(syminfo.tickerid, "60", sellFastEMA), color = color.blue)plot(request.security(syminfo.tickerid, "60", sellSlowEMA), color = color.green)condition = ta.crossover(sellSlowEMA, sellFastEMA)//sellCondition1 = request.security(syminfo.tickerid, "60", condition)strategy.close('Long', when = condition and timePeriod)