Chad-Thackray
This video tutorial explores how to use websockets in Python to collect liquidation order data from Binance, including the symbol, whether it is a buy or sell order, liquidation price, and amount liquidated. The code includes four imports for websockets, and creates a filename variable to save the liquidation orders to a CSV file for backtesting. The speaker also covers how to check if the CSV file already exists before writing the header, use async IO for the WebSocket streaming, and catch exceptions to reconnect in case the WebSocket connection drops. The tutorial concludes with a reminder to verify the accuracy and meaning of the data and apply the knowledge to collect data from other exchanges.
In this section of the video tutorial, the presenter shares how to use websockets in Python to gather liquidation order data from Binance. The liquidation order data includes the symbol, whether the order is a buy or sell, the liquidated price, and the amount of the given asset that was liquidated. For traders, this data can be valuable in predicting trend continuation or reversal. The presenter directs users to access the websocket market stream from the Binance Futures documentation and use the liquidation order stream to copy and paste it to their code. The code includes four imports, including websockets. The presenter adds a filename variable to save the results of the liquidations down to a CSV for backtesting.
In this section, the speaker discusses the Python code needed to create and write to a CSV file. They explain that the code checks whether the CSV file already exists before writing the file header, which consists of the column names from the Binance WebSocket stream. The column names are obtained from the Binance documentation, and the speaker clarifies that these names are always in the same order unless there are significant changes to the API. They also explain that they are using async IO for the WebSocket streaming, which allows for multiple functions to wait for messages and stream data simultaneously. Finally, they discuss the use of an infinite while loop and async/await syntax for catching exceptions and reconnecting in case the WebSocket connection gets closed or dropped.
In this section, the speaker explains how to save liquidation order data from Binance in Python. They describe how to use websockets to receive message data and convert strings into Python dictionaries to access the order information. They extract the values from the dictionary, turn them into a list, and append the list to a CSV file to save the data for analysis. The speaker cautions about the importance of understanding which side the sell order is on, as it may indicate a long liquidation or a short liquidation, depending on the exchange API being used. Overall, the process is straightforward and provides a useful dataset for backtesting trading algorithms.
In this section, the speaker concludes the tutorial on gathering liquidation order price data from Binance in Python. They emphasize the importance of verifying the meaning of the data to ensure accuracy before using it to gain an edge in the market. The speaker also hopes that viewers can apply the knowledge to collect their own data from various exchanges.
No videos found.
No related videos found.
No music found.