From 2309e8ce6064c5babffb53dd8dc61ee1f44d73d7 Mon Sep 17 00:00:00 2001 From: Adrian Gallagher Date: Mon, 30 Apr 2018 17:24:28 +1000 Subject: [PATCH] Fix OKEX match_price logic Fixes https://github.com/thrasher-/gocryptotrader/issues/116 --- exchanges/okex/okex.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/exchanges/okex/okex.go b/exchanges/okex/okex.go index e52f9133..f36c372f 100644 --- a/exchanges/okex/okex.go +++ b/exchanges/okex/okex.go @@ -562,8 +562,10 @@ func (o *OKEX) PlaceContractOrders(symbol, contractType, position string, levera values.Set("type", position) if matchPrice { values.Set("match_price", "1") + } else { + values.Set("match_price", "0") } - values.Set("match_price", "0") + if leverageRate != 10 && leverageRate != 20 { return 0, errors.New("leverage rate can only be 10 or 20") }