1020 / MQL5 / USDⓈ-M FUTURES
How can MQL5 query Binance account configuration for a symbol?
Call ufQuerySymbolConfiguration for the chart contract. This example reads symbol, marginType, isAutoAddMargin, leverage and maxNotionalValue from the first response-array item. It queries configuration without changing leverage or margin mode.
What do you need to use this example?
- Install and configure MT5 Binance and API credentials. Make mt5binance.mqh, JAson.mqh and the account permissions required by this example available.
- Use the intended chart symbol and account configuration access. The data describes this account’s settings for that symbol rather than exchange-wide rules for all symbols.
How does the source execute?
- On the first tick, call ufQuerySymbolConfiguration(handles, Symbol(), recvWindow, resultChar).
- Convert the synchronous response to a string and parse it as CJAVal.
- Read configuration fields at index 0 and set isRun=true; the source does not traverse all array items.
Run on the first tick of this attachment; isRun then prevents repetition. Reloading may execute it again.
Parameters and execution behavior
| Parameter | Source value or behavior |
|---|---|
| Main interface | ufQuerySymbolConfiguration |
| Symbol | Symbol() |
| Array index | 0 |
| Margin settings | marginType / isAutoAddMargin |
| Leverage settings | leverage / maxNotionalValue |
| Request timing window | recvWindow = 3000 ms |
| Execution trigger | Run on the first tick of this attachment; isRun then prevents repetition. Reloading may execute it again. |