Created
February 16, 2014 08:37
-
-
Save memeyou/9031218 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // sent advice over to the IRC channel | |
| Actor.prototype.emitAdvice = function() { | |
| var stuff | |
| if(this.advice == 'long') { | |
| stuff = c.green('Go long; buy.'); | |
| } else if(this.advice == 'short') { | |
| stuff = c.red('Go short; sell.'); | |
| } | |
| // extra info from the advisor method... | |
| if(this.info) stuff += ' ' + this.info; | |
| var message = [ | |
| c.bold(config.watch.asset + '-' + config.watch.currency + ' (' + config.tradingAdvisor.candleSize + 'm ' + config.tradingAdvisor.method + '): '), | |
| stuff, | |
| ' ', | |
| ' (from ' + this.adviceTime.fromNow() + ')' | |
| ].join(''); | |
| this.bot.say(ircbot.channel, message); | |
| }; | |
| // sent price over to the IRC channel | |
| Actor.prototype.emitPrice = function() { | |
| var stuff; | |
| if(this.advice == 'long') { | |
| stuff = c.green(this.price); | |
| } else if(this.advice == 'short') { | |
| stuff = c.red(this.price); | |
| } else { | |
| stuff = this.price; | |
| } | |
| var message = [ | |
| c.bold(config.watch.asset) + ' @ ' + c.bold(config.watch.exchange), | |
| ' is ', | |
| stuff, | |
| ' ', | |
| c.bold(config.watch.currency), | |
| ' (', | |
| this.priceTime.fromNow(), | |
| ')' | |
| ].join(''); | |
| this.bot.say(ircbot.channel, message); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment