Skip to content

Commit

Permalink
fixed second issue in askmike#220
Browse files Browse the repository at this point in the history
  • Loading branch information
askmike committed Mar 3, 2014
1 parent b805432 commit 9bea7ab
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 4 deletions.
6 changes: 4 additions & 2 deletions core/baseTradingMethod.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ var Base = function() {
// should be set up now, check some things
// to make sure everything is implemented
// correctly.
if(!this.name)
log.warn('Warning, trading method has no name');
if(this.name)
log.info('\t', 'Using trading method:', this.name);
else
log.warn('\t', 'Warning, trading method has no name');

if(!config.debug || !this.log)
this.log = function() {};
Expand Down
2 changes: 2 additions & 0 deletions methods/DEMA.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ method.init = function() {
this.currentTrend;
this.requiredHistory = config.tradingAdvisor.historySize;

this.name = 'DEMA';

// define the indicators we need
this.addIndicator('dema', 'DEMA', settings);
}
Expand Down
2 changes: 2 additions & 0 deletions methods/MACD.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ var method = {};
// prepare everything our method needs
method.init = function() {

this.name = 'MACD';

// keep state about the current trend
// here, on every new candle we use this
// state object to check if we need to
Expand Down
2 changes: 2 additions & 0 deletions methods/PPO.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ var method = {};

// prepare everything our method needs
method.init = function() {
this.name = 'PPO';

this.trend = {
direction: 'none',
duration: 0,
Expand Down
2 changes: 2 additions & 0 deletions methods/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ var method = {};

// Prepare everything our method needs
method.init = function() {
this.name = 'The gambler';

this.currentTrend = 'long';
this.requiredHistory = 0;
}
Expand Down
2 changes: 0 additions & 2 deletions plugins/tradingAdvisor.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ var Actor = function() {
if(!_.contains(methods, methodName))
util.die('Gekko doesn\'t know the method ' + methodName);

log.info('\t', 'Using the trading method: ' + methodName);

var Consultant = require('../core/baseTradingMethod');

var method = require('../methods/' + methodName);
Expand Down

0 comments on commit 9bea7ab

Please sign in to comment.