ONNX Trader clusters
This EA uses two ONNX neural network models — a main model and a meta-model — to generate binary classification signals for EURUSD trading. The main model predicts trade direction (buy/sell) while the meta-model acts as a confidence filter, only allowing trades when its output exceeds a threshold. It executes trades with fixed SL/TP and position sizing based on risk percentage.
Open the interactive view (equity curve, symbol switch)Key facts
Backtest results (H1, about 1 year)
| Symbol | P&L | Annual | Max DD | Trades | Win rate | Sharpe | Recovery | Losing streak | Per trade | Status |
|---|---|---|---|---|---|---|---|---|---|---|
| EURUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| GBPUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| USDJPY | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| XAUUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
Why this EA never traded: no entry rule survived the conversion.
Converted from MQL5 to Python and run with the same rules for every EA. Positions use MT5 lot sizes (100,000 units per FX lot, 100 oz per gold lot) with 1:100 leverage, one order at a time, and a stop-out below 10% of the starting balance. Sharpe is computed from the equity curve. Results marked as unreliable are shown for completeness only.
Blow-up risk: No blow-up pattern found
None of the usual blow-up patterns were found in the code, and the account was not stopped out in our backtests. That is not a guarantee: any EA can lose money.
High: stopped out in our backtest, or martingale/grid sizing without a stop loss. Elevated: martingale or grid sizing with a stop loss, or several positions at once without a stop loss. What the label means and what we found →
Strategy analysis
The strategy concept is built on a dual-model machine learning architecture: the main model outputs classification probabilities as directional signals, while the meta-model outputs probabilities as a confidence filter for signal quality. Entry conditions: when the meta-model probability exceeds meta_threshold, a buy is triggered if the main model probability is below (1-main_threshold), and a sell is triggered if it exceeds main_threshold; a buy signal below 0.5 indicates the model predicts higher upward probability, while a sell signal above 0.5 predicts higher downward probability. Exit conditions: when the meta-model confirms, existing long positions are closed if the main model signal exceeds main_threshold, and short positions are closed if the signal falls below (1-main_threshold). Position sizing calculates lot size based on the MaximumRisk parameter as a fraction of account free margin, with support for fixed ManualLot, and enforces min/max volume limits plus volume step normalization. Money management uses the CheckMoneyForTrade function to verify sufficient margin before placing orders, preventing order failures due to insufficient funds.
Strengths
- Dual-model architecture is well-designed, with the meta-model acting as a confidence filter that effectively reduces trades on low-quality signals
- ONNX model inference can capture non-linear market features, offering more potential than traditional technical indicators
- Includes comprehensive money management checks (margin verification, lot normalization, min/max volume limits)
Weaknesses
- Infinite retry loops (do-while res==-1) can cause indefinite blocking without a maximum retry count limit
- countOrders uses PositionSelect instead of PositionGetTicket for iteration, which can repeatedly select the same position and cause incorrect counts with multiple positions
- Fixed SL/TP of 2000 points with no trailing stop mechanism prevents dynamic adjustment based on market volatility
- No orthogonality verification between meta-model and main model features, potentially limiting the filtering effectiveness
Possible improvements
- Add maximum retry count and timeout mechanism to do-while retry loops to prevent indefinite blocking
- Fix countOrders function to use PositionGetTicket(k) for proper position iteration instead of PositionSelect
- Add spread filter and slippage control to prevent opening positions in high-spread environments
- Consider adding trailing stop or dynamic stop-loss mechanism adjusted by volatility indicators like ATR
Risk assessment
Overall risk: Medium
- Infinite retry loops may freeze the EA during high latency or server disconnection
- countOrders function counting errors may allow opening positions beyond max_orders limit
- Sleep(50) in retry loops blocks the EA thread, affecting execution of other logic
- No spread filter may result in unfavorable fills during low-liquidity periods
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
Allow_Buy | true | Allow buytrading |
Allow_Sell | true | Allow selltrading |
main_threshold | 0.5 | Main model signal threshold; exceeded = sell signal |
meta_threshold | 0.5 | Meta-model confidence threshold; must exceed to allow trading |
MaximumRisk | 0.001 | Progressive lot coefficient based on margin ratio |
ManualLot | 0 | Fixed lot size, 0 to disable |
OrderMagic | 666 | Order magic number identifying this EA's positions |
max_orders | 1 | Maximum simultaneous positions |
stoploss | 2000 | Stop loss in points |
takeprofit | 2000 | Take profit in points |
comment | The ONNX EA | Order comment |
Similar Machine Learning EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.