RSI = 0 first view candles - Printable Version +- Gekko Forum (https://forum.gekko.wizb.it) +-- Forum: Gekko (https://forum.gekko.wizb.it/forum-13.html) +--- Forum: Technical Discussion (https://forum.gekko.wizb.it/forum-23.html) +--- Thread: RSI = 0 first view candles (/thread-57676.html) |
RSI = 0 first view candles - PrimalFury - 09-23-2018 I have a simple rsi script which buys at rsi below 30 en buy at rsi above 70 Every candle which it checks it also prints out the RSI value See the attachment. why are the first rsi value 0 ? Code: // Let's create our own strategy RE: RSI = 0 first view candles - cubit - 09-23-2018 Just a guess but there are 14 zeros so I would say that relates to your RSIinterval of 14... it probably requires this many iterations to warm up! RE: RSI = 0 first view candles - PrimalFury - 09-23-2018 (09-23-2018, 07:55 PM)cubit Wrote: Just a guess but there are 14 zeros so I would say that relates to your RSIinterval of 14... it probably requires this many iterations to warm up! could be. But how do I prevent the strategy to buy in the first 14 candles ? it is 0, so the strategy says buy. RE: RSI = 0 first view candles - cubit - 09-23-2018 put something like (and RsiValue!=0) into your code! RE: RSI = 0 first view candles - cubit - 09-23-2018 Something like this! : if (RSIsaysBUY && RSI!=0) { this.advice('long') } RE: RSI = 0 first view candles - mark.sch - 09-24-2018 Add a history size to your tradingAdvisor config, like this: config.tradingAdvisor = { enabled: true, method: 'myStrat', candleSize: 60, historySize: 14 } This will force Gekko to call your strategy update function 14 times until it calls the check function for the first time, so all your indicator candle arrays are prepared and will give you valid results. At least this will work in the CLI version, not sure if it is already in the UI version - in the past it was not. |