Fixing to run without month or year

This commit is contained in:
Luis Fernando Molina committed 2018-02-17 11:45:20 +01:00
1 parent 67a14defdb
commit 0f2bdae15f
4 files changed
+9 -42

No files matched your search

Binary file not shown.
+2 -7
View File
@@ -6,7 +6,8 @@
<ProjectGuid>{aa2901bc-8f81-40f0-a402-5ca79a3f22ad}</ProjectGuid>
<ProjectHome />
<ProjectView>ShowAllFiles</ProjectView>
<StartupFile>Multi-Period-Market\run.js</StartupFile>
<StartupFile>
</StartupFile>
<WorkingDirectory>c:\users\luis\source\repos\AAOlivia\Multi-Period-Market</WorkingDirectory>
<OutputPath>.</OutputPath>
<ProjectTypeGuids>{3AF33F2E-1136-4D97-BBB7-1795711AC8B8};{349c5851-65df-11da-9384-00065b846f21};{9092AA53-FB77-4645-B42D-1CCCA6BD08BD}</ProjectTypeGuids>
@@ -19,12 +20,7 @@
<Content Include="package-lock.json" />
<Content Include="package.json" />
<Content Include="README.md" />
<Compile Include="Multi-Period-Market\Interval Executor.js" />
<Compile Include="Multi-Period-Market\Interval.js" />
<Compile Include="Multi-Period-Market\run.js" />
<Compile Include="24-hs-Market\Interval Executor.js" />
<Compile Include="24-hs-Market\Interval.js" />
<Compile Include="24-hs-Market\run.js" />
<Content Include="logs\Dummy File.txt" />
<Content Include="obj\Debug\AABruce.njsproj.FileListAbsolute.txt" />
<Content Include="obj\Debug\AACarol.njsproj.FileListAbsolute.txt" />
@@ -33,7 +29,6 @@
</ItemGroup>
<ItemGroup>
<Folder Include="Multi-Period-Market\" />
<Folder Include="24-hs-Market\" />
<Folder Include="bin" />
<Folder Include="logs" />
<Folder Include="logs\AA Masters" />
+1 -29
View File
@@ -96,35 +96,7 @@ Read the candles and volumes from Bruce and produce a single Index File for each
try {
if (LOG_INFO === true) {
logger.write("[INFO] Entering function 'start', with year = " + year + " and month = " + month);
}
let processDate = new Date(year + "-" + month + "-1 00:00:00.000 GMT+0000");
let lastMinuteOfMonth = new Date(year + "-" + month + "-1 00:00:00.000 GMT+0000");
lastMinuteOfMonth.setUTCMonth(lastMinuteOfMonth.getUTCMonth() + 1); // First we go 1 month into the future.
lastMinuteOfMonth.setUTCSeconds(lastMinuteOfMonth.getUTCSeconds() - 30); // Then we go back 30 seconds, or to the last minute of the original month.
let thisDatetime = new Date();
if ((year === thisDatetime.getUTCFullYear() && parseInt(month) > thisDatetime.getUTCMonth() + 1) || year > thisDatetime.getUTCFullYear()) {
logger.write("[INFO] We are too far in the future. Interval will not execute. Sorry.");
return;
}
let atHeadOfMarket; // This tell us if we are at the month which includes the head of the market according to current datetime.
if ((year === thisDatetime.getUTCFullYear() && parseInt(month) === thisDatetime.getUTCMonth() + 1)) {
atHeadOfMarket = true;
} else {
atHeadOfMarket = false;
logger.write("[INFO] Entering function 'start'");
}
let nextIntervalExecution = false; // This tell weather the Interval module will be executed again or not. By default it will not unless some hole have been found in the current execution.
+6 -6
View File
@@ -11,17 +11,17 @@
"description": "Produces different files with multi-period candles and volumes for entire markets.",
"startMode": {
"allMonths": {
"run": "true",
"minYear": "2014",
"maxYear": "2018"
"run": "false",
"minYear": "",
"maxYear": ""
},
"oneMonth": {
"run": "false",
"year": "2018",
"month": "2"
"year": "",
"month": ""
},
"noTime": {
"run": "false"
"run": "true"
}
},
"intervalLapse": 3600000,