【问题标题】:How can I get trade buy/sell data of Binance?如何获取币安的买卖数据?
【发布时间】:2022-03-24 22:42:06
【问题描述】:

我想通过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>)

此方法返回以下值:

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?
}

但是,这个数据似乎无法判断是卖还是买。如何获取买卖交易数据?

【问题讨论】:

    标签: python binance-api-client


    【解决方案1】:

    这个帖子帮助我最终理解了做市商/接受者的概念: https://money.stackexchange.com/questions/90686/what-does-buyer-is-maker-mean

    基本上如下:

    • isBuyerMaker = true -> 卖出
    • isBuyerMaker = false -> 购买

    【讨论】:

    • 这正是我想要的!花了太多时间寻找“实际包含买卖信息”的其他端点 谢谢!
    猜你喜欢
    • 2012-03-14
    • 1970-01-01
    • 2021-11-29
    • 2021-11-02
    • 2021-11-05
    • 1970-01-01
    • 2021-05-15
    • 2021-04-27
    • 2021-12-19
    相关资源
    最近更新 更多