小编kom*_*dap的帖子

如何获取币安的交易买入/卖出数据?

我想通过 binance websocket 获取 BTC 的实时交易买入/卖出数据。

我在以下 websocket 模块中使用此方法:

网址:https ://python-binance.readthedocs.io/en/latest/binance.html#module-binance.streams

method:aggtrade_futures_socket(symbol: str, futures_type: binance.enums.FuturesType = <FuturesType.USD_M: 1>)
Run Code Online (Sandbox Code Playgroud)

该方法返回以下值:

data:
{
"e": "aggTrade", // Event type
"E": 123456789, // Event time
"s": "BTCUSDT", // Symbol
"a": 5933014, // Aggregate trade ID
"p": "0.001", // Price
"q": "100", // Quantity
"f": 100, // First trade ID
"l": 105, // Last trade ID
"T": 123456785, // Trade time
"m": true, // Is the buyer the market maker?
}
Run Code Online (Sandbox Code Playgroud)

但是,这个数据似乎并不能决定是卖还是买。如何获取买卖交易的数据?

python binance-api-client

5
推荐指数
1
解决办法
4258
查看次数

标签 统计

binance-api-client ×1

python ×1