Skip to content
All library documents

Filtering Larry Williams Outside Bars with an ONNX Classifier

Article MQL5 code base

Summary

This Expert Advisor pairs the Larry Williams Outside Bar setup with an ONNX machine-learning filter. At each new bar, it identifies a candle whose high exceeds the prior candle’s high and whose low falls below the prior low. It then supplies the model with ten features, including candle body and range measures, ATR, volume change, day of week, and hour. The EA opens a buy or sell only when the corresponding class probability exceeds a user-set threshold.

For trade management, the stop is placed at the signal candle’s low for buys or high for sells, and the take-profit distance is derived from a configurable risk/reward ratio. The guide describes model file placement, input parameters, expected output nodes, and a training and conversion workflow. It mentions an XAUUSD four-hour backtest period but provides no performance figures or details of the training labels, sample design, or validation. The strategy’s results therefore cannot be judged from the supplied description alone.

Key ideas

  • The EA detects Outside Bars at the start of each new bar.
  • An ONNX model evaluates ten price, volume, and calendar features before entry.
  • A buy or sell requires the matching class probability to exceed the configured threshold.
  • Stops use the signal candle extreme, while take profit follows a risk/reward setting.
  • The document gives no numerical results or model validation details.

Tags

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