From 318ccaa2068e69d7316bb15fef983b115ab9f9c7 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Thu, 17 Oct 2019 22:20:10 +0200 Subject: [PATCH] forced recalculation impleneted --- BollingerBands.js | 9 +++++++-- PercentageBandwidth.js | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/BollingerBands.js b/BollingerBands.js index 81e1158eb..211c7e0c6 100644 --- a/BollingerBands.js +++ b/BollingerBands.js @@ -642,12 +642,17 @@ } } - function onOffsetChanged() { + function onOffsetChanged(event) { try { + if (event !== undefined) { + if (event.recalculate === true) { + recalculate() + return + } + } if (Math.random() * 100 > 95) { - recalculate() }; diff --git a/PercentageBandwidth.js b/PercentageBandwidth.js index c2b694992..549417b11 100644 --- a/PercentageBandwidth.js +++ b/PercentageBandwidth.js @@ -883,12 +883,17 @@ } } - function onOffsetChanged() { + function onOffsetChanged(event) { try { + if (event !== undefined) { + if (event.recalculate === true) { + recalculate() + return + } + } if (Math.random() * 100 > 95) { - recalculate() };