diff --git a/.vs/AAOlivia-Plotter/v15/.suo b/.vs/AAOlivia-Plotter/v15/.suo index ae48bd12e..e617a6143 100644 Binary files a/.vs/AAOlivia-Plotter/v15/.suo and b/.vs/AAOlivia-Plotter/v15/.suo differ diff --git a/Candlestick.js b/Candlestick.js index 3c93dc9f0..203270f37 100644 --- a/Candlestick.js +++ b/Candlestick.js @@ -344,11 +344,8 @@ let daysOnSides = getSideDays(timePeriod); - let leftDate; - let rightDate; - - leftDate = getDateFromPoint(viewPort.visibleArea.topLeft, candlesticks.container, plotArea); - rightDate = getDateFromPoint(viewPort.visibleArea.topRight, candlesticks.container, plotArea); + let leftDate = getDateFromPoint(viewPort.visibleArea.topLeft, candlesticks.container, plotArea); + let rightDate = getDateFromPoint(viewPort.visibleArea.topRight, candlesticks.container, plotArea); leftDate.setDate(leftDate.getDate() - daysOnSides); rightDate.setDate(rightDate.getDate() + daysOnSides); @@ -404,7 +401,10 @@ function recalculateCandlesUsingMarketFiles() { - if (marketFile === undefined) { return;} // Initialization not complete yet. + if (marketFile === undefined) { return; } // Initialization not complete yet. + + let leftDate = getDateFromPoint(viewPort.visibleArea.topLeft, candlesticks.container, plotArea); + let rightDate = getDateFromPoint(viewPort.visibleArea.topRight, candlesticks.container, plotArea); candles = []; @@ -425,7 +425,11 @@ if (candle.open < candle.close) { candle.direction = 'up'; } if (candle.open === candle.close) { candle.direction = 'side'; } - candles.push(candle); + if (candle.begin >= leftDate.valueOf() && candle.end <= rightDate.valueOf()) { + + candles.push(candle); + + } } console.log("Olivia > recalculateCandlesUsingMarketFiles > total candles generated : " + candles.length);