Position Stream
Opened this issue · 2 comments
bugbaal commented
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 commented
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 commented
maybe here?
def handle_message(message):
print(message)