Skip to content

TradesHistory example script not working out-of-the-box #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
BorstenElch opened this issue Jul 12, 2017 · 9 comments
Closed

TradesHistory example script not working out-of-the-box #29

BorstenElch opened this issue Jul 12, 2017 · 9 comments

Comments

@BorstenElch
Copy link

Hi,
I tried out this code as it is until line 45 as a test. Unfortunately my only output is:
{'error': [], 'result': {'trades': {}, 'count': 0}}
Same results when I am going to change the year to 2017 and the change in line 38 to:
end_date = datetime.datetime(2017, i+2, 28)
Does anyone have a solution?
Thank you a lot in advance!
Best regards.

@veox
Copy link
Owner

veox commented Jul 13, 2017

I tried out this code

What code?

@veox veox added the invalid label Jul 13, 2017
@BorstenElch
Copy link
Author

I meant the example code from krakenex for the method 'trades-history'.

@veox
Copy link
Owner

veox commented Jul 15, 2017

I tried out this code as it is until line 45 as a test.

You mean this line:

data.append(pd.DataFrame.from_dict(th['result']['trades']).transpose())

The script requires the pandas Python package - do you have that installed?

The fact is not reflected in the script's header. Also, the comment there may be a stale copy-paste from examples/form8949.py.

The script was contributed by @AustinDeric in PR #13.

@veox veox added examples and removed invalid labels Jul 15, 2017
@veox veox added this to the v1.0 milestone Jul 15, 2017
@veox veox changed the title Method 'trades-history' is not working examples/trades-history.py script is not working out-of-the-box Jul 15, 2017
@veox veox changed the title examples/trades-history.py script is not working out-of-the-box TradesHistory example script not working out-of-the-box Aug 4, 2017
@veox veox added the stale label Aug 4, 2017
@veox veox removed this from the v1.0 milestone Aug 6, 2017
@zhuoyizhang
Copy link

Hi,

I tried this code and found that 2 rows were missing in the output.
In my Kraken account, there are 50 rows in July and August. But in the csv, I only have 48 rows.

Below is the only changes I have made to your example.

for i in range(6,9):
    start_date = datetime.datetime(2017, i, 1)
    end_date = datetime.datetime(2017, i+1, 1) - datetime.timedelta(seconds=1)
    th = k.query_private('TradesHistory', req(start_date, end_date, 1))

Could you help?

@Rorchmain
Copy link

Hi there,
Thanks for the code. Unfortunately I do not manage to retrieve my trade history using it. I keep getting the following error :

th = k.query_private('TradesHistory', data(start_date, end_date, 1))
TypeError: 'list' object is not callable

I am not sure que query_private('TradesHistory') expects as much inputs...
Thx for your help

@piotrjbedkowski
Copy link

@Rorchmain I encountered the same. Fixed #81

@veox
Copy link
Owner

veox commented Jan 20, 2018

The cause for this issue is changes in pandas.

@veox veox closed this as completed in 6097d60 Jan 20, 2018
@veox
Copy link
Owner

veox commented Jan 20, 2018

The script in question and the other one using pandas don't check for its version. Therefore, the backward-incompatible change in pandas API broke the scripts.

The above commit should do the same as in PR #81. Do reopen this issue if not so.

@christopheblp
Copy link

@Rorchmain have you resolved your issue ? I'm having the same problem...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants