Bug Dataset Updated Fixed
This commit is contained in:
1 parent
e90ccebe8f
commit
4d6c0ad493
7 files changed
+35
-28
No files matched your search
@@ -0,0 +1 @@
|
||||
{"type":"Data Mine","name":"Masters","config":"{\n\"codeName\": \"Masters\"\n}","sensorBots":[{"type":"Sensor Bot","name":"Exchange Raw Data","config":"{\n\"codeName\": \"Exchange-Raw-Data\",\n\"repo\": \"Exchange-Raw-Data-Sensor-Bot\"\n}","processes":[{"type":"Process Definition","name":"Historic-Trades","config":"{\n \"codeName\": \"Historic-Trades\",\n \"description\": \"Retrieves and saves the historical trades in batches going backwards from the current time until reaching the begining of the market.\",\n \"startMode\": {\n \"noTime\": {\n \"run\": \"true\"\n },\n \"fixedInterval\": {\n \"run\": \"false\",\n \"interval\": 0\n }\n },\n \"deadWaitTime\": 0,\n \"normalWaitTime\": 60000,\n \"retryWaitTime\": 10000\n}","processOutput":{"type":"Process Output","name":"New Process Output","outputDatasets":[],"id":"e3008f15-43ae-4452-9c28-bfbb6c1a5e84","savedPayload":{"position":{"x":13889.892304785908,"y":17976.7326423862},"targetPosition":{"x":13788.99537092664,"y":18353.285125876908},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":4,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"processDependencies":{"type":"Process Dependencies","name":"New Process Dependencies","statusDependencies":[{"type":"Status Dependency","name":"Self Reference","config":"{\n \"mainUtility\": \"Self Reference\"\n}","id":"f796022a-7871-4bde-bcc7-bcf2818f1eaf","savedPayload":{"position":{"x":14299.325525762739,"y":17993.12379366583},"targetPosition":{"x":13938.17907937083,"y":17993.12379366583},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Status Report","name":"New Status Report","id":"116834de-6646-4387-9f4b-4f711cea9235"}}}],"dataDependencies":[],"id":"1332b41e-7cd2-4e69-a40a-39ea47df67b5","savedPayload":{"position":{"x":13938.17907937083,"y":17993.12379366583},"targetPosition":{"x":13788.99537092664,"y":18353.285125876908},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":4,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"statusReport":{"type":"Status Report","name":"New Status Report","id":"116834de-6646-4387-9f4b-4f711cea9235","savedPayload":{"position":{"x":13983.913279342734,"y":18015.677405195172},"targetPosition":{"x":13788.99537092664,"y":18353.285125876908},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":4,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"executionStartedEvent":{"type":"Execution Started Event","name":"New Execution Started Event","id":"a9ea7169-fcd8-48c3-b0a9-b4e8941aa170","savedPayload":{"position":{"x":14026.312379860185,"y":18044.00757842793},"targetPosition":{"x":13788.99537092664,"y":18353.285125876908},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":4,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"executionFinishedEvent":{"type":"Execution Finished Event","name":"New Execution Finished Event","id":"51908884-c7a2-46ca-8a55-209070ae5fa6","savedPayload":{"position":{"x":14064.650920558077,"y":18077.62957624547},"targetPosition":{"x":13788.99537092664,"y":18353.285125876908},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":4,"distanceToParent":3,"arrangementStyle":0},"uiObject":{}}},"id":"7a6a9399-474f-4a93-bcbd-28a594ef1943","savedPayload":{"position":{"x":14351.93363503598,"y":18425.400341491753},"targetPosition":{"x":13888.04337325749,"y":18696.024787447222},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":3,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Process Definition","name":"Historic-OHLCVs","config":"{\n \"codeName\": \"Historic-OHLCVs\",\n \"description\": \"Retrieves and saves historical maket data\",\n \"startMode\": {\n \"noTime\": {\n \"run\": \"true\"\n },\n \"fixedInterval\": {\n \"run\": \"false\",\n \"interval\": 0\n }\n },\n \"deadWaitTime\": 0,\n \"normalWaitTime\": 60000,\n \"retryWaitTime\": 10000\n}","processOutput":{"type":"Process Output","name":"New Process Output","outputDatasets":[],"id":"dfe2556e-a765-4e38-9d30-7f91090c0069","savedPayload":{"position":{"x":14546.018334597831,"y":18039.39680205973},"targetPosition":{"x":14407.127481538195,"y":18558.43550715096},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"processDependencies":{"type":"Process Dependencies","name":"New Process Dependencies","statusDependencies":[{"type":"Status Dependency","name":"Exchange Raw Data Historic-OHLCVs","config":"{\n \"mainUtility\": \"SLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"type":"Data Mine","name":"Masters-Trading","config":"{ \n\"codeName\": \"Masters-Trading\"\n}","sensorBots":[],"indicatorBots":[],"tradingBots":[{"type":"Trading Bot","name":"Low Frequency","config":"{\n\"codeName\": \"Low-Frequency\"\n}","processes":[{"type":"Process Definition","name":"Trading","config":"{\n \"codeName\": \"Trading\",\n \"liveTradingWaitTime\": 0,\n \"paperTradingWaitTime\": 0,\n \"fordwardTestingWaitTime\": 0,\n \"backtestingWaitTime\": 0,\n \"sessionRunWaitTime\": 5000,\n \"retryWaitTime\": 10000,\n \"framework\": {\n \"name\": \"Low-Frequency-Trading-Process\"\n }\n }","processOutput":{"type":"Process Output","name":"New Process Output","outputDatasets":[{"type":"Output Dataset","name":"Multi-Period-Market Episode Counters","id":"6fc3054e-5034-4fc7-bddf-02360e0a6acf","savedPayload":{"position":{"x":17450.068251326462,"y":15841.551559017382},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"db063d7b-db05-4bf6-941f-999e1ccb38fc"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Episode Counters","id":"c3c2240f-514b-40de-825f-674037117d0b","savedPayload":{"position":{"x":17408.574644476477,"y":15727.325552793509},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"0764aaaf-d970-4f23-9df8-55fe5b7dd273"}}},{"type":"Output Dataset","name":"Multi-Period-Market Episode Statistics","id":"1dfdfc0d-842f-4e63-a591-256ac8a06b0f","savedPayload":{"position":{"x":17373.12088415627,"y":15611.394883926749},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"fc9dc0f7-35e0-4548-bb91-f920825d694f"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Episode Statistics","id":"39360c55-5ba8-413b-b0bd-cac3789ebf5f","savedPayload":{"position":{"x":17343.701241214498,"y":15493.846491633021},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"91953362-8751-4440-a898-21245cd47c15"}}},{"type":"Output Dataset","name":"Multi-Period-Market Current Candle","id":"ba614415-6e4f-4979-97a5-34c72a59e67c","savedPayload":{"position":{"x":17320.378252589224,"y":15374.95820021913},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"17fb41f5-61b5-4433-9a10-950ff8216a7e"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Current Candle","id":"1a2e3461-33e6-45b1-bcc1-c56a8c5d275c","savedPayload":{"position":{"x":17303.209229100234,"y":15255.03551122105},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"bbc9467d-28bf-432b-9e49-582d1bcabfb9"}}},{"type":"Output Dataset","name":"Multi-Period-Market Current Balance","id":"567e4dc9-4deb-41e4-9ac9-dde943fb91ba","savedPayload":{"position":{"x":17292.23789362744,"y":15134.392617857315},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"acddff59-b51b-4b45-b58f-71d4077755ee"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Current Balance","id":"e94b9bb3-9f0c-4550-94e1-09de444780a8","savedPayload":{"position":{"x":17287.49247877813,"y":15013.347651781945},"targetPosition":{"x":19639.44096944686,"y":14981.892188598802},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"213b8fe8-f772-41ea-a3f5-97867be555f7"}}},{"type":"Output Dataset","name":"Multi-Period-Market Distance To Event","id":"a30e7306-7be9-41b6-a465-Line truncated
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
function newFileCursor () {
|
||||
function newFileCursor() {
|
||||
const MODULE_NAME = 'File Cursor'
|
||||
const INFO_LOG = false
|
||||
const ERROR_LOG = true
|
||||
@@ -43,7 +43,7 @@ function newFileCursor () {
|
||||
|
||||
return thisObject
|
||||
|
||||
function finalize () {
|
||||
function finalize() {
|
||||
try {
|
||||
eventsServerClient.stopListening('Dataset Updated', eventSubscriptionIdDatasetUpdated)
|
||||
eventsServerClient.stopListening('Data Range Updated', eventSubscriptionIdDataRangeUpdated)
|
||||
@@ -75,7 +75,7 @@ function newFileCursor () {
|
||||
}
|
||||
}
|
||||
|
||||
function initialize (
|
||||
function initialize(
|
||||
pFileCloud,
|
||||
pDataMine,
|
||||
pBot,
|
||||
@@ -118,11 +118,11 @@ function newFileCursor () {
|
||||
|
||||
callBackFunction(GLOBAL.DEFAULT_OK_RESPONSE)
|
||||
|
||||
function onResponseDataSet (message) {
|
||||
function onResponseDataSet(message) {
|
||||
eventSubscriptionIdDatasetUpdated = message.eventSubscriptionId
|
||||
}
|
||||
|
||||
function onResponseDataRange (message) {
|
||||
function onResponseDataRange(message) {
|
||||
eventSubscriptionIdDataRangeUpdated = message.eventSubscriptionId
|
||||
}
|
||||
} catch (err) {
|
||||
@@ -131,7 +131,7 @@ function newFileCursor () {
|
||||
}
|
||||
}
|
||||
|
||||
function updateDataRange (message) {
|
||||
function updateDataRange(message) {
|
||||
try {
|
||||
if (finalized === true) { return }
|
||||
|
||||
@@ -156,7 +156,7 @@ function newFileCursor () {
|
||||
}
|
||||
}
|
||||
|
||||
function updateFiles (message) {
|
||||
function updateFiles(message) {
|
||||
try {
|
||||
if (finalized === true) { return }
|
||||
|
||||
@@ -170,7 +170,7 @@ function newFileCursor () {
|
||||
|
||||
fileCloud.getFile(dataMine, bot, session, product, dataset, exchange, market, periodName, targetDate, undefined, undefined, undefined, onFileReceived)
|
||||
|
||||
function onFileReceived (err, file) {
|
||||
function onFileReceived(err, file) {
|
||||
try {
|
||||
if (finalized === true) { return }
|
||||
|
||||
@@ -188,7 +188,7 @@ function newFileCursor () {
|
||||
}
|
||||
}
|
||||
|
||||
function setTimeFrame (pTimeFrame, pDatetime) {
|
||||
function setTimeFrame(pTimeFrame, pDatetime) {
|
||||
try {
|
||||
if (finalized === true) { return }
|
||||
|
||||
@@ -225,7 +225,7 @@ function newFileCursor () {
|
||||
enterSavingMode()
|
||||
}
|
||||
|
||||
function enterSavingMode () {
|
||||
function enterSavingMode() {
|
||||
try {
|
||||
switch (timeFrame) {
|
||||
|
||||
@@ -302,7 +302,7 @@ function newFileCursor () {
|
||||
}
|
||||
}
|
||||
|
||||
function exitSavingMode () {
|
||||
function exitSavingMode() {
|
||||
try {
|
||||
switch (timeFrame) {
|
||||
|
||||
@@ -383,7 +383,7 @@ function newFileCursor () {
|
||||
}
|
||||
}
|
||||
|
||||
function setDatetime (pDatetime) {
|
||||
function setDatetime(pDatetime) {
|
||||
try {
|
||||
if (finalized === true) { return }
|
||||
|
||||
@@ -398,7 +398,7 @@ function newFileCursor () {
|
||||
}
|
||||
}
|
||||
|
||||
function reload (callBackFunction) {
|
||||
function reload(callBackFunction) {
|
||||
try {
|
||||
if (finalized === true) { return }
|
||||
|
||||
@@ -411,7 +411,7 @@ function newFileCursor () {
|
||||
}
|
||||
}
|
||||
|
||||
function getFiles (callBackFunction) {
|
||||
function getFiles(callBackFunction) {
|
||||
try {
|
||||
if (finalized === true) { return }
|
||||
|
||||
@@ -422,7 +422,7 @@ function newFileCursor () {
|
||||
|
||||
getNextFile()
|
||||
|
||||
function getNextFile () {
|
||||
function getNextFile() {
|
||||
try {
|
||||
let targetDate = new Date(cursorDate)
|
||||
targetDate.setUTCDate(targetDate.getUTCDate() + j)
|
||||
@@ -479,7 +479,7 @@ function newFileCursor () {
|
||||
}
|
||||
}
|
||||
|
||||
function onFileReceived (err, file) {
|
||||
function onFileReceived(err, file) {
|
||||
try {
|
||||
if (INFO_LOG === true) { logger.write('[INFO] getFiles -> onFileReceived -> Entering function.') }
|
||||
|
||||
@@ -524,7 +524,7 @@ function newFileCursor () {
|
||||
}
|
||||
}
|
||||
|
||||
function controlLoop () {
|
||||
function controlLoop() {
|
||||
try {
|
||||
if (INFO_LOG === true) { logger.write('[INFO] getFiles -> controlLoop -> Entering function.') }
|
||||
|
||||
@@ -548,7 +548,7 @@ function newFileCursor () {
|
||||
}
|
||||
}
|
||||
|
||||
function collectGarbage (callBackFunction) {
|
||||
function collectGarbage(callBackFunction) {
|
||||
try {
|
||||
if (finalized === true) { return }
|
||||
|
||||
@@ -570,7 +570,7 @@ function newFileCursor () {
|
||||
}
|
||||
}
|
||||
|
||||
function getExpectedFiles () {
|
||||
function getExpectedFiles() {
|
||||
if (finalized === true) { return }
|
||||
if (INFO_LOG === true) { logger.write('[INFO] getExpectedFiles -> Entering function.') }
|
||||
|
||||
|
||||
@@ -207,7 +207,6 @@ function newMarketFiles() {
|
||||
try {
|
||||
if (finalized === true) { return }
|
||||
let updatedFiles = 0
|
||||
if (message.event === undefined) { return }
|
||||
|
||||
/* Now we will get the market files */
|
||||
|
||||
@@ -216,8 +215,10 @@ function newMarketFiles() {
|
||||
let periodName = marketFilesPeriods[i][1]
|
||||
|
||||
if (dataset.config.validTimeFrames.includes(periodName) !== true) { continue }
|
||||
if (message.event.timeFrames !== undefined) {
|
||||
if (message.event.timeFrames.includes(periodName) !== true) { continue }
|
||||
if (message.event !== undefined) {
|
||||
if (message.event.timeFrames !== undefined) {
|
||||
if (message.event.timeFrames.includes(periodName) !== true) { continue }
|
||||
}
|
||||
}
|
||||
fileCloud.getFile(dataMine, bot, session, product, dataset, exchange, market, periodName, undefined, undefined, undefined, undefined, onFileReceived)
|
||||
|
||||
|
||||
@@ -617,9 +617,9 @@
|
||||
}
|
||||
|
||||
if (currentTimeFrame > global.dailyFilePeriods[0][0]) {
|
||||
writeMarketStatusReport(onMarketStatusReport)
|
||||
writeMarketStatusReport(currentTimeFrameLabel, onMarketStatusReport)
|
||||
} else {
|
||||
writeDailyStatusReport(bot.tradingProcessDate, onDailyStatusReport);
|
||||
writeDailyStatusReport(bot.tradingProcessDate, currentTimeFrameLabel, onDailyStatusReport);
|
||||
}
|
||||
|
||||
} catch (err) {
|
||||
@@ -709,22 +709,24 @@
|
||||
}
|
||||
}
|
||||
|
||||
function writeDailyStatusReport(lastFileDate, callBack) {
|
||||
function writeDailyStatusReport(lastFileDate, currentTimeFrameLabel, callBack) {
|
||||
let reportKey = bot.dataMine + "-" + bot.codeName + "-" + bot.processNode.referenceParent.config.codeName
|
||||
let thisReport = statusDependencies.statusReports.get(reportKey);
|
||||
|
||||
thisReport.file.lastExecution = bot.currentDaytime;
|
||||
thisReport.file.lastFile = lastFileDate;
|
||||
thisReport.file.simulationState = bot.simulationState;
|
||||
thisReport.file.timeFrames = currentTimeFrameLabel
|
||||
thisReport.save(callBack);
|
||||
}
|
||||
|
||||
function writeMarketStatusReport(callBack) {
|
||||
function writeMarketStatusReport(currentTimeFrameLabel, callBack) {
|
||||
let reportKey = bot.dataMine + "-" + bot.codeName + "-" + bot.processNode.referenceParent.config.codeName
|
||||
let thisReport = statusDependencies.statusReports.get(reportKey);
|
||||
|
||||
thisReport.file.lastExecution = bot.processDatetime;
|
||||
thisReport.file.simulationState = bot.simulationState;
|
||||
thisReport.file.timeFrames = currentTimeFrameLabel
|
||||
|
||||
logger.newInternalLoop(bot.codeName, bot.process, bot.tradingProcessDate);
|
||||
thisReport.save(callBack);
|
||||
|
||||
@@ -521,7 +521,7 @@
|
||||
let timeFrameLabel = global.dailyFilePeriods[n][1]
|
||||
|
||||
/* Check Time Frames Filter */
|
||||
if (bot.marketTimeFrames !== undefined) {
|
||||
if (bot.dailyTimeFrames !== undefined) {
|
||||
if (bot.dailyTimeFrames.includes(timeFrameLabel) === true) {
|
||||
timeFramesArray.push(timeFrameLabel)
|
||||
}
|
||||
@@ -554,6 +554,9 @@
|
||||
thisReport.file.lastFile = lastFileDate;
|
||||
thisReport.file.interExecutionMemoryArray = interExecutionMemoryArray;
|
||||
thisReport.file.beginingOfMarket = beginingOfMarket.toUTCString()
|
||||
if (bot.dailyTimeFrames !== undefined) {
|
||||
thisReport.file.timeFrames = bot.dailyTimeFrames
|
||||
}
|
||||
thisReport.save(callBack)
|
||||
|
||||
bot.hasTheBotJustStarted = false;
|
||||
|
||||
@@ -88,7 +88,6 @@
|
||||
}
|
||||
global.EVENT_SERVER_CLIENT.createEventHandler(key, 'Dataset Updated')
|
||||
global.EVENT_SERVER_CLIENT.raiseEvent(key, 'Dataset Updated', event)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user