Skip to content

Commit

Permalink
[OKEX Futures] Add market order support
Browse files Browse the repository at this point in the history
  • Loading branch information
f0cii committed Apr 3, 2020
1 parent 807036c commit 7ede8ea
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions brokers/okex-futures-broker/broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,13 @@ func (b *OKEXFuturesBroker) PlaceOrder(symbol string, direction Direction, order
}
}
var _orderType int
if reduceOnly {
var matchPrice int
if postOnly {
_orderType = 1
}
var matchPrice int
if orderType == OrderTypeMarket {
price = 0
_orderType = 4
matchPrice = 1
}
var newOrderParams okex.FuturesNewOrderParams
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/frankrap/bybit-api v0.0.0-20200322001335-e3990ed82944
github.com/frankrap/deribit-api v0.0.0-20200322001639-1fbbf5c14797
github.com/frankrap/huobi-api v0.0.0-20200322001841-f013851fc396
github.com/frankrap/okex-api v0.0.0-20200324025205-4b3fe2deebd3
github.com/frankrap/okex-api v0.0.0-20200403022040-48202f46958d
github.com/sony/sonyflake v1.0.0
github.com/spf13/viper v1.6.2
golang.org/x/sys v0.0.0-20200321134203-328b4cd54aae // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ github.com/frankrap/huobi-api v0.0.0-20200322001841-f013851fc396 h1:PCSetqqyIS7S
github.com/frankrap/huobi-api v0.0.0-20200322001841-f013851fc396/go.mod h1:qRToModVi2quhh8aw9uA2j/7GPLb3wnmlSEX/X6m1mQ=
github.com/frankrap/okex-api v0.0.0-20200324025205-4b3fe2deebd3 h1:hA0eoREcKFl0giOvZzbC852qu73sIqgkS9mlP0wVTjs=
github.com/frankrap/okex-api v0.0.0-20200324025205-4b3fe2deebd3/go.mod h1:45g+ebGPCdH3j8plJkgsVz6xP8PkNyPjpDCYoYItsi0=
github.com/frankrap/okex-api v0.0.0-20200403022040-48202f46958d h1:dJdh8KmGYOMZ1fLly7YKzChDc/QBUOrRVqqy7ld7kZc=
github.com/frankrap/okex-api v0.0.0-20200403022040-48202f46958d/go.mod h1:45g+ebGPCdH3j8plJkgsVz6xP8PkNyPjpDCYoYItsi0=
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsouza/go-dockerclient v1.4.4/go.mod h1:PrwszSL5fbmsESocROrOGq/NULMXRw+bajY0ltzD6MA=
Expand Down

0 comments on commit 7ede8ea

Please sign in to comment.