Multi Period Daily process fully implemented ready to debug

This commit is contained in:
Luis Fernando Molina committed 2018-02-22 16:58:12 +01:00
1 parent 9c1ada6fa6
commit 1975063274
5 files changed
+1229 -16

No files matched your search

Binary file not shown.
+4 -2
View File
@@ -28,7 +28,8 @@
<Content Include="this.bot.config.json" />
</ItemGroup>
<ItemGroup>
<Folder Include="Candles-Volumes-Stairs-Market\" />
<Folder Include="Multi-Period-Daily\" />
<Folder Include="Multi-Period-Market\" />
<Folder Include="bin" />
<Folder Include="logs" />
<Folder Include="logs\AA Masters" />
@@ -41,7 +42,8 @@
<Folder Include="obj\Debug" />
</ItemGroup>
<ItemGroup>
<Compile Include="Candles-Volumes-Stairs-Market\Interval.js" />
<Compile Include="Multi-Period-Daily\Interval.js" />
<Compile Include="Multi-Period-Market\Interval.js" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<!--Do not delete the following Import Project. While this appears to do nothing it is a marker for setting TypeScript properties before our import that depends on them.-->
File diff suppressed because it is too large. Load diff
@@ -62,6 +62,7 @@
charlyAzureFileStorage.initialize("Charly");
bruceAzureFileStorage.initialize("Bruce");
oliviaAzureFileStorage.initialize("Olivia");
tomAzureFileStorage.initialize("Tom");
markets = MARKETS_MODULE.newMarkets(bot);
markets.initialize(callBackFunction);
@@ -247,6 +248,8 @@ Read the candles and volumes from Olivia and produce for each market two files w
function buildStairs() {
let n;
periodsLoop();
function periodsLoop() {
@@ -257,7 +260,7 @@ Read the candles and volumes from Olivia and produce for each market two files w
*/
let n = 0 // loop Variable representing each possible period as defined at the periods array.
n = 0 // loop Variable representing each possible period as defined at the periods array.
loopBody();
@@ -276,7 +279,7 @@ Read the candles and volumes from Olivia and produce for each market two files w
let fileName = market.assetA + '_' + market.assetB + ".json"
let filePath = EXCHANGE_NAME + "/Output/" + CANDLES_FOLDER_NAME + "/" + "Multi-Period-Market" + "/" + folderName;
oliviaFileStorage.getTextFile(filePath, fileName, onFileReceived, true);
oliviaAzureFileStorage.getTextFile(filePath, fileName, onFileReceived, true);
function onFileReceived(text) {
@@ -453,7 +456,7 @@ Read the candles and volumes from Olivia and produce for each market two files w
stairs.max + "," +
stairs.begin + "," +
stairs.end + "," +
stairs.direction + "," +
'"' + stairs.direction + '"' + "," +
stairs.candleCount + "," +
stairs.firstMin + "," +
stairs.firstMax + "," +
@@ -467,10 +470,10 @@ Read the candles and volumes from Olivia and produce for each market two files w
}
fileContent = "[" + fileContent + "]";
let fileName = '' + market.assetA + '_' + market.assetB + '.json';
let filePath = EXCHANGE_NAME + "/Output/" + CANDLES_FOLDER_NAME + "/" + bot.process + "/" + folderName;
let filePath = EXCHANGE_NAME + "/" + bot.name + "/" + bot.dataSetVersion + "/Output/" + CANDLES_FOLDER_NAME + "/" + bot.process + "/" + folderName;
utilities.createFolderIfNeeded(filePath, tomAzureFileStorage, onFolderCreated);
@@ -497,7 +500,7 @@ Read the candles and volumes from Olivia and produce for each market two files w
let fileName = market.assetA + '_' + market.assetB + ".json"
let filePath = EXCHANGE_NAME + "/Output/" + VOLUMES_FOLDER_NAME + "/" + "Multi-Period-Market" + "/" + folderName;
oliviaFileStorage.getTextFile(filePath, fileName, onFileReceived, true);
oliviaAzureFileStorage.getTextFile(filePath, fileName, onFileReceived, true);
function onFileReceived(text) {
@@ -542,7 +545,7 @@ Read the candles and volumes from Olivia and produce for each market two files w
volume.begin = marketFile[i][2];
volume.end = marketFile[i][3];
volumes.push(candle);
volumes.push(volume);
}
@@ -770,10 +773,10 @@ Read the candles and volumes from Olivia and produce for each market two files w
let stairs = stairsArray[i];
fileContent = fileContent + separator + '[' +
stairs.type + "," +
'"' + stairs.type + '"' + "," +
stairs.begin + "," +
stairs.end + "," +
stairs.direction + "," +
'"' + stairs.direction + '"' + "," +
stairs.barsCount + "," +
stairs.firstAmount + "," +
stairs.lastAmount + "]";
@@ -788,7 +791,7 @@ Read the candles and volumes from Olivia and produce for each market two files w
let fileName = '' + market.assetA + '_' + market.assetB + '.json';
let filePath = EXCHANGE_NAME + "/Output/" + VOLUMES_FOLDER_NAME + "/" + bot.process + "/" + folderName;
let filePath = EXCHANGE_NAME + "/" + bot.name + "/" + bot.dataSetVersion + "/Output/"+ VOLUMES_FOLDER_NAME + "/" + bot.process + "/" + folderName;
utilities.createFolderIfNeeded(filePath, tomAzureFileStorage, onFolderCreated);
@@ -835,7 +838,7 @@ Read the candles and volumes from Olivia and produce for each market two files w
try {
let reportFilePath = EXCHANGE_NAME + "/Processes/" + bot.process;
let reportFilePath = EXCHANGE_NAME + "/" + bot.name + "/" + bot.dataSetVersion + "/Processes/" + bot.process;
utilities.createFolderIfNeeded(reportFilePath, tomAzureFileStorage, onFolderCreated);
@@ -857,7 +860,7 @@ Read the candles and volumes from Olivia and produce for each market two files w
let fileContent = JSON.stringify(report);
oliviaAzureFileStorage.createTextFile(reportFilePath, fileName, fileContent + '\n', onFileCreated);
tomAzureFileStorage.createTextFile(reportFilePath, fileName, fileContent + '\n', onFileCreated);
function onFileCreated() {
@@ -865,6 +868,7 @@ Read the candles and volumes from Olivia and produce for each market two files w
logger.write("[INFO] 'writeStatusReport' - Content written: " + fileContent);
}
nextIntervalExecution = true;
closeAndOpenMarket();
}
}
+24 -2
View File
@@ -3,11 +3,12 @@
"name": "Tom",
"type": "Indicator",
"version": "1.0.0",
"devTeam": "AA Masters"
"devTeam": "AA Masters",
"dataSetVersion": "dataSet.V1"
},
"processes": [
{
"name": "Candles-Volumes-Stairs-Market",
"name": "Multi-Period-Market",
"description": "Produces for each market two files with candles stairs and volumes stairs respectively.",
"startMode": {
"allMonths": {
@@ -26,6 +27,27 @@
},
"intervalLapse": 3600000,
"intervalMaxLoops": -1
},
{
"name": "Multi-Period-Daily",
"description": "Produces for each market two files with candles stairs and volumes stairs respectively at each day of the market history.",
"startMode": {
"allMonths": {
"run": "false",
"minYear": "",
"maxYear": ""
},
"oneMonth": {
"run": "false",
"year": "",
"month": ""
},
"noTime": {
"run": "true"
}
},
"intervalLapse": 60000,
"intervalMaxLoops": -1
}
]
}