What is PyTrader
masterPyTrader is a drag-and-drop connector designed to link Python scripts with MetaTrader 4 (MT4) and MetaTrader 5 (MT5).
Architecture Model:
- Server: The Expert Advisor (EA) running within MT4/MT5 acts as the server.
- Client: The Python script acts as the client.
- Communication: Uses WebSockets for fast and efficient data transfer.
- Deployment: The EA can run on a different computer than the Python script.
Capabilities:
- Python login to MT5.
- Connection persistence (keep connection alive).
- Retrieve account information and open orders.
- Manage orders (open, change, close) directly from Python.
- Retrieve last tick and bar data.
- Get instrument information (e.g., pip value, tick size).