Deploying Fixed-Width Fractional Differentiation in MQL5
Summary
The article translates fixed-width fractional differentiation from Python into an MQL5 engine and custom indicator for live market data. It explains how to generate weights recursively until they fall below a chosen threshold, reverse them to align with the price window, and apply them as a dot product to prices, optionally after taking logarithms. The design precomputes weights during initialization, avoids allocation on each tick, and uses MetaTrader's calculation state to limit indicator recomputation.
The implementation is intended to preserve long-memory information while making a series more stationary for feature construction. The article describes single-bar and buffer calculations, integration options for expert advisors, and validation by comparing MQL5 output with a Python pipeline using the same settings. Window length depends on the differentiation order and cutoff threshold, so computational cost can grow substantially. The text presents implementation and equivalence checks rather than evidence that fractional differentiation improves forecasting or trading returns.
Key ideas
- Fixed-width fractional differentiation uses a finite set of recursively generated weights applied to a rolling price window.
- Weights are built once, allowing each new observation to be computed with a bounded dot product.
- An optional logarithm transform and a weight cutoff control the calculation and its effective window length.
- The MQL5 output can be checked bar by bar against a Python implementation configured identically.
- The article establishes deployment mechanics, not trading performance improvements.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.