Heikin Ashi
#2
(02-23-2018, 11:42 PM)fo0man Wrote: I found Gekko a few days ago and have been trying out some different strategies. One of the things I was experimenting with is Heikin Ashi candles so. For anyone wanting to use HA candles here's how I'm doing it.


Code:
var _ = require('lodash');

var strat = {
...

  heikenAshi: function(candle) {
    return {
      close: (candle.open + candle.close + candle.high + candle.low) / 4,
      open: (this.previousCandle.open + this.previousCandle.close) / 2,
      high: _.max([candle.high, candle.open, candle.close]),
      low: _.min([candle.low, candle.open, candle.close])
    };
  },

  update: function () {
    if (this.previousCandle) {
      this.heikenCandle = this.heikenAshi(this.candle);
    }

    this.previousCandle = this.candle;
  },

...
}

Thank you so much, I have been looking for a script that buys when red heiken Ashi turns green, and sells when it turns red agian.

Aldo i didnt get it to work. Can you please assist me ? Should i put this script in strategy folder, and is it enought or should i do something else. 

Thank you so much for the help
  Reply


Messages In This Thread
Heikin Ashi - by fo0man - 02-23-2018, 11:42 PM
RE: Heikin Ashi - by korani - 03-14-2018, 02:52 PM
RE: Heikin Ashi - by Simone - 04-25-2019, 12:35 PM
RE: Heikin Ashi - by MichaelGonzales - 08-02-2020, 08:36 PM
RE: Heikin Ashi - by lindaween - 08-20-2020, 09:18 AM
RE: Heikin Ashi - by slimus5713 - 04-20-2021, 11:04 PM

Forum Jump:


Users browsing this thread: