-
Notifications
You must be signed in to change notification settings - Fork 230
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
base: master
Are you sure you want to change the base?
Conversation
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)
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) |
There was a problem hiding this 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.
_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 |
There was a problem hiding this comment.
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?
except KeyError: | ||
pass |
There was a problem hiding this comment.
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?
except KeyError: | ||
pass |
There was a problem hiding this comment.
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.
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. |
There was a problem hiding this comment.
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?
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)