diff --git a/Commons.js b/Commons.js index d0f98ae4b..ee498e8ab 100644 --- a/Commons.js +++ b/Commons.js @@ -502,12 +502,12 @@ exports.newCommons = function newCommons(bot, logger, UTILITIES) { if (formulaValue < MIN_STOP_LOSS_VALUE) { formulaValue = MIN_STOP_LOSS_VALUE } - } - formulasErrors.push('"' + formulaError + '"') - formulasValues.push( formulaValue) - let key = j + '-' + 'openStage' + '-' + 'initialDefinition' + '-' + 'stopLoss' + '-' + p; - formulas.set(key, formulaValue) + formulasErrors.push('"' + formulaError + '"') + formulasValues.push(formulaValue) + let key = j + '-' + 'openStage' + '-' + 'initialDefinition' + '-' + 'stopLoss' + '-' + p; + formulas.set(key, formulaValue) + } /* next phase event */ let nextPhaseEvent = phase.nextPhaseEvent; @@ -555,12 +555,12 @@ exports.newCommons = function newCommons(bot, logger, UTILITIES) { if (formulaValue < MIN_TAKE_PROFIT_VALUE) { formulaValue = MIN_TAKE_PROFIT_VALUE } - } - formulasErrors.push('"' + formulaError + '"') - formulasValues.push(formulaValue) - let key = j + '-' + 'openStage' + '-' + 'initialDefinition' + '-' + 'takeProfit' + '-' + p; - formulas.set(key, formulaValue) + formulasErrors.push('"' + formulaError + '"') + formulasValues.push(formulaValue) + let key = j + '-' + 'openStage' + '-' + 'initialDefinition' + '-' + 'takeProfit' + '-' + p; + formulas.set(key, formulaValue) + } /* next phase event */ let nextPhaseEvent = phase.nextPhaseEvent; @@ -614,12 +614,12 @@ exports.newCommons = function newCommons(bot, logger, UTILITIES) { if (formulaValue < MIN_STOP_LOSS_VALUE) { formulaValue = MIN_STOP_LOSS_VALUE } - } - formulasErrors.push('"' + formulaError + '"') - formulasValues.push(formulaValue) - let key = j + '-' + 'manageStage' + '-' + 'stopLoss' + '-' + p; - formulas.set(key, formulaValue) + formulasErrors.push('"' + formulaError + '"') + formulasValues.push(formulaValue) + let key = j + '-' + 'manageStage' + '-' + 'stopLoss' + '-' + p; + formulas.set(key, formulaValue) + } /* next phase event */ let nextPhaseEvent = phase.nextPhaseEvent; @@ -667,12 +667,12 @@ exports.newCommons = function newCommons(bot, logger, UTILITIES) { if (formulaValue < MIN_TAKE_PROFIT_VALUE) { formulaValue = MIN_TAKE_PROFIT_VALUE } - } - formulasErrors.push('"' + formulaError + '"') - formulasValues.push(formulaValue) - let key = j + '-' + 'manageStage' + '-' + 'takeProfit' + '-' + p; - formulas.set(key, formulaValue) + formulasErrors.push('"' + formulaError + '"') + formulasValues.push(formulaValue) + let key = j + '-' + 'manageStage' + '-' + 'takeProfit' + '-' + p; + formulas.set(key, formulaValue) + } /* next phase event */ let nextPhaseEvent = phase.nextPhaseEvent; diff --git a/Multi-Period-Daily/User.Bot.js b/Multi-Period-Daily/User.Bot.js index 7f2baca56..9bd5892a0 100644 --- a/Multi-Period-Daily/User.Bot.js +++ b/Multi-Period-Daily/User.Bot.js @@ -401,6 +401,7 @@ at the current date. */ if (record.end < currentDay.valueOf()) { continue; } + if (record.stopRate === undefined) { record.stopRate = 0} fileContent = fileContent + separator + '[' + record.begin + "," + diff --git a/Multi-Period-Market/User.Bot.js b/Multi-Period-Market/User.Bot.js index 52658e30e..8c976caed 100644 --- a/Multi-Period-Market/User.Bot.js +++ b/Multi-Period-Market/User.Bot.js @@ -374,6 +374,7 @@ for (let i = 0; i < tradesArray.length; i++) { let record = tradesArray[i]; + if (record.stopRate === undefined) { record.stopRate = 0 } fileContent = fileContent + separator + '[' + record.begin + "," +