dominiktraxl/pykrakenapi

'consolidation' input for get_open_positions() is not inlcuded

Closed this issue · 2 comments

First off, great work! I find this library extremely helpful in navigating Kraken's API, especially where their documentation may be lacking a little.

The get_open_positions() function does not have the input 'consolidation' included. While I am not entirely sure what Kraken's intent on this is by reading the docs, I can only assume it means it consolidates all your open positions to one average position based on a 'market' supplied as the input definition. I.e.- if you had two open XETHZUSD positions, it would consolidate those to one average XETHZUSD position.

Perhaps this is something that Kraken recently added to their API, but I was curious if there were plans to add it to pykrakenapi anytime soon? Playing around with it myself I can't seem to make head or tails of it, so maybe it is more of an upstream issue, but I can't tell.

you should be able to hard code:
consolidation = 'market'
into the get_open_positions function and it seems like it worked for me.

def get_open_positions(self, txid=None, docalcs=False, consolidation = 'market', otp=None):

Wow, this really helps a ton - I was stuck here interpreting 'market' to be a pair. Like you would enter in:
consolidation = 'XETHZUSD'
I see now, no issue with the code or Kraken, just user error. Thanks for the response!