0bps

Strategy vault / Breakout

A Short term Strategy Combining RSI Indicator and Price Breakthrough

This strategy combines the RSI indicator with price breakthroughs to find rotation opportunities within a certain trend and range-bound market, so as to make short-term trades and pursue highly efficient short-term…

Author
ChaoZhang
Complexity
Intermediate · 44 lines
Parameters
9
Backtest bar
1h · intraday
Tested on
BTC/USDT · futures

IMG

Overview

This strategy combines the RSI indicator with price breakthroughs to find rotation opportunities within a certain trend and range-bound market, so as to make short-term trades and pursue highly efficient short-term profits.

Strategy Principle

  1. RSI Indicator Rule: Generate a buy signal when RSI falls below 30 as a potential reversal buy point. Generate a sell signal when RSI rises above 60 to lock in profits.
  2. Window Limit: Only take effect within the specified backtest time window, which limits the strategy's effectiveness and prevents overall arbitrage.
  3. Breakthrough Judgment: Identify breakthrough opportunities combined with price trends to enhance the actual effect of the strategy and avoid unnecessary idling.

Therefore, this strategy integrates multiple dimensions of judgment logic to conduct short-term profitable rotation operations utilizing the buy and sell signals generated by RSI indicator, under certain trends and breakthrough chances. It can effectively seize the reversal bounce opportunity when the market is extremely oversold, as well as the retracement chance when extremely overbought in the short term.

Advantage Analysis

  1. Integrating multiple logical judgments, which is more rigorous compared to simple RSI strategies, and can effectively avoid unnecessary losses caused by two-way idling.
  2. Identify local extremes with RSI indicator to spot reversal opportunities and make profits.
  3. The backtest time window setting enables verification and optimization targeting specific market conditions, improving the practical applicability of the strategy.
  4. Pursuing short-term profits without predicting trend reversals is easier to grasp and reduces risks.

Risks and Solutions

  1. Unable to directly determine the overall trend direction, manual analysis of the big picture needed.
  2. RSI indicator lags in responding to price changes, potentially missing out the best buy/sell timing.
  3. Requiring adequate understanding of the macro market environment where the strategy is applicable.
  4. Can incorporate more technical indicators for major trend judgment and optimize strategy parameters to improve flexibility.

Optimization Directions

  1. Add judgment of major trends to avoid holding losing trades in prolonged drawdowns.
  2. Adjust RSI parameters and optimize overbought/oversold lines to improve efficiency.
  3. Add stop-loss logic.
  4. Optimize the scope of the backtest window for better fitting actual market conditions.

Summary

This strategy leverages RSI indicator to identify short-term reversal opportunities from extremely overbought/oversold scenarios, and conducts short-term profitable rotation operations combined with price breakthroughs. Its characteristics are pursuing short-term efficiency, easy operation, limited risks, and hence extremely suitable for short-term traders to use under certain market conditions. Attention should be paid to judging the overall major trend, parameter optimization etc., in order to obtain better performance.

Parameters

NameDefaultWhat it controls
v_input_1trueFrom Month
v_input_2trueFrom Day
v_input_32020From Year
v_input_4trueThru Month
v_input_5trueThru Day
v_input_62112Thru Year
v_input_7trueShow Date Range
v_input_830oversold
v_input_960overbought

Source Pine Script

/*backtest
start: 2024-01-01 00:00:00
end: 2024-01-31 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © relevantLeader16058

//@version=4
strategy(shorttitle='RSI Classic Strategy',title='RSI Classic Strategy (by Coinrule)', overlay=true, initial_capital = 1000, 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)

//Backtest dates
fromMonth = input(defval = 1,    title = "From Month",      type = input.integer, minval = 1, maxval = 12)
fromDay   = input(defval = 1,    title = "From Day",        type = input.integer, minval = 1, maxval = 31)
fromYear  = input(defval = 2020, title = "From Year",       type = input.integer, minval = 1970)
thruMonth = input(defval = 1,    title = "Thru Month",      type = input.integer, minval = 1, maxval = 12)
thruDay   = input(defval = 1,    title = "Thru Day",        type = input.integer, minval = 1, maxval = 31)
thruYear  = input(defval = 2112, title = "Thru Year",       type = input.integer, minval = 1970)

showDate  = input(defval = true, title = "Show Date Range", type = input.bool)

start     = timestamp(fromYear, fromMonth, fromDay, 00, 00)        // backtest start window
finish    = timestamp(thruYear, thruMonth, thruDay, 23, 59)        // backtest finish window
window()  => true


// RSI inputs and calculations
lengthRSI = 14
RSI = rsi(close, lengthRSI)
oversold= input(30)
overbought= input(60)

//Entry 
strategy.entry(id="long", long = true, when = RSI< oversold and window())

//Exit
//RSI
strategy.close("long", when = RSI > overbought and window())


Published by ChaoZhang on the FMZ strategy square · last modified 2024-02-06. 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/A-Short-term-Strategy-Combining-RSI-Indicator-and-Price-Breakthrough.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