2 Bugs Fixed: formulas without values and stopRate undefined
This commit is contained in:
1 parent
8724ad9952
commit
85c9c74c3b
3 files changed
+22
-20
No files matched your search
+20
-20
@@ -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;
|
||||
|
||||
@@ -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 + "," +
|
||||
|
||||
@@ -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 + "," +
|
||||
|
||||
Reference in new issue
Block a user