BitMEX-simple-trading-robot icon indicating copy to clipboard operation
BitMEX-simple-trading-robot copied to clipboard

bitmex is not defined

Open KregH opened this issue 5 years ago • 2 comments

Hello, thank you for developing this. I am trying to run the notebook file but when ever I run it I get:


NameError Traceback (most recent call last) in () ----> 1 client = bitmex.bitmex( 2 test=True, 3 api_key="", 4 api_secret="" 5 )

NameError: name 'bitmex' is not defined

I am new to python and I got no idea of how to fix this any help?

KregH avatar Aug 15 '18 22:08 KregH

You have to install the following libs:

  1. talib (https://github.com/mrjbq7/ta-lib)
  2. bitmex (https://github.com/BitMEX/api-connectors/tree/master/official-http/python-swaggerpy) And finally, your python must be at least 3.6 version for using f-strings (ex: f"Last prediction: {prediction}")

Then you can successfully run the code.

IlyaKrotov avatar Aug 16 '18 07:08 IlyaKrotov

tanzeel@tanzeel-System-Product-Name:~/BitMEX-simple-trading-robot$ python main_loop.py 
Traceback (most recent call last):
  File "main_loop.py", line 1, in <module>
    import bitmex
  File "/home/tanzeel/.local/lib/python2.7/site-packages/bitmex.py", line 5, in <module>
    from BitMEXAPIKeyAuthenticator import APIKeyAuthenticator
  File "/home/tanzeel/.local/lib/python2.7/site-packages/BitMEXAPIKeyAuthenticator.py", line 1, in <module>
    import urllib.parse
ImportError: No module named parse
tanzeel@tanzeel-System-Product-Name:~/BitMEX-simple-trading-robot$ 

tanzeelrana avatar Sep 08 '18 21:09 tanzeelrana