MACD Indicator Breakout Trading Strategy
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:
-
Calculate fast EMA and slow EMA, their difference forms the MACD line.
-
Smooth the MACD line using another EMA to derive the signal line.
-
Go long on MACD crossing above signal, and short on crossing below.
-
Set percentage stop loss and take profit for risk management.
Advantages:
-
MACD improves on single EMA for clearer trend identification.
-
Breakout trading captures turning points in a timely manner.
-
Stop loss/take profit mechanisms help control trade risks.
Risks:
-
More false breakouts near MACD zero line.
-
Parameter tuning needed for different trading instruments.
-
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.
/*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 ===- 1
