From 383069cdb690476caf4c0cbb94bc6ded6c326c05 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Fri, 31 Jan 2020 20:16:44 +0100 Subject: [PATCH] Cleaning --- Conditions.js | 35 ----------------------------------- SimulationExecution.js | 30 ------------------------------ Strategies.js | 31 ------------------------------- Trades.js | 31 ------------------------------- TradingSimulation.js | 30 ------------------------------ 5 files changed, 157 deletions(-) diff --git a/Conditions.js b/Conditions.js index 01ae2ca3a..c95c14967 100644 --- a/Conditions.js +++ b/Conditions.js @@ -18,7 +18,6 @@ setTimeFrame: setTimeFrame, setDatetime: setDatetime, draw: draw, - recalculateScale: recalculateScale, /* Events declared outside the plotter. */ @@ -111,8 +110,6 @@ marketFile = marketFiles.getFile(ONE_DAY_IN_MILISECONDS); // This file is the one processed faster. - recalculateScale(); - /* Now we set the right files according to current Period. */ marketFile = marketFiles.getFile(pTimeFrame); @@ -133,7 +130,6 @@ /* Ready for when dimmension changes. */ dimmensionsChangedEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('Dimmensions Changed', function () { - recalculateScale() recalculate(); }) @@ -444,37 +440,6 @@ } } - function recalculateScale() { - - try { - - - if (coordinateSystem.maxValue > 0) { return; } // Already calculated. - - let minValue = { - x: MIN_PLOTABLE_DATE.valueOf(), - y: 0 - }; - - let maxValue = { - x: MAX_PLOTABLE_DATE.valueOf(), - y: nextPorwerOf10(MAX_DEFAULT_RATE_SCALE_VALUE) / 4 // TODO: This 4 is temporary - }; - - - coordinateSystem.initialize( - minValue, - maxValue, - thisObject.container.frame.width, - thisObject.container.frame.height - ); - - } catch (err) { - - if (ERROR_LOG === true) { logger.write("[ERROR] recalculateScale -> err = " + err.stack); } - } - } - function plotChart() { try { diff --git a/SimulationExecution.js b/SimulationExecution.js index 9f56b4c69..2164905d7 100644 --- a/SimulationExecution.js +++ b/SimulationExecution.js @@ -18,7 +18,6 @@ setTimeFrame: setTimeFrame, setDatetime: setDatetime, setCoordinateSystem: setCoordinateSystem, - recalculateScale: recalculateScale, draw: draw }; @@ -336,35 +335,6 @@ } } - function recalculateScale() { - - try { - - if (fileSequence === undefined) { return; } // We need the market file to be loaded to make the calculation. - if (coordinateSystem.maxValue > 0) { return; } // Already calculated. - - let minValue = { - x: MIN_PLOTABLE_DATE.valueOf(), - y: 0 - }; - - let maxValue = { - x: MAX_PLOTABLE_DATE.valueOf(), - y: nextPorwerOf10(MAX_DEFAULT_RATE_SCALE_VALUE) / 4 // TODO: This 4 is temporary - }; - - coordinateSystem.initialize( - minValue, - maxValue, - thisObject.container.frame.width, - thisObject.container.frame.height - ); - - } catch (err) { - if (ERROR_LOG === true) { logger.write("[ERROR] ' + MODULE_NAME + ' -> recalculateScale -> err = " + err.stack); } - } - } - function draw() { plotChart(); } diff --git a/Strategies.js b/Strategies.js index 272a663be..e28e54e06 100644 --- a/Strategies.js +++ b/Strategies.js @@ -20,7 +20,6 @@ setDatetime: setDatetime, setCoordinateSystem: setCoordinateSystem, draw: draw, - recalculateScale: recalculateScale, /* Events declared outside the plotter. */ @@ -480,36 +479,6 @@ } } - function recalculateScale() { - - try { - - if (coordinateSystem.maxValue > 0) { return; } // Already calculated. - - let minValue = { - x: MIN_PLOTABLE_DATE.valueOf(), - y: 0 - }; - - let maxValue = { - x: MAX_PLOTABLE_DATE.valueOf(), - y: nextPorwerOf10(MAX_DEFAULT_RATE_SCALE_VALUE) / 4 // TODO: This 4 is temporary - }; - - - coordinateSystem.initialize( - minValue, - maxValue, - thisObject.container.frame.width, - thisObject.container.frame.height - ); - - } catch (err) { - - if (ERROR_LOG === true) { logger.write("[ERROR] recalculateScale -> err = " + err.stack); } - } - } - function plotChart() { try { diff --git a/Trades.js b/Trades.js index db72ed397..f920f748e 100644 --- a/Trades.js +++ b/Trades.js @@ -20,7 +20,6 @@ setDatetime: setDatetime, setCoordinateSystem: setCoordinateSystem, draw: draw, - recalculateScale: recalculateScale, /* Events declared outside the plotter. */ @@ -461,36 +460,6 @@ } } - function recalculateScale() { - - try { - - if (coordinateSystem.maxValue > 0) { return; } // Already calculated. - - let minValue = { - x: MIN_PLOTABLE_DATE.valueOf(), - y: 0 - }; - - let maxValue = { - x: MAX_PLOTABLE_DATE.valueOf(), - y: nextPorwerOf10(MAX_DEFAULT_RATE_SCALE_VALUE) / 4 // TODO: This 4 is temporary - }; - - - coordinateSystem.initialize( - minValue, - maxValue, - thisObject.container.frame.width, - thisObject.container.frame.height - ); - - } catch (err) { - - if (ERROR_LOG === true) { logger.write("[ERROR] recalculateScale -> err = " + err.stack); } - } - } - function plotChart() { try { diff --git a/TradingSimulation.js b/TradingSimulation.js index 3bec2298f..21d966750 100644 --- a/TradingSimulation.js +++ b/TradingSimulation.js @@ -19,7 +19,6 @@ setDatetime: setDatetime, setCoordinateSystem: setCoordinateSystem, draw: draw, - recalculateScale: recalculateScale, /* Events declared outside the plotter. */ @@ -503,35 +502,6 @@ } } - function recalculateScale() { - - try { - - if (coordinateSystem.maxValue > 0) { return; } // Already calculated. - - let minValue = { - x: MIN_PLOTABLE_DATE.valueOf(), - y: 0 - }; - - let maxValue = { - x: MAX_PLOTABLE_DATE.valueOf(), - y: nextPorwerOf10(MAX_DEFAULT_RATE_SCALE_VALUE) / 4 // TODO: This 4 is temporary - }; - - coordinateSystem.initialize( - minValue, - maxValue, - thisObject.container.frame.width, - thisObject.container.frame.height - ); - - } catch (err) { - - if (ERROR_LOG === true) { logger.write("[ERROR] recalculateScale -> err = " + err.stack); } - } - } - function plotChart() { try {