Type/to search

Pivot-based RSI Divergence Strategy

Cryptocurrency
Created: 2023-11-28 13:43:05
Last modified: 3 years ago
1
Follow
1776
Followers

img

Overview

This strategy is called "Pivot-based RSI Divergence Strategy". It uses the divergence between RSI indicators at different cycles to determine entry and exit points, and adds long-term RSI as a filter condition to improve the stability of the strategy.

Strategy Logic

The strategy mainly judges the opportunity to buy when there is a "hidden bullish divergence" or "regular bullish divergence" between the short-term RSI (such as 5-day RSI) and price; and to sell when there is a "hidden bearish divergence" or "regular bearish divergence".

A "regular bullish divergence" means that the price makes a new low while the RSI does not make a new low; a "hidden bullish divergence" is the opposite, the price does not make a new low while the RSI makes a new low. The "new lows" and "new highs" referred to in both definitions are relative to historical extremes over a certain rolling window.

In addition, the strategy also introduces long-term RSI (such as 50-day RSI) as a filter condition. It only considers buy signals when the long RSI is greater than 50; and considers stop loss or take profit exit when the long RSI is less than 30.

Advantages

The biggest advantage of this strategy is that it utilizes both the RSI divergence signals on the short-term and the filter of long-term RSI, which can avoid being trapped and missing trends to some extent. Specifically, it has the following main advantages:

  1. The short-term RSI divergence signal can give early judgment of price reversal opportunities and timely capture turning points;
  2. The long-term RSI filter avoids going long blindly when the trend is uncertain;
  3. Multiple types of take profit methods and partial profit-taking help reduce risk;
  4. The pyramiding mechanism allows adding positions and further expands profit potential.

Risks

The strategy also has some risks to note:

  1. RSI divergences are not always valid and there could be false signals;
  2. Risks amplify after pyramiding. Losses could accelerate if the judgment is wrong;
  3. Improper take profit settings may also lead to premature profit-taking or insufficient profits.

Corresponding risk management measures include: reasonably setting stop loss/take profit conditions, controlling position sizing, partial profit-taking to smooth the equity curve, etc.

Optimization Directions

There is room for further optimization of the strategy:

  1. RSI parameters can be further optimized to find the best combination;
  2. Divergence signals of other indicators such as MACD and KD can be tested;
  3. Parameters can be specifically optimized on certain products (such as crude oil, precious metals, etc.) to improve adaptability.

Summary

This strategy combines the long/short RSI divergence signals of short-term and long-term to improve profitability while controlling risks. It reflects multiple principles in quantitative strategy design, including when to enter, when to exit, partial profit-taking, stop loss/take profit setting, etc. This is an exemplary RSI divergence strategy for reference.

Source
Pine
/*backtest
start: 2023-11-20 00:00:00
end: 2023-11-27 00:00:00
period: 5m
basePeriod: 1m
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/
// © mohanee

//@version=4
Strategy parameters
Strategy parameters
RSI Period
Long RSI Period
RSI Source
Pivot Lookback Right
Pivot Lookback Left
Take Profit at RSI Level
Stop Loss%(if checked 8% rule applied)
Max of Lookback Range
Min of Lookback Range
Plot Bullish
Plot Hidden Bullish
Plot Bearish
Plot Hidden Bearish
Comment
All comments (0)
No data
No data
  • 1
iPhone Download
Forums
PINE Language
© 2015 - ∞ INVENTOR PTE LTD (SG)