mt5cli

Export MetaTrader 5 market and account data to CSV, JSON, Parquet, or SQLite3.

Updated Mar 28, 2026
One-click install
npx skills add https://github.com/dceoy/mt5cli --skill mt5cli-dceoy
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: mt5cli
Source: https://github.com/dceoy/mt5cli/tree/main/skills/mt5cli
Command: npx skills add https://github.com/dceoy/mt5cli --skill mt5cli-dceoy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires mt5cli, MetaTrader5.

What problem does it solve? Getting data out of a MetaTrader 5 terminal normally requires writing custom Python against the MetaTrader5 API. This Skill wraps that work in a single CLI so you can dump rates, ticks, account info, symbols, orders, positions, and trading history directly to files. ## Core Features & Use Cases - Multi-format export: Write MT5 data to CSV, JSON, Parquet, or SQLite3, with the format auto-detected from the output file extension. - Full data coverage: Fetch OHLC rates by date range or position, tick streams with flags, account and terminal info, symbol metadata, open orders and positions, and historical orders and deals. - Bulk history collection: The collect-history command bundles rates, ticks, and trading history for multiple symbols into one SQLite database, with optional views and append/replace handling. - Use Case: Export one month of EURUSD M1 bars and all historical deals into a single SQLite database for offline backtesting or analysis. ## Quick Start Ask the assistant to export EURUSD M1 rates from 2024-01-01 to 2024-02-01 into a file named rates.parquet using the mt5cli rates-range command.

Frequently Asked Questions about mt5cli

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I export MetaTrader 5 historical data to CSV?▼

Run mt5cli with an output path ending in .csv and a data command such as rates-range or history-deals. For example, mt5cli -o rates.csv rates-range --symbol EURUSD --timeframe H1 --date-from 2024-01-01 --date-to 2024-02-01 writes the bars to CSV.

How to download MT5 tick data for a date range?▼

Use the ticks-range command with --symbol, --date-from, --date-to, and --flags (ALL, INFO, or TRADE). The output format is chosen by the file extension, so mt5cli -o ticks.json ticks-range ... writes the tick stream as JSON.

Does mt5cli support Parquet output?▼

Yes, Parquet is supported but not installed by default. Install it with pip install -U "mt5cli[parquet]" MetaTrader5, then use a .parquet or .pq output extension or pass --format parquet.

Can I use mt5cli without providing login credentials?▼

Yes, credentials are optional when the local MT5 terminal is already logged in. Otherwise pass --login, --password, and --server, or set the MT5_LOGIN, MT5_PASSWORD, MT5_SERVER, and MT5_PATH environment variables.

Why does mt5cli fail silently when connecting to MetaTrader 5?▼

MT5 connection errors are hidden at the default log level. Re-run the command with --log-level DEBUG to surface connection errors, and verify the terminal is running and the login, server, and path values are correct.

What datetime format does mt5cli accept for date filters?▼

The --date-from and --date-to options accept offset-free ISO 8601 values such as 2024-01-01 or 2024-01-01T12:00:00. Values with timezone offsets are rejected because MT5 bounds are timezone-naive trade-server wall-clock times.