DeviaVir / zenbot

Zenbot is a command-line cryptocurrency trading bot using Node.js and MongoDB.
MIT License
8.23k stars 2.03k forks source link

strategy options: Error: Cannot find module #2504

Open e-pangolin opened 3 years ago

e-pangolin commented 3 years ago

Hi! Got this problem for month passing strategy options, zenbot fails when i specify any strategy options since commit 2a09b13ce9e2d75dc5a0cd3ee6258bcb5553f375 - Mon Mar 16 23:38:51 2020 +0100

i use zenbot git default branch, problem occurs with Debian testing 11 AND stable 10. $ npm -v 6.13.7 $ node -v v13.11.0

example with first failing commit, same for all newer versions i think (tested many): commit 2a09b13ce9e2d75dc5a0cd3ee6258bcb5553f375 Author: greenkeeper[bot] 23040076+greenkeeper[bot]@users.noreply.github.com Date: Mon Mar 16 23:38:51 2020 +0100

Update commander to the latest version 🚀 (#1997)

* fix(package): update commander to version 5.0.0

* chore(package): update lockfile package-lock.json

Co-authored-by: greenkeeper[bot] <23040076+greenkeeper[bot]@users.noreply.github.com>

$ ./zenbot.sh sim --strategy kc --kc_size 20 internal/modules/cjs/loader.js:979 throw err; ^

Error: Cannot find module '/home/XXX/zenbot.test/extensions/exchanges/--kc_size/exchange' Require stack:

last working commit (used zenbot months before without any problem):

commit 8024596781cda9f7e86f75f6a3b11daf683b4a5c Author: greenkeeper[bot] 23040076+greenkeeper[bot]@users.noreply.github.com Date: Mon Mar 16 23:38:23 2020 +0100

podoglyph commented 3 years ago

I had a similar issue. If I specify the exchange param it works. Didn't dig into the code, but seems it may be required if adding options.

./zenbot.sh trade gdax.BTC-USD --paper --period=1h

jorisw commented 3 years ago

Your zenbot is trying to load the --kc_size exchange. This means you're putting --kc_size in a place where it expects a selector, like binance.BTC-USDT.

Check the order of your parameters, and whether zenbot is set up at all to accept a --kc_size parameter. You can find this in commands/buy.js.

k3ntinhu commented 3 years ago

Your command should specify first the exchange and product.

Example: zenbot sim gdax.ETH-USD --strategy blabla

A domingo, 29/11/2020, 12:49, Joris W notifications@github.com escreveu:

Your zenbot is trying to load the --kc_size exchange. This means you're putting --kc_size in a place where it expects a selector, like binance.BTC-USDT.

Check the order of your parameters, and whether zenbot is set up at all to accept a --kc_size parameter. You can find this in commands/buy.js.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/DeviaVir/zenbot/issues/2504#issuecomment-735388668, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF6776AVNA24PJVA3GUQOHLSSI7MNANCNFSM4UBMOJZA .

jorisw commented 3 years ago

The fix to this 'bug' would be for the bot to better warn the user of wrong order of input parameters.

e-pangolin commented 3 years ago

Thank you for the workaround! In my opinion this is a bug because:

$ ./zenbot.sh --help Usage: zenbot [options] [command]

Options: -V, --version output the version number -h, --help display help for command

Commands: backfill [options] [selector] download historical trades for analysis balance [options] [selector] get asset and currency balance from the exchange buy [options] [selector] execute a buy order to the exchange list-selectors list available selectors list-strategies list available strategies new_backfill [options] [selector] download historical trades for analysis sell [options] [selector] execute a sell order to the exchange sim [options] [selector] run a simulation on backfilled data trade [options] [selector] run trading bot against live market data