Type/to search

Trend Following Moving Stop Loss MA Strategy

Cryptocurrency
Created: 2023-10-10 10:36:16
Last modified: 3 years ago
1
Follow
1781
Followers

Overview

This strategy uses a combination of moving averages and relative strength index to determine the trend direction, and implements a trailing stop loss mechanism to achieve profit targets. It is suitable for high volatility markets, allowing fast market entry after trends are formed, and securing profits through stop loss and take profit.

Strategy Logic

The strategy uses RSI indicator to determine the current market trend. RSI below 30 is considered bearish, while above 70 considered bullish. When RSI crossover signals a bullish trend, it will long. When RSI crossover signals a bearish trend, it will short.

After opening positions, the strategy uses a moving stop loss mechanism to trail price changes and lock in profits. Specifically, it records the average entry price of each position. When price reaches 1% of the entry price, it will activate the moving stop loss mechanism, moving the stop loss line based on the difference between current price and highest price.

When price reaches stop loss level, it will exit the position. When price reaches 3% of entry price, it will take profit. By using double protection from stop loss and take profit, it achieves the profit target.

Advantages

  • Using RSI to determine trend direction allows fast judgment of market momentum
  • Moving stop loss can flexibly adjust stop loss level based on real-time price change, avoiding premature stop loss
  • The double protection from stop loss and take profit ensures certain profit while controlling risks

Risks

  • RSI may signal false entry if used alone
  • Stop loss distance too small may activate easily, while too loose may fail to stop loss
  • Improper take profit setting may also fail the profit target

Additional indicators can be added to confirm RSI signals and reduce false signals. Optimizing stop loss and take profit levels based on backtesting can also help find the best parameter combination.

Optimization

  • Add Bollinger Bands or KD to confirm trend signals and avoid false entries
  • Research using additions and multiplications to expand indicator combinations
  • Try multi-timeframe confirmation to avoid false signals on single timeframe
  • Research adaptive stop loss mechanism to adjust stop distance based on market volatility

Summary

Overall this is a very professional and reliable trend following strategy. It can quickly determine market direction and lock in profits through moving stop loss and take profit. Further optimizing parameters and adding confirming indicators can improve win rate and reliability. With clear logic and flexible parameters, it is a very good example for learning quant trading strategies.

Source
Pine
/*backtest
start: 2022-10-03 00:00:00
end: 2023-10-09 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=3
// Learn more about Autoview and how you can automate strategies like this one here: https://autoview.with.pink/
// strategy("Autoview Build-a-bot - 1m chart", "Strategy", overlay=true, pyramiding=2000, default_qty_value=10000)
// study("Autoview Build-a-bot", "Alerts")
Strategy parameters
Strategy parameters
Backtest Start Year
Backtest Start Month
Backtest Start Day
Backtest Stop Year
Backtest Stop Month
Backtest Stop Day
RSI Period Length
Length
rsin
Longs Only
Shorts Only
Flip the Opens
Pyramiding less than
Pyramiding equal to
Pyramiding greater than
Trailing Stop
Activate Trailing Stop Price (%). Divided by 100 (1 = 0.01%)
Trailing Stop (%). Divided by 100 (1 = 0.01%)
Take Profit
Take Profit (%). Divided by 100 (1 = 0.01%)
Stop Loss
Stop Loss (%). Divided by 100 (1 = 0.01%)
Comment
All comments (0)
No data
No data
  • 1
iPhone Download
Forums
PINE Language
© 2015 - ∞ INVENTOR PTE LTD (SG)