Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update DWX_ZeroMQ_Connector_v2_0_1_RC8.py #81

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Wortburrito
Copy link

added 3 new Functions:
_DWX_MTX_GET_ACCOUNT_INFO_() --> Informations like balance, margin, etc
_DWX_MTX_GET_MARKET_INFO_([symbolpair]) ---> precision, digits, swap ...
and a new SUB Socket for receiving Account Infos + Open Orders every 100ms in JSON and store it to _ACC_Data_DB
(i didnt test the new SUB socket jet)

added 3 new Functions:
_DWX_MTX_GET_ACCOUNT_INFO_() --> Informations like balance, margin, etc
_DWX_MTX_GET_MARKET_INFO_([symbolpair]) ---> precision, digits, swap ...
and a new SUB Socket for receiving Account Infos + Open Orders every 100ms in JSON and write it to _ACC_Data_DB
(i didnt test the new SUB socket jet)
@Mtype
Copy link

Mtype commented Jul 31, 2020

Hi @Wortburrito!

Thank you for your addition. Exactly what I was looking for. Do you think you could add the ability to pull the account history into python through the DWX ZeroMQ connector? (something similar to this: https://www.mql5.com/en/docs/integration/python_metatrader5/mt5historydealsget_py (In mt5 deals == mt4 orders)

Copy link

@Qoyyuum Qoyyuum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, looks good. Though I would prefer better error handling for future reference. Is there a reason to not print or log errors when it occurs? At least it gets easier to debug for later versions.

Comment on lines -35 to +39
_PUSH_PORT=32768, # Port for Sending commands
_PULL_PORT=32769, # Port for Receiving responses
_SUB_PORT=32770, # Port for Subscribing for prices
_PUSH_PORT=1000, # Port for Sending commands
_PULL_PORT=1001, # Port for Receiving responses
_SUB_PORT=1002, # Port for Subscribing for prices
_SUB_PORT_ACC=1003, # Port for Subscribing Accound and OpenOrders
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason for changing the port numbers besides _SUB_PORT_ACC? Can we still maintain the port numbers as the original defaults?

Comment on lines +394 to +395
except KeyError:
pass
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps print the error (or log it?) if it failed to get the account info?

Comment on lines +406 to +407
except KeyError:
pass
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likewise with this error if failed to get the market info.

Comment on lines +569 to +574
except zmq.error.Again:
pass # resource temporarily unavailable, nothing to print
except ValueError:
pass # No data returned, passing iteration.
except UnboundLocalError:
pass # _symbol may sometimes get referenced before being assigned.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a good reason to ignore these raised errors?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants