Type/to search

Multi Timeframe MACD Moving Average Trading Strategy

Common strategy
Created: 2024-01-16 14:06:10
Last modified: 3 years ago
1
Follow
1802
Followers

img

Overview

This strategy is based on the MACD indicator and moving averages across multiple timeframes to generate trading signals. It utilizes the performance of MACD on different periods as well as the price’s position relative to different moving averages to design entry and exit rules for long and short positions.

Strategy Logic

1. MACD Indicator

  • Calculate 5-min, 15-min, 1-hour and 4-hour moving averages
  • Judge the trend based on the price’s relationship with moving averages on different periods

2. RSI Indicator

  • Calculate the RSI values on the current period and higher timeframe
  • Use RSI topping and bottoming reversals to identify reversal signals

3. Candlestick Patterns

  • Calculate various bullish and bearish candle combinations to identify reversal signals
  • Pay attention to key support and resistance levels in combination with price levels

4. Entry Rules

Long Condition:

  • Current period RSI breaks above lower line
  • Higher period RSI shows bullish divergence, signaling impending reversal

Short Condition:

  • Current period RSI breaks below upper line
  • Higher period RSI shows bearish divergence, signaling impending reversal

5. Exit Rules

Close Long Condition:

  • Candlestick shows reversal signal: trend reversal to bearish candle, e.g. Shooting Star and Dark Cloud Cover

Close Short Condition:

  • Candlestick shows reversal signal: trend reversal to bullish candle, e.g. Hammer and Piercing Pattern

6. Risk Control

Set stop loss and take profit standards to limit losses and profit erosion.

Advantage Analysis

  1. Multiple indicator combination for more accurate signals
  2. Make full use of information across periods to improve profitability
  3. Strict entry and exit rules ensure controllable risks

Risks and Optimization

  1. Inappropriate parameter optimization may lead to over-trading
  2. Indicator parameters need optimization for different products
  3. Dynamic stop loss and take profit can help lock in profits

Summary

This is an overall robust strategy. By using multiple indicators and strict entry/exit rules, it can effectively capture market trends and avoid trading risks. But further optimization is needed to improve return stability.

Source
Pine
/*backtest
start: 2023-12-01 00:00:00
end: 2023-12-31 23:59:59
period: 3h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=2

//
// Author : Jacques CRETINON
Strategy parameters
Strategy parameters
Use Current Chart Resolution
Use Different Timeframe ? Uncheck Box Above
Large timeframe ?
Use Start Time Limiter?
Start From Year
Start From Month
Start From Day
Start From Hour
Start From Minute
plot macd (only strategy script) ?
plot rsi info ?
Length
Upper Line Value?
Lower Line Value?
plot all candle info (only strategy script) ?
plot fractals info (only strategy script) ?
plot level info (only strategy script) ?
Directional PBars, % of Range of Candle the Long Wick Has To Be
Shaved Bars, % of Range it Has To Close On The Lows or Highs
min body size factor ? WARNING see pine code to understand
Reversal PBars, % of Range of Candle the Long Wick Has To Be
Reversal Pin Bar Lookback Length
Take Profit
Stop Loss
Trailing Stop Loss
Trailing Stop Loss Offset
Comment
All comments (0)
No data
No data
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)