BenjiLee/PoloniexAnalyzer

No section 'API keys'

Closed this issue · 12 comments

Hi guys,

Now this is the error when using the py3 version

Traceback (most recent call last): File "/usr/lib/python3.5/configparser.py", line 1135, in _unify_values sectiondict = self._sections[section] KeyError: 'ApiKeys' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/root/.anapolo/poloniex.py", line 73, in <module> main() File "/root/.anapolo/poloniex.py", line 65, in main actions[args.action]['function']() File "/root/.anapolo/analyzer.py", line 24, in get_overview balances = Balances() File "/root/.anapolo/poloniex_apis/api_models/balances.py", line 6, in __init__ self.all_balances = trading_api.return_complete_balances() File "/root/.anapolo/poloniex_apis/trading_api.py", line 38, in return_complete_balances return _call_trading_api(body) File "/root/.anapolo/poloniex_apis/trading_api.py", line 96, in _call_trading_api request.add_header("Key", get_api_key()) File "/root/.anapolo/poloniex_apis/api_key_secret_util.py", line 10, in get_api_key key = config.get("ApiKeys", "key") File "/usr/lib/python3.5/configparser.py", line 778, in get d = self._unify_values(section, vars) File "/usr/lib/python3.5/configparser.py", line 1138, in _unify_values raise NoSectionError(section) configparser.NoSectionError: No section: 'ApiKeys'

But my api_keys.ini is filled :/

@criptonauta if you enclose text in ``` it will display it exactly as is. I tried to do it to your comment but it looks like you added some other formatting in there.

Example
newline
newline
   indented

vs
Example newline newline indented

@criptonauta Double check that your config file looks exactly like so.

[ApiKeys]
key:{stringhere}
secret:{stringhere}

image

It run! Thanks!

The sum is weird though. It's considering all of my trade history, isn't it?

^^

@criptonauta Do you use a margin account?

I did, not anymore

I think it's a big difference in CalculateFees
image

This is from cointracking
image

Thanks for the help as always ^^

What is cointracking?
Nevermind, googled it :)

Also, 160 does seem off by a little :)

A portfolio tool cointracking . info

@criptonauta Would you mind printing out your output for the fees?

BTC_EMC2=0.07000000000000002
BTC_POT=0.2935000000000002
BTC_BITS=0.007000000000000001
BTC_MAID=0.039000000000000014
BTC_XEM=0.07400000000000004
BTC_BLK=0.0255
XMR_LTC=0.11500000000000007
BTC_PINK=0.018500000000000003
USDT_REP=0.006
BTC_XVC=0.05100000000000001
BTC_GNT=0.2600000000000002
BTC_BTCD=0.02
ETH_REP=0.0055
BTC_FCT=0.6934999999999946
BTC_LBC=0.018
USDT_DASH=0.012399999999999998
BTC_STEEM=0.029
BTC_VTC=0.003
BTC_NOBL=0.007000000000000001
BTC_RADS=0.05580000000000002
USDT_XRP=0.0083
BTC_RIC=0.013
USDT_BTC=0.012499999999999999
BTC_REP=0.22100000000000017
BTC_BCN=0.10400000000000005
BTC_NEOS=0.034999999999999996
BTC_XBC=0.05800000000000004
BTC_DOGE=0.012999999999999998
BTC_XMR=0.16800000000000012
BTC_XRP=0.23200000000000018
BTC_BTS=0.11450000000000007
ETH_ZEC=0.0045000000000000005
BTC_STRAT=0.2495000000000002
BTC_FLO=0.05550000000000003
XMR_DASH=0.2660000000000002
BTC_NAV=0.10750000000000007
BTC_SJCX=0.016
ETH_ETC=0.025500000000000005
BTC_DGB=0.23600000000000018
BTC_XCP=0.023000000000000003
XMR_ZEC=0.4820000000000004
BTC_STR=0.07650000000000004
BTC_FLDC=0.048500000000000015
BTC_OMNI=0.019000000000000003
BTC_LSK=0.08950000000000005
ETH_GNT=0.024499999999999994
BTC_PASC=0.023000000000000003
BTC_EXP=0.07450000000000004
BTC_DASH=0.5654999999999982
BTC_HUC=0.011999999999999999
BTC_BELA=0.05750000000000003
BTC_ARDR=0.05600000000000002
USDT_XMR=0.013
BTC_ETH=0.22400000000000017
BTC_GAME=0.037500000000000006
XMR_BTCD=0.07650000000000004
BTC_ETC=0.1300000000000001
BTC_PPC=0.011
BTC_DCR=0.36260000000000026
BTC_SDC=0.004
XMR_MAID=0.0115
BTC_SYS=0.029499999999999995
USDT_ETH=0.0135
XMR_BBR=0.006
BTC_XPM=0.1305000000000001
BTC_AMP=0.07350000000000004
BTC_NMC=0.012000000000000002
BTC_LTC=0.1535000000000001
BTC_EBT=0.008
BTC_C2=0.003
BTC_NSR=0.004
BTC_GRC=0.033
BTC_ZEC=0.12000000000000008
BTC_SC=0.21060000000000015
BTC_NXT=0.022500000000000003
-------------Total Fees-------------
Total fees in BTC=160.25468609211998```

There's a strong possibility I just suck at math. I'll take a look

Looks like I didn't handle the case of USDT_ETH correctly and multiplied it by the BTC price instead of the ETH price. That's only part of the problem though.

Looks like the fees reported by polo are mixed when selling vs buying against USDT... So sometimes they give you the fee as USDT and sometimes as BTC. I was assuming it was all BTC and added them up and then multiplied by the currently price but there needs to be more math. I would also need to adjust the fee against the current price at the time instead of in the moment.