资源加载中... loading...

Momentum Breakout Strategy

Author: ChaoZhang, Date: 2024-01-18 15:17:11
Tags:

img

Overview

This strategy combines EMA lines, MACD indicator and single-day gain to identify market breakthrough signals and implement a momentum trading strategy to buy low and sell high.

Strategy Principle

When the fast EMA line crosses over the slow EMA line, it is considered that the market is in an upward trend and a buy signal is generated. When the difference of MACD indicator crosses over the 0 axis, a buy signal is also generated to open long positions.

In addition, if the close price of a single day rises more than 10% compared to the open price, a buy signal will also be generated to chase the breaking market trend.

After opening positions, if the price falls more than 10%, stop loss will be triggered. If the profit reaches 45%, take profit will be triggered.

Advantage Analysis

This is a typical trend following strategy that can capture the uptrend after a strong momentum breakthrough, with great profit potential. The main advantages are:

  1. EMA lines implement trend judgment to avoid opening positions during market consolidation.
  2. MACD indicator ensures more reliable buy signals.
  3. Single day gain condition captures trend outbreak.
  4. Reasonable stop loss and take profit settings help control risks.

Risk Analysis

Although reasonably designed, some risks still exist:

  1. Improper breakthrough signal judgment may lead to short losses.
  2. Market rebound may also generate false signals.
  3. Oversize stop loss setting increases loss risk.
  4. Insufficient follow-up trend after breakthrough may lead to insufficient profit.

To reduce the above risks, we can consider optimizing the moving stop loss strategy or adding other indicators like volume to filter signals.

Optimization Directions

There is still room for further optimization:

  1. Add volume indicator to ensure enough trading volume supporting the trend.
  2. Optimize MACD parameters to improve indicator sensitivity.
  3. Test different combinations of EMA periods.
  4. Add adaptive stop loss mechanism.
  5. Optimize take profit points for more efficient money management.

Through parameter tuning, indicator combination and other methods, the stability and profitability of this strategy can be greatly improved.

Conclusion

In general, this strategy is simple, practical and with great profit potential. By judging market breakthrough points, it can effectively capture uptrends, and the drawdown control is also reasonable. In future optimization, continuingly improving parameter adjustment and stop loss/take profit design can make it a worthwhile long-term quantitative trading strategy.


/*backtest
start: 2023-01-11 00:00:00
end: 2024-01-17 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=3
strategy("Alt Coins", overlay=true)

//Simple Alt Coin Trading Strategy//
// by @ShanghaiCrypto //

////EMA////
fastLength = input(5)
slowLength = input(12)
baseLength = input(50)
price = close

emafast = ema(price, fastLength)
emaslow = ema(price, slowLength)
emabase = ema(price, baseLength)

///MACD////
MACDLength = input(9)
MACDfast = input(12)
MACDslow = input(26)
MACD = ema(close, MACDfast) - ema(close, MACDslow)
aMACD = ema(MACD, MACDLength)
delta = MACD - aMACD

////PUMP////
OneCandleIncrease = input(10, title='Gain %')
pump = OneCandleIncrease/100

////Profit Capture and Stop Loss//////
stop = input(10.0, title='Stop Loss %', type=float)/100
profit = input(45.0, title='Profit %', type=float)/100
stop_level = strategy.position_avg_price * (1 - stop)
take_level = strategy.position_avg_price * (1 + profit)

////Entries/////
if crossover(emafast, emaslow)
    strategy.entry("Cross", strategy.long, comment="BUY")

if (crossover(delta, 0))
    strategy.entry("MACD", strategy.long, comment="BUY")
    
if close > (open + open*pump)
    strategy.entry("Pump", strategy.long, comment="BUY")

/////Exits/////
strategy.exit("SELL","Cross", stop=stop_level, limit=take_level)
strategy.exit("SELL","MACD", stop=stop_level, limit=take_level)
strategy.exit("SELL","Pump", stop=stop_level, limit=take_level)

////Plots////
plot(emafast, color=green)
plot(emaslow, color=red)
plot(emabase, color=yellow)
plot(take_level, color=blue)
plot(stop_level, color=orange)

More