Configuration upgraded to Alpha
This commit is contained in:
1 parent
d1c840c13b
commit
2813661cf5
6 files changed
+47
-138
No files matched your search
Binary file not shown.
Binary file not shown.
@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.27130.2027
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9092AA53-FB77-4645-B42D-1CCCA6BD08BD}") = "AABruce", "AABruce.njsproj", "{045BBAEF-3C35-4017-8458-E46AEF438790}"
|
||||
Project("{9092AA53-FB77-4645-B42D-1CCCA6BD08BD}") = "Project", "Project.njsproj", "{045BBAEF-3C35-4017-8458-E46AEF438790}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@@ -136,136 +136,6 @@ Read the trades from Charly's Output and pack them into daily files with candles
|
||||
|
||||
marketsLoop();
|
||||
|
||||
/*
|
||||
|
||||
At every run, the process needs to loop through all the markets at this exchange.
|
||||
The following functions marketsLoop(), openMarket(), closeMarket() and closeAndOpenMarket() controls the serialization of this processing.
|
||||
|
||||
*/
|
||||
|
||||
function marketsLoop() {
|
||||
|
||||
try {
|
||||
|
||||
if (LOG_INFO === true) {
|
||||
logger.write("[INFO] Entering function 'marketsLoop'");
|
||||
}
|
||||
|
||||
markets.getMarketsByExchange(EXCHANGE_ID, onMarketsReady);
|
||||
|
||||
function onMarketsReady(marketsArray) {
|
||||
|
||||
marketQueue = JSON.parse(marketsArray);
|
||||
|
||||
openMarket(); // First execution and entering into the real loop.
|
||||
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
const logText = "[ERROR] 'marketsLoop' - ERROR : " + err.message;
|
||||
logger.write(logText);
|
||||
}
|
||||
}
|
||||
|
||||
function openMarket() {
|
||||
|
||||
// To open a Market means picking a new market from the queue.
|
||||
|
||||
try {
|
||||
|
||||
if (LOG_INFO === true) {
|
||||
logger.write("[INFO] Entering function 'openMarket'");
|
||||
}
|
||||
|
||||
|
||||
if (marketQueue.length === 0) {
|
||||
|
||||
if (LOG_INFO === true) {
|
||||
logger.write("[INFO] 'openMarket' - marketQueue.length === 0");
|
||||
}
|
||||
|
||||
const logText = "[WARN] We processed all the markets.";
|
||||
logger.write(logText);
|
||||
|
||||
callBackFunction(nextIntervalExecution);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (GO_RANDOM === true) {
|
||||
const index = parseInt(Math.random() * (marketQueue.length - 1));
|
||||
|
||||
market.id = marketQueue[index][0];
|
||||
market.assetA = marketQueue[index][1];
|
||||
market.assetB = marketQueue[index][2];
|
||||
market.status = marketQueue[index][3];
|
||||
|
||||
marketQueue.splice(index, 1);
|
||||
} else {
|
||||
let marketRecord = marketQueue.shift();
|
||||
|
||||
market.id = marketRecord[0];
|
||||
market.assetA = marketRecord[1];
|
||||
market.assetB = marketRecord[2];
|
||||
market.status = marketRecord[3];
|
||||
|
||||
if (FORCE_MARKET > 0) {
|
||||
if (FORCE_MARKET !== market.id) {
|
||||
closeAndOpenMarket();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (LOG_INFO === true) {
|
||||
logger.write("[INFO] 'openMarket' - marketQueue.length = " + marketQueue.length);
|
||||
logger.write("[INFO] 'openMarket' - market sucessfully opened : " + market.assetA + "_" + market.assetB);
|
||||
}
|
||||
|
||||
if (market.status === markets.ENABLED) {
|
||||
|
||||
getStatusReport();
|
||||
|
||||
} else {
|
||||
|
||||
logger.write("[INFO] 'openMarket' - market " + market.assetA + "_" + market.assetB + " skipped because its status is not valid. Status = " + market.status);
|
||||
closeAndOpenMarket();
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
catch (err) {
|
||||
const logText = "[ERROR] 'openMarket' - ERROR : " + err.message;
|
||||
logger.write(logText);
|
||||
closeMarket();
|
||||
}
|
||||
}
|
||||
|
||||
function closeMarket() {
|
||||
|
||||
if (LOG_INFO === true) {
|
||||
logger.write("[INFO] Entering function 'closeMarket'");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function closeAndOpenMarket() {
|
||||
|
||||
if (LOG_INFO === true) {
|
||||
logger.write("[INFO] Entering function 'closeAndOpenMarket'");
|
||||
}
|
||||
|
||||
openMarket();
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
The following code executes for each market.
|
||||
|
||||
*/
|
||||
|
||||
function getStatusReport() {
|
||||
|
||||
try {
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
<ProjectTypeGuids>{3AF33F2E-1136-4D97-BBB7-1795711AC8B8};{349c5851-65df-11da-9384-00065b846f21};{9092AA53-FB77-4645-B42D-1CCCA6BD08BD}</ProjectTypeGuids>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
<Name>Project</Name>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)' == 'Debug'" />
|
||||
<PropertyGroup Condition="'$(Configuration)' == 'Release'" />
|
||||
+45
-7
@@ -1,10 +1,14 @@
|
||||
{
|
||||
"bot": {
|
||||
"name": "Bruce",
|
||||
"type": "Indicator",
|
||||
"version": "1.0.0",
|
||||
"devTeam": "AA Masters"
|
||||
"displayName": "Bruce",
|
||||
"codeName": "AABruce",
|
||||
"type": "Indicator",
|
||||
"version": {
|
||||
"major": 1,
|
||||
"minor": 0,
|
||||
"patch": 0
|
||||
},
|
||||
"devTeam": "AAMasters",
|
||||
"dataSetVersion": "dataSet.V1",
|
||||
"processes": [
|
||||
{
|
||||
"name": "One-Min-Daily-Candles-Volumes",
|
||||
@@ -24,8 +28,42 @@
|
||||
"run": "false"
|
||||
}
|
||||
},
|
||||
"intervalLapse": 10000,
|
||||
"intervalMaxLoops": -1
|
||||
"normalWaitTime": 60000,
|
||||
"retryWaitTime": 10000,
|
||||
"sleepWaitTime": 3600000,
|
||||
"comaWaitTime": 86400000,
|
||||
"dependencies": [
|
||||
{
|
||||
"devTeam": "AAMasters",
|
||||
"bot": "AACharly",
|
||||
"botVersion": {
|
||||
"major": 1,
|
||||
"minor": 0
|
||||
},
|
||||
"process": "Poloniex-Historic-Trades",
|
||||
"dataSetVersion": "dataSet.V1"
|
||||
},
|
||||
{
|
||||
"devTeam": "AAMasters",
|
||||
"bot": "AACharly",
|
||||
"botVersion": {
|
||||
"major": 1,
|
||||
"minor": 0
|
||||
},
|
||||
"process": "Poloniex-Hole-Fixing",
|
||||
"dataSetVersion": "dataSet.V1"
|
||||
},
|
||||
{
|
||||
"devTeam": "AAMasters",
|
||||
"bot": "AABruce",
|
||||
"botVersion": {
|
||||
"major": 1,
|
||||
"minor": 0
|
||||
},
|
||||
"process": "One-Min-Daily-Candles-Volumes",
|
||||
"dataSetVersion": "dataSet.V1"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user