MQ Harmonic EA
- Experts
-
Muhammad Iqbal
Need a Custom MT5 Indicator or Expert Advisor?
I specialize in developing custom MetaTrader 5 (MT5) Indicators and Expert Advisors (EAs) tailored to your specific trading strategy and requirements.
You can hire me for:
- Custom MT5 Indicators
- Custom Expert Advisors (EAs) - Versão: 1.0
MQHarmonicEA is a prototype Expert Advisor for MetaTrader 5 that detects potential harmonic price patterns and automatically places limit orders at selected Potential Reversal Zone (PRZ) levels.
It supports seven harmonic patterns: Gartley, Bat, Butterfly, Crab, Deep Crab, Shark, and Cypher. You can configure entry levels, lot sizing, stop-loss, take-profit, trend filters, and signal quality requirements to suit your trading preferences.
Key Features:
- Automated Harmonic Trading — Detects potential bullish and bearish harmonic setups and places Buy Limit or Sell Limit orders at PRZ1, PRZ2, or both.
- Seven Harmonic Patterns — Supports Gartley, Bat, Butterfly, Crab, Deep Crab, Shark and Cypher. Each pattern can be enabled or disabled individually.
- PRZ-Based Entries — Choose PRZ1 (the nearer boundary) or PRZ2 (the farther boundary). Each enabled level can place one order per pattern signal.
- Automatic or Manual SL/TP — Use pattern-based SL1/SL2 and TP1/TP2 levels, or configure fixed stop-loss and take-profit distances in pips.
- Flexible Position Sizing — Choose a fixed lot size or calculate position size based on a percentage of account balance and the entry-to-stop-loss distance.
- Stop-Loss Safety — Configure an additional buffer beyond the PRZ, a minimum stop-loss distance for automatic SL, and an optional minimum reward-to-risk ratio.
- Higher-Timeframe Trend Filter — Use an EMA filter to trade with or against the higher-timeframe trend, or disable the filter.
- Signal Quality Filters — Configure the minimum pattern score, minimum pivot-length confirmations, Fibonacci tolerance and other pattern detection parameters.
- Pending Order Management — Set a pending-order expiration period and optionally cancel orders when their corresponding pattern is no longer valid.
- Trading Controls — Configure the maximum spread, maximum number of open positions and pending orders, and an optional trading session based on server time.
- Chart Visualization — Display harmonic patterns, pivot labels, PRZ1/PRZ2, and the configured TP/SL levels while trades are active. Keep a configurable number of closed-trade patterns on the chart.
Inputs:
- Trade — Magic number, fixed lot or risk-based sizing, slippage, maximum spread and maximum open trades.
- Entry — Enable PRZ1 and/or PRZ2, pending-order expiration and invalid-pattern cancellation.
- Stop Loss / Take Profit — Automatic pattern-based levels or manual pip distances.
- SL Safety — Automatic SL buffer, minimum SL distance, handling of narrow stops and minimum reward-to-risk ratio.
- Trend Filter — Filter mode, timeframe and EMA period.
- Signal Filters — Minimum trade score, minimum pivot confirmations and optional trading hours.
- Pattern Detection — Bullish/bearish setups, individual pattern types, pivot lengths, point D confirmation bars, Fibonacci tolerance, leg asymmetry and analysis lookback.
- Display — Pattern colors, TP/SL colors, chart drawing and the number of closed-trade patterns retained.
How It Works:
- The EA analyzes price swings to identify potential harmonic structures and evaluates their Fibonacci ratios against the enabled pattern rules. It scores matching setups and applies the configured signal quality and trend filters.
- When a potential setup meets the requirements, the EA can place a Buy Limit or Sell Limit order at the selected PRZ boundary. Stop-loss and take-profit levels are then calculated from the pattern or configured manually. Pending orders can expire or be cancelled when their pattern becomes invalid, depending on your settings.
Important Notes:
- MQHarmonicEA is a prototype provided for testing and experimentation. Its behavior and results may change as development continues.
- Thoroughly backtest it in the MetaTrader 5 Strategy Tester and test it on a demo account before considering live trading. Trading involves significant risk, and results are not guaranteed. Use it at your own risk.
- Trading Forex and other financial instruments involves substantial risk and can result in the loss of your capital. This EA does not guarantee profits and should not be considered financial advice.
- Use the EA at your own risk. Conduct your own research and thoroughly test it in the Strategy Tester and on a demo account before considering live trading. Review your broker's trading conditions and configure position sizing and risk parameters carefully.
- Harmonic patterns are not guaranteed to produce reversals. Signals can change or become invalid as new price bars form. Pending orders may be cancelled, rejected or remain unfilled depending on market and broker conditions.

