Skip to content

Commit

Permalink
Comment and whitespace cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
werkkrew authored and askmike committed Feb 3, 2018
1 parent 20df7c3 commit 782bf9b
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions plugins/tradingAdvisor/baseTradingMethod.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ Base.prototype.propogateTick = function(candle) {
}

Base.prototype.processTrade = function(trade) {
this.onTrade(trade);
this._position = (trade.action === 'buy' && _.isNumber(trade.price)) ? 'long' : 'short';
this.onTrade(trade);
this._position = (trade.action === 'buy' && _.isNumber(trade.price)) ? 'long' : 'short';
}

Base.prototype.addTalibIndicator = function(name, type, parameters) {
Expand Down Expand Up @@ -318,10 +318,7 @@ Base.prototype.advice = function(newPosition, _candle) {
if(!newPosition)
return;

// ignore if advice equals previous advice
// updated to take the current actual position into account in case a previous advice resulted in a cancelled/failed trade
// ** still need to consider a way to deal with an enhancement to not use the full balance on every trade
// ** making multiple instances of the same advice in succession desirable
// ignore if advice equals previous advice and the current trade action is the same as the current position
if(newPosition === this._prevAdvice && newPosition === this._position) {
log.debug('Advice to go [' + newPosition.toUpperCase() + '] is the same as the previous advice and current market position, ignoring.');
return;
Expand Down

0 comments on commit 782bf9b

Please sign in to comment.