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() };