NEWCard payments are live · from $18/month, USDT also acceptedSee plans
COINPRED / STRATEGY LIBRARY

BTC RSI-SMA cross: Go long when RSI crosses above its own average, and exit when it crosses back below; the 30/70 lines are visual only, and it never goes short

reees's open-source trend script (MPL 2.0), titled "RSI Crossover Strategy" (publication: "RSI SMA Crossover Strategy"). It calculates RSI from close, then a simple average of that RSI. A long opens when RSI crosses above that average and closes when it crosses back below. The 30 and 70 lines are visual only. Long only, with no stop. The author's chart is CRYPTO:BTCUSD, daily. Rules follow the source; this page invents no backtest figures.

Illustrated guidesPine Script®Included with monthly & annual plans
← All strategies
reees · 1.0 · 2026-12-04 · Trend following
BTC RSI-SMA cross: Go long when RSI crosses above its own average, and exit when it crosses back below; the 30/70 lines are visual only, and it never goes short

The idea

This is reees's open-source strategy, published as "RSI SMA Crossover Strategy". The script itself is named "RSI Crossover Strategy" (short title "RSI Cross"). It uses a fairly long RSI as a momentum line, then plots a shorter simple average of that RSI — not a moving average of price. When RSI crosses up through its own average, the script treats momentum as turning up and goes long. When RSI crosses back down through that average, it flattens the long.

It is long-only; the source never calls strategy.short. The pane colors the RSI and fills the gap to its average, and it also draws horizontal lines at 30 and 70. Those levels are the usual oversold and overbought guides, but they are not used in the entry or exit conditions. The author's chart is CRYPTO:BTCUSD, daily. The strategy sets calc_on_every_tick=true, so the tester may fill an order on an intra-bar cross; it does not have to wait for the bar to close.

Author chart of reees RSI SMA Crossover Strategy on CRYPTO:BTCUSD daily
Author chart: CRYPTO:BTCUSD, daily, from the script's publication page. The image shows RSI, its average, and trade marks; it is only a visual example, not a live or backtest track record. / 作者展示:CRYPTO:BTCUSD,日线图,取自作者发布页主图。

How the lines are built

  • RSI is ta.rsi(close, rsiLength) with a default length of 50, using close.
  • The average is a simple moving average of that RSI: ta.sma(rsi, smaLength), default 25. It follows RSI, not price.
  • The RSI plot changes color above or below its average, and the gap is filled. hline(30) and hline(70) are display only.
  • The long signal is ta.crossover(rsi, sma). The exit signal is ta.crossunder(rsi, sma).

Entry rules

  • Long only. The source never calls strategy.short.
  • When RSI crosses above its own average, the script calls strategy.entry('Long', strategy.long) with comment Buy.
  • The entry does not require RSI to have been oversold first, and it does not use the 30 or 70 lines.
  • Because calc_on_every_tick is on, a cross can fire during the bar, not only at the close.

Exits and position size

  • When RSI crosses below its average, strategy.close('Long') exits at market with comment Sell. There is no strategy.exit, and no fixed stop or take-profit.
  • If the strategy is already flat, that close does not open a short.
  • Orders default to 100% of equity, with initial_capital set to 1000. The source does not set commission or slippage, so the tester uses platform defaults.

Inputs (defaults in the source)

InputDefaultWhat it does
RSI Length50Lookback for the RSI.
SMA Length25Lookback for the simple average of that RSI.

Caveats

  • The strategy never goes short. When RSI falls below its average it only exits an open long.
  • The 30 / 70 lines can look like oversold-buy and overbought-sell rules, but the orders use only the RSI-versus-average crosses.
  • calc_on_every_tick=true means a cross that happens mid-bar and then reverses by the close can still fill in the tester, which is different from close-only confirmation.
  • The default size is a full 100% of equity, and there is no stop order. In a chopping market the crosses can whipsaw; sizing and risk limits need a separate decision.
  • The author's chart is daily. The same 50 / 25 lengths will be more sensitive on a shorter timeframe.

Install it on TradingView

  1. Download the .pine file from Coinpred (a current membership is required; see the page) or check the original publication for a newer revision.
  2. Open the symbol and timeframe you want in TradingView, open the Pine Editor, paste the source, and add it to the chart.
  3. Start with the default RSI length of 50 and average length of 25 so you can see the crosses, then change those lengths for your market and timeframe.
  4. The source sizes orders at 100% of equity, sets initial capital to 1000, and turns on calc_on_every_tick. Commission and slippage may still be platform defaults. Live order routing has to be set separately.
  5. Crypto trades around the clock. The tester's timezone and session settings may differ from your venue by several hours.

About backtest figures

Source, license, and version

  • Source: https://www.tradingview.com/script/ZINSYeR8-RSI-SMA-Crossover-Strategy/
  • Author: reees (header © reees)
  • License: Mozilla Public License 2.0. Redistribution must keep the original copyright and license notices; if you modify the source file, the modified file must remain under MPL 2.0. Coinpred ships the unmodified source.
  • Version: 1.0 in the publication record and pine-facade. scriptAccess is open_no_auth.

Source, license and version

Licensed under MPL 2.0 per the source header, © reees. Redistribution must keep the copyright and license notices; modified files must remain under MPL 2.0. Coinpred ships the unmodified source.

View original source ↗

Check the script license and your TradingView account features. Historical results do not guarantee future performance.

More strategies

All strategies →