<commit_before>// required indicators
var EMA = require('./EMA.js');

var Indicator = function(config) {
  this.input = 'price'
  this.result = false;
  this.inner = new EMA(config.weight);
  this.outer = new EMA(config.weight);
}

// add a price and calculate the EMAs and
// the result
Indicator.prototype.update = function(price) {
  this.inner.update(price);
  this.outer.update(this.inner.result);
  this.result = 2 * this.inner.result - this.outer.result;
}

module.exports = Indicator;
<commit_msg>Update DEMA.js (#2146)<commit_after>// required indicators
var EMA = require('./EMA.js');

var Indicator = function(config) {
  this.input = 'price';
  this.result = false;
  this.inner = new EMA(config.weight);
  this.outer = new EMA(config.weight);
}

// add a price and calculate the EMAs and
// the result
Indicator.prototype.update = function(price) {
  this.inner.update(price);
  this.outer.update(this.inner.result);
  this.result = 2 * this.inner.result - this.outer.result;
}

module.exports = Indicator;

{'fraction_non_alphanumeric': 0.1480392156862745, 'fraction_numerical': 0.0058823529411764705, 'mean_word_length': 3.861904761904762, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3284193', 'n_tokens_mistral': 348, 'n_tokens_neox': 337, 'n_words': 80}