Buy Sell Stop Pending Order
- Experts
- Olalekan Damilola Aturaka
- Versione: 2.13
- Aggiornato: 28 febbraio 2026
- Attivazioni: 5
HA Breakout Pending Order EA v2.13
MT5 Expert Advisor | Heikin Ashi Breakout | Buy Stop & Sell Stop Pending Orders
Overview
HA Breakout Pending Order EA is a precision-engineered Expert Advisor for MetaTrader 5 that automates breakout trading using Heikin Ashi candle analysis. Instead of reacting to raw price action, the EA uses the smoother, noise-filtered Heikin Ashi methodology to identify the previous bar's true high and low, then places Buy Stop** and **Sell Stop pending orders above and below those levels with a configurable offset.
What makes this EA stand out is its time-triggered entry system: orders are placed only at a specific broker time (hour and minute), giving you precise control over when the EA enters the market. Combined with smart opposite-order cancellation and flexible lot sizing, this is a clean, professional tool for breakout strategy development and live deployment.
Default symbol is EURUSD on H1, but the EA is fully configurable for any symbol or timeframe.
Key Features
✅ Heikin Ashi Breakout Logic
Computes a true Heikin Ashi bar from raw price data using the correct HA formula, no separate indicator needed. Uses the previous completed bar to determine breakout levels, avoiding recalculation noise.
✅ Time-Triggered Pending Orders
Orders are placed exactly once at the broker hour and minute you configure. This prevents overtrading and keeps entries aligned with your chosen market session (e.g., London open, NY open).
✅ Smart Opposite-Order Cancellation
Once one side of the range (Buy Stop or Sell Stop) is triggered, the EA automatically cancels the other pending order, keeping your book clean and preventing double exposure.
✅ Dual Lot Sizing Modes
Choose between fixed lot size or dynamic risk-based sizing. In dynamic mode, lot size is calculated from your account balance and a configurable risk percentage, using the broker's actual tick value/tick size for accurate monetary risk per trade.
✅ Fully Configurable Parameters
All key inputs; offset, take profit, stop loss, trigger time, timeframe, magic number, lot size, risk percent, are fully exposed as user inputs. No hardcoded values.
✅ Multi-Symbol & Multi-Timeframe Ready
While defaulting to EURUSD H1, the EA works on any symbol and timeframe supported by your broker.
✅ Clean Order Validation
Every pending order is pre-validated with `OrderCheck()` before being sent, and filling mode is automatically detected per broker/symbol no manual fill-mode adjustments needed.
✅ Detailed Journal Logging
All key events; order placement, lot calculation details, cancellations, and errors, are printed to the MT5 journal for easy debugging and trade review.
Input Parameters (EURUSD)
| Parameter | Default | Description |
| `OffsetUnits` | 0.0003 | Price offset above HA high / below HA low for order entry |
| `TPUnits` | 0.0003 | Take Profit distance in price units from entry |
| `SLUnits` | 0.0008 | Stop Loss distance in price units from entry |
| `MagicNumber` | 777 | Unique identifier for this EA's orders |
| `TriggerHourBroker` | 13 | Broker server hour to place orders (0–23) |
| `TriggerMinuteBroker` | 31 | Broker server minute to place orders (0–59) |
| `TimeFrame` | PERIOD_H1 | Timeframe used for Heikin Ashi calculation |
| `UseDynamicLots` | false | true = risk-based sizing \| false = fixed lot |
| `Lots` | 0.1 | Fixed lot size (used when UseDynamicLots = false) |
| `RiskPercent` | 1.0 | % of account balance to risk per trade (dynamic mode) |
| `MaxLots` | 40.0 | Hard cap on dynamic lot size |
| `MinLots` | 0.01 | Minimum lot size floor (dynamic mode) |
Advantages
- Breakout timing with context: Heikin Ashi smoothing filters out false price spikes that would mislead a raw-candle strategy.
- Session-aware entries: Time-trigger logic lets you target high-probability windows like London/NY open or major news releases.
- Risk-accurate lot sizing: Dynamic mode uses broker tick values to compute true monetary risk, not rough pip-multiplier guesses.
- Broker-agnostic: Works across brokers by using server time and auto-detecting fill modes and symbol properties.
- No indicator dependencies: HA values are computed natively in the EA; no external indicator files required.
- Multi-asset application: Clean, modular code structure makes it simple to configure for different assets.
Installation and Support
- Select EURUSD (or any preferred forex pair/CFD/Market Indices/Synthetic Indices) from market watch and add to chart window.
- Timeframe: H1 (chart and EA timeframe should match or be explicitly set via input).
- Trigger time: Set to match your preferred range target in broker time.
- Start with fixed lots and review journal logs before switching to dynamic sizing.
- Test on demo first to validate broker time offset and symbol-specific offsets.
Developer support via MQL5 messaging (bonus XAUUSD set file after purchase)
Version History
| Version | Changes
| v2.13 | Added dynamic lot sizing with risk-based calculation using tick value/tick size
| v2.x | Switched from EST time conversion to native broker/server time for reliability
| v1.x | Initial release with fixed lots and time-based HA breakout logic
Risk Disclaimer: Trading involves substantial risk. Past performance does not guarantee future results. Always test and validate your strategy on a demo account before going live, trade responsibly!!
