Skip to content
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

__get_auth if len(api_key) > 0 and len(api_secret): #9

Open
tuutuutuut opened this issue May 6, 2019 · 6 comments
Open

__get_auth if len(api_key) > 0 and len(api_secret): #9

tuutuutuut opened this issue May 6, 2019 · 6 comments

Comments

@tuutuutuut
Copy link

I have added my (testnet) APIKEY+ SECRET in .bash_profile
like so:

export BITMEX_APIKEY=xxxxxxxxxx
export BITMEX_SECRET=xxxxxxxxxxxxxxx

when i run python3 main.py --demo --strategy Doten →

2019-05-06 02:51:27,683 - INFO - Bot Mode : Trade
Traceback (most recent call last):
File "main.py", line 22, in
bot.run()
File "/Users/admin/marketmakers/bitmex/ebisu/src/bot.py", line 123, in run
self.exchange.on_update(self.bin_size, self.strategy)
File "/Users/admin/marketmakers/bitmex/ebisu/src/bitmex.py", line 616, in on_update
self.ws = BitMexWs(test=self.demo)
File "/Users/admin/marketmakers/bitmex/ebisu/src/bitmex_websocket.py", line 59, in init
header=self.__get_auth())
File "/Users/admin/marketmakers/bitmex/ebisu/src/bitmex_websocket.py", line 71, in __get_auth
if len(api_key) > 0 and len(api_secret):
TypeError: object of type 'NoneType' has no len()

any tips/suggestions?

@nateflanders
Copy link

I get the same error.

@canihojr
Copy link

me too

@l8nit3tr0ubl3
Copy link

set "BITMEX_TEST_API" rather then "BITMEX_API", and same for secret. Then run "source ~/.bash_profile" to actually use new variables

@caressgents
Copy link

@l8nit3tr0ubl3 would we do the same process to run on main net and not test net just reverse?

@l8nit3tr0ubl3
Copy link

what ive done is set both BITMEX_API, and BITMEX_TEST_API in the bash_profile file. Then be sure to run "source ~/.bash_profile" to set the new variables. This should bypass the "len > 0" issue for either testnet or mainnet.

however I have run into more issue after (likely user error)

@haikalfouzi
Copy link

fixed the error by running source ~/.bash_profile before running the main.py.

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

No branches or pull requests

8 participants
@l8nit3tr0ubl3 @canihojr @haikalfouzi @tuutuutuut @nateflanders @caressgents and others