Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gab0 committed Jan 6, 2019
1 parent 8203ad9 commit 7953e5c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion indicators/AO.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var SMA = require('./SMA');
var Indicator = function(settings) {
this.input = 'candle';

this.result = 0;
this.result = NaN;
this.age = 0;

this.shortsma = new SMA(5);
Expand Down
3 changes: 2 additions & 1 deletion indicators/DPO.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var SMA = require('./SMA');
var Indicator = function(settings) {
this.input = 'price';

this.result = 0;
this.result = NaN;
this.age = 0;

this.sma = new SMA(settings.optInTimePeriod);
Expand All @@ -22,6 +22,7 @@ Indicator.prototype.update = function(price) {

this.pricehist.push(price);
this.sma.update(price);

if (this.pricehist.length >= this.delay)
{
var oldprice = this.pricehist.shift();
Expand Down
2 changes: 1 addition & 1 deletion indicators/MFI.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var SMA = require('./SMA');
var Indicator = function(settings) {
this.input = 'candle';

this.result = 0;
this.result = NaN;
this.age = 0;


Expand Down

0 comments on commit 7953e5c

Please sign in to comment.