MetaTrader Import Guide
AlgoChef accepts two different MetaTrader exports, and which one you want depends on what you are trying to validate.
- Backtest results — export the Strategy Tester Report as HTML. AlgoChef reads it directly with no column mapping. This is the right choice for most people, because AlgoChef exists to validate backtested strategies.
- Live trading history — export your Account History as CSV and map the columns by hand. Use this when you want to analyse trades you actually took.
Strategy Tester Report (recommended)
This is the one-step path. AlgoChef recognises a MetaTrader Strategy Tester Report on sight and maps it for you.
- In MetaTrader, run your backtest in the Strategy Tester
- Right-click the results and choose Save as Report (MT4) or Report → HTML (MT5)
- In AlgoChef, open Add Strategies in the sidebar, click Import Strategy Data, and upload the
.htm/.htmlfile - Review and save — there is no column-mapping step
AlgoChef reads the strategy name, symbol, timeframe and initial capital straight out of the file, and stitches each entry row to its matching stop-loss, take-profit or close row using the order number, so a single trade arrives as one complete record.
Tip
This is the same treatment TradeStation RINA XML gets. If your platform can produce either format, prefer it — it removes every opportunity to map a column wrongly.
Account History (live trades)
Use this only if you want to import trades you actually placed rather than a backtest. For MetaTrader 5 there is a ready-made MetaTrader 5 CSV system template; for MetaTrader 4, or an MT5 export with different columns, you map the columns in the wizard.
Only the Strategy Tester Report is read as HTML. An account statement saved as HTML is not recognised — convert it to CSV first, as described below.
Exporting from MetaTrader 4 (MT4)
- Open MetaTrader 4
- Go to View → Terminal (or press Ctrl+T)
- Click the Account History tab
- Right-click anywhere in the trade list
- Select Save as Report → choose Detailed Report
- Save as HTML, then open in Excel and export as CSV
Info
MT4 does not export directly to CSV. The recommended workflow is: export as HTML → open in Excel → save as CSV. Alternatively, use the Save as Report (CSV) option if available in your broker's MT4 build.
Exporting from MetaTrader 5 (MT5)
- Open MetaTrader 5
- Go to View → Terminal (or press Ctrl+T)
- Click the History tab
- Right-click anywhere in the trade list
- Select Report → Save as CSV
- Save the file
Importing Into AlgoChef
- In the app sidebar, open Add Strategies, then click Import Strategy Data
- Upload your MetaTrader CSV file
- For an MT5 history CSV, pick the MetaTrader 5 CSV system template from the template menu. Otherwise, give each column its field label in the mapping table
- Fill in the strategy settings (name, instrument, timeframe, position type, timezone, date format) and your Initial Capital
- Review the preview and click Save to Database
MetaTrader Column Reference
| MetaTrader Column | Wizard label |
|---|---|
| Open Time | EntryDate (+ EntryTime if the time is a separate column) |
| Close Time | ExitDate (+ ExitTime if the time is a separate column) |
| Open Price | EntryPrice |
| Close Price | ExitPrice |
| Profit | ProfitLoss_Dollar |
| Type (buy/sell) | Direction |
| Volume | Contracts |
| Commission | Commission |
| Swap | None (not mapped) |
Tip
The Swap column (overnight financing cost) is not mapped by AlgoChef. If swap costs are significant for your strategy, add them manually to your P&L column before importing.
Troubleshooting
Profit showing as negative when it should be positive? MT4 sometimes exports short trade profits as negative values in the wrong column. Verify the sign convention in your export matches what AlgoChef expects — a winning trade should have a positive P&L value.
Trades missing from export? Make sure your date range filter in the Account History tab includes the full backtest period. MT4 sometimes defaults to the last month only.
Currency mismatch? AlgoChef expects P&L in your account's base currency. If your MT4 account trades in a different currency, convert before importing or adjust your Initial Capital accordingly.
Next Steps
- CSV Format Reference — Full field specifications
- Understanding Your Dashboard — What to do after import
- Run Monte Carlo Simulation — Stress-test your imported strategy
Tip
Ready to analyze your own strategy? Start your 14-day free trial.