zenbot icon indicating copy to clipboard operation
zenbot copied to clipboard

strategy options: Error: Cannot find module

Open e-pangolin opened this issue 5 years ago • 5 comments

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:

  • /home/XXX/zenbot.test/extensions/exchanges/sim/exchange.js
  • /home/XXX/zenbot.test/lib/engine.js
  • /home/XXX/zenbot.test/commands/buy.js
  • /home/XXX/zenbot.test/zenbot.js at Function.Module._resolveFilename (internal/modules/cjs/loader.js:976:15) at Function.Module._load (internal/modules/cjs/loader.js:859:27) at Module.require (internal/modules/cjs/loader.js:1036:19) at require (internal/modules/cjs/helpers.js:72:18) at sim (/home/XXX/zenbot.test/extensions/exchanges/sim/exchange.js:10:23) at module.exports (/home/XXX/zenbot.test/lib/engine.js:29:92) at Command. (/home/XXX/zenbot.test/commands/sim.js:103:20) at Command.listener [as _actionHandler] (/home/XXX/zenbot.test/node_modules/commander/index.js:408:31) at Command._parseCommand (/home/XXX/zenbot.test/node_modules/commander/index.js:909:14) at Command._dispatchSubcommand (/home/XXX/zenbot.test/node_modules/commander/index.js:860:18) { code: 'MODULE_NOT_FOUND', requireStack: [ '/home/XXX/zenbot.test/extensions/exchanges/sim/exchange.js', '/home/XXX/zenbot.test/lib/engine.js', '/home/XXX/zenbot.test/commands/buy.js', '/home/XXX/zenbot.test/zenbot.js' ] }

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

e-pangolin avatar Nov 24 '20 20:11 e-pangolin

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

podoglyph avatar Nov 27 '20 07:11 podoglyph

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.

jorisw avatar Nov 29 '20 12:11 jorisw

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 [email protected] 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 .

k3ntinhu avatar Nov 29 '20 12:11 k3ntinhu

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

jorisw avatar Nov 29 '20 12:11 jorisw

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

  • help command tells that selector should be at the end, wich doesn't works:

$ ./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

  • selector is already specified in conf.js, wich worked until 2020-03-16. Now still working if no specific option specified, for example: ./zenbot.sh sim --strategy kc (works) ./zenbot sim --strategy kc --kc_size 20 (doesn't works)

  • maybe "--something" should be considered as an option, anyway.

I'm sorry i can't help very easily with Node.js ... Thank you again!

e-pangolin avatar Nov 29 '20 17:11 e-pangolin