Strategy vault / Mean reversion
Simple Cryptocurrency Trading Strategy Based on RSI
This is a simple cryptocurrency trading strategy based on the Relative Strength Index (RSI). It generates trading signals by calculating RSI values to determine if the market is overbought or oversold. The strategy…

Overview
This is a simple cryptocurrency trading strategy based on the Relative Strength Index (RSI). It generates trading signals by calculating RSI values to determine if the market is overbought or oversold. The strategy is suitable for medium-term trading.
Strategy Logic
The strategy first calculates the 14-day RSI value. It then judges if the RSI value is below 30, the oversold line. If so, a buy signal is generated. If the RSI surpasses 70, the overbought line, a sell signal is generated.
When the RSI value crosses above the oversold line, long positions are closed. When it crosses below the overbought line, short positions are closed.
Advantage Analysis
- The strategy logic is simple and clear, easy to understand and implement
- Utilizes mature RSI indicator to judge market conditions
- Customizable parameters suit different market environments
- Relatively small drawdown risk
Risk Analysis
- Market events may cause temporary failure
- Fixed parameters may cause overtrading
- Reliance on a single indicator makes false signals likely
The risks above can be mitigated by dynamically adjusting parameters, incorporating multiple indicators, and setting stop loss.
Optimization Directions
The strategy can be optimized from the following aspects:
Combine with moving averages and other indicators to form multiple confirmations;
Add trend judgement rules to avoid choppy markets;
Set trade size or stop loss rules to control risks;
Optimize RSI parameters to suit the high-frequency nature of crypto trading.
Summary
Overall this is a very basic RSI strategy, generating trading signals by identifying overbought/oversold levels using a mature indicator. The pros are simplicity and relatively small practical risks. But reliance on a single indicator also makes false signals likely. We can extend and optimize it in many ways to make it more robust and adaptive.
Parameters
| Name | Default | What it controls |
|---|---|---|
| v_input_1 | 14 | Length |
| v_input_2 | 70 | Overbought Level |
| v_input_3 | 30 | Oversold Level |
Source Pine Script
/*backtest
start: 2024-02-14 00:00:00
end: 2024-02-21 00:00:00
period: 1m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
strategy("Larry Williams Simple Crypto Strategy", overlay=true)
// Параметры стратегии
length = input(14, title="Length")
overboughtLevel = input(70, title="Overbought Level")
oversoldLevel = input(30, title="Oversold Level")
// Вычисление RSI
rsiValue = rsi(close, length)
// Определение условий для входа в позицию
enterLong = rsiValue < oversoldLevel
enterShort = rsiValue > overboughtLevel
// Открытие позиции
if enterLong
strategy.entry("Buy", strategy.long)
if enterShort
strategy.entry("Sell", strategy.short)
// Закрытие позиции
if enterLong and rsiValue > oversoldLevel
strategy.close("Buy")
if enterShort and rsiValue < overboughtLevel
strategy.close("Sell")
// Отрисовка уровней
hline(overboughtLevel, "Overbought", color=color.red)
hline(oversoldLevel, "Oversold", color=color.green)Published by ChaoZhang on the FMZ strategy square · last modified 2024-02-22. Collected in the Quant Trading Vault. Unvalidated research: re-test with your own data and costs before trusting it.
Build this with AgenKit
A spec is not a trading system. Paste this into your coding agent and AgenKit runs a specialist team — architecture, test-first build, risk gates, review — with paper trading on by default.
/agenkit build a production-grade trading bot with a backtest engine, risk controls and paper trading by default from strategies/Simple-Cryptocurrency-Trading-Strategy-Based-on-RSI.md- npx agenkit install engineering-kit in your project
- Paste the command into your agent and approve each phase
- Get tests, backtest, risk controls and a paper-trading switch
Understand it first
Before you run this, read the lesson behind the idea and how to backtest it honestly. Specs like this one are the survivors of an unknown number of trials; deflate their results accordingly.
Related specs
- ATR and EMA based Dynamic Take Profit and Stop Loss Adaptive StrategyPine Script · Mean reversion · 1h
- Adaptive Mean Reversion Trading Strategy Based on Chande Momentum OscillatorPine Script · Mean reversion · 1d
- Adaptive RSI Oscillator Dynamic Trading Strategy with Threshold OptimizationPine Script · Mean reversion · 1d
- Advanced 15 Minute Chart Trading Signal StrategyPine Script · Mean reversion · 3h
- Advanced Fibonacci Retracement Trend Following and Reversal Trading StrategyPine Script · Mean reversion · 3h
- Advanced Momentum EMA Trend Following with RSI Overbought Oversold Trading StrategyPine Script · Mean reversion · 1d