Type/to search

RSI and SuperTrend Based Dual Direction Trading Strategy

Common strategy
Created: 2023-11-03 14:22:50
Last modified: 3 years ago
1
Follow
1802
Followers

img

Overview

This is a dual direction trading strategy that comprehensively utilizes the RSI indicator and the SuperTrend indicator. The strategy aims to identify the strength and weakness in the market and make timely position switching when the trend direction changes, in order to obtain higher returns.

Strategy Principle

The strategy is mainly based on the following principles:

  1. Use the RSI indicator to determine the current market strength and weakness. Above 50 RSI indicates a strong market, and below 50 a weak one.

  2. Use the SuperTrend indicator as a trend filter. Trading signals are triggered only when the price breaks through the SuperTrend lines.

  3. When RSI gives a strong signal, go long if the price breaks above the upper band, and close position if it breaks below the lower band.

  4. When RSI gives a weak signal, go short if the price breaks below the lower band, and close position if it breaks above the upper band.

  5. Capture turning points by monitoring the transitions of RSI between long and short, and make timely position switching.

Implementation

  1. Calculate RSI values with length of 14, using 50 as the threshold for strength/weakness.

  2. Calculate SuperTrend with length of 10 and multiplier of 2.

  3. Go long when RSI goes above 50 and price breaks above SuperTrend upper band. Go short when RSI falls below 50 and price breaks below lower band.

  4. When already long, if RSI turns weak and price breaks below upper band, close long position. Vice versa when short.

  5. Configurable for long-only or short-only modes.

Advantages

This strategy combines trend following and overbought/oversold analysis, and has the following advantages:

  1. Can capture trend changes in a timely manner and avoid unnecessary entries.

  2. RSI effectively identifies overbought/oversold zones to avoid chasing tops and bottoms.

  3. SuperTrend filters out market noise well and tracks mid-long term trends.

  4. Combining RSI and SuperTrend improves stability.

  5. The strategy has large parameter tuning space for different products and timeframes.

  6. Supports long-only/short-only modes to handle different market conditions flexibly.

Risks

There are also some risks with this strategy:

  1. RSI can generate false signals easily, requiring price confirmation.

  2. Bad SuperTrend parameters may cause missed trades or chasing.

  3. Divergence risk exists when combining two indicators. Parameters need to be adjusted for best match.

  4. Stop loss may be taken out instantly in extreme volatility. Reasonable stop loss placement is necessary.

  5. Avoid taking reversal positions near major support/resistance levels.

Enhancements

The strategy can be further optimized in the following aspects:

  1. Adjust RSI parameters to find the optimal length for filtering out false signals.

  2. Optimize SuperTrend parameters for better trend tracking capability.

  3. Test different parameter combinations on different products and timeframes to find the optimum.

  4. Add other indicators like MACD, KDJ to improve signal accuracy.

  5. Add analysis of key support/resistance, Bollinger Bands, moving averages etc. to qualify strategy signals.

  6. Optimize stop loss strategy to reduce being stopped out while maintaining effectiveness.

Conclusion

This strategy integrates the strengths of RSI and SuperTrend to effectively identify mid-term trend changes between bull and bear markets. The strategy is easy to implement with clear logic and has strong practical value. With parameter tuning it can adapt to more market conditions. Common issues like false signals and bad parameters need to be watched out for. Overall this is a solid trend following strategy.

Source
Pine
/*backtest
start: 2023-01-01 00:00:00
end: 2023-11-02 00:00:00
period: 1d
basePeriod: 1h
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/
//@version=5
//Created by @CITIAlgo
// —————————————————————————————————————————————————————————————————————————————————————————————————————————
Strategy parameters
Strategy parameters
Base Settings ---------------------------------------
Allow Repainting ?
Trade Direction
Show Entries
Show Exits
Display Settings ------------------------------------
Apply Bar Colors
Candle Colors
cbearColor
Long/Short Labels
lbearColor
Show Supertrend
st_bullColor
st_bearColor
Trend & Signal Settings---------------------
Entry
Strong/Weak Momentum
Entry
Bull/Bear Momentum
Filter
MA
Disable RSI Ranges
Filter
Supertrend
Disable Supertrend Ranges
RSI Settings ----------------------------------
TF
setHTF1a
setHTF1b
RSI Length
Above 50
Below 50
MA Length
Show MA
ma_bullColor
ma_bearColor
Supertrend Settings ----------------------------------
TF
setHTF2a
setHTF2b
Supertrend Length
Mult
Highlights
Step 5 - 📆 Time Filter 📆-------------
Start Timeㅤㅤ
End Time ㅤ ㅤ
Step 6 - Risk Management-------------
TP Price %
tppercent
Quantity %
SL Price %
stoppercent
Order Size
Use Net Profit
🇪🇶🇺🇮🇹🇾 %
🇸🇮🇿🇪
🇨🇴🇳🇹🇷🇦🇨🇹🇸
Step 7 - Alerts & Bot Trading Settings-------------
Broker
Bot ID
Bot Email Token
Cloud Function Server
Ticker
Passphrase
Comment
All comments (0)
No data
No data
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)