From eb7da338118c0c00a136cf05a87c95286f1c2361 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Tue, 4 Jun 2019 21:48:11 +0200 Subject: [PATCH] Refactoring check for calculate --- Commons.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Commons.js b/Commons.js index 188a1d1d9..5ae6b1cac 100644 --- a/Commons.js +++ b/Commons.js @@ -550,7 +550,7 @@ exports.newCommons = function newCommons(bot, logger, UTILITIES) { if (strategyStage === 'Manage Stage') { checkStopPhases() - checkStopLoss(); + calculateStopLoss(); } @@ -583,7 +583,7 @@ exports.newCommons = function newCommons(bot, logger, UTILITIES) { } } - function checkStopLoss() { + function calculateStopLoss() { let strategy = tradingSystem.strategies[currentStrategyNumber - 1]; let phase = strategy.stopLoss.phases[stopLossPhase - 1]; @@ -607,7 +607,7 @@ exports.newCommons = function newCommons(bot, logger, UTILITIES) { if (strategyStage === 'Manage Stage') { checkTakeProfitPhases(); - checkTakeProfit(); + calculateTakeProfit(); } @@ -640,7 +640,7 @@ exports.newCommons = function newCommons(bot, logger, UTILITIES) { } } - function checkTakeProfit() { + function calculateTakeProfit() { let strategy = tradingSystem.strategies[currentStrategyNumber - 1]; let phase = strategy.takeProfit.phases[takeProfitPhase - 1]; @@ -669,8 +669,8 @@ exports.newCommons = function newCommons(bot, logger, UTILITIES) { stopLoss = positionRate + positionRate * 1 / 100; previousStopLoss = stopLoss; - checkStopLoss(); - checkTakeProfit(); + calculateStopLoss(); + calculateTakeProfit(); previousBalanceAssetA = balanceAssetA; lastProfit = 0;