Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Market Data example fails #5

Open
cryptal opened this issue Apr 13, 2013 · 1 comment
Open

Market Data example fails #5

cryptal opened this issue Apr 13, 2013 · 1 comment

Comments

@cryptal
Copy link

cryptal commented Apr 13, 2013

Running node v0.10.4 and microtime 0.3.3. Checked out the code.

$ npm examples/market_data.js

~/trader.nodejs/lib/books/mtgox_rest.js:45
    maybe_update(0, bid, book.bids[book.bids.length - 1]);
                                            ^
TypeError: Cannot read property 'length' of undefined
    at process_new_book (/home/dan/trader.nodejs/lib/books/mtgox_rest.js:45:49)
    at IncomingMessage.<anonymous> (/home/dan/trader.nodejs/lib/books/mtgox_rest.js:68:17)
    at IncomingMessage.EventEmitter.emit (events.js:117:20)
    at _stream_readable.js:883:14
    at process._tickCallback (node.js:415:13)
@carsato
Copy link

carsato commented Apr 13, 2013

Same error here.
I solved It by replacing mtgox.com by data.mtgox.com on "./trader.nodejs/examples/market_data.js:39" market_data.js around line 39 (i added some lines). That's the "host" property

original:
35 var gox = books.build({
36 exchange: 'mtgox',
37 depth: 'L1',
38 protocol: 'rest',
39 host: 'mtgox.com',
40 // specified per mtgox api v0
41 product: 'EUR',
42 });

replaced:
35 var gox = books.build({
36 exchange: 'mtgox',
37 depth: 'L1',
38 protocol: 'rest',
39 host: 'data.mtgox.com',
40 // specified per mtgox api v0
41 product: 'EUR',
42 });

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

No branches or pull requests

2 participants