How do I fix Cannot read property ‘askPrice’ of undefined error?

TypeError: Cannot read property ‘askPrice’ of undefined
at Binance.parseOrderBook (C:\snapshot\Gunbot-master\ctx\js\binance.js:0:0)
at module.exports.fetchOrderBook.Promise.binance.allBookTickers (C:\snapshot\Gunbot-master\ctx\js\binance.js:0:0)
at Request.module.exports._makeRequest.request [as _callback] (C:\snapshot\Gunbot-master\ctx\helper\binance\binance-api.js:0:0)
at Request.init.self.callback (C:\snapshot\Gunbot-master\node_modules\request\request.js:186:22)
at emitTwo (events.js:126:13)
at Request.emit (events.js:214:7)
at Request. (C:\snapshot\Gunbot-master\node_modules\request\request.js:1163:10)
at emitOne (events.js:116:13)
at Request.emit (events.js:211:7)
at IncomingMessage. (C:\snapshot\Gunbot-master\node_modules\request\request.js:1085:12)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:111:20)
at IncomingMessage.emit (events.js:208: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

You might be getting this error and wondering “what did I do wrong?”  “How do I fix it?”  “Why does botting hate me?”

This error message – keyed on the TypeError: Cannot read property askprice of undefined tagline – usually means one MAJOR thing is wrong with your configuration.

One of your pairs is wrong.

“But, my pairs are right!” I can hear you saying.  Check again, I say.

Gunbotting isn’t a science – it’s an art.  Go through your pairs and actually check on the exchange if they exist. Gunbot does what you tell it to do, even if it’s wrong.

For example, if you’re running Binance, and you didn’t correct the typo in the default config, you might be running BTC-IOT instead of BTC-IOTA.

If you use the GUI, and gunbot and Trading View support the exchange, then the graph will show you if the pair is good or not.  If you see an actual graph, then your pair is for sure good.

However, if you see “Invalid Symbol” then that’s telling you that the pair is no good.  Remove it.

invalid symbol

If you’re sure the pair name is correct, then it could be an API error, or, in some cases, the Exchange allows the coin to be traded normally (ie, through the web interface) but the Exchange doesn’t allow API trading.

Other things to check if all else fails:

  • Ensure your API key is valid on the Exchange.
  • Ensure your time is synced properly
  • Make sure you’re not banned from the Exchange on a temporary IP ban or a permanent ban.