CodeReclaimers / btce-bot

Library to support building trading bots for the BTC-e cryptocurrency exchange.
MIT License
52 stars 28 forks source link

error #9

Closed RenzoGamero closed 7 years ago

RenzoGamero commented 7 years ago

MacBook-Pro-de-Renzo:samples Mac$ MacBook-Pro-de-Renzo:samples Mac$ python hello-world-bot.py "/Users/Mac/PycharmProjects/btcetest2/btce-keys.txt" 4.0 4.1 Traceback (most recent call last): File "hello-world-bot.py", line 141, in run(args.key_file, args.buy_floor, args.sell_ceiling, args.live_trades) File "hello-world-bot.py", line 92, in run handler = btceapi.KeyHandler(key_file) File "build/bdist.macosx-10.6-intel/egg/btceapi/keyhandler.py", line 111, in init File "build/bdist.macosx-10.6-intel/egg/btceapi/keyhandler.py", line 48, in init File "build/bdist.macosx-10.6-intel/egg/btceapi/keyhandler.py", line 115, in _loadKeys File "build/bdist.macosx-10.6-intel/egg/btceapi/keyhandler.py", line 133, in _parse ValueError: invalid literal for int() with base 10: '' MacBook-Pro-de-Renzo:samples Mac$

i don't know what is wrong

CodeReclaimers commented 7 years ago

It looks like your btce-keys.txt file is missing the initial nonce value for the last key in the file. Each key should have three lines in that file: the key, the secret, and a nonce value. So it should look something like this:

GZGQE3IY-8WHYJANV-S5DSYB5Z-BERG3J79-8K8NSSP6 a034b00c827a84400956d697a7da0a216cb6cde9818ccf5346b3e0979a34fdfa 1

CodeReclaimers commented 7 years ago

I should add: if you've never used the API key before, a nonce value of 1 should be fine.

Also, thanks for mentioning this, because I hadn't noticed that step 8 in the documentation here didn't show three lines; the nonce was included on the second line and was easy to miss.

RenzoGamero commented 7 years ago

/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/btce_api-0.3.1-py2.7.egg/btceapi/trade.py:180: UserWarning: The nonce in the key file is out of date; attempting to correct.

i use the key before.

CodeReclaimers commented 7 years ago

You will have to choose a nonce value that is larger than any you've used before. Because there is no way to ask the API what the next nonce should be, you can either just try larger numbers until it works, or create a new set of keys and then use 1 as the nonce (which is probably easier if you've used the key a lot).