Skip to content
All library documents

Using Fibonacci Retracement Levels to Build Machine Learning Targets

Article MQL5 articles

Summary

The document turns a rolling Fibonacci retracement level into supervised-learning targets. For classification, it compares a later price with the current price and a level calculated from a recent high-low range, assigning bullish, bearish, or no-hit labels. For regression, the target is the retracement price itself. It then trains Random Forest classifier and regressor models on OHLC data, using a chronological train-test split for classification and describing strategy-tester evaluation for the regression model.

The article reports classification metrics, with weaker test performance than training performance, and presents a strategy-tester report as evidence for the regression approach. It does not establish that the results generalize: the labels depend on future prices, so they must be kept strictly separate from model inputs, and the described setup uses few predictors. The author calls for additional features, other Fibonacci levels, and further refinement; claims of effectiveness should be treated as preliminary.

Key ideas

  • A rolling high-low range can define a Fibonacci price level for supervised-learning targets.
  • Classification labels encode whether later prices move across the level, while regression predicts the level value.
  • The example trains Random Forest models using OHLC data and reports both training and test classification metrics.
  • The reported test metrics are weaker than the training metrics, and the approach is presented as unfinished.
  • Future-price information belongs in target construction and must not leak into model features.

Tags

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