Renaming ok
This commit is contained in:
1 parent
c89aac6c35
commit
5221d68b42
13 files changed
+66
-50
No files matched your search
@@ -1,4 +1,4 @@
|
||||
exports.newDataDependencies = function (processIndex, DATA_SET) {
|
||||
exports.newSuperalgosProcessModulesDataDependencies = function (processIndex, DATA_SET) {
|
||||
|
||||
const MODULE_NAME = "Data Dependencies";
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
let newNodeArray = []
|
||||
|
||||
for (let i = 0; i < thisObject.nodeArray.length; i++) {
|
||||
let dataSetModule = DATA_SET.newDataSet(processIndex);
|
||||
let dataSetModule = DATA_SET.newSuperalgosProcessModulesDataset(processIndex);
|
||||
dataSetModule.initialize(thisObject.nodeArray[i], onInitilized);
|
||||
|
||||
function onInitilized(err, wasInitialized) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
exports.newDataSet = function (processIndex) {
|
||||
exports.newSuperalgosProcessModulesDataset = function (processIndex) {
|
||||
|
||||
const MODULE_NAME = "Dataset";
|
||||
|
||||
|
||||
@@ -8,6 +8,14 @@ exports.newFileStorage = function newFileStorage(processIndex, host, port) {
|
||||
const FAST_RETRY_TIME_IN_MILISECONDS = 500
|
||||
const SLOW_RETRY_TIME_IN_MILISECONDS = 2000
|
||||
|
||||
let thisObject = {
|
||||
asyncGetTextFile: asyncGetTextFile,
|
||||
asyncCreateTextFile: asyncCreateTextFile,
|
||||
getTextFile: getTextFile,
|
||||
createTextFile: createTextFile,
|
||||
deleteTextFile: deleteTextFile
|
||||
}
|
||||
|
||||
let logger
|
||||
if (TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE === undefined) { // Dummy logger
|
||||
logger = {}
|
||||
@@ -18,15 +26,6 @@ exports.newFileStorage = function newFileStorage(processIndex, host, port) {
|
||||
} else {
|
||||
logger = TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE
|
||||
}
|
||||
|
||||
let thisObject = {
|
||||
asyncGetTextFile: asyncGetTextFile,
|
||||
asyncCreateTextFile: asyncCreateTextFile,
|
||||
getTextFile: getTextFile,
|
||||
createTextFile: createTextFile,
|
||||
deleteTextFile: deleteTextFile
|
||||
}
|
||||
|
||||
return thisObject
|
||||
|
||||
async function asyncGetTextFile(filePath, noRetry, canUsePrevious) {
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
|
||||
function initializeProcessExecutionEvents() {
|
||||
try {
|
||||
processExecutionEvents = PROCESS_EXECUTION_EVENTS.newProcessExecutionEvents(processIndex)
|
||||
processExecutionEvents = PROCESS_EXECUTION_EVENTS.newSuperalgosProcessModulesProcessExecutionEvents(processIndex)
|
||||
processExecutionEvents.initialize(processConfig, onInizialized);
|
||||
|
||||
function onInizialized(err) {
|
||||
@@ -232,7 +232,7 @@
|
||||
|
||||
function initializeStatusDependencies() {
|
||||
try {
|
||||
statusDependencies = STATUS_DEPENDENCIES.newStatusDependencies(processIndex, STATUS_REPORT, PROCESS_OUTPUT);
|
||||
statusDependencies = STATUS_DEPENDENCIES.newSuperalgosProcessModulesStatusDependencies(processIndex, STATUS_REPORT, PROCESS_OUTPUT);
|
||||
statusDependencies.initialize(onInizialized);
|
||||
|
||||
function onInizialized(err) {
|
||||
@@ -280,7 +280,7 @@
|
||||
|
||||
function initializeDataDependencies() {
|
||||
try {
|
||||
dataDependencies = DATA_DEPENDENCIES.newDataDependencies(processIndex, DATA_SET);
|
||||
dataDependencies = DATA_DEPENDENCIES.newSuperalgosProcessModulesDataDependencies(processIndex, DATA_SET);
|
||||
dataDependencies.initialize(onInizialized);
|
||||
|
||||
function onInizialized(err) {
|
||||
|
||||
@@ -24,9 +24,7 @@
|
||||
return thisObject;
|
||||
|
||||
function initialize(pProcessConfig, pStatusDependencies, pDataDependencies, callBackFunction) {
|
||||
|
||||
|
||||
|
||||
|
||||
statusDependencies = pStatusDependencies;
|
||||
dataDependenciesModule = pDataDependencies;
|
||||
processConfig = pProcessConfig;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
exports.newProcessExecutionEvents = function (processIndex) {
|
||||
exports.newSuperalgosProcessModulesProcessExecutionEvents = function (processIndex) {
|
||||
/*
|
||||
Here we manage the process execution events. This allow us to emit events
|
||||
when the process starts and finishes. Also to wait for a dependent event
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
exports.newProcessOutput = function (processIndex) {
|
||||
exports.newSuperalgosProcessModulesProcessOutput = function (processIndex) {
|
||||
|
||||
/*
|
||||
Here we emit the events that signals that a Dataset was updated.
|
||||
|
||||
@@ -1,25 +1,6 @@
|
||||
exports.newLearningBot = function (processIndex, parentLogger) {
|
||||
|
||||
const MODULE_NAME = "Learning Bot";
|
||||
const FULL_LOG = true;
|
||||
|
||||
const TRADING_PROCESS_MODULE = require(TS.projects.superalgos.globals.nodeJSConstants.REQUIRE_ROOT_DIR + '/LowFrequencyTrading/MachineLearningProcess.js');
|
||||
const FILE_STORAGE = require('./FileStorage.js');
|
||||
const SESSION = require(TS.projects.superalgos.globals.nodeJSConstants.REQUIRE_ROOT_DIR + 'TradingSession');
|
||||
|
||||
let fileStorage = FILE_STORAGE.newFileStorage(processIndex, parentLogger);
|
||||
let session = SESSION.newLearningSession(processIndex, parentLogger)
|
||||
|
||||
const DEBUG_MODULE = require(TS.projects.superalgos.globals.nodeJSConstants.REQUIRE_ROOT_DIR + 'DebugLog');
|
||||
|
||||
let nextLoopTimeoutHandle;
|
||||
|
||||
let thisObject = {
|
||||
initialize: initialize,
|
||||
run: run
|
||||
};
|
||||
|
||||
let processConfig;
|
||||
|
||||
|
||||
return thisObject;
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
|
||||
function initializeProcessExecutionEvents() {
|
||||
try {
|
||||
processExecutionEvents = PROCESS_EXECUTION_EVENTS.newProcessExecutionEvents(processIndex)
|
||||
processExecutionEvents = PROCESS_EXECUTION_EVENTS.newSuperalgosProcessModulesProcessExecutionEvents(processIndex)
|
||||
processExecutionEvents.initialize(processConfig, onInizialized);
|
||||
|
||||
function onInizialized(err) {
|
||||
@@ -235,7 +235,7 @@
|
||||
|
||||
function initializeStatusDependencies() {
|
||||
try {
|
||||
statusDependencies = STATUS_DEPENDENCIES.newStatusDependencies(processIndex, STATUS_REPORT, PROCESS_OUTPUT);
|
||||
statusDependencies = STATUS_DEPENDENCIES.newSuperalgosProcessModulesStatusDependencies(processIndex, STATUS_REPORT, PROCESS_OUTPUT);
|
||||
statusDependencies.initialize(onInizialized);
|
||||
|
||||
function onInizialized(err) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
exports.newStatusDependencies = function (processIndex, STATUS_REPORT, PROCESS_OUTPUT) {
|
||||
exports.newSuperalgosProcessModulesStatusDependencies = function (processIndex, STATUS_REPORT, PROCESS_OUTPUT) {
|
||||
|
||||
const MODULE_NAME = "Status Dependencies";
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
|
||||
for (let i = 0; i < dependenciesToProcess.length; i++) {
|
||||
|
||||
let statusReportModule = STATUS_REPORT.newStatusReport(processIndex, PROCESS_OUTPUT);
|
||||
let statusReportModule = STATUS_REPORT.newSuperalgosProcessModulesStatusReport(processIndex, PROCESS_OUTPUT);
|
||||
|
||||
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE.write(MODULE_NAME, "[INFO] initialize -> onInitilized -> Initializing Status Report # " + (i + 1));
|
||||
let statusDependency = dependenciesToProcess[i]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
exports.newStatusReport = function (processIndex, PROCESS_OUTPUT) {
|
||||
exports.newSuperalgosProcessModulesStatusReport = function (processIndex, PROCESS_OUTPUT) {
|
||||
|
||||
/*
|
||||
|
||||
@@ -365,7 +365,7 @@
|
||||
|
||||
/* All good, lets emit the event that means data has been updated. */
|
||||
|
||||
let processOutput = PROCESS_OUTPUT.newProcessOutput(processIndex)
|
||||
let processOutput = PROCESS_OUTPUT.newSuperalgosProcessModulesProcessOutput(processIndex)
|
||||
processOutput.raiseEvents(thisObject.file.lastFile, thisObject.file.timeFrames, callBackFunction);
|
||||
return
|
||||
}
|
||||
@@ -392,7 +392,7 @@
|
||||
}
|
||||
|
||||
/* All good, lets emit the event that means data has been updated. */
|
||||
let processOutput = PROCESS_OUTPUT.newProcessOutput(processIndex)
|
||||
let processOutput = PROCESS_OUTPUT.newSuperalgosProcessModulesProcessOutput(processIndex)
|
||||
processOutput.asyncRaiseEvents(thisObject.file.lastFile, thisObject.file.timeFrames)
|
||||
}
|
||||
}
|
||||
@@ -118,7 +118,7 @@
|
||||
|
||||
function initializeProcessExecutionEvents() {
|
||||
try {
|
||||
processExecutionEvents = PROCESS_EXECUTION_EVENTS.newProcessExecutionEvents(processIndex)
|
||||
processExecutionEvents = PROCESS_EXECUTION_EVENTS.newSuperalgosProcessModulesProcessExecutionEvents(processIndex)
|
||||
processExecutionEvents.initialize(processConfig, onInizialized);
|
||||
|
||||
function onInizialized(err) {
|
||||
@@ -219,7 +219,7 @@
|
||||
|
||||
function initializeStatusDependencies() {
|
||||
try {
|
||||
statusDependencies = STATUS_DEPENDENCIES.newStatusDependencies(processIndex, STATUS_REPORT, PROCESS_OUTPUT);
|
||||
statusDependencies = STATUS_DEPENDENCIES.newSuperalgosProcessModulesStatusDependencies(processIndex, STATUS_REPORT, PROCESS_OUTPUT);
|
||||
statusDependencies.initialize(onInizialized);
|
||||
|
||||
function onInizialized(err) {
|
||||
@@ -267,7 +267,7 @@
|
||||
|
||||
function initializeDataDependencies() {
|
||||
try {
|
||||
dataDependencies = DATA_DEPENDENCIES.newDataDependencies(processIndex, DATA_SET);
|
||||
dataDependencies = DATA_DEPENDENCIES.newSuperalgosProcessModulesDataDependencies(processIndex, DATA_SET);
|
||||
dataDependencies.initialize(onInizialized);
|
||||
|
||||
function onInizialized(err) {
|
||||
|
||||
Reference in new issue
Block a user