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

Position Stream #239

Open
bugbaal opened this issue Aug 19, 2024 · 2 comments
Open

Position Stream #239

bugbaal opened this issue Aug 19, 2024 · 2 comments

Comments

@bugbaal
Copy link

bugbaal commented Aug 19, 2024

Hi,

I tried just the example in the doc to stream the positions, but doesn't work.
I waited for 5min. but I didn't receive any message, neither error, nor information about the positions.
Any help?
Thanks

from pybit.unified_trading import WebSocket
from time import sleep
ws = WebSocket(
    testnet=True,
    channel_type="private",
    api_key="XXXXX",
    api_secret="XXXXX",
)
def handle_message(message):
    print(message)
ws.position_stream(callback=handle_message)
while True:
    sleep(1)
@TRON-FAN
Copy link

from pybit.unified_trading import WebSocket
from time import sleep
ws = WebSocket(
testnet=True,
channel_type="private",
api_key="XXXXX",
api_secret="XXXXX",
)
def handle_message(message):
print(message)
ws.position_stream(callback=handle_message)
while True:
handle_message(message)
sleep(1)

maybe ;) but where is your message to print :p

@bugbaal
Copy link
Author

bugbaal commented Aug 26, 2024

maybe here?

def handle_message(message):
    print(message)

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

No branches or pull requests

2 participants