Skip to content

Tag: websocket

Python websocket closes after few seconds

I am try subscribe API http://developers.xstore.pro/documentation/ Process how I am doing it. Login (Ok) Subscribe some command (Ok) The data starts coming in (Ok) After few second (cca 20s) (Fail) on: Python or API closes connection :( inicialize socket: Every 5s I am sending following ping There is a way to…

Pandas won’t create CSV file?

just trying to save websockets to CSV’s. But it just doesnt make the file. Nothing in the directory. Tried running VScvode as admin, moving folder out of C: drive to documents .. nothing. no csv file, and no error. and no information on the internet about this either. So i kept stripping down the code t…

Websocket Json Data to DataFrame

I am learning how to work with APIs and web sockets in finance. My goal for this code is to access data and create a DataFrame with only columns (index, ask, bid & quote) I have tried appending values to the DataFrame but it creates a new DataFrame every time I receive a message similar to the df = new_df…

Can not get cookie from localhost websocket fast api

I’m testing websockets to work with cookies and trying to get them in fast api. I manually installed them in chrome but I get an empty dictionary inside the application. I used the fast api documentation templates and slightly redesigned it My html My websocket print(websocket.cookies) returns an empty …

Python asyncio loop.run_forever()

I try to do a trading bot and the most things work fine. But everytime the internet connection is gone for a short time, the code fails. I use asyncio run_forever() function and I think that the code should run forever until it gets stopped, but it does not work. Here is my code: And I call the loop like

Python Binance multiple kline time intervals

I’m writing a program that collects cryptocurrency price information and I want to perform technical analysis on two different kline time intervals. I’ve been struggling to achieve this as I’m new to programming and even newer to Python specifically. Below is the code I’m currently try…