BenjiLee / PoloniexAnalyzer

Trade history and balance analyzer for Poloniex
MIT License
78 stars 22 forks source link

Issue with deposit total and balance #13

Closed Zettt closed 7 years ago

Zettt commented 7 years ago

Hello,

I think I have an issue with calculation of GetOverview. When I run it, it says that I have:

Deposits=2017.54465408

To be frank, I'd wish that was true, however it's not. I don't even have 1 BTC on my account. Therefore it is calculating wrongly. Does that make sense to you? I couldn't find the issue in the code because I can't work with Python.

Also, I'd urge you to remove the offensiveness of the program. To call folks an idiot is neither helpful, nor nice. At least it should be helpful.

BenjiLee commented 7 years ago

Also, I'd urge you to remove the offensiveness of the program. To call folks an idiot is neither helpful, nor nice. At least it should be helpful.

I can make it less offensive.

I think I have an issue with calculation of GetOverview. When I run it, it says that I have: Deposits=2017.54465408

I wish that were true for you too!

Did you deposit to Poloniex with something other than BTC by any chance?

Zettt commented 7 years ago

I did. I deposited via various altcoins, e.g. LTC, DASH, and PPC. Is that problematic?

I can make it less offensive.

I'd appreciate that!

BenjiLee commented 7 years ago

I did. I deposited via various altcoins, e.g. LTC, DASH, and PPC. Is that problematic?

When I first wrote this, BTC was the assumed way to deposit. I'm looking at the code and I realized it doesn't account for alt coin deposits which is becoming more popular and accessible. Thanks for your feedback! Will be working on a fix.

Zettt commented 7 years ago

Gotcha. Maybe you can make it ignore the altcoins for the time being until you are able to figure out how to calculate them correctly.

BenjiLee commented 7 years ago

https://github.com/BenjiLee/PoloniexAnalyzer/pull/15 Could you give the latest update a try? I don't have any ETH to deposit and test with.

Zettt commented 7 years ago

I'm not sure how helpful my answer is going to be. I sold my last ETH position yesterday.

I get a new(?) error when I run GetOverview. Just for completeness sake:

Traceback (most recent call last):
  File "poloniex.py", line 64, in <module>
    main()
  File "poloniex.py", line 56, in main
    actions[args.action]['function']()
  File "/Users/me/Coding/PoloniexAnalyzer/analyzer.py", line 27, in get_overview
    balance = dw_history.get_btc_balance(public_api.return_ticker())
  File "/Users/me/Coding/PoloniexAnalyzer/poloniex_apis/api_models/deposit_withdrawal_history.py", line 27, in get_btc_balance
    balance += amount * ticker_data[u'BTC_' + deposit]['last']
TypeError: can't multiply sequence by non-int of type 'float'
BenjiLee commented 7 years ago

@Zettt Pretty helpful. I know how to fix this particular line of code but I'm going to find some ETH to deposit so I can test it. Thanks.

fhdummy commented 7 years ago

@BenjiLee I'm actually having the same problem as @Zettt , just to let you know. I had deposited externaly Siacoin and Zcash and it fails with the following error message:

Traceback (most recent call last):
  File "poloniex.py", line 64, in <module>
    main()
  File "poloniex.py", line 56, in main
    actions[args.action]['function']()
  File "C:\Users\Stefan\Downloads\PoloniexAnalyzer-master\analyzer.py", line 27, in get_overview
    balance = dw_history.get_btc_balance(public_api.return_ticker())
  File "C:\Users\Stefan\Downloads\PoloniexAnalyzer-master\poloniex_apis\api_models\deposit_withdrawal_history.py", line 27, in get_btc_balance
    balance += amount * ticker_data[u'BTC_' + deposit]['last']
TypeError: can't multiply sequence by non-int of type 'float'

Thanks for your work.

BenjiLee commented 7 years ago

@Zettt @fhdummy It's taking forever to get my ETH to test it out myself. I addressed the specific bug in the error above https://github.com/BenjiLee/PoloniexAnalyzer/pull/16. Try the latest master and see if that works. Otherwise, we are stuck until Coinbase gives me access to my ETH.

Zettt commented 7 years ago

@BenjiLee I do have some ETH now again, and tested GetOverview. I don't seem to be getting the error listed above anymore.

The earning/losses balance now only calculates the earning through trading, and doesn't include deposits anymore?

Zettt commented 7 years ago

I just saw that DOGE is now also listed with a 2012 in front.

--Currency=Deposit-Withdrawal=Total-
DOGE=2012.80586888-0=2012.80586888
fhdummy commented 7 years ago

@BenjiLee For me too the error is gone and the GetOverview and also GetDetailedOverview executes.. Didn't get the time though to verify the calculated results.

BenjiLee commented 7 years ago

@Zettt Not sure where the 2012 came from. It looks like you've deposited 2012.80586888 DOGE? What was the actual value of DOGE you deposited?

The earning/losses balance now only calculates the earning through trading, and doesn't include deposits anymore?

I've removed the total deposits without subtracting withdrawal. I found this value not useful. Were you still interested in this value? The result is all deposits and withdrawals combined which totals out to your current balance.

I think the latest fix works now. https://github.com/BenjiLee/PoloniexAnalyzer/pull/16

Zettt commented 7 years ago

I must have dumped that much DOGE on my account, I believe.

Anyway. I like the little calculation there. Thanks for it. I think this bug is fixed, isn't it?!

BenjiLee commented 7 years ago

Anyway. I like the little calculation there.

I'll take another look at it another time.

Thanks for your bug report!