GembalaADX Trend Following with SAR Filter
- Experts
- Syafrien Anwar
- 버전: 1.80
- 활성화: 5
Strategy Overview
The GembalaCandle EA is a trend-following system that uses the ADX (Average Directional Index) indicator to determine the strength of a trend and the direction (using +DI and -DI). It uses multiple timeframes (from M1 to D1, but typically the lower timeframes are used) and combines their signals according to a selected mode (like consensus, strict, etc.). The EA also uses several filters (Bollinger Bands, MA29, Parabolic SAR, ADX exhaustion, MA50, and others) to avoid entering trades in unfavorable conditions. It has a sophisticated risk management system, including an averaging/martingale system (with grid options), auto-hedging, and a re-entry system.
How ADX Creates Signals
The EA uses the ADX indicator on multiple timeframes (which ones are used is configurable). For each timeframe, it checks:
-
ADX Strength: The ADX value must be above the Strong_ADX_Level (default 18.0) to consider the trend strong enough.
-
DI Cross and Levels:
-
For a buy signal: The +DI must be above the -DI by at least the DI_High_Level for that timeframe (e.g., 14.0 for M1). Also, the +DI must be above a certain level (the DI_High_Level ) and the -DI below the DI_Low_Level (7.0 for M1). However, note that the code uses DI_High_Level and DI_Low_Level for each timeframe to set thresholds for the DI values.
-
For a sell signal: The -DI must be above the +DI by at least the DI_High_Level for that timeframe, and the -DI must be above the DI_High_Level and the +DI below the DI_Low_Level .
-
For a buy signal on a given timeframe:
-
ADX > Strong_ADX_Level
-
+DI > -DI (the positive directional indicator is above the negative one)
-
+DI >= DI_High_Level (for that timeframe)
-
-DI <= DI_Low_Level (for that timeframe)
For a sell signal:
-
ADX > Strong_ADX_Level
-
-DI > +DI
-
-DI >= DI_High_Level
-
+DI <= DI_Low_Level
Then, the EA combines the signals from multiple timeframes according to the TimeframeMode :
Protection Features
The EA has multiple layers of protection:
1. Bollinger Band Filter
-
Can be enabled/disabled per timeframe (M1, M2, M5, M15).
-
For a buy signal, the price must be below the upper Bollinger Band (or above the lower for sell). The exact condition is that the price must be within the bands to allow the trade.
2. Bollinger Band Extreme Filter
-
This filter checks if the price is too close to the extreme of the Bollinger Bands (using a distance in points). If the price is within BBExtreme_Distance (default 500 points) of the upper band, a buy signal is blocked. Similarly for sell and the lower band.
3. MA29 Filter (Linear Weighted Moving Average)
-
This is an override filter for the Bollinger Bands. If the price breaks above the MA29 high (for buy) or below the MA29 low (for sell), then the Bollinger Band filter is temporarily disabled, allowing the trade.
4. Parabolic SAR Filter
-
Checks the direction of the Parabolic SAR. If SAR is below the price (bullish), only buy signals are allowed. If SAR is above the price (bearish), only sell signals are allowed.
5. ADX Exhaustion Filter
-
If the ADX value is too high (above ADX_Exhaustion_Level , default 44.0) and the corresponding DI line (D+ for buy, D- for sell) is also above DI_Exhaustion_Level (default 44.0), then the trend is considered exhausted and the signal is blocked.
6. MA50 Filter
-
This is a trend filter. For a buy signal, the price must be above the MA50 line (if MA50_FilterBuy is true). For a sell signal, the price must be below the MA50 line (if MA50_FilterSell is true). This filter can be bypassed for reversal signals and hedge signals.
7. Signal Direction Protection
-
After a signal direction change (e.g., from buy to sell), the EA can block averaging (or all trades) in the opposite direction for a set period ( SignalChangeBlockMins , default 5 minutes). This is to prevent entering trades against the new signal direction immediately.
8. Dynamic Stop Loss and Take Profit
-
The EA can calculate SL and TP based on the ATR (Average True Range) to adapt to market volatility.
9. Auto-Hedging System
-
When the floating loss reaches a certain percentage ( HedgeTriggerPercent , default 7.5%), the EA can open a hedge position (in the opposite direction) to reduce the drawdown. It also has a rebalancing feature to adjust the hedge.
10. Re-entry System
-
After a trade is closed (by SL, TP, trailing stop, or manually), the EA can wait for a cooldown period and then re-enter in the same direction (or opposite, as configured) if the conditions are still met.
11. Zigzag Reversal System
-
Uses the Zigzag indicator to detect potential reversal points. When a reversal signal is generated (price moves beyond a Zigzag peak/trough by a threshold), it can override the original trend signal.
12. Floating Loss Protection
-
If the floating loss reaches a certain percentage ( MaxFloatLossPercent , default 10%), the EA can close all positions and stop trading for a recovery period.
13. Risk Management
-
Includes position sizing based on account balance and risk percentage, leverage control, and maximum positions limit.
14. Averaging/Martingale System with Grid
-
The EA can average down losing positions in a grid pattern, but with strict risk controls (maximum risk percentage, emergency close levels, etc.).
Recommended Usage
Best Conditions:
· Trending markets Identify clear directional movement(adjust in low timeframes for ranging market)
· It’s designed to match Gold's Volatility Profile(XAUUSD).Can be adjusted for XAGUSD and Major currency pairs (EURUSD, GBPUSD)
· High volatility periods (news events, session overlaps)
· Sufficient account size for proper position sizing
· Very good in scalping nature; Adjust for Intraday or swing
Configuration Guidelines:
1. Start with conservative settings (higher SL, lower risk %)
2. Use demo account for testing
3. Adjust timeframe consensus based on trading style (scalping vs. swing)
4. Enable only necessary filters to avoid over-filtering
5. Monitor performance regularly and adjust parameters as needed
6. To maintain peak effectiveness in capturing market opportunities, schedule a weekly parameter review session. This regular adjustment helps the EA adapt to changing volatility, trend characteristics, and market structure shifts and to keep the EA finely tuned to market conditions. Regular adjustments enhance signal accuracy and improve alignment with the dynamic nature of financial markets
7. Panels can be on off
Minimum Account Requirement:
· Standard Accounts: $10,000 USD minimum
· Cent Accounts: 10,000 cent units minimum
This threshold ensures the integrated risk management systems function as designed, with sufficient capital to withstand normal market volatility while maintaining recommended position sizing protocols.
· A minimum account balance is required to implement the recommended risk management, including proper position sizing, drawdown protection, and multi-layered safety mechanisms inherent in this trading system
· Risk Disclaimer
· Important Considerations:
1. Forex and CFD trading carries significant risk of loss
2. This EA does not guarantee profits
3. Past performance is not indicative of future results
4. Always use proper risk management
5. Test thoroughly on demo before live trading
6. Only trade with funds you can afford to lose
Technical Requirements:
· MetaTrader 5 platform
· Stable internet connection
· VPS recommended for 24/7 operation
· Sufficient account balance for minimum position sizes
Broker with proper execution and reasonable spreads
Maintenance and Monitoring
Regular Checks:
1. Daily: Verify all systems are functioning correctly
2. Weekly: Review performance metrics and adjust parameters if needed
3. Monthly: Full system check and potential re-optimization
4. After significant market events: Verify system behavior during high volatility
This threshold ensures the integrated risk management systems function as designed, with sufficient capital to withstand normal market volatility while maintaining recommended position sizing protocols.
Conclusion
The GembalaCandle EA is a complex system that uses multiple indicators and filters to try to capture trends while protecting against false signals and managing risk. It is designed for the XAUUSD (gold) market but can be adapted to others. The strategy is based on the ADX trend strength and direction, with multiple layers of confirmation and protection.
