When ONNX models go into an MT5 EA, there are two patterns that span the design space:

Both have published successes and published disasters. This article makes the case for the filter pattern as the default, names the cases where standalone wins, and walks through the trade-offs.

The filter pattern in one paragraph

You have an existing rule-based EA — MA crossover, breakout, RSI mean reversion, anything. It's marginally profitable on its own. You train an ONNX model whose only job is to score each potential trade signal: "would this historical version of this signal have been profitable?" The EA only takes trades the model approves. Simple, robust, additive.

The standalone pattern in one paragraph

You train an ONNX model to predict price direction or magnitude. The EA places trades directly from the model output, without a rule-based component. The EA's logic is "if prediction > threshold, buy; if prediction < -threshold, sell." Higher ceiling, much riskier.

Why filter usually wins

  1. Bounded downside. If the model fails, you fall back to the base EA's behavior — which already had an edge. Worst case is "no improvement," not "catastrophic loss."
  2. Easier to validate. You can compare the filtered EA to the unfiltered EA on the same data. A clean A/B test.
  3. Less data required. The model only sees signals, not every bar — smaller training set, easier convergence.
  4. More interpretable. When the model rejects a trade, you can ask "what about this signal looked bad?" and inspect features.
  5. Easier to ship to prop firms. The trade logic is rule-based; the model is just a yes/no. Conservative, defensible.

When standalone is worth it

Hybrid patterns

Most production EAs end up somewhere in between:

This combines the safety of the rule-based candidate generation with the upside of model-driven prioritization. It's how most quant funds actually use ML.

Recommendation

Start with the filter pattern. Move to hybrid as you build confidence in your features and training pipeline. Only consider standalone if you've proven your model has out-of-sample predictive power on the raw task.