Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Numbro TypeError: Cannot read property 'toString' of undefined #662

Closed
adamnmcc opened this issue Oct 28, 2017 · 3 comments · Fixed by #2021
Closed

Numbro TypeError: Cannot read property 'toString' of undefined #662

adamnmcc opened this issue Oct 28, 2017 · 3 comments · Fixed by #2021
Labels

Comments

@adamnmcc
Copy link

adamnmcc commented Oct 28, 2017

running on AWS Ubuntu python3.

Bittrex Exchange BTC-SALT pair.

Causes scripts to fail.

/home/ubuntu/zenbot/node_modules/numbro/numbro.js:1111
        var parts = x.toString().split('.');
                      ^

TypeError: Cannot read property 'toString' of undefined
    at multiplier (/home/ubuntu/zenbot/node_modules/numbro/numbro.js:1111:23)
    at /home/ubuntu/zenbot/node_modules/numbro/numbro.js:1127:22
    at Array.reduce (<anonymous>)
    at correctionFactor (/home/ubuntu/zenbot/node_modules/numbro/numbro.js:1125:21)
    at Numbro.add (/home/ubuntu/zenbot/node_modules/numbro/numbro.js:1197:47)
    at /home/ubuntu/zenbot/commands/trade.js:388:78
    at /home/ubuntu/zenbot/lib/engine.js:192:14
    at /home/ubuntu/zenbot/extensions/exchanges/bittrex/exchange.js:113:18
    at Request._callback (/home/ubuntu/zenbot/node_modules/node.bittrex.api/node.bittrex.api.js:112:25)
    at Request.self.callback (/home/ubuntu/zenbot/node_modules/request/request.js:188:22)
    at emitTwo (events.js:125:13)
    at Request.emit (events.js:213:7)
    at Request.<anonymous> (/home/ubuntu/zenbot/node_modules/request/request.js:1171:10)
    at emitOne (events.js:115:13)
    at Request.emit (events.js:210:7)
    at IncomingMessage.<anonymous> (/home/ubuntu/zenbot/node_modules/request/request.js:1091:12)
    at Object.onceWrapper (events.js:312:30)
    at emitNone (events.js:110:20)
    at IncomingMessage.emit (events.js:207:7)
    at endReadableNT (_stream_readable.js:1056:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
@ljankok
Copy link
Contributor

ljankok commented Oct 29, 2017

Numbro expects to deal with typeof number.. Check your variables value when running your strategy, do you see the variable values as white or blue? Blue means the they are seen as typeof number and white means that they are seen as typeof string. You can fix that in your code by setting the variable to typeof number

@adamnmcc
Copy link
Author

All the variables are blue..
screen shot 2017-10-29 at 18 25 21

@ljankok
Copy link
Contributor

ljankok commented Oct 29, 2017

there is a fix for this. check this:
#457

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants