Skip to content
All library documents

KD-Tree and Echo State Network Filters for Adaptive Position Sizing

Article MQL5 articles

Summary

This article proposes a custom MQL5 money-management class that combines a KD-tree over historical log-return and ATR coordinates with an Echo State Network (ESN) processing recent return sequences. The KD-tree is intended to identify whether current conditions lie near historically labeled crash points, while the ESN is used to modulate risk according to the recent temporal pattern. Together, these signals are meant to scale trade volume down in dangerous regimes before an order is sent.

The article frames the method as a defensive alternative to fixed or linear lot sizing and describes a Wizard-assembled EA and test runs. Its own discussion cautions against treating the reported test as meaningful validation: it cites only 12 trades over three months, notes the absence of stop-losses, and calls for high-quality tick data and simulation of costs and latency. The material therefore offers an implementation concept rather than established evidence of alpha or reliable tail-risk protection. Feature definitions, crash labels, thresholds, and broader out-of-sample testing would be important to assess its practical value.

Key ideas

  • The proposed KD-tree maps log returns and ATR to historical points labeled as crashes.
  • An ESN processes recent return sequences to adjust position sizing based on temporal behavior.
  • The combined filter is designed to reduce exposure when current conditions resemble historical danger zones.
  • The article presents a custom money-management implementation, not a validated standalone trading strategy.
  • The reported test is limited by a small trade count, no stop-loss, and omitted execution frictions.

Tags

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