latests objects cleaned
This commit is contained in:
1 parent
91ceec5f35
commit
ac720b1032
2 files changed
+5
-40
No files matched your search
+2
-35
@@ -60,7 +60,6 @@
|
||||
let conditionsArray = [];
|
||||
let strategiesArray = [];
|
||||
let tradesArray = [];
|
||||
let lastObjectsArray = [];
|
||||
|
||||
let tradingSystem = bot.DEFINITION.tradingSystem;
|
||||
|
||||
@@ -633,38 +632,7 @@
|
||||
controlLoop();
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
let lastObjects = {
|
||||
candle: clone(candle),
|
||||
//LRC: clone(LRC),
|
||||
bollingerBand: clone(bollingerBand),
|
||||
percentageBandwidth: clone(percentageBandwidth),
|
||||
bollingerChannel: clone(bollingerChannel),
|
||||
bollingerSubChannel: clone(bollingerSubChannel)
|
||||
}
|
||||
|
||||
function clone(obj) {
|
||||
if (null == obj || "object" != typeof obj) return obj;
|
||||
var copy = obj.constructor();
|
||||
for (var attr in obj) {
|
||||
if (obj.hasOwnProperty(attr)) copy[attr] = obj[attr];
|
||||
}
|
||||
return copy;
|
||||
}
|
||||
|
||||
lastObjects.candle.previous = undefined;
|
||||
//lastObjects.LRC.previous = undefined;
|
||||
lastObjects.bollingerBand.previous = undefined;
|
||||
lastObjects.percentageBandwidth.previous = undefined;
|
||||
lastObjects.bollingerChannel.previous = undefined;
|
||||
lastObjects.bollingerSubChannel.previous = undefined;
|
||||
|
||||
lastObjectsArray.push(lastObjects);
|
||||
|
||||
if (lastObjectsArray.length > 5) {
|
||||
lastObjectsArray.splice(0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
let conditions = new Map; // Here we store the conditions values that will be use in the simulator for decision making.
|
||||
let formulas = new Map;
|
||||
@@ -2789,10 +2757,9 @@
|
||||
|
||||
if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] runSimulation -> callback -> recordsArray.length = " + recordsArray.length); }
|
||||
|
||||
callback(tradingSystem, recordsArray, conditionsArray, strategiesArray, tradesArray, lastObjectsArray);
|
||||
callback(tradingSystem, recordsArray, conditionsArray, strategiesArray, tradesArray);
|
||||
}
|
||||
|
||||
|
||||
function getElement(pArray, currentCandle, datasetName) {
|
||||
|
||||
try {
|
||||
|
||||
@@ -66,7 +66,6 @@
|
||||
let conditionsArray
|
||||
let strategiesArray
|
||||
let tradesArray
|
||||
let lastObjectsArray
|
||||
|
||||
let tradingSystem = {};
|
||||
|
||||
@@ -155,14 +154,13 @@
|
||||
writeFiles,
|
||||
callBackFunction)
|
||||
|
||||
function writeFiles(pTradingSystem, pRecordsArray, pConditionsArray, pStrategiesArray, pTradesArray, pLastObjectsArray) {
|
||||
function writeFiles(pTradingSystem, pRecordsArray, pConditionsArray, pStrategiesArray, pTradesArray) {
|
||||
|
||||
tradingSystem = pTradingSystem
|
||||
recordsArray = pRecordsArray
|
||||
conditionsArray = pConditionsArray
|
||||
strategiesArray = pStrategiesArray
|
||||
tradesArray = pTradesArray
|
||||
lastObjectsArray = pLastObjectsArray
|
||||
|
||||
if (timePeriod > global.dailyFilePeriods[0][0]) {
|
||||
writeMarketFiles()
|
||||
@@ -318,7 +316,7 @@
|
||||
}
|
||||
|
||||
fileContent = "[" + fileContent + "]";
|
||||
fileContent = "[" + JSON.stringify(tradingSystem) + "," + JSON.stringify(lastObjectsArray) + "," + fileContent + "]";
|
||||
fileContent = "[" + JSON.stringify(tradingSystem) + "," + fileContent + "]";
|
||||
let fileName = '' + market.assetA + '_' + market.assetB + '.json';
|
||||
|
||||
let filePathRoot = bot.devTeam + "/" + bot.codeName + "." + bot.version.major + "." + bot.version.minor + "/" + global.CLONE_EXECUTOR.codeName + "." + global.CLONE_EXECUTOR.version + "/" + global.EXCHANGE_NAME + "/" + bot.dataSetVersion;
|
||||
@@ -780,7 +778,7 @@
|
||||
}
|
||||
|
||||
fileContent = "[" + fileContent + "]";
|
||||
fileContent = "[" + JSON.stringify(tradingSystem) + "," + JSON.stringify(lastObjectsArray) + "," + fileContent + "]";
|
||||
fileContent = "[" + JSON.stringify(tradingSystem) + "," + fileContent + "]";
|
||||
|
||||
let dateForPath = currentDay.getUTCFullYear() + '/' + utilities.pad(currentDay.getUTCMonth() + 1, 2) + '/' + utilities.pad(currentDay.getUTCDate(), 2);
|
||||
let fileName = '' + market.assetA + '_' + market.assetB + '.json';
|
||||
|
||||
Reference in new issue
Block a user