Skip to content
All library documents

Finding Repeating Forex Direction Patterns and Measuring Their Outcomes

Article MQL5 articles

Summary

The article outlines a Python and MetaTrader 5 workflow for searching historical forex bars for recurring sequences of price directions. It converts close-to-close changes into up or down labels, tests sequences of varied lengths, and records whether the price direction six bars later matches a buy or sell outcome. It then calculates each pattern’s observed win rate and frequency, filters for patterns with more than 20 occurrences, and ranks candidates by win rate.

The workflow fetches OHLC data through the MetaTrader terminal and suggests adding indicators such as RSI, MACD, and Bollinger Bands as further features. The article discusses visualizing results and backtesting, but provides no reported performance evidence. Its simple directional outcome rule does not describe transaction costs, risk-adjusted returns, or out-of-sample validation; patterns found in historical data may reflect noise and may not persist.

Key ideas

  • The method converts each bar’s close-to-close change into an up or down label.
  • It searches sequences of different lengths and evaluates direction six bars after each sequence.
  • Pattern statistics include historical win rate and occurrence frequency.
  • Candidates with more than 20 occurrences are filtered and ranked by win rate.
  • The article provides no out-of-sample results or accounting for trading costs.

Tags

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