darwinex / dwxconnect

Seamlessly link any Trading Strategy in ANY programming language to Darwinex liquidity via MetaTrader 4 or 5. DWX Connect is your very own, fully customizable Trading API!
BSD 3-Clause "New" or "Revised" License
158 stars 84 forks source link

Passing market depth data and spread to the client #15

Closed Boscop closed 2 years ago

Boscop commented 2 years ago

How would the code need to be extended in order to pass market depth / order book data to the client? Which MQL functions should be called to fetch this data from MT?

And which MQL functions should be called to get the spread for a symbol?

elvinex commented 2 years ago

Hi, Regarding the spread, I would not add a new function for that. If you are subscribed to a symbol, you can just use "ask minus bid" on the python side to get the spread.

Market depth would only work on MT5, not MT4. DWX Connect does not offer this function yet, so you would have to add it yourself.

Here is a great video from Martyn explaining how to get market depth data.

An here is a link to the mql documentation.