Ekliptor / WolfBot

Crypto currency trading bot written in TypeScript for NodeJS
https://wolfbot.org
GNU Affero General Public License v3.0
703 stars 213 forks source link

Backtesting Configuration Empty #8

Closed ynzheng closed 5 years ago

ynzheng commented 5 years ago

after installation and boot with "node app.js --debug --config=Noop --trader=RealTimeTrader --noUpdate --noBrowser"

following steps in https://forum.wolfbot.org/threads/backtesting.20/#lg=post-37&slide=1

"Go to the "Backtesting" page and select ...." no Backtesting Configuration can be choosed ,cos it `s empty

:(

image

Ekliptor commented 5 years ago

I can not reproduce your error, backtesting is working for me.

Please ensure you are running the latest version of WolfBot and paste your log file here. It seems WolfBot is unable to load the /config dir with the files. Does the dropdown menu on the configuration page show config files?

ynzheng commented 5 years ago

the configuration page works fine

image

image

yn@hostdoc:~/github.com/ekliptor/bot/build$ node app.js --debug --config=Noop --trader=RealTimeTrader --noUpdate --noBrowser 2018-10-17 19:42:03 - warn: Uncaught Exception 2018-10-17 19:42:03 - warn: {"message":"listen EADDRINUSE :::8331","stack":"Error: listen EADDRINUSE :::8331\n at Server.setupListenHandle [as _listen2] (net.js:1286:14)\n at listenInCluster (net.js:1334:12)\n at Server.listen (net.js:1421:7)\n at Object. (/home/yn/github.com/ekliptor/WolfBot/app.ts:217:8)\n at Module._compile (internal/modules/cjs/loader.js:689:30)\n at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)\n at Module.load (internal/modules/cjs/loader.js:599:32)\n at tryModuleLoad (internal/modules/cjs/loader.js:538:12)\n at Function.Module._load (internal/modules/cjs/loader.js:530:3)\n at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)\n at startup (internal/bootstrap/node.js:279:19)\n at bootstrapNodeJSCore (internal/bootstrap/node.js:752:3)","errno":"EADDRINUSE","code":"EADDRINUSE","syscall":"listen","address":"::","port":8331} 2018-10-17 19:42:03 - warn: Error: listen EADDRINUSE :::8331 at Server.setupListenHandle [as _listen2] (net.js:1286:14) at listenInCluster (net.js:1334:12) at Server.listen (net.js:1421:7) at Object. (/home/yn/github.com/ekliptor/WolfBot/app.ts:217:8) at Module._compile (internal/modules/cjs/loader.js:689:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3) at Function.Module.runMain (internal/modules/cjs/loader.js:742:12) at startup (internal/bootstrap/node.js:279:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:752:3) 2018-10-17 19:42:03 - error: Error logging to database {"message":"Cannot read property 'collection' of null","stack":"TypeError: Cannot read property 'collection' of null\n at SystemMessageData.save (/home/yn/github.com/ekliptor/WolfBot/node_modules/@ekliptor/bit-models/models/SystemMessage.ts:53:37)\n at new SystemMessageData (/home/yn/github.com/ekliptor/WolfBot/node_modules/@ekliptor/bit-models/models/SystemMessage.ts:49:18)\n at Controller.log (/home/yn/github.com/ekliptor/WolfBot/src/Controller.ts:91:13)\n at process.Controller.process.on (/home/yn/github.com/ekliptor/WolfBot/src/Controller.ts:65:22)\n at process.emit (events.js:182:13)\n at process.emit (/home/yn/github.com/ekliptor/WolfBot/node_modules/source-map-support/source-map-support.js:439:21)\n at process._fatalException (internal/bootstrap/node.js:485:27)"} 2018-10-17 19:42:03 - warn: Uncaught Exception 2018-10-17 19:42:03 - warn: {"message":"listen EADDRINUSE :::8332","stack":"Error: listen EADDRINUSE :::8332\n at Server.setupListenHandle [as _listen2] (net.js:1286:14)\n at listenInCluster (net.js:1334:12)\n at Server.listen (net.js:1421:7)\n at Object. (/home/yn/github.com/ekliptor/WolfBot/app.ts:239:17)\n at Module._compile (internal/modules/cjs/loader.js:689:30)\n at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)\n at Module.load (internal/modules/cjs/loader.js:599:32)\n at tryModuleLoad (internal/modules/cjs/loader.js:538:12)\n at Function.Module._load (internal/modules/cjs/loader.js:530:3)\n at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)\n at startup (internal/bootstrap/node.js:279:19)\n at bootstrapNodeJSCore (internal/bootstrap/node.js:752:3)","errno":"EADDRINUSE","code":"EADDRINUSE","syscall":"listen","address":"::","port":8332} 2018-10-17 19:42:03 - warn: Error: listen EADDRINUSE :::8332 at Server.setupListenHandle [as _listen2] (net.js:1286:14) at listenInCluster (net.js:1334:12) at Server.listen (net.js:1421:7) at Object. (/home/yn/github.com/ekliptor/WolfBot/app.ts:239:17) at Module._compile (internal/modules/cjs/loader.js:689:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3) at Function.Module.runMain (internal/modules/cjs/loader.js:742:12) at startup (internal/bootstrap/node.js:279:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:752:3) 2018-10-17 19:42:03 - error: Error logging to database {"message":"Cannot read property 'collection' of null","stack":"TypeError: Cannot read property 'collection' of null\n at SystemMessageData.save (/home/yn/github.com/ekliptor/WolfBot/node_modules/@ekliptor/bit-models/models/SystemMessage.ts:53:37)\n at new SystemMessageData (/home/yn/github.com/ekliptor/WolfBot/node_modules/@ekliptor/bit-models/models/SystemMessage.ts:49:18)\n at Controller.log (/home/yn/github.com/ekliptor/WolfBot/src/Controller.ts:91:13)\n at process.Controller.process.on (/home/yn/github.com/ekliptor/WolfBot/src/Controller.ts:65:22)\n at process.emit (events.js:182:13)\n at process.emit (/home/yn/github.com/ekliptor/WolfBot/node_modules/source-map-support/source-map-support.js:439:21)\n at process._fatalException (internal/bootstrap/node.js:485:27)"} 2018-10-17 19:42:03 - verbose: Ta-Lib successfully loaded. Ta-Lib Version 1.0.2 ready 2018-10-17 19:42:03 - info: Connected to MongoDB 2018-10-17 19:42:03 - info: minified all resources 2018-10-17 19:42:03 - info: Loading exchange Binance with apiKey index 0 2018-10-17 19:42:03 - verbose: Fetched ticker of Binance 2018-10-17 19:42:03 - info: Active candle makers: ["BINANCE USDT_BTC"] 2018-10-17 19:42:03 - info: Active candle batchers: ["BINANCE USDT_BTC: 1 min","BINANCE USDT_BTC: 2 min"] 2018-10-17 19:42:03 - verbose: Opening Websocket connection in Binance to wss://API 2018-10-17 19:42:03 - verbose: Updating portfolio of 1 exchanges in RealTimeTrader 2018-10-17 19:42:03 - verbose: Creating backup of 119 config files 2018-10-17 19:42:03 - info: Restored strategy state of 1-USDT_BTC NOOP from state-Noop.json 2018-10-17 19:42:04 - verbose: Resetting order book 2018-10-17 19:42:04 - info: USDT_BTC order book snapshot of exchange BINANCE is ready. seqNr 266063334, orders 200 2018-10-17 19:42:04 - verbose: Updated 1 order books in Binance 2018-10-17 19:42:04 - verbose: 1 Binance order book snapshots ready 2018-10-17 19:42:05 - verbose: Fetched ticker of Binance 2018-10-17 19:43:01 - verbose: 1min BINANCE candle USDT_BTC: high 6715.00000000, low 6708.96000000, close 6714.96000000, volume 49.60882300, trades 137 2018-10-17 19:43:03 - verbose: No open margin positions on Binance to sync 2018-10-17 19:43:03 - verbose: Synced Binance USDT_BTC portfiolio: 0.0143121 coins, 0 margin amount 2018-10-17 19:43:08 - verbose: Fetched ticker of Binance 2018-10-17 19:44:00 - verbose: 1min BINANCE candle USDT_BTC: high 6714.92000000, low 6709.00000000, close 6710.01000000, volume 15.38362800, trades 126 2018-10-17 19:44:03 - verbose: Updating portfolio of 1 exchanges in RealTimeTrader 2018-10-17 19:44:04 - verbose: No open margin positions on Binance to sync 2018-10-17 19:44:04 - verbose: Synced Binance USDT_BTC portfiolio: 0.0143121 coins, 0 margin amount 2018-10-17 19:44:08 - verbose: Fetched ticker of Binance 2018-10-17 19:45:00 - verbose: 1min BINANCE candle USDT_BTC: high 6714.35000000, low 6710.02000000, close 6711.13000000, volume 11.58511100, trades 114 2018-10-17 19:45:10 - verbose: Fetched ticker of Binance 2018-10-17 19:46:00 - verbose: 1min BINANCE candle USDT_BTC: high 6717.22000000, low 6702.00000000, close 6709.77000000, volume 48.52408200, trades 171 2018-10-17 19:46:04 - verbose: Updating portfolio of 1 exchanges in RealTimeTrader 2018-10-17 19:46:13 - verbose: Fetched ticker of Binance 2018-10-17 19:47:02 - verbose: 1min BINANCE candle USDT_BTC: high 6714.56000000, low 6706.81000000, close 6707.51000000, volume 11.20607800, trades 97 2018-10-17 19:47:15 - verbose: Fetched ticker of Binance 2018-10-17 19:48:02 - verbose: 1min BINANCE candle USDT_BTC: high 6714.00000000, low 6708.17000000, close 6709.85000000, volume 10.14048900, trades 123 2018-10-17 19:48:04 - verbose: Updating portfolio of 1 exchanges in RealTimeTrader 2018-10-17 19:48:16 - verbose: Fetched ticker of Binance 2018-10-17 19:49:00 - verbose: 1min BINANCE candle USDT_BTC: high 6717.53000000, low 6709.92000000, close 6717.53000000, volume 17.32656700, trades 140 2018-10-17 19:49:01 - info: Exiting main process. Please wait... 2018-10-17 19:49:01 - error: 2018-10-17 19:49:02 - info: Exiting main process. Please wait... 2018-10-17 19:49:02 - error: 2018-10-17 19:49:02 - info: Main process exited with code 0 2018-10-17 19:49:02 - info: Exiting main process. Please wait... 2018-10-17 19:49:02 - verbose: Saved strategy state to: /home/yn/github.com/ekliptor/WolfBot/temp/state-Noop.json

Ekliptor commented 5 years ago

I can see that you are running multiple bots on the same port because of the EADDRINUSE :::8332 error. You should use the -p1234 argument on startup to assign different ports.

Other than that I don't see an error related to missing config files. What operating system are you using? I also just published the latest version of my packages apputils and bit-models. Please run yarn install again to ensure you have the latest versions and try again.

ynzheng commented 5 years ago

infact I am runing only one bots on debian 9.5 with the latest version ( 8713760..aaed072 master)

anyway I will delete all and rebuild again to see and let you khnow here.thanks

node -v v10.11.0

yarn -v 1.10.1

mongo --version MongoDB shell version v4.0.2 git version: fc1573ba18aee42f97a3bb13b67af7d837826b47 OpenSSL version: OpenSSL 1.1.0f 25 May 2017 allocator: tcmalloc modules: none build environment: distmod: debian92 distarch: x86_64 target_arch: x86_64

tsc -v Version 3.1.1

uname -a Linux hostdoc 4.9.0-8-amd64 #1 SMP Debian 4.9.110-3+deb9u4 (2018-08-21) x86_64 GNU/Linux

webpack --version 4.20.2

cat /etc/debian_version 9.5

Ekliptor commented 5 years ago

I am running it on debian too, so it's really strange. But the EADDRINUSE :::8332 error from you log above definitely means that the port was in use. So if you only run 1 WolfBot, you didn't shut it down.

I have no idea why your Backtester doesn't show config files, especially since you see them on the configuration page. You could debug this yourself by checking what the Promise of ConfigEditor.listConfigFiles() in BacktestingUpdater.ts line 87 returns.

Ekliptor commented 5 years ago

now i see an error in your log related to the Backtesting view: {"message":"configLocal_1.currencyImportMap is not iterable","stack":"TypeError: configLocal_1.currencyImportMap is not iterable\n at BacktestingUpdater.getCurrencyPairImportMap (/home/yn/github.com/ekliptor/WolfBot/src/WebSocket/BacktestingUpdater.ts:327:25)\

I updated the configLocal-sample.ts. Please use the new one and try again, the error should be gone

ynzheng commented 5 years ago

it works great! well done!

let me test more ...

thanks

ynzheng commented 5 years ago

backtesting(few days) takes some hours without any information on webpage...

can this backtesting run only on bash command with log and verbose info?

image

Ekliptor commented 5 years ago

If you click on the blue arrow in the lower right corner you will see a the log with the current progress. i might add a progress bar for imports some time later

also you can start it from console: https://forum.wolfbot.org/threads/importing-large-amounts-of-trades-for-backtesting.4/#post-8

that's another advantage of the cloud version: imported trades are already available

ynzheng commented 5 years ago

2018-10-18 15:47:30 - error: Importing multiple currency pairs from Binance is not supported

doest the cloud version support Binance And Huobipro?

Ekliptor commented 5 years ago

Import and backtesting can always only be done 1 currency at a time (the exchange also has API rate limits).

the cloud version currently has the currency pairs listed here pre imported: https://forum.wolfbot.org/threads/backtesting.20/#post-37

But if you are interested in popular pairs of Binance I can add them to the auto import of the cloud version