huobi futures: improve market order type (#878)

This commit is contained in:
Luis Rascão
2022-01-20 23:10:46 +00:00
committed by GitHub
parent 1970a8e1b3
commit c65ec97556

View File

@@ -946,9 +946,17 @@ func (h *HUOBI) SubmitOrder(ctx context.Context, s *order.Submit) (order.SubmitR
var oType string
switch s.Type {
case order.Market:
oType = "opponent"
// https://huobiapi.github.io/docs/dm/v1/en/#order-and-trade
// At present, Huobi Futures does not support market price when placing an order.
// To increase the probability of a transaction, users can choose to place an order based on BBO price (opponent),
// optimal 5 (optimal_5), optimal 10 (optimal_10), optimal 20 (optimal_20), among which the success probability of
// optimal 20 is the largest, while the slippage always is the largest as well.
//
// It is important to note that the above methods will not guarantee the order to be filled in 100%.
// The system will obtain the optimal N price at that moment and place the order.
oType = "optimal_20"
if s.ImmediateOrCancel {
oType = "opponent_ioc"
oType = "optimal_20_ioc"
}
case order.Limit:
oType = "limit"