Fixing Market Files
This commit is contained in:
1 parent
a67d383c88
commit
df3139e4ce
3 files changed
+675
-594
No files matched your search
@@ -104,7 +104,7 @@ LRCIndicator.prototype.calculate = function (price) {
|
||||
}
|
||||
|
||||
exports.newUserBot = function newUserBot(BOT, COMMONS, UTILITIES, DEBUG_MODULE, BLOB_STORAGE) {
|
||||
const FULL_LOG = false;
|
||||
const FULL_LOG = true;
|
||||
const LOG_FILE_CONTENT = false;
|
||||
const USE_PARTIAL_LAST_CANDLE = true; // When running live the last candle generated is a partial candle.
|
||||
|
||||
@@ -289,7 +289,7 @@ exports.newUserBot = function newUserBot(BOT, COMMONS, UTILITIES, DEBUG_MODULE,
|
||||
|
||||
if (FULL_LOG === true) { logger.write("[INFO] start -> buildLRCPoints -> advanceTime -> Entering function."); }
|
||||
|
||||
executionTime = new Date(lastCandles[10] + ONE_MIN_IN_MILISECONDS);
|
||||
executionTime = new Date(lastCandles[2] + (ONE_MIN_IN_MILISECONDS*30));
|
||||
|
||||
if (FULL_LOG === true) { logger.write("[INFO] start -> buildLRCPoints -> advanceTime -> New processing time @ " + executionTime.toISOString()); }
|
||||
|
||||
@@ -324,7 +324,7 @@ exports.newUserBot = function newUserBot(BOT, COMMONS, UTILITIES, DEBUG_MODULE,
|
||||
isTimeToRun();
|
||||
|
||||
function isTimeToRun() {
|
||||
let nextExecution = lastCandles[n] + outputPeriod;
|
||||
let nextExecution = lastCandles[2] + outputPeriod;
|
||||
if (executionTime.valueOf() >= nextExecution) {
|
||||
getLRCPoints();
|
||||
} else {
|
||||
@@ -345,7 +345,7 @@ exports.newUserBot = function newUserBot(BOT, COMMONS, UTILITIES, DEBUG_MODULE,
|
||||
let candleArray = [];
|
||||
|
||||
let queryDate = new Date(executionTime);
|
||||
let candleFile = getDailyFile(queryDate, onDailyFileReceived);
|
||||
let candleFile = getDailyFile(queryDate, onDailyFileReceived); //TODO Implement remote file cache
|
||||
|
||||
function onDailyFileReceived(err, candleFile) {
|
||||
if (FULL_LOG === true) { logger.write("[INFO] start -> getLRCPoints -> onDailyFileReceived."); }
|
||||
@@ -597,7 +597,7 @@ exports.newUserBot = function newUserBot(BOT, COMMONS, UTILITIES, DEBUG_MODULE,
|
||||
}
|
||||
|
||||
// We keep a record of the last candle used for the time period
|
||||
lastCandles[n] = lrcPoint[0];
|
||||
lastCandles[2] = lrcPoint[0];
|
||||
|
||||
controlLoop();
|
||||
}
|
||||
@@ -626,7 +626,7 @@ exports.newUserBot = function newUserBot(BOT, COMMONS, UTILITIES, DEBUG_MODULE,
|
||||
}
|
||||
|
||||
// We keep a record of the last candle used for the time period
|
||||
lastCandles[n] = lrcPoint[0];
|
||||
lastCandles[2] = lrcPoint[0];
|
||||
|
||||
controlLoop();
|
||||
}
|
||||
@@ -650,7 +650,7 @@ exports.newUserBot = function newUserBot(BOT, COMMONS, UTILITIES, DEBUG_MODULE,
|
||||
loopBody();
|
||||
|
||||
} else {
|
||||
let lastOneMinuteCandle = lastCandles[10];
|
||||
let lastOneMinuteCandle = lastCandles[2];
|
||||
writeDataRange(lastOneMinuteCandle, onWritten);
|
||||
|
||||
function onWritten(err) {
|
||||
|
||||
+611
-586
File diff suppressed because it is too large.
Load diff
+57
-1
@@ -10,6 +10,55 @@
|
||||
"devTeam": "AAVikings",
|
||||
"dataSetVersion": "dataSet.V1",
|
||||
"processes": [
|
||||
{
|
||||
"name": "Multi-Period-Market",
|
||||
"description": "Produces files with the LRC Points for the entire market.",
|
||||
"startMode": {
|
||||
"allMonths": {
|
||||
"run": "false",
|
||||
"minYear": "",
|
||||
"maxYear": ""
|
||||
},
|
||||
"oneMonth": {
|
||||
"run": "false",
|
||||
"year": "",
|
||||
"month": ""
|
||||
},
|
||||
"noTime": {
|
||||
"run": "true"
|
||||
},
|
||||
"fixedInterval": {
|
||||
"run": "false",
|
||||
"interval": 0
|
||||
}
|
||||
},
|
||||
"normalWaitTime": 50,
|
||||
"retryWaitTime": 10000,
|
||||
"sleepWaitTime": 3600000,
|
||||
"comaWaitTime": 86400000,
|
||||
"statusDependencies": [
|
||||
{
|
||||
"devTeam": "AAVikings",
|
||||
"bot": "AAGauss",
|
||||
"botVersion": {
|
||||
"major": 1,
|
||||
"minor": 0
|
||||
},
|
||||
"process": "Multi-Period-Market",
|
||||
"dataSetVersion": "dataSet.V1"
|
||||
},
|
||||
{
|
||||
"devTeam": "AAMasters",
|
||||
"bot": "AAOlivia",
|
||||
"botVersion": {
|
||||
"major": 1,
|
||||
"minor": 0
|
||||
},
|
||||
"process": "Multi-Period-Market",
|
||||
"dataSetVersion": "dataSet.V1"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Multi-Period-Daily",
|
||||
"description": "Produces files with the LRC Points on a daily format.",
|
||||
@@ -67,10 +116,17 @@
|
||||
"description": "Two sets of files per period that contains LRC points.",
|
||||
"storageAccount": "aagauss",
|
||||
"dataSets": [
|
||||
{
|
||||
"codeName": "Multi-Period-Market",
|
||||
"type": "Market Files",
|
||||
"validPeriods": [ "24-hs", "12-hs", "08-hs", "06-hs", "04-hs", "03-hs", "02-hs", "01-hs" ],
|
||||
"filePath": "AAVikings/AAGauss.1.0/AACloud.1.1/@Exchange/dataSet.V1/Output/LRC-Points/Multi-Period-Market/@Period",
|
||||
"fileName": "@AssetA_@AssetB.json"
|
||||
},
|
||||
{
|
||||
"codeName": "Multi-Period-Daily",
|
||||
"type": "Daily Files",
|
||||
"validPeriods": [ "45-min", "40-min", "30-min", "20-min", "15-min", "10-min", "05-min", "04-min", "03-min", "02-min", "01-min" ],
|
||||
"validPeriods": [ "30-min" ],
|
||||
"filePath": "AAVikings/AAGauss.1.0/AACloud.1.1/@Exchange/dataSet.V1/Output/LRC-Points/Multi-Period-Daily/@Period/@Year/@Month/@Day",
|
||||
"fileName": "@AssetA_@AssetB.json",
|
||||
"dataRange": {
|
||||
|
||||
Reference in new issue
Block a user