DeviaVir / zenbot

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

Datetime not initialized at start with empty database. #306

Open tuxitor opened 7 years ago

tuxitor commented 7 years ago

A date and time variable seems to be uninitialized at startup with an empty database. Diff shows "infinity%" and vs shows "NaN%"

[eigilb@tb zenbot-work]$ ./zenbot.sh trade --paper --order_type bitstamp.btc-usd fetching pre-roll data: cannot backfill bitstamp.BTC-USD: exchange does not offer historical data DATE PRICE DIFF VOL RSI ACTIONS BAL PROFIT ---------------------------- STARTING "maker" PAPER TRADING ---------------------------- !!! Paper mode enabled. No real trades are performed until you remove --paper from the startup command. 1970-01-01 01:02:00 0.00 BTC-USD 0 0.00000 BTC 1000.00 USD +0.0% NaN% 2017-06-18 14:20:00 2577.15 BTC-USD+Infinity% 36 0.00000 BTC 1000.00 USD +0.0% NaN% 2017-06-18 14:22:00 2577.19 BTC-USD +0.0% 2 0.00000 BTC 1000.00 USD +0.0% NaN% 2017-06-18 14:26:00 2577.36 BTC-USD +0.0% 8 0.00000 BTC 1000.00 USD +0.0% NaN%

DeviaVir commented 7 years ago

This is not really a bug, as we can't get the historical data to base these numbers on just yet, but we could definitely portray that better, so in that sense it's a bug.

tuxitor commented 7 years ago

LOL. Cosmetic, but it is a good programming habit to initialize variables, right?

LoneWolf345 commented 6 years ago

Are you still experiencing this problem? If not, consider closing this.