Skip to content
All library documents

Four-Bar Price Pattern Expert Advisor with Tick-Based Testing

Article MQL5 code base

Summary

This Expert Advisor looks for buy and sell setups using the recent four bars. The buy logic compares the previous bar’s high and the current bar’s low with the previous bar’s low, then applies additional price and time checks; sell logic reverses the conditions. It combines completed-bar and still-forming-bar data, so the source says it should be evaluated in every-tick mode.

The document describes configurable lot sizing, stop loss, take profit, and an option to invert signals. It cites visual strategy-tester examples and a EURUSD H4 test covering one month in September 2012, but gives no numerical performance measures or enough detail to assess robustness. The pattern rules and additional checks are only summarized, not fully specified, and the brief test period does not establish general profitability.

Key ideas

  • The strategy analyzes four recent bars to identify price-pattern entries.
  • Buy conditions compare the prior bar’s high and the current bar’s low with the prior bar’s low, plus additional price and time checks.
  • Sell conditions reverse the buy setup.
  • Because some conditions use a forming bar, the document calls for every-tick testing.
  • Lots, stop loss, take profit, and signal inversion are configurable.

Tags

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