Version 2.90 2026.04.05
Pyramid Gold Pro v2.90
Pyramid Gold Pro is an automated trading system designed for the MetaTrader 5 platform, specifically optimized for the XAUUSD (Gold) pair. The Expert Advisor (EA) utilizes a breakout strategy combined with a trend-following filter to identify potential market entries.

Trading Strategy
The EA identifies trading opportunities by monitoring price breakouts over a specific period. To increase the probability of following the established trend, it incorporates a Moving Average filter. A trade is initiated only when the price breaks a recent high or low while remaining on the trending side of the Moving Average.

Key Technical Features
Dynamic Lot Scaling: The system includes a volume management logic that adjusts the lot size based on the account equity. For every $500 of equity, the position size increases by 0.01 lot, allowing the trade volume to stay proportional to the account size.

Pyramiding Logic (Layering): When a trade moves into profit, the EA can open additional positions (layers) to take advantage of the continuing trend. The number of layers is limited to a user-defined maximum to manage exposure.

Dynamic Risk Management: Along with the lot size, the Stop Loss (in USD) and the Layer Trigger values are automatically adjusted as the account equity grows. This ensures that the risk parameters remain consistent in terms of pips/points.

Candle Retracement Exit: This feature is designed to protect accumulated profits. If the price retraces by a specific percentage (default 50%) of the previous H1 candle’s body, the EA closes all active positions. This logic activates only after the second layer is opened.

Daily Safety Lock: The EA monitors daily performance and will cease all trading operations if the daily equity drawdown reaches a predefined percentage (default 20%).

Technical Requirements and Recommendations
Symbol: XAUUSD (Gold).

Timeframe: M15 (Recommended for signal generation).

Account Type: Low spread accounts (Raw Spread or ECN) are recommended for optimal execution.

Leverage: 1:500 or higher is suggested to accommodate the layering logic.

Spread Protection: The EA includes a built-in filter to prevent trading during periods of high market volatility or excessive spreads.

Input Parameters
InpPeriod: The number of bars used to calculate the breakout levels.

MAPeriod: The period for the Moving Average trend filter.

InpBaseLot: The starting lot size for the base equity amount ($500).

InpBaseTPUSD: The target profit in USD for the base equity.

InpRetracePct: The percentage of candle retracement required to trigger a global exit.

InpMaxDailyLossPct: The maximum allowed daily loss percentage before the safety lock activates.

Important Notice
Trading financial instruments involves significant risk. The performance of the Expert Advisor in a backtesting environment does not represent a guarantee of future results in a live trading environment. Users should test the EA on a demo account to understand its logic before using it on a live account.