Potentially Useful Strategy (Inverse Fisher Transform RSI)
#10
Code:
var strat = {};
var traded = false;
var IFTRSI = require('./indicators/IFTRSI.js');
strat.init = function() {
    var iftrsiParameters = {rsiInterval: 14, wmaLength: 8};
    this.addIndicator('iftrsi', 'IFTRSI', iftrsiParameters);
    
}
strat.update = function(candle) {
    this.indicators.iftrsi.update(candle);
 
}
strat.check = function(candle) {
    var iftResult = this.indicators.iftrsi.result;

if ( traded == false && iftResult < -0.5 ){
    this.advice('long')
    traded = true;
    console.log(iftResult);
}else if(traded == true && iftResult > 0.5 ){
    this.advice('short')
    console.log(iftResult);
    traded = false;
}
}


module.exports = strat;
This is most simplest way.
  Reply


Messages In This Thread
RE: Potentially Useful Strategy (Inverse Fisher Transform RSI) - by Remo - 11-26-2018, 07:35 PM

Forum Jump:


Users browsing this thread: