How Strategy X-Ray reverse-engineers a trading strategy
A transparent, step-by-step process: from raw trade history to a validated rule set and a forex EA you can backtest yourself.
1. Read the trade history
Connect an MT4 or MT5 account using its investor (read-only) password, account number and server, or upload a statement exported from the terminal (HTML, CSV or XLSX). We import closed trades, open positions, deposits and withdrawals, and normalise times to UTC using the broker’s server offset. A master password is rejected automatically — we can only read, never trade.
For crypto, connect Binance, Bybit, OKX, Bitget, Gate, KuCoin, HTX, Coinbase or Kraken with a read-only API key — keys that can trade, withdraw or transfer are refused — or upload the exchange’s trade-history export (CSV or XLSX). Individual fills are rebuilt into positions for USDT-margined perpetual futures and spot, funding payments are counted, and minute quotes come straight from the same exchange.
2. Free trading statistics
You immediately get a full performance report: absolute and relative gain, maximum drawdown, profit factor, expectancy, win rate for longs and shorts, average holding time, best and worst trades, balance and equity curve, monthly returns and breakdowns by symbol, hour of day and weekday.
3. Build hypotheses
The engine profiles the trading behaviour — holding time, active sessions, typical stop-loss and take-profit distances, position sizing — and builds candidate rule sets from a library of indicator templates (moving-average crosses, trend filters, RSI, Bollinger Bands, Donchian breakouts, MACD, Stochastic). AI models can propose additional rule sets from an anonymised behaviour summary; credentials never leave our servers.
4. Replay and match
Each candidate is replayed bar by bar on historical quotes with no look-ahead, and its simulated trades are matched one-to-one with the real ones. Parameters are optimised on the first 70% of the history; the remaining 30% is held out for validation. You see:
- Match score on the held-out period (0–100)
- Precision and recall — how many real trades are explained and how many simulated trades are extra
- Baseline — the score random entries would get, so a good match can’t be luck
- Confidence — Low, Medium or High, based on data volume and stability
5. Forward checks
Connected accounts are synchronised every 6 hours. New trades are compared with what the reconstructed strategy would have done, and the forward match score is updated automatically.
6. Unlock the algorithm and code
The result page shows roughly a third of the algorithm — the entry logic in plain language. Unlock the full description (exits, money management, exact parameters) and download commented source code for MQL4, MQL5, cTrader cBot or SharpTrader.
Crypto strategies are exported as SharpTrader bots — SharpTrader connects to the exchanges itself, so you only get the bot logic — or as MQL5 Expert Advisors for brokers that offer crypto CFDs.
What it can and can’t do
Strategy X-Ray works best on rule-based, indicator-driven trading with enough history (at least 20 closed trades, ideally a few hundred). Discretionary trading, news-driven entries, copy trading from external signals or strategies that depend on data we can’t see will produce a lower match score and confidence — and the report tells you so honestly.
Exchange APIs limit how far back you can read: about the last 3 months on Binance and OKX and up to 2 years on Bybit. For a longer history, upload the exchange’s trade-history export as a statement.
Try it on your own account
Statistics are free. A reconstruction costs tokens only when you run it.