Python interface for connecting to and trading with MetaTrader 5 (MT5) terminal. Current version 5.0.5735; actively maintained with frequent updates mirroring MT5 build changes.
pip install metatrader5Verified import paths — ran on the pinned version, not inferred.
Initialize connection to MT5 terminal (must be running on local machine).
Ensure your code handles numpy arrays, or convert: list(mt5.copy_rates_from_pos(...))
Always check the return value and print error with mt5.last_error() if available.
Use mt5.copy_rates_from_pos or mt5.copy_rates_from_range with lowercase.