Skip to content
All library documents

Multi-Timeframe Heiken Ashi Signals with Pending Orders

Article MQL5 code base

Summary

This example describes an expert advisor that uses Heiken Ashi candles on two timeframes to signal entries. Its bullish condition looks for a current candle with a rising close and open at the low, preceded by another rising candle whose open is not at the low. The bearish condition mirrors those checks. The sample shows a buy when the daily and chart-timeframe signals agree and no buy order with the specified magic number is active. It says entries use pending limit orders and that separate magic numbers can support hedging.

The initialization code rejects a list of metals and energy symbols. The article provides code examples but no performance data, exit rules, or detailed order-management logic, so it does not establish profitability or robustness. Its author recommends using the example for learning and modification in a demo account or strategy tester, and cautions against real-money use.

Key ideas

  • The entry example requires Heiken Ashi conditions to agree on a daily timeframe and the chart timeframe.
  • Bullish and bearish signals compare candle direction and whether the open coincides with the low or high.
  • The example uses pending limit orders and identifies orders using magic numbers.
  • The initialization logic blocks a hard-coded list of metals and energy symbols.
  • No backtest results or complete risk and exit rules are provided.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.