MT5 Connector
A Python package for connecting to and managing MetaTrader5 servers.
Installation
pip install fivitech-mt5-connector
Documentation
For detailed documentation, see DOCUMENTATION.md
Changelog
For changelog, see CHANGELOG.md
Usage
from fivitech_mt5_connector import MT5Pool
# Configure your MT5 servers
servers = [
{
"id": 1,
"type": "demo",
"name": "Demo Server",
"username": "manager",
"manager_password": "your_manager_password",
"api_password": "your_api_password",
"ips": ["127.0.0.1", "localhost"]
}
]
# Initialize the pool
pool = MT5Pool(servers)
# Connect to all servers
connection_status = pool.connect_all()
# Or connect to specific server
pool.connect_server(1)
# Add a new server dynamically
pool.add_server({
"id": 2,
"type": "live",
"name": "Live Server",
"username": "manager",
"manager_password": "your_manager_password",
"api_password": "your_api_password",
"ips": ["server1.domain.com", "server2.domain.com"]
})
# Connect to the new server
pool.connect_server(2)
# Update server configuration
pool.update_server(2, {
"name": "Updated Live Server",
"ips": ["new.server.com"]
})
# Disconnect specific server
pool.disconnect_server(2)
# Remove server from pool
pool.remove_server(2)
# Add custom callbacks if needed
def my_deal_callback(deal, server_info):
print(f"New deal on {server_info.name}: {deal.Deal}")
pool.add_deal_callback('deal_add', my_deal_callback)
# Get a specific server connection
demo_server = pool.get_server(1)
live_server = pool.get_server(101)
# Disconnect all servers when done
pool.disconnect_all()
Features
- Dynamic server management (add/remove/update servers)
- Individual server connection control
- Multiple server connections management
- Account operations
- Transaction handling
- User management
- Deal monitoring
- Default and custom callbacks for deals and user events
Server Configuration
Each server in the configuration requires:
id: Unique integer identifiertype: Either 'demo' or 'live'name: Server nameusername: Manager username/loginmanager_password: Manager password for server operationsapi_password: API password for MT5 WebAPI accessips: List of IP addresses for failover
Server Management Methods
Adding Servers
pool.add_server({
"id": 1,
"type": "demo",
"name": "Demo Server",
"username": "manager",
"manager_password": "password",
"api_password": "api_password",
"ips": ["127.0.0.1"]
})
Updating Servers
pool.update_server(1, {
"name": "Updated Name",
"ips": ["new.ip.address"]
})
Removing Servers
pool.remove_server(1)
Connection Control
# Connect specific server
pool.connect_server(1)
# Disconnect specific server
pool.disconnect_server(1)
# Connect all servers
pool.connect_all()
# Disconnect all servers
pool.disconnect_all()
Requirements
- Python 3.7+
- MT5Manager>=5.0.3906
- pandas>=1.0.0
- numpy>=1.19.0
- pytz>=2021.1
- requests>=2.26.0
- python-dateutil>=2.8.2
License
Proprietary - All rights reserved
Metadata
Release files for fivitech-mt5-connector 0.2.19
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fivitech_mt5_connector-0.2.19.tar.gz | 38.5 kB | Without provenance | Details for fivitech_mt5_connector-0.2.19.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fivitech_mt5_connector-0.2.19-py3-none-any.whl | Python 3 | none | any | Details for fivitech_mt5_connector-0.2.19-py3-none-any.whl |
Total release size: 84.4 kB
Release files / fivitech_mt5_connector-0.2.19.tar.gz
| Download URL | fivitech_mt5_connector-0.2.19.tar.gz |
|---|---|
| Size | 38.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9f636b7d2efd99a11cfceff1ddbfb1a636bf5ca0eee0013bb366150b1982fc0c
|
|
BLAKE2b-256 checksum How to use checksums |
7565aff932965087fb105f92017e072e0fb130a79b87b85c873409abd6abbad7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.13.1
|
Release files / fivitech_mt5_connector-0.2.19-py3-none-any.whl
| Download URL | fivitech_mt5_connector-0.2.19-py3-none-any.whl |
|---|---|
| Size | 45.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
33ab3ea854de60b3eddefb46acac2b826537368c9e700bfbdf84dcaf7b1183a9
|
|
BLAKE2b-256 checksum How to use checksums |
805cb845d2b882e8e326d85413a69dca91aadb085ff9a4ed1ca36547d9c9cf61
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.13.1
|
Security for fivitech-mt5-connector 0.2.19
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.