Skip to content

Commit

Permalink
Merge pull request #19 from fedelaport/patch-1
Browse files Browse the repository at this point in the history
Conditional close order fix
  • Loading branch information
dominiktraxl authored Jun 18, 2018
2 parents f5202a3 + 1cec1b3 commit 9b5d556
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pykrakenapi/pykrakenapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1879,6 +1879,16 @@ def add_standard_order(self, pair, type, ordertype, volume, price=None,
data = {arg: value for arg, value in locals().items() if
arg != 'self' and value is not None}

# This little hack fixes the problem with [ ]
if "close_ordertype" in data:
data["close[ordertype]"] = data.pop("close_ordertype")

if "close_price" in data:
data["close[price]"] = data.pop("close_price")

if "close_price2" in data:
data["close[price2]"] = data.pop("close_price2")

# query
res = self.api.query_private('AddOrder', data=data)

Expand Down

0 comments on commit 9b5d556

Please sign in to comment.