From a20fae746213a005b4a44b6550b98a05dfafe666 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 8 Jun 2019 11:39:30 +0200 Subject: [PATCH] Bug fix with infitiy handling --- Commons.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Commons.js b/Commons.js index cc1368172..0bf7c6e8e 100644 --- a/Commons.js +++ b/Commons.js @@ -951,7 +951,8 @@ exports.newCommons = function newCommons(bot, logger, UTILITIES) { stopLoss = phase.formula.value if (stopLoss === Infinity) { phase.formula.error = "Formula evaluates to Infinity." - takeProfit = MAX_STOP_LOSS_VALUE + stopLoss = MAX_STOP_LOSS_VALUE + phase.formula.value = stopLoss } } catch (err) { phase.formula.error = err.message @@ -1064,7 +1065,8 @@ exports.newCommons = function newCommons(bot, logger, UTILITIES) { takeProfit = phase.formula.value if (takeProfit === Infinity) { phase.formula.error = "Formula evaluates to Infinity." - takeProfit = MAX_TAKE_PROFIT_VALUE + takeProfit = MAX_TAKE_PROFIT_VALUE + phase.formula.value = takeProfit } } catch (err) { phase.formula.error = err.message