MT 4_Sources
You receive an archive containing the C# source code of the S#.MT4 bridge and the MQL4 Expert Advisor source that connect applications based on API to a running MetaTrader 4 terminal. The code lets yo...
Install-Package StockSharp.MT4_Sources -Version 5.0.36
You receive an archive containing the C# source code of the S#.MT4 bridge and the MQL4 Expert Advisor source that connect applications based on API to a running MetaTrader 4 terminal. The code lets you inspect how terminal data and trading commands are converted to the StockSharp message model and adapt the integration to your infrastructure. The connector is also available as a separate product: MT 4.
The project contains an x86 DLL with functions exported through DllExport, the MQL4 Expert Advisor, and a local FIX server. The Expert Advisor loads the DLL, passes terminal structures to C#, and retrieves commands from an internal queue.
- Instruments and quotes: the code obtains symbols and their properties and produces Level1 messages.
- Candles: time-frame candle subscriptions and date-range history requests are implemented through MetaTrader 4 functions.
- Account and positions: balance, equity, profit, margin, positions, orders, and executions are mapped to StockSharp messages.
- Trading commands: the implementation covers market, limit, and stop-order registration, modification, and cancellation, together with terminal-supported Stop Loss, Take Profit, expiration, and slippage parameters.
- Integration settings: the Expert Advisor exposes the FIX server address, credentials, board code, primary symbol, polling interval, and order-history depth.
The native bridge targets x86 and is intended for a matching MetaTrader 4 environment on Windows. Available instruments, history, and trading operations depend on the terminal, broker, and connected account.