+
+
+
+
+
+
+ | LOGO |
+
+
+
+
+
+ | PROFILE |
+
+
+ |
+
+
+
+ | CONTENT TITLE |
+
+
+ |
+ |
+
+
+ |
+
+
+
+ | SEARCH |
+
+
+
+
+
+ | Who to follow |
+
+
+ |
+ |
+
+
+ | Show more |
+
+
+ |
+
+
+ |
+
+
+
>
-
- POST 1
+
+ Placeholder
+
+
+
+
+ | Profile Pic |
+
+
+
+ |
+
+ |
+
+
+ | Permissions |
+
+
+ | Tool Bar |
+
+
+ |
+
+
POST 2
@@ -60,87 +159,6 @@
-
-
-
-
-
- | LOGO |
-
-
-
-
-
- | PROFILE |
-
-
- |
-
-
-
- | CONTENT TITLE |
-
-
- |
- |
-
-
- |
-
-
- |
-
-
-
\ No newline at end of file
diff --git a/Projects/Foundations/SA/Utilities/FilesAndDirectories.js b/Projects/Foundations/SA/Utilities/FilesAndDirectories.js
index 2f7bc485b..4ebe10379 100644
--- a/Projects/Foundations/SA/Utilities/FilesAndDirectories.js
+++ b/Projects/Foundations/SA/Utilities/FilesAndDirectories.js
@@ -2,7 +2,9 @@ exports.newFoundationsUtilitiesFilesAndDirectories = function () {
let thisObject = {
getDirectories: getDirectories,
- getAllFilesInDirectoryAndSubdirectories: getAllFilesInDirectoryAndSubdirectories
+ getAllFilesInDirectoryAndSubdirectories: getAllFilesInDirectoryAndSubdirectories,
+ pathFromDate: pathFromDate,
+ mkDirByPathSync: mkDirByPathSync
}
return thisObject
@@ -51,4 +53,49 @@ exports.newFoundationsUtilitiesFilesAndDirectories = function () {
return files.reduce((a, f) => a.concat(f), []);
}
}
+
+ function pathFromDate(timestamp) {
+ let file = { date: new Date(timestamp) }
+ file.year = file.date.getUTCFullYear()
+ file.month = file.date.getUTCMonth() + 1
+ file.day = file.date.getUTCDate()
+ return file.year + '/' +
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(file.month, 2) + '/' +
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(file.day, 2)
+ }
+
+ /* Function to create folders of missing folders at any path. */
+ function mkDirByPathSync(targetDir, { isRelativeToScript = false } = {}) {
+ const path = require('path')
+
+ targetDir = targetDir.substring(0, targetDir.lastIndexOf('/') + 1);
+
+ const sep = '/';
+ const initDir = path.isAbsolute(targetDir) ? sep : '';
+ const baseDir = isRelativeToScript ? __dirname : '.';
+
+ return targetDir.split(sep).reduce((parentDir, childDir) => {
+ const curDir = path.resolve(baseDir, parentDir, childDir);
+ try {
+ const fs = require('fs')
+ fs.mkdirSync(curDir);
+ } catch (err) {
+ if (err.code === 'EEXIST') { // curDir already exists!
+ return curDir;
+ }
+
+ // To avoid `EISDIR` error on Mac and `EACCES`-->`ENOENT` and `EPERM` on Windows.
+ if (err.code === 'ENOENT') { // Throw the original parentDir error on curDir `ENOENT` failure.
+ throw new Error(`EACCES: permission denied, mkdir '${parentDir}'`);
+ }
+
+ const caughtErr = ['EACCES', 'EPERM', 'EISDIR'].indexOf(err.code) > -1;
+ if (!caughtErr || caughtErr && curDir === path.resolve(targetDir)) {
+ throw err; // Throw if it's just the last created dir.
+ }
+ }
+
+ return curDir;
+ }, initDir);
+ }
}
\ No newline at end of file
diff --git a/Projects/Foundations/SA/Utilities/MiscellaneousFunctions.js b/Projects/Foundations/SA/Utilities/MiscellaneousFunctions.js
index 27c00cff2..992619b39 100644
--- a/Projects/Foundations/SA/Utilities/MiscellaneousFunctions.js
+++ b/Projects/Foundations/SA/Utilities/MiscellaneousFunctions.js
@@ -1,7 +1,8 @@
exports.newFoundationsUtilitiesMiscellaneousFunctions = function () {
let thisObject = {
- genereteUniqueId: genereteUniqueId
+ genereteUniqueId: genereteUniqueId,
+ pad: pad
}
return thisObject
@@ -12,4 +13,9 @@ exports.newFoundationsUtilitiesMiscellaneousFunctions = function () {
return v.toString(16)
})
}
+
+ function pad(str, max) {
+ str = str.toString();
+ return str.length < max ? pad("0" + str, max) : str;
+ }
}
\ No newline at end of file
diff --git a/Projects/Foundations/TS/Bot-Modules/API-Data-Fetcher-Bot/FetchingProcess.js b/Projects/Foundations/TS/Bot-Modules/API-Data-Fetcher-Bot/FetchingProcess.js
index a928504a8..d45ca4cc6 100644
--- a/Projects/Foundations/TS/Bot-Modules/API-Data-Fetcher-Bot/FetchingProcess.js
+++ b/Projects/Foundations/TS/Bot-Modules/API-Data-Fetcher-Bot/FetchingProcess.js
@@ -922,8 +922,8 @@ exports.newFoundationsBotModulesFetchingProcess = function (processIndex) {
file.month = file.date.getUTCMonth() + 1
file.day = file.date.getUTCDate()
let dateForPath = file.year + '/' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(file.month, 2) + '/' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(file.day, 2)
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(file.month, 2) + '/' +
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(file.day, 2)
/* We will need to save this at the Status Report */
contextVariables.lastFile = file.date
diff --git a/Projects/Foundations/TS/Bot-Modules/Indicator-Bot/Bollinger-Bands/BollingerBandsMultiTimeFrameDaily.js b/Projects/Foundations/TS/Bot-Modules/Indicator-Bot/Bollinger-Bands/BollingerBandsMultiTimeFrameDaily.js
index 8bd814581..7fdba9a41 100644
--- a/Projects/Foundations/TS/Bot-Modules/Indicator-Bot/Bollinger-Bands/BollingerBandsMultiTimeFrameDaily.js
+++ b/Projects/Foundations/TS/Bot-Modules/Indicator-Bot/Bollinger-Bands/BollingerBandsMultiTimeFrameDaily.js
@@ -270,8 +270,8 @@
/* Telling the world we are alive and doing well */
let currentDateString =
processDate.getUTCFullYear() + '-' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(processDate.getUTCMonth() + 1, 2) + '-' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(processDate.getUTCDate(), 2);
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(processDate.getUTCMonth() + 1, 2) + '-' +
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(processDate.getUTCDate(), 2);
let currentDate = new Date(processDate)
let percentage = TS.projects.foundations.utilities.dateTimeFunctions.getPercentage(fromDate, currentDate, lastDate)
TS.projects.foundations.functionLibraries.processFunctions.processHeartBeat(processIndex, currentDateString, percentage)
@@ -322,8 +322,8 @@
try {
let dateForPath =
previousDay.getUTCFullYear() + '/' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(previousDay.getUTCMonth() + 1, 2) + '/' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(previousDay.getUTCDate(), 2);
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(previousDay.getUTCMonth() + 1, 2) + '/' +
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(previousDay.getUTCDate(), 2);
let fileName = "Data.json"
let filePathRoot =
'Project/' +
@@ -368,8 +368,8 @@
try {
let dateForPath =
processDate.getUTCFullYear() + '/' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(processDate.getUTCMonth() + 1, 2) + '/' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(processDate.getUTCDate(), 2);
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(processDate.getUTCMonth() + 1, 2) + '/' +
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(processDate.getUTCDate(), 2);
let fileName = "Data.json"
let filePathRoot =
'Project/' +
@@ -584,8 +584,8 @@
let dateForPath =
processDate.getUTCFullYear() + '/' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(processDate.getUTCMonth() + 1, 2) + '/' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(processDate.getUTCDate(), 2);
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(processDate.getUTCMonth() + 1, 2) + '/' +
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(processDate.getUTCDate(), 2);
let fileName = 'Data.json';
let filePath =
TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).FILE_PATH_ROOT +
@@ -654,8 +654,8 @@
let dateForPath =
processDate.getUTCFullYear() + '/' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(processDate.getUTCMonth() + 1, 2) + '/' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(processDate.getUTCDate(), 2);
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(processDate.getUTCMonth() + 1, 2) + '/' +
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(processDate.getUTCDate(), 2);
let fileName = 'Data.json';
let filePath =
TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).FILE_PATH_ROOT +
diff --git a/Projects/Foundations/TS/Bot-Modules/Indicator-Bot/Bollinger-Bands/BollingerBandsMultiTimeFrameMarket.js b/Projects/Foundations/TS/Bot-Modules/Indicator-Bot/Bollinger-Bands/BollingerBandsMultiTimeFrameMarket.js
index a5f2add12..77415d46e 100644
--- a/Projects/Foundations/TS/Bot-Modules/Indicator-Bot/Bollinger-Bands/BollingerBandsMultiTimeFrameMarket.js
+++ b/Projects/Foundations/TS/Bot-Modules/Indicator-Bot/Bollinger-Bands/BollingerBandsMultiTimeFrameMarket.js
@@ -406,7 +406,7 @@
}
/* Telling the world we are alive and doing well */
- let currentDateString = TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_DATETIME.getUTCFullYear() + '-' + TS.projects.foundations.utilities.miscellaneousFunctions.pad(TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_DATETIME.getUTCMonth() + 1, 2) + '-' + TS.projects.foundations.utilities.miscellaneousFunctions.pad(TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_DATETIME.getUTCDate(), 2);
+ let currentDateString = TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_DATETIME.getUTCFullYear() + '-' + SA.projects.foundations.utilities.miscellaneousFunctions.pad(TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_DATETIME.getUTCMonth() + 1, 2) + '-' + SA.projects.foundations.utilities.miscellaneousFunctions.pad(TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_DATETIME.getUTCDate(), 2);
let currentDate = new Date(TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_DATETIME)
TS.projects.foundations.functionLibraries.processFunctions.processHeartBeat(
processIndex,
diff --git a/Projects/Foundations/TS/Bot-Modules/Indicator-Bot/Candles-Volumes/CandlesVolumesMultiTimeFrameDaily.js b/Projects/Foundations/TS/Bot-Modules/Indicator-Bot/Candles-Volumes/CandlesVolumesMultiTimeFrameDaily.js
index cb7d5f138..83cf08131 100644
--- a/Projects/Foundations/TS/Bot-Modules/Indicator-Bot/Candles-Volumes/CandlesVolumesMultiTimeFrameDaily.js
+++ b/Projects/Foundations/TS/Bot-Modules/Indicator-Bot/Candles-Volumes/CandlesVolumesMultiTimeFrameDaily.js
@@ -232,8 +232,8 @@
/* Telling the world we are alive and doing well */
let currentDateString =
contextVariables.datetimeLastProducedFile.getUTCFullYear() + '-' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(contextVariables.datetimeLastProducedFile.getUTCMonth() + 1, 2) + '-' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(contextVariables.datetimeLastProducedFile.getUTCDate(), 2)
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(contextVariables.datetimeLastProducedFile.getUTCMonth() + 1, 2) + '-' +
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(contextVariables.datetimeLastProducedFile.getUTCDate(), 2)
let currentDate = new Date(contextVariables.datetimeLastProducedFile)
let percentage = TS.projects.foundations.utilities.dateTimeFunctions.getPercentage(fromDate, currentDate, lastDate)
TS.projects.foundations.functionLibraries.processFunctions.processHeartBeat(processIndex, currentDateString, percentage)
@@ -272,8 +272,8 @@
function nextCandleFile() {
let dateForPath =
contextVariables.datetimeLastProducedFile.getUTCFullYear() + '/' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(contextVariables.datetimeLastProducedFile.getUTCMonth() + 1, 2) + '/' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(contextVariables.datetimeLastProducedFile.getUTCDate(), 2)
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(contextVariables.datetimeLastProducedFile.getUTCMonth() + 1, 2) + '/' +
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(contextVariables.datetimeLastProducedFile.getUTCDate(), 2)
let fileName = "Data.json"
let filePathRoot =
@@ -396,7 +396,7 @@
function nextVolumeFile() {
try {
- let dateForPath = contextVariables.datetimeLastProducedFile.getUTCFullYear() + '/' + TS.projects.foundations.utilities.miscellaneousFunctions.pad(contextVariables.datetimeLastProducedFile.getUTCMonth() + 1, 2) + '/' + TS.projects.foundations.utilities.miscellaneousFunctions.pad(contextVariables.datetimeLastProducedFile.getUTCDate(), 2);
+ let dateForPath = contextVariables.datetimeLastProducedFile.getUTCFullYear() + '/' + SA.projects.foundations.utilities.miscellaneousFunctions.pad(contextVariables.datetimeLastProducedFile.getUTCMonth() + 1, 2) + '/' + SA.projects.foundations.utilities.miscellaneousFunctions.pad(contextVariables.datetimeLastProducedFile.getUTCDate(), 2);
let fileName = "Data.json"
let filePathRoot =
'Project/' +
@@ -540,8 +540,8 @@
let fileName = 'Data.json';
let dateForPath =
contextVariables.datetimeLastProducedFile.getUTCFullYear() + '/' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(contextVariables.datetimeLastProducedFile.getUTCMonth() + 1, 2) + '/' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(contextVariables.datetimeLastProducedFile.getUTCDate(), 2)
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(contextVariables.datetimeLastProducedFile.getUTCMonth() + 1, 2) + '/' +
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(contextVariables.datetimeLastProducedFile.getUTCDate(), 2)
let filePath =
TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).FILE_PATH_ROOT +
"/Output/" +
@@ -588,8 +588,8 @@
let fileName = 'Data.json';
let dateForPath =
contextVariables.datetimeLastProducedFile.getUTCFullYear() + '/' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(contextVariables.datetimeLastProducedFile.getUTCMonth() + 1, 2) + '/' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(contextVariables.datetimeLastProducedFile.getUTCDate(), 2)
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(contextVariables.datetimeLastProducedFile.getUTCMonth() + 1, 2) + '/' +
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(contextVariables.datetimeLastProducedFile.getUTCDate(), 2)
let filePath =
TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).FILE_PATH_ROOT +
"/Output/" +
diff --git a/Projects/Foundations/TS/Bot-Modules/Indicator-Bot/Candles-Volumes/CandlesVolumesMultiTimeFrameMarket.js b/Projects/Foundations/TS/Bot-Modules/Indicator-Bot/Candles-Volumes/CandlesVolumesMultiTimeFrameMarket.js
index 1449400ed..0ca8fa025 100644
--- a/Projects/Foundations/TS/Bot-Modules/Indicator-Bot/Candles-Volumes/CandlesVolumesMultiTimeFrameMarket.js
+++ b/Projects/Foundations/TS/Bot-Modules/Indicator-Bot/Candles-Volumes/CandlesVolumesMultiTimeFrameMarket.js
@@ -412,8 +412,8 @@
/* Telling the world we are alive and doing well */
let currentDateString =
contextVariables.datetimeLastProducedFile.getUTCFullYear() + '-' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(contextVariables.datetimeLastProducedFile.getUTCMonth() + 1, 2) + '-' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(contextVariables.datetimeLastProducedFile.getUTCDate(), 2);
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(contextVariables.datetimeLastProducedFile.getUTCMonth() + 1, 2) + '-' +
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(contextVariables.datetimeLastProducedFile.getUTCDate(), 2);
let currentDate = new Date(contextVariables.datetimeLastProducedFile)
let percentage = TS.projects.foundations.utilities.dateTimeFunctions.getPercentage(fromDate, currentDate, lastDate)
TS.projects.foundations.functionLibraries.processFunctions.processHeartBeat(processIndex, currentDateString, percentage)
@@ -509,7 +509,7 @@
nextCandleFile();
function nextCandleFile() {
- let dateForPath = contextVariables.datetimeLastProducedFile.getUTCFullYear() + '/' + TS.projects.foundations.utilities.miscellaneousFunctions.pad(contextVariables.datetimeLastProducedFile.getUTCMonth() + 1, 2) + '/' + TS.projects.foundations.utilities.miscellaneousFunctions.pad(contextVariables.datetimeLastProducedFile.getUTCDate(), 2);
+ let dateForPath = contextVariables.datetimeLastProducedFile.getUTCFullYear() + '/' + SA.projects.foundations.utilities.miscellaneousFunctions.pad(contextVariables.datetimeLastProducedFile.getUTCMonth() + 1, 2) + '/' + SA.projects.foundations.utilities.miscellaneousFunctions.pad(contextVariables.datetimeLastProducedFile.getUTCDate(), 2);
let fileName = "Data.json"
let filePathRoot =
@@ -635,8 +635,8 @@
let dateForPath =
contextVariables.datetimeLastProducedFile.getUTCFullYear() + '/' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(contextVariables.datetimeLastProducedFile.getUTCMonth() + 1, 2) + '/' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(contextVariables.datetimeLastProducedFile.getUTCDate(), 2);
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(contextVariables.datetimeLastProducedFile.getUTCMonth() + 1, 2) + '/' +
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(contextVariables.datetimeLastProducedFile.getUTCDate(), 2);
let fileName = "Data.json"
let filePathRoot =
diff --git a/Projects/Foundations/TS/Bot-Modules/Indicator-Bot/FromOneMinToMultiTimeFrameDaily.js b/Projects/Foundations/TS/Bot-Modules/Indicator-Bot/FromOneMinToMultiTimeFrameDaily.js
index c0bd82e22..93c384207 100644
--- a/Projects/Foundations/TS/Bot-Modules/Indicator-Bot/FromOneMinToMultiTimeFrameDaily.js
+++ b/Projects/Foundations/TS/Bot-Modules/Indicator-Bot/FromOneMinToMultiTimeFrameDaily.js
@@ -160,8 +160,8 @@ exports.newFoundationsBotModulesFromOneMinToMultiTimeFrameDaily = function (proc
file.month = file.date.getUTCMonth() + 1
file.day = file.date.getUTCDate()
let dateForPath = file.year + '/' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(file.month, 2) + '/' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(file.day, 2)
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(file.month, 2) + '/' +
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(file.day, 2)
let fileName = 'Data.json'
let filePath = TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).FILE_PATH_ROOT +
diff --git a/Projects/Foundations/TS/Bot-Modules/Indicator-Bot/MultiTimeFrameDaily.js b/Projects/Foundations/TS/Bot-Modules/Indicator-Bot/MultiTimeFrameDaily.js
index de57bc8ba..681896424 100644
--- a/Projects/Foundations/TS/Bot-Modules/Indicator-Bot/MultiTimeFrameDaily.js
+++ b/Projects/Foundations/TS/Bot-Modules/Indicator-Bot/MultiTimeFrameDaily.js
@@ -275,8 +275,8 @@
/* Telling the world we are alive and doing well */
let currentDateString = TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).DAILY_FILES_PROCESS_DATETIME.getUTCFullYear() + '-' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).DAILY_FILES_PROCESS_DATETIME.getUTCMonth() + 1, 2) + '-' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).DAILY_FILES_PROCESS_DATETIME.getUTCDate(), 2)
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).DAILY_FILES_PROCESS_DATETIME.getUTCMonth() + 1, 2) + '-' +
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).DAILY_FILES_PROCESS_DATETIME.getUTCDate(), 2)
let currentDate = new Date(TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).DAILY_FILES_PROCESS_DATETIME)
let percentage = TS.projects.foundations.utilities.dateTimeFunctions.getPercentage(fromDate, currentDate, lastDate)
TS.projects.foundations.functionLibraries.processFunctions.processHeartBeat(processIndex, currentDateString, percentage)
@@ -360,8 +360,8 @@
function getPreviousFile() {
let dateForPath = previousDay.getUTCFullYear() + '/' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(previousDay.getUTCMonth() + 1, 2) + '/' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(previousDay.getUTCDate(), 2)
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(previousDay.getUTCMonth() + 1, 2) + '/' +
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(previousDay.getUTCDate(), 2)
let filePath
if (dependency.referenceParent.config.codeName === "Multi-Time-Frame-Daily") {
filePath = dependency.referenceParent.parentNode.config.codeName + '/' + dependency.referenceParent.config.codeName + "/" + timeFrameLabel + "/" + dateForPath;
@@ -412,8 +412,8 @@
function getCurrentFile() {
let dateForPath = TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).DAILY_FILES_PROCESS_DATETIME.getUTCFullYear() + '/' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).DAILY_FILES_PROCESS_DATETIME.getUTCMonth() + 1, 2) + '/' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).DAILY_FILES_PROCESS_DATETIME.getUTCDate(), 2)
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).DAILY_FILES_PROCESS_DATETIME.getUTCMonth() + 1, 2) + '/' +
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).DAILY_FILES_PROCESS_DATETIME.getUTCDate(), 2)
let filePath
if (dependency.referenceParent.config.codeName === "Multi-Time-Frame-Daily") {
filePath = dependency.referenceParent.parentNode.config.codeName + '/' + dependency.referenceParent.config.codeName + "/" + timeFrameLabel + "/" + dateForPath;
diff --git a/Projects/Foundations/TS/Bot-Modules/Indicator-Bot/MultiTimeFrameMarket.js b/Projects/Foundations/TS/Bot-Modules/Indicator-Bot/MultiTimeFrameMarket.js
index efe597995..739a7dc5d 100644
--- a/Projects/Foundations/TS/Bot-Modules/Indicator-Bot/MultiTimeFrameMarket.js
+++ b/Projects/Foundations/TS/Bot-Modules/Indicator-Bot/MultiTimeFrameMarket.js
@@ -224,7 +224,7 @@
}
/* Telling the world we are alive and doing well */
- let currentDateString = TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_DATETIME.getUTCFullYear() + '-' + TS.projects.foundations.utilities.miscellaneousFunctions.pad(TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_DATETIME.getUTCMonth() + 1, 2) + '-' + TS.projects.foundations.utilities.miscellaneousFunctions.pad(TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_DATETIME.getUTCDate(), 2)
+ let currentDateString = TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_DATETIME.getUTCFullYear() + '-' + SA.projects.foundations.utilities.miscellaneousFunctions.pad(TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_DATETIME.getUTCMonth() + 1, 2) + '-' + SA.projects.foundations.utilities.miscellaneousFunctions.pad(TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_DATETIME.getUTCDate(), 2)
let currentDate = new Date(TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_DATETIME)
TS.projects.foundations.functionLibraries.processFunctions.processHeartBeat(
processIndex,
diff --git a/Projects/Foundations/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/LearningSimulation.js b/Projects/Foundations/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/LearningSimulation.js
index ab8b96dcf..7e2548f3f 100644
--- a/Projects/Foundations/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/LearningSimulation.js
+++ b/Projects/Foundations/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/LearningSimulation.js
@@ -317,7 +317,7 @@ exports.newFoundationsBotModulesLearningSimulation = function (processIndex) {
let fromDate = new Date(sessionParameters.timeRange.config.initialDatetime)
let lastDate = new Date(sessionParameters.timeRange.config.finalDatetime)
- let currentDateString = heartBeatDate.getUTCFullYear() + '-' + TS.projects.foundations.utilities.miscellaneousFunctions.pad(heartBeatDate.getUTCMonth() + 1, 2) + '-' + TS.projects.foundations.utilities.miscellaneousFunctions.pad(heartBeatDate.getUTCDate(), 2)
+ let currentDateString = heartBeatDate.getUTCFullYear() + '-' + SA.projects.foundations.utilities.miscellaneousFunctions.pad(heartBeatDate.getUTCMonth() + 1, 2) + '-' + SA.projects.foundations.utilities.miscellaneousFunctions.pad(heartBeatDate.getUTCDate(), 2)
let currentDate = new Date(heartBeatDate)
let percentage = TS.projects.foundations.utilities.dateTimeFunctions.getPercentage(fromDate, currentDate, lastDate)
/*
@@ -327,7 +327,7 @@ exports.newFoundationsBotModulesLearningSimulation = function (processIndex) {
if (heartBeatDate.valueOf() !== previousHeartBeatDate) {
previousHeartBeatDate = heartBeatDate.valueOf()
- let processingDate = heartBeatDate.getUTCFullYear() + '-' + TS.projects.foundations.utilities.miscellaneousFunctions.pad(heartBeatDate.getUTCMonth() + 1, 2) + '-' + TS.projects.foundations.utilities.miscellaneousFunctions.pad(heartBeatDate.getUTCDate(), 2)
+ let processingDate = heartBeatDate.getUTCFullYear() + '-' + SA.projects.foundations.utilities.miscellaneousFunctions.pad(heartBeatDate.getUTCMonth() + 1, 2) + '-' + SA.projects.foundations.utilities.miscellaneousFunctions.pad(heartBeatDate.getUTCDate(), 2)
TS.projects.foundations.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
'[INFO] runSimulation -> loop -> Simulation ' + TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_KEY + ' Loop # ' + learningEngine.learningCurrent.learningEpisode.candle.index.value + ' @ ' + processingDate)
diff --git a/Projects/Foundations/TS/Bot-Modules/Sensor-Bot/Exchange-Raw-Data/HistoricOHLCVs.js b/Projects/Foundations/TS/Bot-Modules/Sensor-Bot/Exchange-Raw-Data/HistoricOHLCVs.js
index a1f6f0253..64d03654e 100644
--- a/Projects/Foundations/TS/Bot-Modules/Sensor-Bot/Exchange-Raw-Data/HistoricOHLCVs.js
+++ b/Projects/Foundations/TS/Bot-Modules/Sensor-Bot/Exchange-Raw-Data/HistoricOHLCVs.js
@@ -258,8 +258,8 @@
let fileName = "Data.json"
let datetime = new Date(lastFile.valueOf())
let dateForPath = datetime.getUTCFullYear() + '/' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(datetime.getUTCMonth() + 1, 2) + '/' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(datetime.getUTCDate(), 2)
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(datetime.getUTCMonth() + 1, 2) + '/' +
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(datetime.getUTCDate(), 2)
let filePath = TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).FILE_PATH_ROOT + "/Output/" + OHLCVS_FOLDER_NAME + '/' + dateForPath;
let fullFileName = filePath + '/' + fileName
fileStorage.getTextFile(fullFileName, onFileReceived)
@@ -368,7 +368,7 @@
/* Reporting we are doing well */
function heartBeat(noNewInternalLoop) {
let processingDate = new Date(since)
- processingDate = processingDate.getUTCFullYear() + '-' + TS.projects.foundations.utilities.miscellaneousFunctions.pad(processingDate.getUTCMonth() + 1, 2) + '-' + TS.projects.foundations.utilities.miscellaneousFunctions.pad(processingDate.getUTCDate(), 2);
+ processingDate = processingDate.getUTCFullYear() + '-' + SA.projects.foundations.utilities.miscellaneousFunctions.pad(processingDate.getUTCMonth() + 1, 2) + '-' + SA.projects.foundations.utilities.miscellaneousFunctions.pad(processingDate.getUTCDate(), 2);
TS.projects.foundations.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[INFO] start -> getOHLCVs -> Fetching OHLCVs @ " + processingDate + "-> exchange = " + TS.projects.foundations.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + " -> symbol = " + symbol + " -> since = " + since + " -> limit = " + limit)
let heartBeatText = "Fetching " + rawDataArray.length.toFixed(0) + " OHLCVs from " + TS.projects.foundations.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + " " + symbol + " @ " + processingDate
@@ -476,7 +476,7 @@
}
let processingDate = new Date(earliestMarketSince)
- processingDate = processingDate.getUTCFullYear() + '-' + TS.projects.foundations.utilities.miscellaneousFunctions.pad(processingDate.getUTCMonth() + 1, 2) + '-' + TS.projects.foundations.utilities.miscellaneousFunctions.pad(processingDate.getUTCDate(), 2);
+ processingDate = processingDate.getUTCFullYear() + '-' + SA.projects.foundations.utilities.miscellaneousFunctions.pad(processingDate.getUTCMonth() + 1, 2) + '-' + SA.projects.foundations.utilities.miscellaneousFunctions.pad(processingDate.getUTCDate(), 2);
TS.projects.foundations.functionLibraries.processFunctions.processHeartBeat(processIndex, "Invalid or No Start Date. Finding Market Start @ " + processingDate, 0)
}
}
@@ -509,7 +509,7 @@
}
let processingDate = new Date(since)
- processingDate = processingDate.getUTCFullYear() + '-' + TS.projects.foundations.utilities.miscellaneousFunctions.pad(processingDate.getUTCMonth() + 1, 2) + '-' + TS.projects.foundations.utilities.miscellaneousFunctions.pad(processingDate.getUTCDate(), 2);
+ processingDate = processingDate.getUTCFullYear() + '-' + SA.projects.foundations.utilities.miscellaneousFunctions.pad(processingDate.getUTCMonth() + 1, 2) + '-' + SA.projects.foundations.utilities.miscellaneousFunctions.pad(processingDate.getUTCDate(), 2);
TS.projects.foundations.functionLibraries.processFunctions.processHeartBeat(processIndex, "No Data Found. Fast-Forwarding to Next Data @ " + processingDate, 0)
}
}
@@ -945,8 +945,8 @@
let processingDate = new Date(candle.begin)
processingDate =
processingDate.getUTCFullYear() + '-' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(processingDate.getUTCMonth() + 1, 2) + '-' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(processingDate.getUTCDate(), 2);
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(processingDate.getUTCMonth() + 1, 2) + '-' +
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(processingDate.getUTCDate(), 2);
TS.projects.foundations.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[INFO] start -> saveOHLCVs -> Before Fetch -> Saving OHLCVs @ " + processingDate + " -> ohlcvArrayIndex = " + ohlcvArrayIndex + " -> total = " + rawDataArray.length)
@@ -1048,8 +1048,8 @@
function getFilePath(timestamp, folderName) {
let datetime = new Date(timestamp)
let dateForPath = datetime.getUTCFullYear() + '/' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(datetime.getUTCMonth() + 1, 2) + '/' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(datetime.getUTCDate(), 2)
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(datetime.getUTCMonth() + 1, 2) + '/' +
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(datetime.getUTCDate(), 2)
let filePath = TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).FILE_PATH_ROOT + "/Output/" + folderName + '/' + dateForPath;
return filePath
}
diff --git a/Projects/Foundations/TS/Bot-Modules/Trading-Bot/Low-Frequency-Trading/TradingSimulation.js b/Projects/Foundations/TS/Bot-Modules/Trading-Bot/Low-Frequency-Trading/TradingSimulation.js
index 3e8d114ae..bcc9a2a6a 100644
--- a/Projects/Foundations/TS/Bot-Modules/Trading-Bot/Low-Frequency-Trading/TradingSimulation.js
+++ b/Projects/Foundations/TS/Bot-Modules/Trading-Bot/Low-Frequency-Trading/TradingSimulation.js
@@ -308,7 +308,7 @@ exports.newFoundationsBotModulesTradingSimulation = function (processIndex) {
let fromDate = new Date(sessionParameters.timeRange.config.initialDatetime)
let lastDate = new Date(sessionParameters.timeRange.config.finalDatetime)
- let currentDateString = heartBeatDate.getUTCFullYear() + '-' + TS.projects.foundations.utilities.miscellaneousFunctions.pad(heartBeatDate.getUTCMonth() + 1, 2) + '-' + TS.projects.foundations.utilities.miscellaneousFunctions.pad(heartBeatDate.getUTCDate(), 2)
+ let currentDateString = heartBeatDate.getUTCFullYear() + '-' + SA.projects.foundations.utilities.miscellaneousFunctions.pad(heartBeatDate.getUTCMonth() + 1, 2) + '-' + SA.projects.foundations.utilities.miscellaneousFunctions.pad(heartBeatDate.getUTCDate(), 2)
let currentDate = new Date(heartBeatDate)
let percentage = TS.projects.foundations.utilities.dateTimeFunctions.getPercentage(fromDate, currentDate, lastDate)
/*
@@ -318,7 +318,7 @@ exports.newFoundationsBotModulesTradingSimulation = function (processIndex) {
if (heartBeatDate.valueOf() !== previousHeartBeatDate) {
previousHeartBeatDate = heartBeatDate.valueOf()
- let processingDate = heartBeatDate.getUTCFullYear() + '-' + TS.projects.foundations.utilities.miscellaneousFunctions.pad(heartBeatDate.getUTCMonth() + 1, 2) + '-' + TS.projects.foundations.utilities.miscellaneousFunctions.pad(heartBeatDate.getUTCDate(), 2)
+ let processingDate = heartBeatDate.getUTCFullYear() + '-' + SA.projects.foundations.utilities.miscellaneousFunctions.pad(heartBeatDate.getUTCMonth() + 1, 2) + '-' + SA.projects.foundations.utilities.miscellaneousFunctions.pad(heartBeatDate.getUTCDate(), 2)
TS.projects.foundations.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
'[INFO] runSimulation -> loop -> Simulation ' + TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_KEY + ' Loop # ' + tradingEngine.tradingCurrent.tradingEpisode.candle.index.value + ' @ ' + processingDate)
diff --git a/Projects/Foundations/TS/Function-Libraries/DataDependenciesFunctions.js b/Projects/Foundations/TS/Function-Libraries/DataDependenciesFunctions.js
index df57c8548..d80fb517a 100644
--- a/Projects/Foundations/TS/Function-Libraries/DataDependenciesFunctions.js
+++ b/Projects/Foundations/TS/Function-Libraries/DataDependenciesFunctions.js
@@ -241,7 +241,7 @@ exports.newFoundationsFunctionLibrariesDataDependenciesFunctions = function () {
processDate
) {
/* Telling the world we are alive and doing well and which date we are processing right now. */
- let processingDateString = processDate.getUTCFullYear() + '-' + TS.projects.foundations.utilities.miscellaneousFunctions.pad(processDate.getUTCMonth() + 1, 2) + '-' + TS.projects.foundations.utilities.miscellaneousFunctions.pad(processDate.getUTCDate(), 2)
+ let processingDateString = processDate.getUTCFullYear() + '-' + SA.projects.foundations.utilities.miscellaneousFunctions.pad(processDate.getUTCMonth() + 1, 2) + '-' + SA.projects.foundations.utilities.miscellaneousFunctions.pad(processDate.getUTCDate(), 2)
TS.projects.foundations.functionLibraries.processFunctions.processHeartBeat(processIndex, processingDateString, undefined, "Running...")
/*
@@ -327,7 +327,7 @@ exports.newFoundationsFunctionLibrariesDataDependenciesFunctions = function () {
async function getDataFileFromDate(dataFileDate) {
- let dateForPath = dataFileDate.getUTCFullYear() + '/' + TS.projects.foundations.utilities.miscellaneousFunctions.pad(dataFileDate.getUTCMonth() + 1, 2) + '/' + TS.projects.foundations.utilities.miscellaneousFunctions.pad(dataFileDate.getUTCDate(), 2)
+ let dateForPath = dataFileDate.getUTCFullYear() + '/' + SA.projects.foundations.utilities.miscellaneousFunctions.pad(dataFileDate.getUTCMonth() + 1, 2) + '/' + SA.projects.foundations.utilities.miscellaneousFunctions.pad(dataFileDate.getUTCDate(), 2)
let filePath = dependency.referenceParent.parentNode.config.codeName + '/' + dependency.referenceParent.config.codeName + "/" + timeFrameLabel + "/" + dateForPath
let fileName = "Data.json"
diff --git a/Projects/Foundations/TS/Function-Libraries/FromOneMinToMultiTimeFrameFunctions.js b/Projects/Foundations/TS/Function-Libraries/FromOneMinToMultiTimeFrameFunctions.js
index 17358b319..7300d33b0 100644
--- a/Projects/Foundations/TS/Function-Libraries/FromOneMinToMultiTimeFrameFunctions.js
+++ b/Projects/Foundations/TS/Function-Libraries/FromOneMinToMultiTimeFrameFunctions.js
@@ -329,8 +329,8 @@ exports.newFoundationsFunctionLibrariesFromOneMinToMultiTimeFrameFunctions = fun
/* Telling the world we are alive and doing well */
let currentDateString =
contextVariables.datetimeLastProducedFile.getUTCFullYear() + '-' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(contextVariables.datetimeLastProducedFile.getUTCMonth() + 1, 2) + '-' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(contextVariables.datetimeLastProducedFile.getUTCDate(), 2)
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(contextVariables.datetimeLastProducedFile.getUTCMonth() + 1, 2) + '-' +
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(contextVariables.datetimeLastProducedFile.getUTCDate(), 2)
let currentDate = new Date(contextVariables.datetimeLastProducedFile)
let percentage = TS.projects.foundations.utilities.dateTimeFunctions.getPercentage(fromDate, currentDate, lastDate)
TS.projects.foundations.functionLibraries.processFunctions.processHeartBeat(processIndex, currentDateString, percentage)
@@ -360,8 +360,8 @@ exports.newFoundationsFunctionLibrariesFromOneMinToMultiTimeFrameFunctions = fun
const ONE_MIN_DATASET_TYPE = "One-Min"
let dateForPath = contextVariables.datetimeLastProducedFile.getUTCFullYear() + '/' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(contextVariables.datetimeLastProducedFile.getUTCMonth() + 1, 2) + '/' +
- TS.projects.foundations.utilities.miscellaneousFunctions.pad(contextVariables.datetimeLastProducedFile.getUTCDate(), 2)
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(contextVariables.datetimeLastProducedFile.getUTCMonth() + 1, 2) + '/' +
+ SA.projects.foundations.utilities.miscellaneousFunctions.pad(contextVariables.datetimeLastProducedFile.getUTCDate(), 2)
let fileName = "Data.json"
diff --git a/Projects/Foundations/TS/Function-Libraries/OutputManagementFunctions.js b/Projects/Foundations/TS/Function-Libraries/OutputManagementFunctions.js
index 6efcdbe5e..35daf7769 100644
--- a/Projects/Foundations/TS/Function-Libraries/OutputManagementFunctions.js
+++ b/Projects/Foundations/TS/Function-Libraries/OutputManagementFunctions.js
@@ -117,7 +117,7 @@ exports.newFoundationsFunctionLibrariesOutputManagementFunctions = function () {
if (dataset.config.type === 'Daily Files') {
- let dateForPath = tradingProcessDate.getUTCFullYear() + '/' + TS.projects.foundations.utilities.miscellaneousFunctions.pad(tradingProcessDate.getUTCMonth() + 1, 2) + '/' + TS.projects.foundations.utilities.miscellaneousFunctions.pad(tradingProcessDate.getUTCDate(), 2);
+ let dateForPath = tradingProcessDate.getUTCFullYear() + '/' + SA.projects.foundations.utilities.miscellaneousFunctions.pad(tradingProcessDate.getUTCMonth() + 1, 2) + '/' + SA.projects.foundations.utilities.miscellaneousFunctions.pad(tradingProcessDate.getUTCDate(), 2);
let fileName = 'Data.json'
let filePath = TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).FILE_PATH_ROOT + '/Output/' + TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_FOLDER_NAME + '/' + dataset.parentNode.config.codeName + '/' + dataset.config.codeName + '/' + timeFrameLabel + "/" + dateForPath
@@ -181,7 +181,7 @@ exports.newFoundationsFunctionLibrariesOutputManagementFunctions = function () {
if (dataset.config.type === 'Daily Files') {
- let dateForPath = tradingProcessDate.getUTCFullYear() + '/' + TS.projects.foundations.utilities.miscellaneousFunctions.pad(tradingProcessDate.getUTCMonth() + 1, 2) + '/' + TS.projects.foundations.utilities.miscellaneousFunctions.pad(tradingProcessDate.getUTCDate(), 2);
+ let dateForPath = tradingProcessDate.getUTCFullYear() + '/' + SA.projects.foundations.utilities.miscellaneousFunctions.pad(tradingProcessDate.getUTCMonth() + 1, 2) + '/' + SA.projects.foundations.utilities.miscellaneousFunctions.pad(tradingProcessDate.getUTCDate(), 2);
let fileName = 'Data.json'
let filePath = TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).FILE_PATH_ROOT + '/Output/' + TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_FOLDER_NAME + '/' + dataset.parentNode.config.codeName + '/' + dataset.config.codeName + '/' + timeFrameLabel + "/" + dateForPath
diff --git a/Projects/Foundations/TS/Function-Libraries/SingleMarketFunctions.js b/Projects/Foundations/TS/Function-Libraries/SingleMarketFunctions.js
index fe7426af1..b0904da95 100644
--- a/Projects/Foundations/TS/Function-Libraries/SingleMarketFunctions.js
+++ b/Projects/Foundations/TS/Function-Libraries/SingleMarketFunctions.js
@@ -563,7 +563,7 @@
let dateForPath = ''
if (processingDailyFiles === true) {
- dateForPath = "/" + currentDay.getUTCFullYear() + '/' + TS.projects.foundations.utilities.miscellaneousFunctions.pad(currentDay.getUTCMonth() + 1, 2) + '/' + TS.projects.foundations.utilities.miscellaneousFunctions.pad(currentDay.getUTCDate(), 2);
+ dateForPath = "/" + currentDay.getUTCFullYear() + '/' + SA.projects.foundations.utilities.miscellaneousFunctions.pad(currentDay.getUTCMonth() + 1, 2) + '/' + SA.projects.foundations.utilities.miscellaneousFunctions.pad(currentDay.getUTCDate(), 2);
}
let filePathRoot = 'Project/' + contextSummary.project + "/" + contextSummary.mineType + "/" + contextSummary.dataMine + "/" + contextSummary.bot + '/' + TS.projects.foundations.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.config.codeName + "/" + TS.projects.foundations.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.baseAsset.referenceParent.config.codeName + "-" + TS.projects.foundations.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.quotedAsset.referenceParent.config.codeName
diff --git a/Projects/Foundations/TS/Task-Modules/FileStorage.js b/Projects/Foundations/TS/Task-Modules/FileStorage.js
index 0d3cb7c62..97cd5a7f6 100644
--- a/Projects/Foundations/TS/Task-Modules/FileStorage.js
+++ b/Projects/Foundations/TS/Task-Modules/FileStorage.js
@@ -244,7 +244,7 @@ exports.newFileStorage = function newFileStorage(processIndex, host, port) {
logger.write(MODULE_NAME, '[INFO] FileStorage -> createTextFile -> fileLocation: ' + fileLocation)
/* If necesary a folder or folders are created before writing the file to disk. */
- TS.projects.foundations.utilities.miscellaneousFunctions.mkDirByPathSync(fileLocation)
+ SA.projects.foundations.utilities.filesAndDirectories.mkDirByPathSync(fileLocation)
/*
Here we write the file with a temporary name so as to avoid dirty read from other processes.
diff --git a/Projects/Foundations/TS/Utilities/MiscellaneousFunctions.js b/Projects/Foundations/TS/Utilities/MiscellaneousFunctions.js
index 502378e7d..98d21a40d 100644
--- a/Projects/Foundations/TS/Utilities/MiscellaneousFunctions.js
+++ b/Projects/Foundations/TS/Utilities/MiscellaneousFunctions.js
@@ -2,9 +2,7 @@ exports.newFoundationsUtilitiesMiscellaneousFunctions = function () {
let thisObject = {
truncateToThisPrecision: truncateToThisPrecision,
- pad: pad,
- asyncGetDatasetFile: asyncGetDatasetFile,
- mkDirByPathSync: mkDirByPathSync
+ asyncGetDatasetFile: asyncGetDatasetFile
}
return thisObject
@@ -13,11 +11,6 @@ exports.newFoundationsUtilitiesMiscellaneousFunctions = function () {
return parseFloat(floatNumber.toFixed(precision))
}
- function pad(str, max) {
- str = str.toString();
- return str.length < max ? pad("0" + str, max) : str;
- }
-
async function asyncGetDatasetFile(datasetModule, filePath, fileName) {
/*
This function helps a caller to use await syntax while the called
@@ -39,38 +32,4 @@ exports.newFoundationsUtilitiesMiscellaneousFunctions = function () {
return promise
}
- /* Function to create folders of missing folders at any path. */
- function mkDirByPathSync(targetDir, { isRelativeToScript = false } = {}) {
- const path = require('path')
-
- targetDir = targetDir.substring(0, targetDir.lastIndexOf('/') + 1);
-
- const sep = '/';
- const initDir = path.isAbsolute(targetDir) ? sep : '';
- const baseDir = isRelativeToScript ? __dirname : '.';
-
- return targetDir.split(sep).reduce((parentDir, childDir) => {
- const curDir = path.resolve(baseDir, parentDir, childDir);
- try {
- const fs = require('fs')
- fs.mkdirSync(curDir);
- } catch (err) {
- if (err.code === 'EEXIST') { // curDir already exists!
- return curDir;
- }
-
- // To avoid `EISDIR` error on Mac and `EACCES`-->`ENOENT` and `EPERM` on Windows.
- if (err.code === 'ENOENT') { // Throw the original parentDir error on curDir `ENOENT` failure.
- throw new Error(`EACCES: permission denied, mkdir '${parentDir}'`);
- }
-
- const caughtErr = ['EACCES', 'EPERM', 'EISDIR'].indexOf(err.code) > -1;
- if (!caughtErr || caughtErr && curDir === path.resolve(targetDir)) {
- throw err; // Throw if it's just the last created dir.
- }
- }
-
- return curDir;
- }, initDir);
- }
}
\ No newline at end of file
diff --git a/Projects/ProjectsSchema.json b/Projects/ProjectsSchema.json
index c6d84b71b..b49b681e4 100644
--- a/Projects/ProjectsSchema.json
+++ b/Projects/ProjectsSchema.json
@@ -1339,6 +1339,12 @@
"functionName": "newSocialTradingModulesQueriesUserProfiles",
"fileName": "Queries/UserProfiles.js"
},
+ {
+ "name": "Unfollowed User Profiles",
+ "propertyName": "queriesUnfollowedUserProfiles",
+ "functionName": "newSocialTradingModulesQueriesUnfollowedUserProfiles",
+ "fileName": "Queries/UnfollowedUserProfiles.js"
+ },
{
"name": "Bot Profile Stats",
"propertyName": "queriesBotProfileStats",
diff --git a/Projects/Social-Trading/DK/modules/WebAppInterface.js b/Projects/Social-Trading/DK/modules/WebAppInterface.js
index ef3a6bd6f..5c43a13e4 100644
--- a/Projects/Social-Trading/DK/modules/WebAppInterface.js
+++ b/Projects/Social-Trading/DK/modules/WebAppInterface.js
@@ -65,6 +65,40 @@ exports.newSocialTradingModulesWebAppInterface = function newSocialTradingModule
}
return JSON.stringify(response)
}
+
+ if (
+ eventMessage.eventType === SA.projects.socialTrading.globals.eventTypes.NEW_USER_POST ||
+ eventMessage.eventType === SA.projects.socialTrading.globals.eventTypes.REPLY_TO_USER_POST ||
+ eventMessage.eventType === SA.projects.socialTrading.globals.eventTypes.REPOST_USER_POST
+ ) {
+ /*
+ We need to save the post at the User's storage and remove the text from the message
+ going to the Network Node.
+ */
+ let commitMessage
+ switch (eventMessage.eventType) {
+ case SA.projects.socialTrading.globals.eventTypes.NEW_USER_POST: {
+ commitMessage = "New Post"
+ break
+ }
+ case SA.projects.socialTrading.globals.eventTypes.REPLY_TO_USER_POST: {
+ commitMessage = "Reply to User Post"
+ break
+ }
+ case SA.projects.socialTrading.globals.eventTypes.REPOST_USER_POST: {
+ commitMessage = "Repost User Post"
+ break
+ }
+ }
+ /*
+ The post text is eliminated, since it is now at the user's storage,
+ and a hash of the content was generated, and that is what is going to
+ the Network Node.
+ */
+ eventMessage.emitterPostHash = await savePostAtStorage(eventMessage.text, commitMessage, eventMessage.timestamp)
+ eventMessage.text = undefined
+ }
+
eventMessage.emitterUserProfileId = DK.TEST_NETWORK_CLIENT_USER_PROFILE_ID
messageHeader.eventMessage = JSON.stringify(eventMessage)
@@ -84,4 +118,35 @@ exports.newSocialTradingModulesWebAppInterface = function newSocialTradingModule
}
}
}
+
+ async function savePostAtStorage(text, commitMessage, timestamp) {
+ const { createHash } = await import('crypto')
+ const hash = createHash('sha256')
+ let post = {
+ timestamp: timestamp,
+ text: text
+ }
+
+ const fileContent = JSON.stringify(post, undefined, 4)
+ const fileHash = hash.update(fileContent).digest('hex')
+ const fileName = fileHash + ".json"
+
+ let filePath = './My-Social-Trading-Data/User-Posts/' + SA.projects.foundations.utilities.filesAndDirectories.pathFromDate(timestamp)
+
+ SA.projects.foundations.utilities.filesAndDirectories.mkDirByPathSync(filePath + '/')
+ SA.nodeModules.fs.writeFileSync(filePath + '/' + fileName, fileContent)
+
+ const options = {
+ baseDir: process.cwd() + '/My-Social-Trading-Data',
+ binary: 'git',
+ maxConcurrentProcesses: 6,
+ }
+ const git = SA.nodeModules.simpleGit(options)
+
+ await git.add('./*')
+ await git.commit(commitMessage)
+ await git.push('origin')
+
+ return fileHash
+ }
}
\ No newline at end of file
diff --git a/Projects/Social-Trading/DK/modules/WebSocketsInterface.js b/Projects/Social-Trading/DK/modules/WebSocketsInterface.js
index 89b577960..22de639d2 100644
--- a/Projects/Social-Trading/DK/modules/WebSocketsInterface.js
+++ b/Projects/Social-Trading/DK/modules/WebSocketsInterface.js
@@ -64,11 +64,25 @@ exports.newDesktopModulesWebSocketsInterface = function newDesktopModulesWebSock
return
}
- let response = await webAppInterface.messageReceived(messageHeader.payload)
- webApp.socket.send(JSON.stringify(response))
+ await webAppInterface.messageReceived(messageHeader.payload)
+ .then(sendResponseToWebApp)
+ .catch(onError)
+
+ function sendResponseToWebApp(response) {
+ webApp.socket.send(JSON.stringify(response))
+ }
+
+ function onError(errorMessage) {
+ console.log('[ERROR] Web Sockets Interface -> onMenssage -> errorMessage = ' + errorMessage)
+ let response = {
+ result: 'Error',
+ message: errorMessage
+ }
+ webApp.socket.send(JSON.stringify(response))
+ }
} catch (err) {
- console.log('[ERROR] Web Sockets Interface -> setUpWebSocketServer -> err.stack = ' + err.stack)
+ console.log('[ERROR] Web Sockets Interface -> onMenssage -> err.stack = ' + err.stack)
}
}
}
diff --git a/Projects/Social-Trading/NT/Modules/ClientInterface.js b/Projects/Social-Trading/NT/Modules/ClientInterface.js
index 16a1f1978..742b7541f 100644
--- a/Projects/Social-Trading/NT/Modules/ClientInterface.js
+++ b/Projects/Social-Trading/NT/Modules/ClientInterface.js
@@ -103,6 +103,16 @@ exports.newSocialTradingModulesClientInterface = function newSocialTradingModule
return response
}
/*
+ We will not accept events that don't have an eventId.
+ */
+ if (eventReceived.eventId === undefined) {
+ let response = {
+ result: 'Error',
+ message: 'eventId Not Provided.'
+ }
+ return response
+ }
+ /*
We will not accept events that have already been processed.
*/
diff --git a/Projects/Social-Trading/NT/Modules/Event.js b/Projects/Social-Trading/NT/Modules/Event.js
index 7db74847a..f0bf34040 100644
--- a/Projects/Social-Trading/NT/Modules/Event.js
+++ b/Projects/Social-Trading/NT/Modules/Event.js
@@ -139,8 +139,6 @@ exports.newSocialTradingModulesEvent = function newSocialTradingModulesEvent() {
emitterUserProfile.addPost(
thisObject.emitterUserProfileId,
thisObject.targetUserProfileId,
- thisObject.emitterBotProfileId,
- thisObject.targetBotProfileId,
thisObject.emitterPostHash,
thisObject.targetPostHash,
thisObject.eventType - 10,
diff --git a/Projects/Social-Trading/NT/Modules/Queries/ProfileFollowers.js b/Projects/Social-Trading/NT/Modules/Queries/ProfileFollowers.js
index ce9ba104d..6fd01ef6f 100644
--- a/Projects/Social-Trading/NT/Modules/Queries/ProfileFollowers.js
+++ b/Projects/Social-Trading/NT/Modules/Queries/ProfileFollowers.js
@@ -35,7 +35,7 @@ exports.newSocialTradingModulesQueriesProfileFollowers = function newSocialTradi
let response = []
switch (thisObject.direction) {
- case SA.projects.socialTrading.globals.queryConstants.DIRECTION_FUTURE: {
+ case SA.projects.socialTrading.globals.queryConstants.DIRECTION_UP: {
for (let i = thisObject.initialIndex; i < thisObject.initialIndex + thisObject.amountRequested; i++) {
let arrayItem = thisObject.array[i]
if (arrayItem === undefined) { break }
@@ -43,7 +43,7 @@ exports.newSocialTradingModulesQueriesProfileFollowers = function newSocialTradi
}
break
}
- case NT.projects.socialTrading.globals.queryConstants.DIRECTION_PAST: {
+ case NT.projects.socialTrading.globals.queryConstants.DIRECTION_DOWN: {
for (let i = thisObject.initialIndex; i > thisObject.initialIndex - thisObject.amountRequested; i--) {
let arrayItem = thisObject.array[i]
if (arrayItem === undefined) { break }
diff --git a/Projects/Social-Trading/NT/Modules/Queries/ProfileFollowing.js b/Projects/Social-Trading/NT/Modules/Queries/ProfileFollowing.js
index a04791cac..d0c088350 100644
--- a/Projects/Social-Trading/NT/Modules/Queries/ProfileFollowing.js
+++ b/Projects/Social-Trading/NT/Modules/Queries/ProfileFollowing.js
@@ -35,7 +35,7 @@ exports.newSocialTradingModulesQueriesProfileFollowing = function newSocialTradi
let response = []
switch (thisObject.direction) {
- case SA.projects.socialTrading.globals.queryConstants.DIRECTION_FUTURE: {
+ case SA.projects.socialTrading.globals.queryConstants.DIRECTION_UP: {
for (let i = thisObject.initialIndex; i < thisObject.initialIndex + thisObject.amountRequested; i++) {
let arrayItem = thisObject.array[i]
if (arrayItem === undefined) { break }
@@ -43,7 +43,7 @@ exports.newSocialTradingModulesQueriesProfileFollowing = function newSocialTradi
}
break
}
- case SA.projects.socialTrading.globals.queryConstants.DIRECTION_PAST: {
+ case SA.projects.socialTrading.globals.queryConstants.DIRECTION_DOWN: {
for (let i = thisObject.initialIndex; i > thisObject.initialIndex - thisObject.amountRequested; i--) {
let arrayItem = thisObject.array[i]
if (arrayItem === undefined) { break }
diff --git a/Projects/Social-Trading/NT/Modules/Queries/UnfollowedUserProfiles.js b/Projects/Social-Trading/NT/Modules/Queries/UnfollowedUserProfiles.js
new file mode 100644
index 000000000..51a9b0d23
--- /dev/null
+++ b/Projects/Social-Trading/NT/Modules/Queries/UnfollowedUserProfiles.js
@@ -0,0 +1,104 @@
+exports.newSocialTradingModulesQueriesUnfollowedUserProfiles = function newSocialTradingModulesQueriesUnfollowedUserProfiles() {
+ /*
+ This query returns a list of user profiles ordered
+ by Ranking. It filters out all the profiles that
+ are already followed by the Emitter User Profile.
+ */
+ let thisObject = {
+ emitterUserProfile: undefined,
+ profiles: undefined,
+ initialIndex: undefined,
+ amountRequested: undefined,
+ direction: undefined,
+ execute: execute,
+ initialize: initialize,
+ finalize: finalize
+ }
+
+ return thisObject
+
+ function finalize() {
+ thisObject.profiles = undefined
+ thisObject.emitterUserProfile = undefined
+ }
+
+ function initialize(queryReceived) {
+
+ thisObject.emitterUserProfile = NT.projects.socialTrading.globals.memory.maps.USER_PROFILES_BY_ID.get(queryReceived.emitterUserProfileId)
+ if (thisObject.emitterUserProfile === undefined) {
+ throw ('Emitter User Profile Not Found.')
+ }
+
+ thisObject.profiles = Array.from(
+ NT.projects.socialTrading.globals.memory.maps.USER_PROFILES_BY_ID,
+ x => x[1]
+ )
+ thisObject.profiles.sort((a, b) => (a["ranking"] > b["ranking"]) ? 1 : -1)
+
+ NT.projects.socialTrading.utilities.queriesValidations.arrayValidations(queryReceived, thisObject, thisObject.profiles)
+
+ }
+
+ function execute() {
+
+ let response = []
+
+ switch (thisObject.direction) {
+ case SA.projects.socialTrading.globals.queryConstants.DIRECTION_UP: {
+ let i = thisObject.initialIndex
+ let foundCount = 0
+ while (
+ foundCount < thisObject.amountRequested &&
+ i < thisObject.profiles.length
+ ) {
+ let profile = thisObject.profiles[i]
+ if (
+ thisObject.emitterUserProfile.following.get(profile.userProfileId) === undefined &&
+ thisObject.emitterUserProfile.userProfileId !== profile.userProfileId
+ ) {
+ addToResponse(profile)
+ foundCount++
+ }
+ i++
+ }
+ break
+ }
+ case SA.projects.socialTrading.globals.queryConstants.DIRECTION_DOWN: {
+ let i = thisObject.initialIndex
+ let foundCount = 0
+ while (
+ foundCount < thisObject.amountRequested &&
+ i >= 0
+ ) {
+ let profile = thisObject.profiles[i]
+ if (
+ thisObject.emitterUserProfile.following.get(profile.userProfileId) === undefined &&
+ thisObject.emitterUserProfile.userProfileId !== profile.userProfileId
+ ) {
+ addToResponse(profile)
+ foundCount++
+ }
+ i--
+ }
+ break
+ }
+ }
+ return response
+
+ function addToResponse(profile) {
+ let postResponse = {
+ "userProfileId": profile.userProfileId,
+ "userProfileHandle": profile.userProfileHandle,
+ "blockchainAccount": profile.blockchainAccount,
+ "ranking": profile.ranking,
+ "followingCount": profile.following.size,
+ "followersCount": profile.followers.size,
+ "postsCount": profile.posts.size,
+ "botsCount": profile.bots.size,
+ "emitterEventsCount": profile.emitterEventsCount,
+ "targetEventsCount": profile.targetEventsCount
+ }
+ response.push(postResponse)
+ }
+ }
+}
\ No newline at end of file
diff --git a/Projects/Social-Trading/NT/Modules/Queries/UserProfiles.js b/Projects/Social-Trading/NT/Modules/Queries/UserProfiles.js
index bf5223624..57b93bd74 100644
--- a/Projects/Social-Trading/NT/Modules/Queries/UserProfiles.js
+++ b/Projects/Social-Trading/NT/Modules/Queries/UserProfiles.js
@@ -5,7 +5,7 @@ exports.newSocialTradingModulesQueriesUserProfiles = function newSocialTradingMo
and provide them with alternative of who to follow.
*/
let thisObject = {
- array: undefined,
+ profiles: undefined,
initialIndex: undefined,
amountRequested: undefined,
direction: undefined,
@@ -17,18 +17,18 @@ exports.newSocialTradingModulesQueriesUserProfiles = function newSocialTradingMo
return thisObject
function finalize() {
- thisObject.array = undefined
+ thisObject.profiles = undefined
}
function initialize(queryReceived) {
- thisObject.array = Array.from(
+ thisObject.profiles = Array.from(
NT.projects.socialTrading.globals.memory.maps.USER_PROFILES_BY_ID,
x => x[1]
)
- thisObject.array.sort((a, b) => (a["ranking"] > b["ranking"]) ? 1 : -1)
+ thisObject.profiles.sort((a, b) => (a["ranking"] > b["ranking"]) ? 1 : -1)
- NT.projects.socialTrading.utilities.queriesValidations.arrayValidations(queryReceived, thisObject, thisObject.array)
+ NT.projects.socialTrading.utilities.queriesValidations.arrayValidations(queryReceived, thisObject, thisObject.profiles)
}
@@ -37,19 +37,19 @@ exports.newSocialTradingModulesQueriesUserProfiles = function newSocialTradingMo
let response = []
switch (thisObject.direction) {
- case SA.projects.socialTrading.globals.queryConstants.DIRECTION_FUTURE: {
+ case SA.projects.socialTrading.globals.queryConstants.DIRECTION_UP: {
for (let i = thisObject.initialIndex; i < thisObject.initialIndex + thisObject.amountRequested; i++) {
- let arrayItem = thisObject.array[i]
- if (arrayItem === undefined) { break }
- addToResponse(arrayItem)
+ let profile = thisObject.profiles[i]
+ if (profile === undefined) { break }
+ addToResponse(profile)
}
break
}
- case SA.projects.socialTrading.globals.queryConstants.DIRECTION_PAST: {
+ case SA.projects.socialTrading.globals.queryConstants.DIRECTION_DOWN: {
for (let i = thisObject.initialIndex; i > thisObject.initialIndex - thisObject.amountRequested; i--) {
- let arrayItem = thisObject.array[i]
- if (arrayItem === undefined) { break }
- addToResponse(arrayItem)
+ let profile = thisObject.profiles[i]
+ if (profile === undefined) { break }
+ addToResponse(profile)
}
break
}
diff --git a/Projects/Social-Trading/NT/Modules/Query.js b/Projects/Social-Trading/NT/Modules/Query.js
index d60f1e998..8f9ab4633 100644
--- a/Projects/Social-Trading/NT/Modules/Query.js
+++ b/Projects/Social-Trading/NT/Modules/Query.js
@@ -34,6 +34,12 @@ exports.newSocialTradingModulesQuery = function newSocialTradingModulesQuery() {
break
}
+ case SA.projects.socialTrading.globals.queryTypes.UNFOLLOWED_USER_PROFILES: {
+ thisObject.query = NT.projects.socialTrading.modules.queriesUnfollowedUserProfiles.newSocialTradingModulesQueriesUnfollowedUserProfiles()
+ thisObject.query.initialize(queryReceived)
+ break
+ }
+
case SA.projects.socialTrading.globals.queryTypes.USER_PROFILE_STATS: {
thisObject.query = NT.projects.socialTrading.modules.queriesUserProfileStats.newSocialTradingModulesQueriesUserProfileStats()
thisObject.query.initialize(queryReceived)
diff --git a/Projects/Social-Trading/NT/Utilities/QueriesValidations.js b/Projects/Social-Trading/NT/Utilities/QueriesValidations.js
index dd63209ae..21d7932b7 100644
--- a/Projects/Social-Trading/NT/Utilities/QueriesValidations.js
+++ b/Projects/Social-Trading/NT/Utilities/QueriesValidations.js
@@ -91,7 +91,12 @@ exports.newSocialTradingUtilitiesQueriesValidations = function newSocialTradingU
throw ('Direction Undefined.')
}
- if (queryReceived.direction !== SA.projects.socialTrading.globals.queryConstants.DIRECTION_FUTURE && queryReceived.direction !== SA.projects.socialTrading.globals.queryConstants.DIRECTION_PAST) {
+ if (
+ queryReceived.direction !== SA.projects.socialTrading.globals.queryConstants.DIRECTION_FUTURE &&
+ queryReceived.direction !== SA.projects.socialTrading.globals.queryConstants.DIRECTION_PAST &&
+ queryReceived.direction !== SA.projects.socialTrading.globals.queryConstants.DIRECTION_UP &&
+ queryReceived.direction !== SA.projects.socialTrading.globals.queryConstants.DIRECTION_DOWN
+ ) {
throw ('Direction Not Supported.')
}
diff --git a/Projects/Social-Trading/SA/Globals/QueryConstants.js b/Projects/Social-Trading/SA/Globals/QueryConstants.js
index 8f62db770..d5a3e0d1b 100644
--- a/Projects/Social-Trading/SA/Globals/QueryConstants.js
+++ b/Projects/Social-Trading/SA/Globals/QueryConstants.js
@@ -6,7 +6,9 @@ exports.newSocialTradingGlobalsQueryConstants = function () {
MIN_AMOUNT_REQUESTED: 1,
MAX_AMOUNT_REQUESTED: 100,
DIRECTION_FUTURE: 'Future',
- DIRECTION_PAST: 'Past'
+ DIRECTION_PAST: 'Past',
+ DIRECTION_UP: 'Up',
+ DIRECTION_Down: 'Down'
}
return thisObject
diff --git a/Projects/Social-Trading/SA/Globals/QueryTypes.js b/Projects/Social-Trading/SA/Globals/QueryTypes.js
index ec010b230..34fa39dc6 100644
--- a/Projects/Social-Trading/SA/Globals/QueryTypes.js
+++ b/Projects/Social-Trading/SA/Globals/QueryTypes.js
@@ -2,13 +2,14 @@ exports.newSocialTradingGlobalsQueryTypes = function () {
let thisObject = {
USER_PROFILES: 0,
- USER_PROFILE_STATS: 1,
- BOT_PROFILE_STATS: 2,
- PROFILE_POSTS: 3,
- PROFILE_FOLLOWERS: 4,
- PROFILE_FOLLOWING: 5,
- POST_REPLIES: 6,
- EVENTS: 7
+ UNFOLLOWED_USER_PROFILES: 1,
+ USER_PROFILE_STATS: 2,
+ BOT_PROFILE_STATS: 3,
+ PROFILE_POSTS: 4,
+ PROFILE_FOLLOWERS: 5,
+ PROFILE_FOLLOWING: 6,
+ POST_REPLIES: 7,
+ EVENTS: 8
}
return thisObject
diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/TensorFlowLibrary.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/TensorFlowLibrary.js
index 319a88b0b..1b17f2013 100644
--- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/TensorFlowLibrary.js
+++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/TensorFlowLibrary.js
@@ -120,7 +120,7 @@ exports.newTensorFlowBotModulesTensorFlowLibrary = function (processIndex) {
async function saveModel() {
let fileLocation = getModelPath();
/* If necesary a folder or folders are created before writing the file to disk: */
- TS.projects.foundations.utilities.miscellaneousFunctions.mkDirByPathSync(fileLocation);
+ SA.projects.foundations.utilities.filesAndDirectories.mkDirByPathSync(fileLocation);
const savedModel = await tensorFlowModelsManager.model.save('file://' + fileLocation);
}
diff --git a/TaskServer/.vscode/settings.json b/TaskServer/.vscode/settings.json
index e94f27f6f..43e1dd87f 100644
--- a/TaskServer/.vscode/settings.json
+++ b/TaskServer/.vscode/settings.json
@@ -4,14 +4,16 @@
"**/Documentation": true,
"**/Log-Files": true,
"**/node_modules": true,
- "**/Deprecated-Code": true
+ "**/Deprecated-Code": true,
+ "**/My-Social-Trading-Data": true,
},
"search.exclude": {
"**/Data-Storage": true,
"**/Documentation": true,
"**/Log-Files": true,
"**/node_modules": true,
- "**/Deprecated-Code": true
+ "**/Deprecated-Code": true,
+ "**/My-Social-Trading-Data": true
},
"search.maintainFileSearchCache": true
}
\ No newline at end of file
diff --git a/desktop.js b/desktop.js
index 67f933c20..a4ee44975 100644
--- a/desktop.js
+++ b/desktop.js
@@ -44,7 +44,9 @@ SA.nodeModules = {
web3: require('web3'),
ws: require('ws'),
open: require('open'),
- http: require('http')
+ http: require('http'),
+ octokit: require("@octokit/rest"),
+ simpleGit: require('simple-git')
}
/*
diff --git a/package-lock.json b/package-lock.json
index 469e05fe0..d801cc66a 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -220,6 +220,145 @@
"@ethersproject/strings": "^5.4.0"
}
},
+ "@kwsites/file-exists": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/@kwsites/file-exists/-/file-exists-1.1.1.tgz",
+ "integrity": "sha512-m9/5YGR18lIwxSFDwfE3oA7bWuq9kdau6ugN4H2rJeyhFQZcG9AgSHkQtSD15a8WvTgfz9aikZMrKPHvbpqFiw==",
+ "requires": {
+ "debug": "^4.1.1"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "4.3.2",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz",
+ "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==",
+ "requires": {
+ "ms": "2.1.2"
+ }
+ },
+ "ms": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
+ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
+ }
+ }
+ },
+ "@kwsites/promise-deferred": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/@kwsites/promise-deferred/-/promise-deferred-1.1.1.tgz",
+ "integrity": "sha512-GaHYm+c0O9MjZRu0ongGBRbinu8gVAMd2UZjji6jVmqKtZluZnptXGWhz1E8j8D2HJ3f/yMxKAUC0b+57wncIw=="
+ },
+ "@octokit/auth-token": {
+ "version": "2.4.5",
+ "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.5.tgz",
+ "integrity": "sha512-BpGYsPgJt05M7/L/5FoE1PiAbdxXFZkX/3kDYcsvd1v6UhlnE5e96dTDr0ezX/EFwciQxf3cNV0loipsURU+WA==",
+ "requires": {
+ "@octokit/types": "^6.0.3"
+ }
+ },
+ "@octokit/core": {
+ "version": "3.5.1",
+ "resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.5.1.tgz",
+ "integrity": "sha512-omncwpLVxMP+GLpLPgeGJBF6IWJFjXDS5flY5VbppePYX9XehevbDykRH9PdCdvqt9TS5AOTiDide7h0qrkHjw==",
+ "requires": {
+ "@octokit/auth-token": "^2.4.4",
+ "@octokit/graphql": "^4.5.8",
+ "@octokit/request": "^5.6.0",
+ "@octokit/request-error": "^2.0.5",
+ "@octokit/types": "^6.0.3",
+ "before-after-hook": "^2.2.0",
+ "universal-user-agent": "^6.0.0"
+ }
+ },
+ "@octokit/endpoint": {
+ "version": "6.0.12",
+ "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.12.tgz",
+ "integrity": "sha512-lF3puPwkQWGfkMClXb4k/eUT/nZKQfxinRWJrdZaJO85Dqwo/G0yOC434Jr2ojwafWJMYqFGFa5ms4jJUgujdA==",
+ "requires": {
+ "@octokit/types": "^6.0.3",
+ "is-plain-object": "^5.0.0",
+ "universal-user-agent": "^6.0.0"
+ }
+ },
+ "@octokit/graphql": {
+ "version": "4.8.0",
+ "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.8.0.tgz",
+ "integrity": "sha512-0gv+qLSBLKF0z8TKaSKTsS39scVKF9dbMxJpj3U0vC7wjNWFuIpL/z76Qe2fiuCbDRcJSavkXsVtMS6/dtQQsg==",
+ "requires": {
+ "@octokit/request": "^5.6.0",
+ "@octokit/types": "^6.0.3",
+ "universal-user-agent": "^6.0.0"
+ }
+ },
+ "@octokit/openapi-types": {
+ "version": "10.1.1",
+ "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-10.1.1.tgz",
+ "integrity": "sha512-ygp/6r25Ezb1CJuVMnFfOsScEtPF0zosdTJDZ7mZ+I8IULl7DP1BS5ZvPRwglcarGPXOvS5sHdR0bjnVDDfQdQ=="
+ },
+ "@octokit/plugin-paginate-rest": {
+ "version": "2.16.0",
+ "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.16.0.tgz",
+ "integrity": "sha512-8YYzALPMvEZ35kgy5pdYvQ22Roz+BIuEaedO575GwE2vb/ACDqQn0xQrTJR4tnZCJn7pi8+AWPVjrFDaERIyXQ==",
+ "requires": {
+ "@octokit/types": "^6.26.0"
+ }
+ },
+ "@octokit/plugin-request-log": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz",
+ "integrity": "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA=="
+ },
+ "@octokit/plugin-rest-endpoint-methods": {
+ "version": "5.10.1",
+ "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.10.1.tgz",
+ "integrity": "sha512-Rf1iMl40I0dIxjh1g32qZ6Ym/uT8QWZMm2vYGG5Vi8SX1MwZvbuxEGXYgmzTUWSD3PYWSLilE2+4L8kmdLGTMg==",
+ "requires": {
+ "@octokit/types": "^6.27.0",
+ "deprecation": "^2.3.1"
+ }
+ },
+ "@octokit/request": {
+ "version": "5.6.1",
+ "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.6.1.tgz",
+ "integrity": "sha512-Ls2cfs1OfXaOKzkcxnqw5MR6drMA/zWX/LIS/p8Yjdz7QKTPQLMsB3R+OvoxE6XnXeXEE2X7xe4G4l4X0gRiKQ==",
+ "requires": {
+ "@octokit/endpoint": "^6.0.1",
+ "@octokit/request-error": "^2.1.0",
+ "@octokit/types": "^6.16.1",
+ "is-plain-object": "^5.0.0",
+ "node-fetch": "^2.6.1",
+ "universal-user-agent": "^6.0.0"
+ }
+ },
+ "@octokit/request-error": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.1.0.tgz",
+ "integrity": "sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg==",
+ "requires": {
+ "@octokit/types": "^6.0.3",
+ "deprecation": "^2.0.0",
+ "once": "^1.4.0"
+ }
+ },
+ "@octokit/rest": {
+ "version": "18.10.0",
+ "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-18.10.0.tgz",
+ "integrity": "sha512-esHR5OKy38bccL/sajHqZudZCvmv4yjovMJzyXlphaUo7xykmtOdILGJ3aAm0mFHmMLmPFmDMJXf39cAjNJsrw==",
+ "requires": {
+ "@octokit/core": "^3.5.1",
+ "@octokit/plugin-paginate-rest": "^2.16.0",
+ "@octokit/plugin-request-log": "^1.0.4",
+ "@octokit/plugin-rest-endpoint-methods": "^5.9.0"
+ }
+ },
+ "@octokit/types": {
+ "version": "6.27.0",
+ "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.27.0.tgz",
+ "integrity": "sha512-ha27f8DToxXBPEJdzHCCuqpw7AgKfjhWGdNf3yIlBAhAsaexBXTfWw36zNSsncALXGvJq4EjLy1p3Wz45Aqb4A==",
+ "requires": {
+ "@octokit/openapi-types": "^10.1.0"
+ }
+ },
"@sindresorhus/is": {
"version": "0.14.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz",
@@ -357,6 +496,11 @@
"tweetnacl": "^0.14.3"
}
},
+ "before-after-hook": {
+ "version": "2.2.2",
+ "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz",
+ "integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ=="
+ },
"bignumber.js": {
"version": "9.0.1",
"resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.1.tgz",
@@ -807,6 +951,11 @@
"resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
"integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak="
},
+ "deprecation": {
+ "version": "2.3.1",
+ "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz",
+ "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ=="
+ },
"des.js": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz",
@@ -1561,6 +1710,11 @@
"resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz",
"integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4="
},
+ "is-plain-object": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz",
+ "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q=="
+ },
"is-regex": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz",
@@ -2335,6 +2489,31 @@
"simple-concat": "^1.0.0"
}
},
+ "simple-git": {
+ "version": "2.45.1",
+ "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-2.45.1.tgz",
+ "integrity": "sha512-NmEoThiLTJxl26WNtZxtJTue18ReTcSrf3so5vJG/O8KY9uMxH+yAhXV/DElBJyOYZrrBbVsH8JOFxgENdc9Xg==",
+ "requires": {
+ "@kwsites/file-exists": "^1.1.1",
+ "@kwsites/promise-deferred": "^1.1.1",
+ "debug": "^4.3.1"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "4.3.2",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz",
+ "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==",
+ "requires": {
+ "ms": "2.1.2"
+ }
+ },
+ "ms": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
+ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
+ }
+ }
+ },
"sshpk": {
"version": "1.16.1",
"resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz",
@@ -2570,6 +2749,11 @@
"which-boxed-primitive": "^1.0.2"
}
},
+ "universal-user-agent": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz",
+ "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w=="
+ },
"universalify": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz",
diff --git a/package.json b/package.json
index d083084f8..e59e25f2d 100644
--- a/package.json
+++ b/package.json
@@ -1,8 +1,10 @@
{
"dependencies": {
+ "@octokit/rest": "^18.10.0",
"http": "0.0.1-security",
"node-fetch": "^2.6.1",
"open": "^8.2.1",
+ "simple-git": "^2.45.1",
"web3": "^1.5.2",
"ws": "^8.2.1"
}