diff --git a/.vs/AAOlivia-Plotter/v15/.suo b/.vs/AAOlivia-Plotter/v15/.suo index 762c3ed89..299a4f30b 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 43fc62ae6..a1dcadf67 100644 --- a/Candlestick.js +++ b/Candlestick.js @@ -43,9 +43,6 @@ fileCache = newFileCache(); fileCache.initialize("AAMasters", "AAOlivia", "Market Candles", "Market Candlesticks", pExchange, pMarket, onFileReady); - fileCursorCache = newFileCursorCache(); - fileCursorCache.initialize("AAMasters", "AAOlivia", "Daily Candles", "Daily Candlesticks", pExchange, pMarket, pDatetime, onFileCursorReady); - function onFileReady() { let newMarketFile = fileCache.getFile(ONE_DAY_IN_MILISECONDS); @@ -54,19 +51,18 @@ marketFile = newMarketFile; - recalculateScale(); // With any of the market files we can calculate the scale. - - layerStatus = chartLayersPanel.getLayerStatus(chartLayersPanel.layerNames.OLIVIA_CANDLES); - - recalculateCandles(); - postitionViewPort(); - - viewPort.eventHandler.listenToEvent("Zoom Changed", onZoomChanged); - canvas.eventHandler.listenToEvent("Drag Finished", onDragFinished); + initializeFileCursorCache(); } } + function initializeFileCursorCache() { + + fileCursorCache = newFileCursorCache(); + fileCursorCache.initialize("AAMasters", "AAOlivia", "Daily Candles", "Daily Candlesticks", pExchange, pMarket, pDatetime, onFileCursorReady); + + } + function onFileCursorReady() { let newFileCursor = fileCursorCache.getFileCursor(pTimePeriod); @@ -80,6 +76,17 @@ if (dailyFile !== undefined) { fileCursor = newFileCursor; + + recalculateScale(); // With any of the market files we can calculate the scale. + + layerStatus = chartLayersPanel.getLayerStatus(chartLayersPanel.layerNames.OLIVIA_CANDLES); + + recalculateCandles(); + postitionViewPort(); + + viewPort.eventHandler.listenToEvent("Zoom Changed", onZoomChanged); + canvas.eventHandler.listenToEvent("Drag Finished", onDragFinished); + callBackFunction(); }