diff --git a/LowFrequencyTrading/TradingRecords.js b/LowFrequencyTrading/TradingRecords.js index af897c42a..8865f092c 100644 --- a/LowFrequencyTrading/TradingRecords.js +++ b/LowFrequencyTrading/TradingRecords.js @@ -114,7 +114,7 @@ exports.newTradingRecords = function newTradingRecords(bot, logger) { value = '"' + value + '"' } if (recordProperty.config.decimals !== undefined) { - value = value.toFixed(decimals) + value = Number(value.toFixed(recordProperty.config.decimals)) } record.push(value) } diff --git a/LowFrequencyTrading/TradingSimulation.js b/LowFrequencyTrading/TradingSimulation.js index 36f92621e..f6aee62d9 100644 --- a/LowFrequencyTrading/TradingSimulation.js +++ b/LowFrequencyTrading/TradingSimulation.js @@ -151,9 +151,10 @@ exports.newTradingSimulation = function newTradingSimulation(bot, logger, UTILIT heartBeat() positionChartAtCurrentCandle() + tradingSystemModule.setChart(chart) tradingEngineModule.updateEpisodeCountersAndStatistics() - tradingSystemModule.setChart(chart) + tradingSystemModule.evalConditions() tradingSystemModule.evalFormulas() tradingSystemModule.checkTriggerOn() diff --git a/LowFrequencyTrading/TradingSystem.js b/LowFrequencyTrading/TradingSystem.js index 558683b3b..cf066bc8f 100644 --- a/LowFrequencyTrading/TradingSystem.js +++ b/LowFrequencyTrading/TradingSystem.js @@ -100,7 +100,7 @@ exports.newTradingSystem = function newTradingSystem(bot, logger) { case 'node': { if (property.name !== previousPropertyName) { if (node[property.name] !== undefined) { - evalNode(node[property.name]) + evalNode(node[property.name], evaluating) } previousPropertyName = property.name } @@ -109,9 +109,8 @@ exports.newTradingSystem = function newTradingSystem(bot, logger) { case 'array': { if (node[property.name] !== undefined) { let nodePropertyArray = node[property.name] - object[property.name] = [] for (let m = 0; m < nodePropertyArray.length; m++) { - evalNode(nodePropertyArray[m]) + evalNode(nodePropertyArray[m], evaluating) } } break @@ -191,9 +190,9 @@ exports.newTradingSystem = function newTradingSystem(bot, logger) { formulas.set(node.id, value) if (value === true) { - formulaValues.push(1) + tradingSystem.formulasValues.push(1) } else { - formulaValues.push(0) + tradingSystem.formulasValues.push(0) } tradingSystem.formulasErrors.push(error)