File storage dependency

This commit is contained in:
Matias committed 2019-06-22 19:29:34 -03:00
1 parent a4dbcfd25c
commit 11ad478ee5
2 files changed
+14 -20

No files matched your search

+7 -10
View File
@@ -1,4 +1,4 @@
exports.newUserBot = function newUserBot(bot, logger, COMMONS, UTILITIES) {
exports.newUserBot = function newUserBot(bot, logger, COMMONS, UTILITIES, fileStorage) {
const FULL_LOG = true;
const LOG_FILE_CONTENT = false;
@@ -19,9 +19,6 @@
let utilities = UTILITIES.newCloudUtilities(bot, logger);
const FILE_STORAGE = require('./Integrations/FileStorage.js');
let botStorage = FILE_STORAGE.newFileStorage();
let dataDependencies;
return thisObject;
@@ -113,7 +110,7 @@
function writeFiles(pTradingSystem) {
tradingSystem = pTradingSystem
writeRecordsFile()
writeRecordsFile()
}
function writeRecordsFile() {
@@ -168,7 +165,7 @@
record.maximunBalanceA + "," +
record.initialBalanceB + "," +
record.minimunBalanceB + "," +
record.maximunBalanceB + "]";
record.maximunBalanceB + "]";
if (separator === "") { separator = ","; }
@@ -185,7 +182,7 @@
let filePath = filePathRoot + "/Output/" + SIMULATED_RECORDS_FOLDER_NAME + "/" + "Multi-Period-Daily" + "/" + outputPeriodLabel + "/" + dateForPath;
filePath += '/' + fileName
botStorage.createTextFile(bot.devTeam, filePath, fileContent + '\n', onFileCreated);
fileStorage.createTextFile(bot.devTeam, filePath, fileContent + '\n', onFileCreated);
function onFileCreated(err) {
@@ -273,7 +270,7 @@
let filePath = filePathRoot + "/Output/" + CONDITIONS_FOLDER_NAME + "/" + "Multi-Period-Daily" + "/" + outputPeriodLabel + "/" + dateForPath;
filePath += '/' + fileName
botStorage.createTextFile(bot.devTeam, filePath, fileContent + '\n', onFileCreated);
fileStorage.createTextFile(bot.devTeam, filePath, fileContent + '\n', onFileCreated);
function onFileCreated(err) {
@@ -350,7 +347,7 @@
let filePath = filePathRoot + "/Output/" + STRATEGIES_FOLDER_NAME + "/" + "Multi-Period-Daily" + "/" + outputPeriodLabel + "/" + dateForPath;
filePath += '/' + fileName
botStorage.createTextFile(bot.devTeam, filePath, fileContent + '\n', onFileCreated);
fileStorage.createTextFile(bot.devTeam, filePath, fileContent + '\n', onFileCreated);
function onFileCreated(err) {
@@ -430,7 +427,7 @@
let filePath = filePathRoot + "/Output/" + TRADES_FOLDER_NAME + "/" + "Multi-Period-Daily" + "/" + outputPeriodLabel + "/" + dateForPath;
filePath += '/' + fileName
botStorage.createTextFile(bot.devTeam, filePath, fileContent + '\n', onFileCreated);
fileStorage.createTextFile(bot.devTeam, filePath, fileContent + '\n', onFileCreated);
function onFileCreated(err) {
+7 -10
View File
@@ -1,4 +1,4 @@
exports.newUserBot = function newUserBot(bot, logger, COMMONS, UTILITIES) {
exports.newUserBot = function newUserBot(bot, logger, COMMONS, UTILITIES, fileStorage) {
const FULL_LOG = true;
const LOG_FILE_CONTENT = false;
@@ -17,9 +17,6 @@
start: start
};
const FILE_STORAGE = require('./Integrations/FileStorage.js');
let botStorage = FILE_STORAGE.newFileStorage();
let dataDependencies;
return thisObject;
@@ -164,8 +161,8 @@
record.maximunBalanceA + "," +
record.initialBalanceB + "," +
record.minimunBalanceB + "," +
record.maximunBalanceB + "]";
record.maximunBalanceB + "]";
if (separator === "") { separator = ","; }
fileRecordCounter++;
@@ -180,7 +177,7 @@
let filePath = filePathRoot + "/Output/" + SIMULATED_RECORDS_FOLDER_NAME + "/" + "Multi-Period-Market" + "/" + outputPeriodLabel;
filePath += '/' + fileName
botStorage.createTextFile(bot.devTeam, filePath, fileContent + '\n', onFileCreated);
fileStorage.createTextFile(bot.devTeam, filePath, fileContent + '\n', onFileCreated);
function onFileCreated(err) {
@@ -258,7 +255,7 @@
let filePath = filePathRoot + "/Output/" + CONDITIONS_FOLDER_NAME + "/" + "Multi-Period-Market" + "/" + outputPeriodLabel;
filePath += '/' + fileName
botStorage.createTextFile(bot.devTeam, filePath, fileContent + '\n', onFileCreated);
fileStorage.createTextFile(bot.devTeam, filePath, fileContent + '\n', onFileCreated);
function onFileCreated(err) {
@@ -328,7 +325,7 @@
let filePath = filePathRoot + "/Output/" + STRATEGIES_FOLDER_NAME + "/" + "Multi-Period-Market" + "/" + outputPeriodLabel;
filePath += '/' + fileName
botStorage.createTextFile(bot.devTeam, filePath, fileContent + '\n', onFileCreated);
fileStorage.createTextFile(bot.devTeam, filePath, fileContent + '\n', onFileCreated);
function onFileCreated(err) {
@@ -401,7 +398,7 @@
let filePath = filePathRoot + "/Output/" + TRADES_FOLDER_NAME + "/" + "Multi-Period-Market" + "/" + outputPeriodLabel;
filePath += '/' + fileName
botStorage.createTextFile(bot.devTeam, filePath, fileContent + '\n', onFileCreated);
fileStorage.createTextFile(bot.devTeam, filePath, fileContent + '\n', onFileCreated);
function onFileCreated(err) {