Merge pull request #179 from Superalgos/develop

Trading on Daily tested
This commit is contained in:
Luis Fernando Molina authored and GitHub committed 2020-03-31 12:38:17 +02:00
commit ea44a91bda
5 files changed
+27 -11

No files matched your search

+1
View File
@@ -249,6 +249,7 @@ function newCanvas () {
}
function onKeyDown (event) {
if (EDITOR_ON_FOCUS === true) { return }
thisObject.mouse.event = event
thisObject.mouse.action = 'key down'
+2
View File
@@ -73,6 +73,7 @@ function newCodeEditor () {
textArea.style.display = 'none'
thisObject.payload.node.code = textArea.value
}
EDITOR_ON_FOCUS = false
}
function activate (payload) {
@@ -98,6 +99,7 @@ function newCodeEditor () {
'height: ' + thisObject.container.frame.height + 'px'
textArea.style.display = 'block'
textArea.focus()
EDITOR_ON_FOCUS = true
}
function getContainer (point) {
+1
View File
@@ -122,6 +122,7 @@ dailyFilePeriods = JSON.parse(dailyFilePeriods);
let SHOW_ANIMATION_PERFORMACE = false;
let MENU_ITEM_ON_FOCUS
let EDITOR_ON_FOCUS
let testUser = window.localStorage.getItem("test_user")
let LOGGED_IN_USER_LOCAL_STORAGE_KEY
+1 -6
View File
@@ -725,12 +725,7 @@
if ((err.result === "Fail Because" && err.message === "File does not exist.") || err.code === 'The specified key does not exist.') {
logger.write(MODULE_NAME, "[ERROR] start -> processTimeFramesDailyFiles -> periodsLoopBody -> dependencyLoopBody -> getCurrentFile -> onFileReceived -> Fail Because -> err = " + err.message);
logger.write(MODULE_NAME, "[ERROR] start -> processTimeFramesDailyFiles -> periodsLoopBody -> dependencyLoopBody -> getCurrentFile -> onFileReceived -> filePath = " + filePath);
logger.write(MODULE_NAME, "[ERROR] start -> processTimeFramesDailyFiles -> periodsLoopBody -> dependencyLoopBody -> getCurrentFile -> onFileReceived -> fileName = " + fileName);
logger.write(MODULE_NAME, "[ERROR] start -> processTimeFramesDailyFiles -> periodsLoopBody -> dependencyLoopBody -> getCurrentFile -> onFileReceived -> You are trying to use data that does not exist. ");
logger.write(MODULE_NAME, "[ERROR] start -> processTimeFramesDailyFiles -> periodsLoopBody -> dependencyLoopBody -> getCurrentFile -> onFileReceived -> Check that your Datasets building processes are running well. ");
logger.write(MODULE_NAME, "[ERROR] The file " + filePath + '/' + fileName + ' does not exist and it is required to continue. This process will retry to read it in a while. In the meantime make yourself sure that the process that generates it has ran properly.');
callBackFunction(global.DEFAULT_RETRY_RESPONSE);
return;
}
+22 -5
View File
@@ -568,9 +568,19 @@
let processingDate = loopingDay.getUTCFullYear() + '-' + utilities.pad(loopingDay.getUTCMonth() + 1, 2) + '-' + utilities.pad(loopingDay.getUTCDate(), 2);
if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] runSimulation -> loop -> Simulation " + bot.sessionKey + " Loop # " + currentCandleIndex + " @ " + processingDate) }
console.log("Trading-Engine -> " + MODULE_NAME + " -> runSimulation -> loop -> Simulation " + bot.sessionKey + " Loop # " + currentCandleIndex + " @ " + processingDate)
bot.sessionHeartBeat(processingDate) // tell the world we are alive and doing well
/* Telling the world we are alive and doing well */
let fromDate = new Date(bot.VALUES_TO_USE.timeRange.initialDatetime.valueOf())
let lastDate = new Date(bot.VALUES_TO_USE.timeRange.finalDatetime.valueOf())
let currentDateString = loopingDay.getUTCFullYear() + '-' + utilities.pad(loopingDay.getUTCMonth() + 1, 2) + '-' + utilities.pad(loopingDay.getUTCDate(), 2);
let currentDate = new Date(loopingDay)
let percentage = global.getPercentage(fromDate, currentDate, lastDate)
bot.processHeartBeat(currentDateString, percentage)
if (global.areEqualDates(currentDate, new Date()) === false) {
logger.newInternalLoop(bot.codeName, bot.process, currentDate, percentage);
}
}
previousLoopingDay = loopingDay.valueOf()
@@ -2749,8 +2759,15 @@
/* Checking if we should continue processing this loop or not.*/
if (bot.STOP_SESSION === true) {
if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] runSimulation -> controlLoop -> We are going to stop here bacause we were requested to stop processing."); }
console.log("[INFO] runSimulation -> controlLoop -> We are going to stop here bacause we were requested to stop processing.")
if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] runSimulation -> controlLoop -> We are going to stop here bacause we were requested to stop processing this session."); }
console.log("[INFO] runSimulation -> controlLoop -> We are going to stop here bacause we were requested to stop processing this session.")
afterLoop()
return
}
if (global.STOP_TASK_GRACEFULLY === true) {
if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] runSimulation -> controlLoop -> We are going to stop here bacause we were requested to stop processing this task."); }
console.log("[INFO] runSimulation -> controlLoop -> We are going to stop here bacause we were requested to stop processing this task.")
afterLoop()
return
}
@@ -2800,7 +2817,7 @@
number: yesterday.currentStrategy.number,
beginRate: yesterday.currentStrategy.beginRate,
endRate: yesterday.currentStrategy.endRate,
triggerOnSituation: yesterday.curre.triggerOnSituation
triggerOnSituation: yesterday.currentStrategy.triggerOnSituation
}
interExecutionMemory.currentTrade = {