market from UI

This commit is contained in:
Luis Fernando Molina committed 2020-01-05 14:27:15 +01:00
1 parent 7cab2852fa
commit da67471f0e
9 files changed
+17 -14

No files matched your search

+6 -6
View File
@@ -87,7 +87,7 @@
if (global.LOG_CONTROL[MODULE_NAME].logInfo === true) { logger.write(MODULE_NAME, "[INFO] initialize -> getMarketRateFromExchange -> Entering function."); }
exchangeAPI.getTicker(global.MARKET, onTicker);
exchangeAPI.getTicker(bot.market, onTicker);
return;
@@ -144,7 +144,7 @@
let dataSet = thisObject.dataDependencies.dataSets.get(key);
let dateForPath = bot.processDatetime.getUTCFullYear() + '/' + utilities.pad(bot.processDatetime.getUTCMonth() + 1, 2) + '/' + utilities.pad(bot.processDatetime.getUTCDate(), 2);
let fileName = '' + global.MARKET.assetA + '_' + global.MARKET.assetB + '.json';
let fileName = '' + bot.market.assetA + '_' + bot.market.assetB + '.json';
let filePath = bot.marketRateProvider.product + "/" + bot.marketRateProvider.dataSet + "/" + dateForPath;
dataSet.getTextFile(filePath, fileName, onFileReceived);
@@ -345,7 +345,7 @@
case "Live": {
if (global.LOG_CONTROL[MODULE_NAME].logInfo === true) { logger.write(MODULE_NAME, "[INFO] getPositionsAtExchange -> Live Mode Detected."); }
exchangeAPI.getOpenPositions(global.MARKET, onResponse);
exchangeAPI.getOpenPositions(bot.market, onResponse);
break;
}
@@ -360,7 +360,7 @@
case "Competition": {
if (global.LOG_CONTROL[MODULE_NAME].logInfo === true) { logger.write(MODULE_NAME, "[INFO] getPositionsAtExchange -> Competition Mode Detected."); }
exchangeAPI.getOpenPositions(global.MARKET, onResponse);
exchangeAPI.getOpenPositions(bot.market, onResponse);
break;
}
@@ -977,7 +977,7 @@
case "Live": {
exchangeAPI.putPosition(global.MARKET, pType, pRate, pAmountA, pAmountB, onResponse);
exchangeAPI.putPosition(bot.market, pType, pRate, pAmountA, pAmountB, onResponse);
return;
}
@@ -997,7 +997,7 @@
case "Competition": {
exchangeAPI.putPosition(global.MARKET, pType, pRate, pAmountA, pAmountB, onResponse);
exchangeAPI.putPosition(bot.market, pType, pRate, pAmountA, pAmountB, onResponse);
return;
}
+1 -1
View File
@@ -468,7 +468,7 @@
if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] start -> writeFile -> Entering function."); }
let market = global.MARKET;
let market = bot.market;
let fileName = '' + market.assetA + '_' + market.assetB + '.json';
let dateForPath = ''
+1 -1
View File
@@ -93,7 +93,7 @@
let currentTimeFrame
let currentOutputPeriodName
let market = global.MARKET;
let market = bot.market;
let botNeverRan = true;
/* Context Variables */
+1 -1
View File
@@ -88,7 +88,7 @@
if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] start -> Entering function."); }
let market = global.MARKET;
let market = bot.market;
/* Context Variables */
+1 -1
View File
@@ -81,7 +81,7 @@
if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] start -> Entering function."); }
let market = global.MARKET;
let market = bot.market;
/* Context Variables */
+4
View File
@@ -209,6 +209,10 @@
/* Simplifying the access to basic info */
botConfig.dataMine = global.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.code.codeName
botConfig.exchange = global.TASK_NODE.bot.processes[processIndex].marketInstance.referenceParent.parentNode.parentNode.code.codeName
botConfig.market = {
assetA: global.TASK_NODE.bot.processes[processIndex].marketInstance.referenceParent.baseAsset.referenceParent.code.codeName,
assetB: global.TASK_NODE.bot.processes[processIndex].marketInstance.referenceParent.quotedAsset.referenceParent.code.codeName
}
/* This stuff is still hardcoded and unresolved. */
botConfig.version = {
+2 -2
View File
@@ -148,7 +148,7 @@
if (global.LOG_CONTROL[MODULE_NAME].logInfo === true) { logger.write(MODULE_NAME, "[INFO] load -> Entering function."); }
let fileName = "Status.Report." + global.MARKET.assetA + '_' + global.MARKET.assetB + ".json";
let fileName = "Status.Report." + bot.market.assetA + '_' + bot.market.assetB + ".json";
let filePath;
let ownerId = statusDependencyNode.dataMine + "-" + statusDependencyNode.bot + "-" + statusDependencyNode.botVersion.major + "-" + statusDependencyNode.botVersion.minor + "-" + statusDependencyNode.process + "-" + statusDependencyNode.dataSetVersion;
@@ -245,7 +245,7 @@
return;
}
let fileName = "Status.Report." + global.MARKET.assetA + '_' + global.MARKET.assetB + ".json";
let fileName = "Status.Report." + bot.market.assetA + '_' + bot.market.assetB + ".json";
let filePath = bot.filePathRoot + "/Reports/" + sessionPath + statusDependencyNode.process + timePath;
filePath += '/' + fileName
+1 -1
View File
@@ -107,7 +107,7 @@
const TRADING_SIMULATION = require('./TradingSimulation.js');
let tradingSimulation = TRADING_SIMULATION.newTradingSimulation(bot, logger, UTILITIES);
let market = global.MARKET;
let market = bot.market;
const SIMULATED_RECORDS_FOLDER_NAME = "Trading-Simulation";
const CONDITIONS_FOLDER_NAME = "Simulation-Conditions";
-1
View File
@@ -92,7 +92,6 @@ global.WRITE_LOGS_TO_FILES = process.env.WRITE_LOGS_TO_FILES
/* Default parameters can be changed by the execution configuration */
global.MARKET = { assetA: 'USDT', assetB: 'BTC' }
global.CLONE_EXECUTOR = { codeName: 'AACloud', version: '1.1' } // NOTE: To refactor the name of this variable you would need to go through the bots code that are using it.
/*