Browse Source

Expose onOrderbook event to strategies

develop
mark-sch 1 year ago
parent
commit
84ea0fa951
2 changed files with 8 additions and 2 deletions
  1. +4
    -2
      plugins/paperTrader/paperTrader.js
  2. +4
    -0
      plugins/tradingAdvisor/tradingAdvisor.js

+ 4
- 2
plugins/paperTrader/paperTrader.js View File

@ -150,9 +150,11 @@ PaperTrader.prototype.processAdvice = function(advice) {
this.createTrigger(advice);
}
} else {
return log.warn(
// do not warn - advice event is used to transfer infomsg between plugins
return;
/*return log.warn(
`[Papertrader] ignoring unknown advice recommendation: ${advice.recommendation}`
);
);*/
}
this.tradeId = 'trade-' + (++this.propogatedTrades);

+ 4
- 0
plugins/tradingAdvisor/tradingAdvisor.js View File

@ -150,6 +150,10 @@ Actor.prototype.processRemoteCandle = function(rcandle) {
this.strategy.onRemoteCandle(rcandle);
}
Actor.prototype.processOrderbook = function(ob) {
this.strategy.onOrderbook(ob);
}
// pass through shutdown handler
Actor.prototype.finish = function(done) {
this.strategy.finish(done);

Loading…
Cancel
Save