Type/to search

RSI-стратегия следования за трендом

Common strategy
Created: 2023-11-16 15:33:40
Last modified: 3 years ago
1
Follow
1802
Followers

Overview

This strategy combines the RSI indicator and weighted moving average for trend following trading. It goes long when RSI is above 60 and goes short when RSI is below 40, with the moving average verifying the trend condition. The 40-period RSI acts as a trend following indicator. The weighted moving average uses different weights to reduce the impact of short-term fluctuations. The strategy also employs stop loss and trailing take profit to control risks.

Strategy Logic

The strategy firstly calculates the RSI and weighted moving average. The RSI length is 20 periods and the weighted MA length is 20 with higher weights that reduce the impact of short-term volatility. It goes long when RSI is above 60 and weighted MA rate of change is below -1%. It goes short when RSI is below 40 and weighted MA rate of change is above 1%.

After opening long or short, stop loss and trailing take profit orders are placed simultaneously. The stop loss is set at 3 ATR from the current price. The initial trailing take profit activation is 4 ATR away, and trails in 3% increments. When price hits either stop loss or trailing take profit activation, the position will be closed.

The strategy also incorporates money management rules based on the fixed fractional position sizing approach. Whenever PNL hits a fixed amount, the order size is increased or decreased by a fixed amount.

Advantage Analysis

  • RSI indicator can effectively track trends
  • Weighted MA reduces the impact of short-term fluctuations, avoiding whipsaws
  • Trailing take profit allows profits to be maximized
  • Fixed fraction position sizing controls risk effectively

The overall edge is the ability to follow trends, while taking stop loss and trailing take profit measures to control risks, thus capturing significant gains in strong trends.

Risk Analysis

  • False signals from RSI may cause unnecessary trades
  • Forced to stop out when price breaches stop or trailing take profit levels, unable to keep following trends
  • Aggressive money management rules may lead to large losses

The main risks come from the reliability of RSI signals and the stop loss/trailing take profit settings. Incorrect parameters may result in unnecessary closing of trades or losses beyond risk appetite. Breaking stop loss/take profit may also force unwarranted stop outs, losing the chance to continue trend trading.

Solutions include optimizing RSI parameters or adding other indicators for signal confirmation. Adjust stop/trailing take profit levels based on different products and volatility conditions. Also be prudent with money management rules to avoid excessive risks.

Optimization Directions

  • Протестировать другие индикаторы вместе с RSI для подтверждения сигнала, например, KD, MACD и т.д.
  • Оптимизировать параметры стоп-лосса и трейлинг-тейк-профита на основе характеристик продукта и диапазона волатильности
  • Опробовать другие методы управления капиталом, такие как фиксированный размер сделки, формула Келли и т.д.
  • Добавить условия входа, такие как пробои полос Боллинджера, дивергенции RSI и т.д.
  • Рассмотреть возможность добавления позиций при сильных трендах

Существует много аспектов для оптимизации. Первым делом необходимо определить другие индикаторы для дополнения сигналов RSI. Следующий критический шаг – оптимизация параметров стоп-лосса/трейлинг-тейк-профита на основе исторической производительности. Управление капиталом также можно переключить на другие типы. Наконец, условия входа и добавления позиций могут быть улучшены для пирамидинга позиций при сильных трендах.

Итог

Стратегия следования за трендом на основе RSI имеет четкую логику, используя RSI для определения направления тренда и взвешенную скользящую среднюю для подтверждения. Её сила заключается в трендовой торговле, максимизации прибыли за счет стопов/управления капиталом, контролирующих риски. Однако надежность RSI и оптимизация параметров требуют улучшения. Мы можем рассмотреть возможность улучшения индикаторов сигналов, параметров стопов/трейлинга, методов управления капиталом и т.д., чтобы сделать стратегию более устойчивой для различных продуктов.

Source
Pine
/*backtest
start: 2023-01-01 00:00:00
end: 2023-06-24 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/
// © gsanson66

Strategy parameters
Strategy parameters
RSI Settings
RSI Length
MA Settings
MA Type
MA Length
Strategy parameters
RSI Long Signal
RSI Short Signal
ROC MA Long Signal
ROC MA Short Signal
TP activation in multiple of ATR
Trailing TP in percentage
Money Management
Fixed Ratio Value ($)
Increasing Order Amount ($)
Backtesting Period
Start Date
End Date
Comment
All comments (0)
No data
No data
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)