Introducing the PyramidZone Recovery EA – a powerful trading robot combining advanced pyramiding martingale algorithms, an intelligent position recovery system (Zone Recovery), and unique protection against ranging markets. This is a completely redesigned professional version 2.21, created for traders seeking an automated strategy with high profit potential and built-in risk management mechanisms.
🚀 Key Features
1. Pyramiding Martingale with Recovery Zone
Instead of classic averaging in one direction, the EA opens positions alternately in both directions (BUY → SELL → BUY → …) with an increasing lot size. When the next level is activated, the price must pass the specified "recovery zone" (Recovery Zone), ensuring a safer volume increase.
2. Single Stop Order per Direction
At any given time, there is only one pending order (Buy Stop or Sell Stop) for the next entry. This eliminates the chaotic accumulation of orders and simplifies control.
3. Post-Restart Recovery
When the terminal restarts or crashes, the EA automatically analyzes open positions and restores its state: it determines the current direction, the next price level, places the correct stop order, and recreates the take-profit line. No data loss!
4. Flat Detection
The built-in algorithm analyzes the last few candles for sideways movement. If a flat is present, new signals are not generated – the EA avoids entering during unstable periods.
5. Flexible trading time management
You can set multiple time intervals within a day (e.g., "00:00-06:00, 08:00-12:00, 14:00-18:00, 20:00-23:59"). At the end of the interval, the advisor either continues managing open positions or closes them with a delay—your choice.
6. Various lot calculation modes
Choose the appropriate volume increase method:
- Additive (0.01, 0.02, 0.03…)
- Multiplicative (0.01, 0.02, 0.04…)
- Arithmetic progression (0.01, 0.03, 0.05…)
- Classic Fibonacci (0.01, 0.02, 0.03, 0.05, 0.08…)
- Modified Fibonacci with customizable coefficients
- Exponential (0.01, 0.02, 0.04, 0.08…)
- Quadratic (0.01, 0.03, 0.06, 0.10…)
7. Extreme loss protection
- Limit the maximum number of trades in a cycle (MaxTrades).
- Forced closure of all positions upon reaching a specified loss level (MaxLoss).
- Automatic "sleep" of the EA for a specified period after an emergency stop.
8. Visual Take-Profit Line
The chart displays a dynamic line that must be reached to close all positions profitably. The line is recalculated taking into account commissions, swaps, and spreads.
⚙️ How it works
1. Cycle Start
When a signal appears (a green or red candle on a new bar), the first market position is opened in the corresponding direction. A single pending order is immediately placed in the opposite direction at the RecoveryZone distance.
2. Pyramid Development
If the price reaches the pending order, it is activated, and the new direction becomes the current one. The old pending order is deleted, and a new one is placed – again in the opposite direction, with a lot calculated for the next level.
3. Target Reach
As soon as the total profit for all open positions exceeds the specified TakeProfit (or RecoveryTakeProfit, if recovery mode is activated), all positions are closed, and the cycle ends.
4. Crash Protection
If the Expert Advisor is stopped and restarted, it finds open positions, restores the activation history, and continues working correctly.
📊 Settings (Input Parameters)
Recovery Zone
- RecoveryZoneSize – distance to the next level (in points).
- TakeProfit / RecoveryTakeProfit – target profit for normal and recovery modes.
- MaxTrades – maximum number of trades in a cycle (0 – unlimited).
- SetMaxLoss / MaxLoss – activation and maximum loss level.
Lot Management
- InitialLot – starting lot.
- LotMode – select the lot calculation method.
- Additional parameters for each method (multipliers, increments, etc.).
Timing and Filters
- CycleBreakSeconds – pause between cycles.
- SleepMinutesAfterStop – sleep time after an emergency stop.
- EnableFlatDetection and flat analysis parameters.
- EnableTradingTime, TradingTimeIntervals, CloseAtEndTime – flexible trading time management.
Other Settings
- MagicNumber, Slippage, TradeOnBarOpen, CheckInterval.
- Visual Parameters (take-profit line color).
✅ Advantages
- **Full automation** – requires no intervention, operates 24/5.
- **Reliability** – recovery after restart, integrity control of the activation sequence.
- **Flexibility** – dozens of customizable parameters for any instrument and trading style.
- **Security** – protection from flat trading, loss limits, forced closure upon reaching MaxTrades.
- **Transparency** – visual take-profit line, detailed logging.
⚠️ Important
This strategy is based on the principles of martingale and pyramiding, which is associated with increased risk. Before using it on a real account, be sure to test the EA on a demo account and carefully select the parameters for a specific instrument. We recommend using moderate lot settings and enabling protective mechanisms (MaxTrades, MaxLoss).
The PyramidZone Recovery EA is a professional tool for experienced traders ready to use aggressive strategies with advanced risk filters. Gain a competitive advantage in the market with this reliable and functional Expert Advisor!
--
*Version: 2.21 (with recovery after restart)*
*Platform: MetaTrader 5*
*Language: MQL5*