我正在使用 Coinbase Pro API Python SDK。我像这样下限价买单...
import cbpro
...
self._get_auth_client(account).place_limit_order(product_id=formatted_name,
side='buy',
price=fiat_price,
size=amount)
填充后,我得到如下所示的结果
{
'id': '1eaa9934-ccef-489d-80d7-540e0b9ef62a',
'price': '64262.83000000',
'size': '0.01556109',
'product_id': 'BTC-USD',
'profile_id': 'bb05c122-e394-40a9-b183-60456a67b188',
'side': 'buy',
'type': 'limit',
'time_in_force': 'GTC',
'post_only': False,
'created_at': '2021-11-14T19:55:03.791866Z',
'done_at': '2021-11-14T19:55:08.990951Z',
'done_reason': 'filled',
'fill_fees': '1.5639532769270500',
'filled_size': '0.01556109',
'executed_value': '999.8760512847000000',
'status': 'done',
'settled': True
}
我不明白的是他们如何计算“executed_value”?根据购买金额乘以价格减去费用,(64262.83000000 * 0.01556109 - 1.5639532769270500) 我认为执行值(value)将是 998.435728008,这比报告的要少。我错过了什么?
最佳答案
根据我对您的 Buy API 调用
和 Coinbase 中的这句话的解释文档。
executed_value is the cumulative match size * price and is only present for orders placed after 2016-05-20.
看来 executed_value
对您的交易来说是正确的,因为 fill_fees
没有考虑到 executed_value
输出。
当您查询您的订单簿
时,您应该会看到从您的购买订单中提取的fill_fees
。
关于python - Python Coinbase Pro API 如何计算限价订单的执行值(value)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69968194/