AK Dual RSI Breakout Strategy
This strategy combines RSI(2) and moving averages to identify low buy and high sell points when price breaks out of the gap between mid-long term moving averages, aiming to capture ultra-short term reversal…
Overview
This strategy combines RSI(2) and moving averages to identify low buy and high sell points when price breaks out of the gap between mid-long term moving averages, aiming to capture ultra-short term reversal opportunities.
Strategy Logic
Calculate 2-period RSI to reflect latest two days price change ratio.
5-day and 200-day simple moving averages act as short and long term trend indicators.
When price breaks above 200-day MA but below 5-day MA, and RSI(2) < 5, consider oversold, go long.
When price breaks below 200-day MA but above 5-day MA, and RSI(2) > 90, consider overbought, go short.
When price breaks 5-day MA again, reversal confirmed, close position.
Advantage Analysis
RSI(2) has high sensitivity to capture ultra-short reversals quickly.
Combining with MA adds validity to reversal signals, avoids whipsaws.
Backtest shows decent results on stocks with price limits, max DD controllable.
Simple and elegant code with few parameters, easy to implement.
Risk Analysis
Prone to false signals relying on sensitive indicators, parameters need optimization.
Hard to adapt to long trending or ranging markets, return volatility high.
No stop loss unable to limit single trade loss.
Only 2-year backtest data, more samples needed to verify strategy.
Fails to adapt to extreme events like flash crashes.
Optimization Directions
Test combinations of MA and RSI parameters.
Add volume etc. to confirm reversal signals.
Implement moving or percentage stop loss.
Optimize position sizing based on market conditions.
Trade both long and short sides.
Tweak entry logic for stocks with gap risk.
Expand backtest period to verify robustness.
Summary
This strategy identifies overbought/oversold levels with RSI and MA to capture reversals from mid-long term gaps for ultra-short term trades. Pros are simplicity, speed and decent backtest results. But limited sample, param tuning needed, lacks risk control, weak in gap moves. More filters needed to reduce false signals and improve robustness and adaptiveness. Provides useful idea of using indicator combos to determine reversals, but requires comprehensive optimization and verification for large scale application.
Source Pine Script
/*backtest
start: 2023-08-21 00:00:00
end: 2023-09-20 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=2
// Algokid code v. 1.00
strategy("AK_RSI 2 Strategy", overlay=true)
RS = rsi(close,2)
ma5 = sma(close,5)
ma200 = sma(close,200)
longCondition = close > ma200 and close < ma5 and RS < 5
if (longCondition)
strategy.entry("My Long Entry Id", strategy.long)
strategy.close_all(when = close > ma5)
shortCondition = close < ma200 and close > ma5 and RS > 90
if (shortCondition)
strategy.entry("My Short Entry Id", strategy.short)
strategy.close_all(when = close < ma5)
Published by ChaoZhang on the FMZ strategy square · last modified 2023-09-21. 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/AK-Dual-RSI-Breakout-Strategy.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
- Bollinger Band Channel Breakout Trading StrategyPine Script · Breakout · 1d
- Bollinger Bands Dynamic Breakout StrategyPine Script · Breakout · 1h
- Bull Market Tracking SystemPine Script · Breakout · 1h
- Cross boundary Dynamic Range Quantitative Trading Strategy Based on Bollinger BandsPine Script · Breakout · 3h
- Dual MA Momentum Breakout StrategyPine Script · Breakout · 1h
- Dynamic Stop Loss Strategy Adaptive to ATR FluctuationsPine Script · Breakout · 1h