GannZigZagMACD
- Indicators
- Version: 1.0
- Activations: 5
Purpose and Concept
GannZigZagMACD is a hybrid technical indicator for the MetaTrader 5 platform that combines the classic MACD indicator with elements of Gann's zigzag. It is designed to identify trend reversals and generate trading signals based on extreme patterns.
The main idea of the indicator is to detect significant highs and lows using Gann's method and then project signals onto the MACD histogram.
Principle of Operation
Main Components:
-
Classic MACD - calculates the difference between fast (12 periods) and slow (26 periods) exponential moving averages
-
Signal Line - smoothed MA from the MACD histogram (default: 9-period EMA)
-
Gann Algorithm - determines significant extremes based on a specified bar range (GSv_range)
-
Signal Arrows - inverted arrows on the MACD histogram indicating potential entry points
Signal Generation Mechanics:
The indicator uses inverted logic:
-
Green upward arrows (233) → SELL signals
-
Red downward arrows (234) → BUY signals
Signals are generated when the Gann algorithm identifies a significant trend reversal, and this reversal is projected onto the current value of the MACD histogram.
Interface and Visualization
Displayed Elements:
-
Blue Histogram - main MACD histogram
-
Yellow Line - MACD signal line
-
Green Arrows - indicate SELL (drawn on histogram values)
-
Red Arrows - indicate BUY (drawn on histogram values)
The indicator is plotted in a separate subwindow below the main chart.
Settings and Parameters
"GannZIGZAG Parameters" Group:
-
GSv_range (13) - range for determining significance of extremes in bars
-
Smaller values generate signals more frequently
-
Larger values provide more reliable but less frequent signals
-
-
Shift (0) - horizontal shift of the indicator in bars
-
Usually left at 0
-
"MACD Parameters" Group:
-
fastPeriod (12) - fast EMA period
-
fastMethod (MODE_EMA) - calculation method for fast MA (SMA, EMA, SMMA, LWMA)
-
fastPrice (PRICE_CLOSE) - price for calculating fast MA
-
slowPeriod (26) - slow EMA period
-
slowMethod (MODE_EMA) - calculation method for slow MA
-
slowPrice (PRICE_CLOSE) - price for calculating slow MA
-
signalPeriod (9) - signal line period
-
signalMethod (MODE_EMA) - calculation method for signal line
How to Work with the Indicator
Trading Signals:
-
BUY Signal (long):
-
Appearance of a red downward arrow on the MACD histogram
-
MACD should be in an area favorable for reversal (e.g., deep negative zone for bullish reversal)
-
-
SELL Signal (short):
-
Appearance of a green upward arrow on the MACD histogram
-
MACD should be in an area favorable for reversal (e.g., high positive zone for bearish reversal)
-
Usage Recommendations:
-
Signal Confirmation:
-
Preferably confirm signals with other indicators (RSI, Stochastic)
-
Watch for divergence between price and MACD
-
Consider support/resistance levels
-
-
False Signal Filtering:
-
Use higher timeframes for more reliable signals
-
Adjust GSv_range depending on market volatility
-
Pay attention to trend strength
-
-
Risk Management:
-
Set stop-loss beyond the nearest extreme
-
Use trailing stop when the price moves in your favor
-
Calculate risk-reward ratio of at least 1:2
-
Features and Limitations
Technical Features:
-
Inverted Logic - arrows have opposite meanings (up = sell, down = buy)
-
Asynchronous Generation - signals appear not on every bar, but only when Gann conditions are met
-
Delayed Plotting - the indicator requires a certain number of bars for initialization (min_rates_total)
-
Old Arrow Cleanup - when a new signal appears, previous arrows in the area are cleared
Limitations:
-
Lag - like all moving average-based indicators, may lag
-
False Signals in Flat Markets - may generate many false signals during sideways movement
-
Dependence on Settings - sensitivity heavily depends on the GSv_range parameter
-
Not Suitable for Scalping - due to the Gann algorithm, signals appear infrequently
Optimal Settings
For Different Timeframes:
-
M1-M15 (scalping): GSv_range = 5-8
-
M30-H1 (day trading): GSv_range = 10-15
-
H4-D1 (swing trading): GSv_range = 15-25
-
W1-MN (investing): GSv_range = 20-40
For Different Markets:
-
Forex (major pairs): GSv_range = 10-15
-
Stocks: GSv_range = 15-25
-
Cryptocurrencies (high volatility): GSv_range = 20-30
-
Commodities (oil, gold): GSv_range = 12-20
Practical Tips
-
Initial Settings: Start with GSv_range = 13 and standard MACD parameters
-
Testing: Backtest the indicator on historical data before real trading
-
Combination: Use together with trend indicators (ADX, ATR)
-
Capital Management: Don't risk more than 1-2% per trade
-
Journaling: Keep a trading journal to analyze signal effectiveness
Advantages and Disadvantages
Advantages:
-
Combination of two proven methodologies (MACD + Gann)
-
Clear visual signals
-
Adjustable sensitivity
-
Automatic cleanup of old signals
Disadvantages:
-
Inverted logic can be confusing for beginners
-
Dependence on a single parameter (GSv_range)
-
Cannot be used on very small timeframes
-
Requires confirmation with other analysis methods
Conclusion
GannZigZagMACD is a powerful technical analysis tool that is particularly effective in trending markets. With proper configuration and sensible use in combination with other indicators and analysis methods, it can become a valuable component of your trading system.
Important: Like any technical indicator, GannZigZagMACD does not provide 100% accurate signals and should be used within a comprehensive trading strategy with proper risk management rules.
