question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

custom_strategy ImportError: cannot import name 'bitmex' from 'market_maker'

See original GitHub issue

I have successfully installed market maker via the “getting started” instructions in the README.

I am on Mac OSX 10.10.5

I can successfully run “marketmaker XBTUSD” using DRYRUN=True on testnet and get the expected output.

What I am having trouble with and don’t understand how to do is running the custom strategy.

Executing the following:

python3 market_maker/custom_strategy.py

gives the following error:

Traceback (most recent call last):
  File "market_maker/custom_strategy.py", line 3, in <module>
    from market_maker.market_maker import OrderManager
  File "/Users/MYUSERNAME/python_projects/market_maker/market_maker.py", line 11, in <module>
    from market_maker import bitmex
ImportError: cannot import name 'bitmex' from 'market_maker' (/Users/MYUSERNAME/python_projects/market_maker/market_maker.py)

Can someone explain step-by-step what has to be done to execute a custom strategy?

Thank you.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

6reactions
ryanfoxcommented, Sep 25, 2018

Instead of running the custom strategy directly (python3 market_maker/custom_strategy.py), create a script to run it from the top-level directory, similar to marketmaker (note no extension):

from market_maker import custom_strategy
custom_strategy.run()
0reactions
SaleProperlycommented, Sep 26, 2018

ryanfox has the best correct answer. Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

python marketmaker botcustomisation...ImportError - Reddit
ImportError : cannot import name 'bitmex. I have been able to run the sample python marketmaker on testnet using my API keys with...
Read more >
how to run "custom_strategy" in Bitmex - Stack Overflow
Run python custom_strategy.py in windows Powershell, nothing happened, no error information, no order has been placed in Testnet Bitmex. Can ...
Read more >
bitmex-market-maker - PyPI
BitMEX Market Maker. This is a sample market making bot for use with BitMEX. It is free to use and modify for your...
Read more >
Trading Rules - BitMEX
BitMEX enforces the following Trading Rules and implements the following Protections to encourage efficient trading strategies, incentivise behaviours that ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found