Command-line tool for MetaTrader 5
Project description
mt5cli
Command-line tool for exporting MetaTrader 5 data to CSV, JSON, Parquet, and SQLite3.
Built on top of pdmt5, a pandas-based data handler for MetaTrader 5.
Features
- Multi-format export: CSV, JSON, Parquet, and SQLite3 output formats
- Auto-detection: Format detection from file extensions
- Comprehensive data access: Rates, ticks, account info, symbols, orders, positions, and trading history
- Flexible timeframes: Named timeframes (M1, H1, D1, etc.) and numeric values
- Connection management: Optional credentials, server, and timeout configuration
Installation
pip install -U mt5cli MetaTrader5
Usage
# Export account information to CSV
mt5cli -o account.csv account-info
# Export EURUSD M1 rates to Parquet
mt5cli -o rates.parquet rates-from --symbol EURUSD --timeframe M1 \
--date-from 2024-01-01 --count 1000
# Export ticks to JSON
mt5cli -o ticks.json ticks-from --symbol EURUSD \
--date-from 2024-01-01 --count 500 --flags ALL
# Export symbols to SQLite3 with custom table name
mt5cli -o data.db --table symbols symbols --group "*USD*"
# Export with connection credentials
mt5cli --login 12345 --password mypass --server MyBroker-Demo \
-o positions.csv positions
Run as a Python module:
python -m mt5cli -o account.csv account-info
Commands
| Command | Description |
|---|---|
rates-from |
Export rates from a start date |
rates-from-pos |
Export rates from a start position |
rates-range |
Export rates for a date range |
ticks-from |
Export ticks from a start date |
ticks-range |
Export ticks for a date range |
account-info |
Export account information |
terminal-info |
Export terminal information |
symbols |
Export symbol list |
symbol-info |
Export symbol details |
orders |
Export active orders |
positions |
Export open positions |
history-orders |
Export historical orders |
history-deals |
Export historical deals |
Requirements
- Python 3.11+
- Windows OS (MetaTrader 5 requirement)
- MetaTrader 5 platform installed
Development
git clone https://github.com/dceoy/mt5cli.git
cd mt5cli
uv sync
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mt5cli-0.1.0.tar.gz.
File metadata
- Download URL: mt5cli-0.1.0.tar.gz
- Upload date:
- Size: 79.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03341d2dfc6f62b0a1c29311b3861c96bdd293db619b7344732a5265bfb3b7d0
|
|
| MD5 |
0b636fdfaab3a2241f087cea3a21654e
|
|
| BLAKE2b-256 |
2b267504240388618bef55941f473555554ee4922eb9bd2cd4199488c001d238
|
Provenance
The following attestation bundles were made for mt5cli-0.1.0.tar.gz:
Publisher:
release.yml on dceoy/mt5cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mt5cli-0.1.0.tar.gz -
Subject digest:
03341d2dfc6f62b0a1c29311b3861c96bdd293db619b7344732a5265bfb3b7d0 - Sigstore transparency entry: 1359283320
- Sigstore integration time:
-
Permalink:
dceoy/mt5cli@42d8a9beb6fe947b7aa06645a4752e1785d5b13e -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/dceoy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@42d8a9beb6fe947b7aa06645a4752e1785d5b13e -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file mt5cli-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mt5cli-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77488380067bcd4dff011626a712a3cb8f8289a31850c385f5ab091956a2847c
|
|
| MD5 |
630143f84f110d3dcac0983a084bc4da
|
|
| BLAKE2b-256 |
8b05f9541be9f31957941d437684ee1079dcecbede2934218a07f7aee5c46959
|
Provenance
The following attestation bundles were made for mt5cli-0.1.0-py3-none-any.whl:
Publisher:
release.yml on dceoy/mt5cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mt5cli-0.1.0-py3-none-any.whl -
Subject digest:
77488380067bcd4dff011626a712a3cb8f8289a31850c385f5ab091956a2847c - Sigstore transparency entry: 1359283337
- Sigstore integration time:
-
Permalink:
dceoy/mt5cli@42d8a9beb6fe947b7aa06645a4752e1785d5b13e -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/dceoy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@42d8a9beb6fe947b7aa06645a4752e1785d5b13e -
Trigger Event:
workflow_dispatch
-
Statement type: