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

Exchanges Reference Issue #1

Closed
gwdp opened this issue May 19, 2013 · 2 comments
Closed

Exchanges Reference Issue #1

gwdp opened this issue May 19, 2013 · 2 comments

Comments

@gwdp
Copy link

gwdp commented May 19, 2013

I'm getting reference issue with 'this' in exchanger class...

Output:

    if (err) throw err;
                   ^
TypeError: Cannot call method 'add' of undefined
    at EventEmitter.trader.trade (/Users/username/gekko/exchanges/mtgox.js:21:16)
    at EventEmitter.emit (events.js:117:20)
    at advice (/Users/username/gekko/methods/exponential-moving-averages.js:198:22)
    at /Users/username/gekko/methods/exponential-moving-averages.js:84:5
    at IncomingMessage.<anonymous> (/Users/username/gekko/node_modules/mtgox-apiv2/mtgox.js:42:13)
    at IncomingMessage.EventEmitter.emit (events.js:117:20)
    at _stream_readable.js:883:14
    at process._tickCallback (node.js:415:13)

and the same will happen on sale...

Node Version:

v0.10.3
gwdp added a commit to gwdp/gekko that referenced this issue May 19, 2013
@gwdp gwdp mentioned this issue May 19, 2013
@askmike
Copy link
Owner

askmike commented May 19, 2013

Thanks for reporting the issue, it is indeed a pretty severe bug for a tradebot...

Experienced the same issue myself before I saw this pull request and fixed it already by binding the context inside the exchange class.

Thanks for reporting it though!

@askmike
Copy link
Owner

askmike commented May 19, 2013

Github should message me on a new pull request imo..

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

No branches or pull requests

2 participants