dominiktraxl/pykrakenapi

Conditional close not working when placing order

Closed this issue · 1 comments

Hi,
I have found an issue with add_standard_order()
The Kraken API accepts ugly parameters as "close[ordertype]" and "close[price]".
Since you cant use [] in python arguments, the function add_standard_order() takes close_ordertype=None, close_price=None, as arguments.
The function parses parameters as this:
data = {arg: value for arg, value in locals().items() if arg != 'self' and value is not None}
So the API is receiving "close_ordertype" instead of "close[ordertype]".
I am wrong??? I will try to fix it.
maybe some simple hardcoding like:
data["close[ordertype]"] = data["close_ordertype"]

I can't test it at the moment, but it looks good. Thanks!