Skip to content
All library documents

Improving a Self-Adapting Trading Algorithm with Dynamic Sampling

Article MQL5 articles

Summary

This article describes revisions to a candle-counting strategy that starts a series of positions when bullish or bearish candles dominate a sample. It identifies weaknesses in fixed window lengths and thresholds, frequent entries, fixed basket exits, and limits on the number of instruments traded. To make the entry threshold more comparable across sample sizes, it uses combinatorial probabilities to adjust the required directional excess, and illustrates the idea with a probability comparison for different sample lengths.

For signal quality, it proposes aggregating directional percentages across multiple sample windows with weights, or requiring enough windows to exceed their respective thresholds. The broader goal is to reduce weak entries and adapt position-series behavior. The article also acknowledges unresolved instrument differences, correlation, drawdown, and the instability of settings optimized on historical data. It supplies design rationale and an example calculation, but the excerpt does not establish robust out-of-sample performance or eliminate the risks of repeated position entries.

Key ideas

  • The algorithm starts a position series when one candle direction exceeds the other by a threshold.
  • A threshold adjusted for sample length can account for how the rarity of directional excess changes with window size.
  • Weighted percentages across several windows can strengthen or weaken an entry signal.
  • Requiring excess across multiple windows is an alternative way to filter entries.
  • Frequent entries and fixed basket exits can affect drawdown and stability.
  • Historical optimization may fail to transfer across instruments or changing market conditions.

Tags

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