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

getting list of pending, filled and rejected orders #25

Closed MrGekko1 closed 5 years ago

MrGekko1 commented 5 years ago

Hi All, Is there a way to get the list of pending,filled, and rejected orders in python? Also list of Instruments would be great. Thank you.

integracore2 commented 5 years ago

Hi @radulylaszlo1 ,

Thank you for your interest!

In MetaTrader 4, orders available for reporting are either in state OPEN (in the market) or CLOSED (historical).

The _DWX_GET_OPENTRADES() function in the Python script enables you to see all orders currently open.

However, when you attempt to execute an order and let's say it doesn't get filled, MetaTrader 4 will respond via the MQL EA provided in this project, with an error message describing what happened.

Hope this helps answer your question.