Skip to content

added update_types parameter #75

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

Merged
merged 9 commits into from
Aug 1, 2024
Merged

Conversation

KetanGupta12
Copy link
Contributor

No description provided.

Copy link
Contributor

Choose a reason for hiding this comment

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

maintain snake_case for python. Please change the folder names accordingly.

@@ -37,3 +41,24 @@ def connect(self):

threading.Thread(target=self.ws.run_forever,
kwargs={"sslopt": sslopt}).start()

Copy link
Contributor

Choose a reason for hiding this comment

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

More concise version of this function could be

` def get_websocket_url(self):
ws_url = "wss://api.upstox.com/v2/feed/portfolio-stream-feed"
update_types = []
if self.order_update:
update_types.append("order")
if self.holding_update:
update_types.append("holding")
if self.position_update:
update_types.append("position")

  if update_types:
      ws_url += "?update_types=" + "%2C".join(update_types)

  return ws_url`

please test and use.

@KetanGupta12 KetanGupta12 merged commit 1063df5 into master Aug 1, 2024
1 check passed
@KetanGupta12 KetanGupta12 deleted the portfolio-websocket-changes branch August 1, 2024 10:25
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.

2 participants