0bps

Strategy vault / Mean reversion

Ultra Long Period RSI Reversal Strategy

This strategy uses an ultra long period RSI indicator to generate trading signals based on RSI crossover with thresholds. Specifically, it adopts a very long RSI period, typically 50-100. Long signals are triggered…

Author
ChaoZhang
Complexity
Starter · 26 lines
Parameters
4
Backtest bar
1m · intraday
Tested on
BTC/USDT · futures

This strategy uses an ultra long period RSI indicator to generate trading signals based on RSI crossover with thresholds.

Specifically, it adopts a very long RSI period, typically 50-100. Long signals are triggered when RSI crosses above oversold level. Short signals are generated on RSI crossing below overbought level.

The advantage of this strategy is the ultra long RSI can more precisely determine trend, filtering out short-term noise and avoiding whipsaws. However, RSI itself has lagging issues and cannot promptly detect reversals. Also, parameter tuning is required for different products.

In summary, the ultra long RSI reversal strategy suits medium-long term holding. Despite decent performance, attention is still required on trend change risks and timely stop loss to protect capital. Only with comprehensive risk management can steady profits be achieved in the long run.

Parameters

NameDefaultWhat it controls
v_input_165length
v_input_240overSold
v_input_360overBought
v_input_4_close0price: close | high | low | open | hl2 | hlc3 | hlcc4 | ohlc4

Source Pine Script

/*backtest
start: 2023-09-03 00:00:00
end: 2023-09-10 00:00:00
period: 1m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=3
// strategy("Kozlod - RSI Strategy - 1 minute", overlay = true, default_qty_type = strategy.percent_of_equity, default_qty_value = 100)


// Inputs
length     = input(65)
overSold   = input(40)
overBought = input(60)
price      = input(close)

// RSI
vrsi = rsi(price, length)

if (crossover(vrsi, overSold))
    strategy.entry("RsiLE", strategy.long, comment="RsiLE")
if (crossunder(vrsi, overBought))
    strategy.entry("RsiSE", strategy.short, comment="RsiSE")

Published by ChaoZhang on the FMZ strategy square · last modified 2023-09-11. 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.

in Claude Code, Cursor, Codex & 4 more
/agenkit build a production-grade trading bot with a backtest engine, risk controls and paper trading by default from strategies/Ultra-Long-Period-RSI-Reversal-Strategy.md
  1. npx agenkit install engineering-kit in your project
  2. Paste the command into your agent and approve each phase
  3. 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

esc

Try , , or .

↑↓ move↵ open