darwinex / dwx-zeromq-connector

Wrapper library for algorithmic trading in Python 3, providing DMA/STP access to Darwinex liquidity via a ZeroMQ-enabled MetaTrader Bridge EA.
https://blog.darwinex.com/zeromq-interface-python-r-metatrader4/
BSD 3-Clause "New" or "Revised" License
344 stars 228 forks source link

[REQUEST] Get list of all instruments from MetaTrader Terminal #28

Closed MrGekko1 closed 4 years ago

MrGekko1 commented 5 years ago

Hi,

Is there a way to get the list of all available instruments? Thanks.

integracore2 commented 4 years ago

Hi @radulylaszlo1 ,

Great question!

We'll add this as a feature for future releases, but in the meantime if you'd like to implement something custom for yourself, you would need to use the following MQL4 functions:

1) SymbolsTotal() - which returns the number of available symbols in the Terminal, setting the "selected" argument to True or False will return symbols in MarketWatch or all available symbols respectively.

Link to documentation: https://docs.mql4.com/marketinformation/symbolstotal

2) SymbolName() - which takes an integer index as the symbol's position in the list, and returns the name of the symbol (e.g. EURUSD, etc etc)

Link to documentation: https://docs.mql4.com/marketinformation/symbolname