Time Period refactored

This commit is contained in:
Luis Fernando Molina committed 2019-03-17 15:48:51 +01:00
1 parent 340365e0d5
commit 55ed967bd5
4 files changed
+86 -40

No files matched your search

+8 -8
View File
@@ -45,7 +45,7 @@
recordsArray,
conditionsArray,
simulationLogic,
outputPeriod,
timePeriod,
callback) {
try {
@@ -873,7 +873,7 @@
hitRatio = hits / roundtrips;
let miliSecondsPerDay = 24 * 60 * 60 * 1000;
days = periods * outputPeriod / miliSecondsPerDay;
days = periods * timePeriod / miliSecondsPerDay;
anualizedRateOfReturn = ROI / days * 365;
addRecord();
@@ -970,7 +970,7 @@
}
}
function buildLRC(dataFile) {
function buildLRC(dataFile, callBackFunction) {
if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] buildLRC -> Entering function."); }
@@ -1017,7 +1017,7 @@
}
}
function buildPercentageBandwidthMap(dataFile) {
function buildPercentageBandwidthMap(dataFile, callBackFunction) {
if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] buildPercentageBandwidthMap -> Entering function."); }
@@ -1056,7 +1056,7 @@
}
}
function buildBollingerBandsMap(dataFile) {
function buildBollingerBandsMap(dataFile, callBackFunction) {
if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] buildBollingerBandsMap -> Entering function."); }
@@ -1095,7 +1095,7 @@
}
}
function buildBollingerChannelsArray(dataFile) {
function buildBollingerChannelsArray(dataFile, callBackFunction) {
if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] buildBollingerChannelsArray -> Entering function."); }
@@ -1129,7 +1129,7 @@
}
}
function buildBollingerSubChannelsArray(dataFile) {
function buildBollingerSubChannelsArray(dataFile, callBackFunction) {
if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] buildBollingerSubChannelsArray -> Entering function."); }
@@ -1164,7 +1164,7 @@
}
}
function buildCandles(dataFile) {
function buildCandles(dataFile, callBackFunction) {
if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] buildCandles -> Entering function."); }
+14 -14
View File
@@ -18,7 +18,7 @@
};
let utilities = UTILITIES.newCloudUtilities(bot, logger);
let jasonStorage = BLOB_STORAGE.newBlobStorage(bot, logger);
let thisBotStorage = BLOB_STORAGE.newBlobStorage(bot, logger);
let dataDependencies;
@@ -35,7 +35,7 @@
dataDependencies = pDataDependencies;
jasonStorage.initialize(bot.devTeam, onStorageInizialized);
thisBotStorage.initialize(bot.devTeam, onStorageInizialized);
function onStorageInizialized(err) {
@@ -54,7 +54,7 @@
}
}
function start(dataFiles, outputPeriod, timePeriod, currentDate, callBackFunction) {
function start(dataFiles, timePeriod, outputPeriodLabel, currentDate, callBackFunction) {
try {
@@ -77,27 +77,27 @@
switch (i) {
case 0: {
commons.buildLRC(dataFile);
commons.buildLRC(dataFile, callBackFunction);
break;
}
case 1: {
commons.buildPercentageBandwidthMap(dataFile);
commons.buildPercentageBandwidthMap(dataFile, callBackFunction);
break;
}
case 2: {
commons.buildBollingerBandsMap(dataFile);
commons.buildBollingerBandsMap(dataFile, callBackFunction);
break;
}
case 3: {
commons.buildBollingerChannelsArray(dataFile);
commons.buildBollingerChannelsArray(dataFile, callBackFunction);
break;
}
case 4: {
commons.buildBollingerSubChannelsArray(dataFile);
commons.buildBollingerSubChannelsArray(dataFile, callBackFunction);
break;
}
case 5: {
commons.buildCandles(dataFile);
commons.buildCandles(dataFile, callBackFunction);
break;
}
}
@@ -107,7 +107,7 @@
recordsArray,
conditionsArray,
simulationLogic,
outputPeriod,
timePeriod,
writeRecordsFile)
function writeRecordsFile() {
@@ -167,9 +167,9 @@
let fileName = '' + market.assetA + '_' + market.assetB + '.json';
let filePathRoot = bot.devTeam + "/" + bot.codeName + "." + bot.version.major + "." + bot.version.minor + "/" + global.PLATFORM_CONFIG.codeName + "." + global.PLATFORM_CONFIG.version.major + "." + global.PLATFORM_CONFIG.version.minor + "/" + global.EXCHANGE_NAME + "/" + bot.dataSetVersion;
let filePath = filePathRoot + "/Output/" + SIMULATED_RECORDS_FOLDER_NAME + "/" + "Multi-Period-Market" + "/" + timePeriod;
let filePath = filePathRoot + "/Output/" + SIMULATED_RECORDS_FOLDER_NAME + "/" + "Multi-Period-Daily" + "/" + outputPeriodLabel;
jasonStorage.createTextFile(filePath, fileName, fileContent + '\n', onFileCreated);
thisBotStorage.createTextFile(filePath, fileName, fileContent + '\n', onFileCreated);
function onFileCreated(err) {
@@ -246,9 +246,9 @@
let fileName = '' + market.assetA + '_' + market.assetB + '.json';
let filePathRoot = bot.devTeam + "/" + bot.codeName + "." + bot.version.major + "." + bot.version.minor + "/" + global.PLATFORM_CONFIG.codeName + "." + global.PLATFORM_CONFIG.version.major + "." + global.PLATFORM_CONFIG.version.minor + "/" + global.EXCHANGE_NAME + "/" + bot.dataSetVersion;
let filePath = filePathRoot + "/Output/" + CONDITIONS_FOLDER_NAME + "/" + "Multi-Period-Market" + "/" + timePeriod;
let filePath = filePathRoot + "/Output/" + CONDITIONS_FOLDER_NAME + "/" + "Multi-Period-Daily" + "/" + outputPeriodLabel;
jasonStorage.createTextFile(filePath, fileName, fileContent + '\n', onFileCreated);
thisBotStorage.createTextFile(filePath, fileName, fileContent + '\n', onFileCreated);
function onFileCreated(err) {
+14 -14
View File
@@ -18,7 +18,7 @@
};
let utilities = UTILITIES.newCloudUtilities(bot, logger);
let jasonStorage = BLOB_STORAGE.newBlobStorage(bot, logger);
let thisBotStorage = BLOB_STORAGE.newBlobStorage(bot, logger);
let dataDependencies;
@@ -35,7 +35,7 @@
dataDependencies = pDataDependencies;
jasonStorage.initialize(bot.devTeam, onStorageInizialized);
thisBotStorage.initialize(bot.devTeam, onStorageInizialized);
function onStorageInizialized(err) {
@@ -54,7 +54,7 @@
}
}
function start(dataFiles, outputPeriod, timePeriod, callBackFunction) {
function start(dataFiles, timePeriod, outputPeriodLabel, callBackFunction) {
try {
@@ -77,27 +77,27 @@
switch (i) {
case 0: {
commons.buildLRC(dataFile);
commons.buildLRC(dataFile, callBackFunction);
break;
}
case 1: {
commons.buildPercentageBandwidthMap(dataFile);
commons.buildPercentageBandwidthMap(dataFile, callBackFunction);
break;
}
case 2: {
commons.buildBollingerBandsMap(dataFile);
commons.buildBollingerBandsMap(dataFile, callBackFunction);
break;
}
case 3: {
commons.buildBollingerChannelsArray(dataFile);
commons.buildBollingerChannelsArray(dataFile, callBackFunction);
break;
}
case 4: {
commons.buildBollingerSubChannelsArray(dataFile);
commons.buildBollingerSubChannelsArray(dataFile, callBackFunction);
break;
}
case 5: {
commons.buildCandles(dataFile);
commons.buildCandles(dataFile, callBackFunction);
break;
}
}
@@ -107,7 +107,7 @@
recordsArray,
conditionsArray,
simulationLogic,
outputPeriod,
timePeriod,
writeRecordsFile)
function writeRecordsFile() {
@@ -163,9 +163,9 @@
let fileName = '' + market.assetA + '_' + market.assetB + '.json';
let filePathRoot = bot.devTeam + "/" + bot.codeName + "." + bot.version.major + "." + bot.version.minor + "/" + global.PLATFORM_CONFIG.codeName + "." + global.PLATFORM_CONFIG.version.major + "." + global.PLATFORM_CONFIG.version.minor + "/" + global.EXCHANGE_NAME + "/" + bot.dataSetVersion;
let filePath = filePathRoot + "/Output/" + SIMULATED_RECORDS_FOLDER_NAME + "/" + "Multi-Period-Market" + "/" + timePeriod;
let filePath = filePathRoot + "/Output/" + SIMULATED_RECORDS_FOLDER_NAME + "/" + "Multi-Period-Market" + "/" + outputPeriodLabel;
jasonStorage.createTextFile(filePath, fileName, fileContent + '\n', onFileCreated);
thisBotStorage.createTextFile(filePath, fileName, fileContent + '\n', onFileCreated);
function onFileCreated(err) {
@@ -238,9 +238,9 @@
let fileName = '' + market.assetA + '_' + market.assetB + '.json';
let filePathRoot = bot.devTeam + "/" + bot.codeName + "." + bot.version.major + "." + bot.version.minor + "/" + global.PLATFORM_CONFIG.codeName + "." + global.PLATFORM_CONFIG.version.major + "." + global.PLATFORM_CONFIG.version.minor + "/" + global.EXCHANGE_NAME + "/" + bot.dataSetVersion;
let filePath = filePathRoot + "/Output/" + CONDITIONS_FOLDER_NAME + "/" + "Multi-Period-Market" + "/" + timePeriod;
let filePath = filePathRoot + "/Output/" + CONDITIONS_FOLDER_NAME + "/" + "Multi-Period-Market" + "/" + outputPeriodLabel;
jasonStorage.createTextFile(filePath, fileName, fileContent + '\n', onFileCreated);
thisBotStorage.createTextFile(filePath, fileName, fileContent + '\n', onFileCreated);
function onFileCreated(err) {
+50 -4
View File
@@ -153,12 +153,12 @@
"major": 1,
"minor": 0
},
"process": "Poloniex-Historic-Records",
"process": "Poloniex-Historic-Trades",
"dataSetVersion": "dataSet.V1"
},
{
"devTeam": "AAMasters",
"bot": "AAChris",
"bot": "AAOlivia",
"botVersion": {
"major": 1,
"minor": 0
@@ -177,6 +177,8 @@
"dataSetVersion": "dataSet.V1"
}
],
"statusDependenciesIndexBegingOfMarket": 0,
"statusDependenciesIndexEndOfMarket": 1,
"dataDependencies": [
{
"devTeam": "AAVikings",
@@ -187,7 +189,51 @@
},
"product": "LRC-Points",
"dataSetVersion": "dataSet.V1",
"dataSet": "Multi-Period-Daily"
"dataSet": "Multi-Period-Market"
},
{
"devTeam": "AAMasters",
"bot": "AAChris",
"botVersion": {
"major": 1,
"minor": 0
},
"product": "Percentage-Bandwidth",
"dataSetVersion": "dataSet.V1",
"dataSet": "Multi-Period-Market"
},
{
"devTeam": "AAMasters",
"bot": "AAChris",
"botVersion": {
"major": 1,
"minor": 0
},
"product": "Bollinger-Bands",
"dataSetVersion": "dataSet.V1",
"dataSet": "Multi-Period-Market"
},
{
"devTeam": "AAMasters",
"bot": "AAPaula",
"botVersion": {
"major": 1,
"minor": 0
},
"product": "Bollinger-Channels",
"dataSetVersion": "dataSet.V1",
"dataSet": "Multi-Period-Market"
},
{
"devTeam": "AAMasters",
"bot": "AAPaula",
"botVersion": {
"major": 1,
"minor": 0
},
"product": "Bollinger-Sub-Channels",
"dataSetVersion": "dataSet.V1",
"dataSet": "Multi-Period-Market"
},
{
"devTeam": "AAMasters",
@@ -198,7 +244,7 @@
},
"product": "Candles",
"dataSetVersion": "dataSet.V1",
"dataSet": "Multi-Period-Daily"
"dataSet": "Multi-Period-Market"
}
],
"framework": "Multi-Period-Daily"