Gekko Forum
Potentially Useful Strategy (Inverse Fisher Transform RSI) - Printable Version

+- Gekko Forum (https://forum.gekko.wizb.it)
+-- Forum: Gekko (https://forum.gekko.wizb.it/forum-13.html)
+--- Forum: Strategy Development (https://forum.gekko.wizb.it/forum-12.html)
+--- Thread: Potentially Useful Strategy (Inverse Fisher Transform RSI) (/thread-57224.html)

Pages: 1 2


RE: Potentially Useful Strategy (Inverse Fisher Transform RSI) - lucascostner - 11-28-2018

I tried running this but it doesn’t make any buys or sells in backtests? I thought maybe I just needed to change the < > parts to = but still nothing. Any ideas?



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.
[/quote]


RE: Potentially Useful Strategy (Inverse Fisher Transform RSI) - Remo - 11-28-2018

console.log the iftresult before the if statement maybe to see the numbers.
If you have free time feel free to visit codecademy for javascript courses Smile