Skip to content

Commit

Permalink
huobi futures: improve market order type (thrasher-corp#878)
Browse files Browse the repository at this point in the history
  • Loading branch information
lrascao authored Jan 20, 2022
1 parent 1970a8e commit c65ec97
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions exchanges/huobi/huobi_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit c65ec97

Please sign in to comment.