简体   繁体   English

Python-binance api Twap 订单

[英]Python-binance api Twap order

I have been exploring Algorithm trading with little background in programming.我一直在探索算法交易,但几乎没有编程背景。

I have a script that trades on Binance and I noticed the Twap API that was released for futures trading.我有一个在 Binance 上交易的脚本,我注意到为期货交易发布的 Twap API。 https://www.binance.com/en/support/faq/093927599fd54fd48857237f6ebec0b0 https://www.binance.com/en/support/faq/093927599fd54fd48857237f6ebec0b0

I am trying to incorporate this into my existing code, but I can't seem to figure this out.我正在尝试将其合并到我现有的代码中,但我似乎无法弄清楚这一点。

A simple market order will be一个简单的市价单将是

client.futures_create_order(
                symbol='BTCUSDT',
                type="MARKET",
                side="BUY",  
                quantity=0.2 
                )

How do I create a TWAP order?如何创建 TWAP 订单? I have tried setting "type" to "Twap" and added mandatory parameters but I get APIError(code=-1116): Invalid orderType.我尝试将“type”设置为“Twap”并添加了强制参数,但我得到 APIError(code=-1116): Invalid orderType。

For placing Twap futures order, you may wish to send request to this endpoint:要下 Twap 期货订单,您可能希望向此端点发送请求:

POST /sapi/v1/algo/futures/newOrderTwap

I think the method you are using is for placing normal order, which is calling the endpoint POST /fapi/v1/order我认为您使用的方法是放置正常订单,即调用端点POST /fapi/v1/order

The document: https://binance-docs.github.io/apidocs/spot/en/#time-weighted-average-price-twap-new-order-trade文档: https://binance-docs.github.io/apidocs/spot/en/#time-weighted-average-price-twap-new-order-trade

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM