Type/to search

MACD Indicator Breakout Trading Strategy

Cryptocurrency
Created: 2023-09-12 15:32:12
Last modified: 3 years ago
1
Follow
1781
Followers

This strategy trades MACD crossover signals for entry and exit decisions. MACD is composed of fast and slow EMAs, and crossover of the MACD line over zero generates trade signals. It is a typical trend-following quantitative strategy.

Strategy Logic:

  1. Calculate fast EMA and slow EMA, their difference forms the MACD line.

  2. Smooth the MACD line using another EMA to derive the signal line.

  3. Go long on MACD crossing above signal, and short on crossing below.

  4. Set percentage stop loss and take profit for risk management.

Advantages:

  1. MACD improves on single EMA for clearer trend identification.

  2. Breakout trading captures turning points in a timely manner.

  3. Stop loss/take profit mechanisms help control trade risks.

Risks:

  1. More false breakouts near MACD zero line.

  2. Parameter tuning needed for different trading instruments.

  3. Trend trading prone to event risks, requiring stops.

In summary, this strategy trades based on MACD and signal line crossover. MACD's strengths benefit performance but false breakout risks remain. Prudent risk controls are still required for steady gains over the long run.

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

//@version=3 
strategy("uray MACD", overlay=false, pyramiding = 0, calc_on_every_tick=true, precision=2, currency="USD", default_qty_value=10, default_qty_type=strategy.cash,initial_capital=100,commission_type=strategy.commission.percent,commission_value=0.1) 

// === INPUT BACKTEST RANGE ===
Strategy parameters
Strategy parameters
From Month
From Day
From Year
To Month
To Day
To Year
MACD fast
MACD slow
MACD length
Stop Loss (price %)
Take Profit (price %)
Comment
All comments (0)
No data
No data
  • 1
iPhone Download
Forums
PINE Language
© 2015 - ∞ INVENTOR PTE LTD (SG)