Skip to content
All library documents

Segmenting Brute-Force Pattern Searches by Time and Trading Session

Article MQL5 articles

Summary

This article extends a brute-force method for finding trading patterns by dividing historical quotes into time-based samples. The proposed segments include days of the week and intraday windows, with further discussion of months and years. Segmentation is intended both to reduce computation and to reveal whether a candidate pattern behaves differently across time corridors. The search algorithm adds fixed or randomized choices of days and windows, along with multithreaded optimization.

The author describes fitting simple mathematical functions, including linear and higher-degree polynomials, to measures such as expected payoff and profit factor. These measures can peak in different regions, so selection involves trade-offs. The article reports that some currency-pair patterns appeared unusually predictable near the date boundary, but says apparent profitability in MetaTrader 4 did not hold up in MetaTrader 5 because of spread effects. It argues for realistic platform testing, while offering no complete out-of-sample validation or evidence that the discovered patterns persist. Extensive search across samples also leaves a risk of overfitting.

Key ideas

  • Time segmentation can reduce search effort while allowing comparisons across weekdays and intraday windows.
  • The proposed search tests fixed and randomized day and time-window selections.
  • Expected payoff and profit factor may favor different time segments, requiring a deliberate trade-off.
  • Patterns near the daily date boundary can be distorted by spread and platform-specific testing assumptions.
  • Extensive pattern searches require realistic validation because selected results may be overfit.

Tags

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