Gekko-Strategies icon indicating copy to clipboard operation
Gekko-Strategies copied to clipboard

Bug found in candlestick

Open PGTBoos opened this issue 5 years ago • 0 comments

I noted the the lastTreeTrend never got updated, you forgot to use .closed for the last element so candles[8].close instead of candles[8], the same for candles[6]

So your fixed code would become (around line 76) :

if (candleLength < largestCandle.length * 0.25) {

  if (candles[6].close <= candles[7].close && candles[7].close <= candles[8].close) {
    lastThreeTrend = 'up';
  }
  if (candles[8].close <= candles[7].close && candles[7].close <= candles[6].close) {
    lastThreeTrend = 'down';
  }

Another bug or at least strange code detail that you might explain Why do you use the 6,7,8 and not the header candles (ea the last 3 new candles) ??

PGTBoos avatar Aug 30 '19 14:08 PGTBoos