diff --git a/LearningSession.js b/LearningSession.js index 78256597a..6a7953b65 100644 --- a/LearningSession.js +++ b/LearningSession.js @@ -183,7 +183,7 @@ exports.newLearningSession = function newLearningSession(bot, parentLogger) { non critical is missing, we complete it with a default value. */ - if (bot.LEARNING_SESSION.parameters === undefined) { + if (bot.LEARNING_SESSION.learningParameters === undefined) { let errorMessage = "Session Node with no Parameters." parentLogger.write(MODULE_NAME, "[ERROR] initialize -> checkParemeters -> " + errorMessage) bot.sessionError(bot.LEARNING_SESSION, errorMessage) @@ -191,8 +191,8 @@ exports.newLearningSession = function newLearningSession(bot, parentLogger) { } /* Time Range */ - if (bot.LEARNING_SESSION.parameters.timeRange === undefined) { // if the Time Range is missing we create a default one. - bot.LEARNING_SESSION.parameters.timeRange = { + if (bot.LEARNING_SESSION.learningParameters.timeRange === undefined) { // if the Time Range is missing we create a default one. + bot.LEARNING_SESSION.learningParameters.timeRange = { name: 'Missing Time Range', type: 'Time Range', config: { @@ -203,17 +203,17 @@ exports.newLearningSession = function newLearningSession(bot, parentLogger) { } else { /* Check that we received valid dates */ if (bot.LEARNING_SESSION.type === 'Backtesting Session') { - if (isNaN(new Date(bot.LEARNING_SESSION.parameters.timeRange.config.initialDatetime)).valueOf()) { + if (isNaN(new Date(bot.LEARNING_SESSION.learningParameters.timeRange.config.initialDatetime)).valueOf()) { let errorMessage = "sessionParameters.timeRange.config.initialDatetime is not a valid date." parentLogger.write(MODULE_NAME, "[ERROR] initialize -> checkParemeters -> " + errorMessage) - bot.sessionError(bot.LEARNING_SESSION.parameters, errorMessage) + bot.sessionError(bot.LEARNING_SESSION.learningParameters, errorMessage) return false } } - if (isNaN(new Date(bot.LEARNING_SESSION.parameters.timeRange.config.finalDatetime)).valueOf()) { + if (isNaN(new Date(bot.LEARNING_SESSION.learningParameters.timeRange.config.finalDatetime)).valueOf()) { let errorMessage = "sessionParameters.timeRange.config.initialDatetime is not a valid date." parentLogger.write(MODULE_NAME, "[ERROR] initialize -> checkParemeters -> " + errorMessage) - bot.sessionError(bot.LEARNING_SESSION.parameters, errorMessage) + bot.sessionError(bot.LEARNING_SESSION.learningParameters, errorMessage) return false } } @@ -249,80 +249,80 @@ exports.newLearningSession = function newLearningSession(bot, parentLogger) { /* Initial Datetime */ if (bot.LEARNING_SESSION.type === 'Backtesting Session') { - if (bot.LEARNING_SESSION.parameters.timeRange.config.initialDatetime === undefined) { - bot.LEARNING_SESSION.parameters.timeRange.config.initialDatetime = initialDefault + if (bot.LEARNING_SESSION.learningParameters.timeRange.config.initialDatetime === undefined) { + bot.LEARNING_SESSION.learningParameters.timeRange.config.initialDatetime = initialDefault } else { - bot.LEARNING_SESSION.parameters.timeRange.config.initialDatetime = (new Date(bot.LEARNING_SESSION.parameters.timeRange.config.initialDatetime)).valueOf() + bot.LEARNING_SESSION.learningParameters.timeRange.config.initialDatetime = (new Date(bot.LEARNING_SESSION.learningParameters.timeRange.config.initialDatetime)).valueOf() } } else { /* Non backtest session can start from the past only if explicitly configured that way */ - if (bot.LEARNING_SESSION.parameters.timeRange.config.initialDatetime === undefined || bot.LEARNING_SESSION.parameters.timeRange.config.allowStartingFromThePast !== true) { - bot.LEARNING_SESSION.parameters.timeRange.config.initialDatetime = initialDefault + if (bot.LEARNING_SESSION.learningParameters.timeRange.config.initialDatetime === undefined || bot.LEARNING_SESSION.learningParameters.timeRange.config.allowStartingFromThePast !== true) { + bot.LEARNING_SESSION.learningParameters.timeRange.config.initialDatetime = initialDefault } else { - bot.LEARNING_SESSION.parameters.timeRange.config.initialDatetime = (new Date(bot.LEARNING_SESSION.parameters.timeRange.config.initialDatetime)).valueOf() + bot.LEARNING_SESSION.learningParameters.timeRange.config.initialDatetime = (new Date(bot.LEARNING_SESSION.learningParameters.timeRange.config.initialDatetime)).valueOf() } } /* Final Datetime */ - if (bot.LEARNING_SESSION.parameters.timeRange.config.finalDatetime === undefined) { - bot.LEARNING_SESSION.parameters.timeRange.config.finalDatetime = finalDefault + if (bot.LEARNING_SESSION.learningParameters.timeRange.config.finalDatetime === undefined) { + bot.LEARNING_SESSION.learningParameters.timeRange.config.finalDatetime = finalDefault } else { - bot.LEARNING_SESSION.parameters.timeRange.config.finalDatetime = (new Date(bot.LEARNING_SESSION.parameters.timeRange.config.finalDatetime)).valueOf() + bot.LEARNING_SESSION.learningParameters.timeRange.config.finalDatetime = (new Date(bot.LEARNING_SESSION.learningParameters.timeRange.config.finalDatetime)).valueOf() } } /* Time Frame */ - if (bot.LEARNING_SESSION.parameters.timeFrame === undefined) { + if (bot.LEARNING_SESSION.learningParameters.timeFrame === undefined) { let errorMessage = "Session Parameters Node with no Time Frame." parentLogger.write(MODULE_NAME, "[ERROR] initialize -> checkParemeters -> " + errorMessage) - bot.sessionError(bot.LEARNING_SESSION.parameters, errorMessage) + bot.sessionError(bot.LEARNING_SESSION.learningParameters, errorMessage) return false } - if (bot.LEARNING_SESSION.parameters.timeFrame.config.label === undefined) { + if (bot.LEARNING_SESSION.learningParameters.timeFrame.config.label === undefined) { let errorMessage = "Session Parameters Node with no Time Frame Label configuration." parentLogger.write(MODULE_NAME, "[ERROR] initialize -> checkParemeters -> " + errorMessage) - bot.sessionError(bot.LEARNING_SESSION.parameters.timeFrame, errorMessage) + bot.sessionError(bot.LEARNING_SESSION.learningParameters.timeFrame, errorMessage) return false } - bot.LEARNING_SESSION.parameters.timeFrame.config.value = getTimeFrameFromLabel(bot.LEARNING_SESSION.parameters.timeFrame.config.label) - if (bot.LEARNING_SESSION.parameters.timeFrame.config.value === undefined) { + bot.LEARNING_SESSION.learningParameters.timeFrame.config.value = getTimeFrameFromLabel(bot.LEARNING_SESSION.learningParameters.timeFrame.config.label) + if (bot.LEARNING_SESSION.learningParameters.timeFrame.config.value === undefined) { let errorMessage = "Config error: label value not recognized. Try 01-min or 01-hs for example." parentLogger.write(MODULE_NAME, "[ERROR] initialize -> checkParemeters -> " + errorMessage) - bot.sessionError(bot.LEARNING_SESSION.parameters.timeFrame, errorMessage) + bot.sessionError(bot.LEARNING_SESSION.learningParameters.timeFrame, errorMessage) return false } /* Session Base Asset */ - if (bot.LEARNING_SESSION.parameters.sessionBaseAsset === undefined) { + if (bot.LEARNING_SESSION.learningParameters.sessionBaseAsset === undefined) { let errorMessage = "Session Parameters Node with no Session Base Asset." parentLogger.write(MODULE_NAME, "[ERROR] initialize -> checkParemeters -> " + errorMessage) - bot.sessionError(bot.LEARNING_SESSION.parameters, errorMessage) + bot.sessionError(bot.LEARNING_SESSION.learningParameters, errorMessage) return false } - if (bot.LEARNING_SESSION.parameters.sessionBaseAsset.config.initialBalance === undefined) { + if (bot.LEARNING_SESSION.learningParameters.sessionBaseAsset.config.initialBalance === undefined) { let errorMessage = "Session Parameters Session Base Asset with no initialBalance configuration." parentLogger.write(MODULE_NAME, "[ERROR] initialize -> checkParemeters -> " + errorMessage) - bot.sessionError(bot.LEARNING_SESSION.parameters.sessionBaseAsset, errorMessage) + bot.sessionError(bot.LEARNING_SESSION.learningParameters.sessionBaseAsset, errorMessage) return false } /* Session Quoted Asset */ - if (bot.LEARNING_SESSION.parameters.sessionQuotedAsset === undefined) { + if (bot.LEARNING_SESSION.learningParameters.sessionQuotedAsset === undefined) { let errorMessage = "Session Parameters Node with no Session Quoted Asset." parentLogger.write(MODULE_NAME, "[ERROR] initialize -> checkParemeters -> " + errorMessage) - bot.sessionError(bot.LEARNING_SESSION.parameters, errorMessage) + bot.sessionError(bot.LEARNING_SESSION.learningParameters, errorMessage) return false } - if (bot.LEARNING_SESSION.parameters.sessionQuotedAsset.config.initialBalance === undefined) { + if (bot.LEARNING_SESSION.learningParameters.sessionQuotedAsset.config.initialBalance === undefined) { let errorMessage = "Session Parameters Session Quoted Asset with no initialBalance configuration." parentLogger.write(MODULE_NAME, "[ERROR] initialize -> checkParemeters -> " + errorMessage) - bot.sessionError(bot.LEARNING_SESSION.parameters.sessionQuotedAsset, errorMessage) + bot.sessionError(bot.LEARNING_SESSION.learningParameters.sessionQuotedAsset, errorMessage) return false } /* Slippage */ - if (bot.LEARNING_SESSION.parameters.slippage === undefined) { // if the Slippage is missing we create a default one. - bot.LEARNING_SESSION.parameters.slippage = { + if (bot.LEARNING_SESSION.learningParameters.slippage === undefined) { // if the Slippage is missing we create a default one. + bot.LEARNING_SESSION.learningParameters.slippage = { name: 'Missing Slippage', type: 'Slippage', config: { @@ -332,19 +332,19 @@ exports.newLearningSession = function newLearningSession(bot, parentLogger) { } } } - if (bot.LEARNING_SESSION.parameters.slippage.config.marketOrderRate === undefined) { // if the marketOrderRate is missing we create a default one. - bot.LEARNING_SESSION.parameters.slippage.config.marketOrderRate = 0 + if (bot.LEARNING_SESSION.learningParameters.slippage.config.marketOrderRate === undefined) { // if the marketOrderRate is missing we create a default one. + bot.LEARNING_SESSION.learningParameters.slippage.config.marketOrderRate = 0 } - if (bot.LEARNING_SESSION.parameters.slippage.config.stopLoss === undefined) { // if the stopLoss is missing we create a default one. - bot.LEARNING_SESSION.parameters.slippage.config.stopLoss = 0 + if (bot.LEARNING_SESSION.learningParameters.slippage.config.stopLoss === undefined) { // if the stopLoss is missing we create a default one. + bot.LEARNING_SESSION.learningParameters.slippage.config.stopLoss = 0 } - if (bot.LEARNING_SESSION.parameters.slippage.config.takeProfit === undefined) { // if the takeProfit is missing we create a default one. - bot.LEARNING_SESSION.parameters.slippage.config.takeProfit = 0 + if (bot.LEARNING_SESSION.learningParameters.slippage.config.takeProfit === undefined) { // if the takeProfit is missing we create a default one. + bot.LEARNING_SESSION.learningParameters.slippage.config.takeProfit = 0 } /* Fee Structure */ - if (bot.LEARNING_SESSION.parameters.feeStructure === undefined) { // if the Fee Structure is missing we create a default one. - bot.LEARNING_SESSION.parameters.feeStructure = { + if (bot.LEARNING_SESSION.learningParameters.feeStructure === undefined) { // if the Fee Structure is missing we create a default one. + bot.LEARNING_SESSION.learningParameters.feeStructure = { name: 'Missing Fee Structure', type: 'Fee Structure', config: { @@ -353,11 +353,11 @@ exports.newLearningSession = function newLearningSession(bot, parentLogger) { } } } - if (bot.LEARNING_SESSION.parameters.feeStructure.config.maker === undefined) { // if the maker is missing we create a default one. - bot.LEARNING_SESSION.parameters.feeStructure.config.maker = 0 + if (bot.LEARNING_SESSION.learningParameters.feeStructure.config.maker === undefined) { // if the maker is missing we create a default one. + bot.LEARNING_SESSION.learningParameters.feeStructure.config.maker = 0 } - if (bot.LEARNING_SESSION.parameters.feeStructure.config.taker === undefined) { // if the taker is missing we create a default one. - bot.LEARNING_SESSION.parameters.feeStructure.config.taker = 0 + if (bot.LEARNING_SESSION.learningParameters.feeStructure.config.taker === undefined) { // if the taker is missing we create a default one. + bot.LEARNING_SESSION.learningParameters.feeStructure.config.taker = 0 } return true @@ -391,16 +391,16 @@ exports.newLearningSession = function newLearningSession(bot, parentLogger) { balancePercentage = bot.LEARNING_SESSION.config.balancePercentage } - bot.LEARNING_SESSION.parameters.sessionBaseAsset.config.initialBalance = bot.LEARNING_SESSION.parameters.sessionBaseAsset.config.initialBalance * balancePercentage / 100 - bot.LEARNING_SESSION.parameters.sessionQuotedAsset.config.initialBalance = bot.LEARNING_SESSION.parameters.sessionQuotedAsset.config.initialBalance * balancePercentage / 100 + bot.LEARNING_SESSION.learningParameters.sessionBaseAsset.config.initialBalance = bot.LEARNING_SESSION.learningParameters.sessionBaseAsset.config.initialBalance * balancePercentage / 100 + bot.LEARNING_SESSION.learningParameters.sessionQuotedAsset.config.initialBalance = bot.LEARNING_SESSION.learningParameters.sessionQuotedAsset.config.initialBalance * balancePercentage / 100 - bot.LEARNING_SESSION.parameters.sessionBaseAsset.config.minimumBalance = bot.LEARNING_SESSION.parameters.sessionBaseAsset.config.minimumBalance * balancePercentage / 100 - bot.LEARNING_SESSION.parameters.sessionQuotedAsset.config.minimumBalance = bot.LEARNING_SESSION.parameters.sessionQuotedAsset.config.minimumBalance * balancePercentage / 100 + bot.LEARNING_SESSION.learningParameters.sessionBaseAsset.config.minimumBalance = bot.LEARNING_SESSION.learningParameters.sessionBaseAsset.config.minimumBalance * balancePercentage / 100 + bot.LEARNING_SESSION.learningParameters.sessionQuotedAsset.config.minimumBalance = bot.LEARNING_SESSION.learningParameters.sessionQuotedAsset.config.minimumBalance * balancePercentage / 100 - bot.LEARNING_SESSION.parameters.sessionBaseAsset.config.maximumBalance = bot.LEARNING_SESSION.parameters.sessionBaseAsset.config.maximumBalance * balancePercentage / 100 - bot.LEARNING_SESSION.parameters.sessionQuotedAsset.config.maximumBalance = bot.LEARNING_SESSION.parameters.sessionQuotedAsset.config.maximumBalance * balancePercentage / 100 + bot.LEARNING_SESSION.learningParameters.sessionBaseAsset.config.maximumBalance = bot.LEARNING_SESSION.learningParameters.sessionBaseAsset.config.maximumBalance * balancePercentage / 100 + bot.LEARNING_SESSION.learningParameters.sessionQuotedAsset.config.maximumBalance = bot.LEARNING_SESSION.learningParameters.sessionQuotedAsset.config.maximumBalance * balancePercentage / 100 - pProcessConfig.normalWaitTime = bot.LEARNING_SESSION.parameters.timeFrame.config.value + pProcessConfig.normalWaitTime = bot.LEARNING_SESSION.learningParameters.timeFrame.config.value return true } diff --git a/LowFrequencyTrading/OrdersCalculations.js b/LowFrequencyTrading/OrdersCalculations.js index 4d24e4887..94ffe42d3 100644 --- a/LowFrequencyTrading/OrdersCalculations.js +++ b/LowFrequencyTrading/OrdersCalculations.js @@ -23,7 +23,7 @@ exports.newOrdersCalculations = function newOrdersCalculations(bot, logger) { return thisObject function initialize() { - sessionParameters = bot.TRADING_SESSION.parameters + sessionParameters = bot.TRADING_SESSION.tradingParameters tradingEngine = bot.simulationState.tradingEngine tradingSystem = bot.simulationState.tradingSystem } diff --git a/LowFrequencyTrading/OrdersSimulations.js b/LowFrequencyTrading/OrdersSimulations.js index 1432a822f..c50977c1a 100644 --- a/LowFrequencyTrading/OrdersSimulations.js +++ b/LowFrequencyTrading/OrdersSimulations.js @@ -23,7 +23,7 @@ exports.newOrdersSimulations = function newOrdersSimulations(bot, logger) { return thisObject function initialize() { - sessionParameters = bot.TRADING_SESSION.parameters + sessionParameters = bot.TRADING_SESSION.tradingParameters tradingEngine = bot.simulationState.tradingEngine tradingSystem = bot.simulationState.tradingSystem } diff --git a/LowFrequencyTrading/Snapshots.js b/LowFrequencyTrading/Snapshots.js index afa2c83e7..933d0f37c 100644 --- a/LowFrequencyTrading/Snapshots.js +++ b/LowFrequencyTrading/Snapshots.js @@ -45,7 +45,7 @@ exports.newSnapshots = function newSnapshots(bot, logger) { function initialize() { tradingEngine = bot.simulationState.tradingEngine tradingSystem = bot.simulationState.tradingSystem - sessionParameters = bot.TRADING_SESSION.parameters + sessionParameters = bot.TRADING_SESSION.tradingParameters } function finalize() { diff --git a/LowFrequencyTrading/TradingEngine.js b/LowFrequencyTrading/TradingEngine.js index 7c868dafb..b91ed2247 100644 --- a/LowFrequencyTrading/TradingEngine.js +++ b/LowFrequencyTrading/TradingEngine.js @@ -25,7 +25,7 @@ exports.newTradingEngine = function newTradingEngine(bot, logger) { function initialize() { tradingEngine = bot.simulationState.tradingEngine - sessionParameters = bot.TRADING_SESSION.parameters + sessionParameters = bot.TRADING_SESSION.tradingParameters initializeNodeMap(tradingEngine) diff --git a/LowFrequencyTrading/TradingEpisode.js b/LowFrequencyTrading/TradingEpisode.js index 56d6d289c..05ea301c0 100644 --- a/LowFrequencyTrading/TradingEpisode.js +++ b/LowFrequencyTrading/TradingEpisode.js @@ -23,7 +23,7 @@ exports.newTradingEpisode = function newTradingEpisode(bot, logger, tradingEngin function initialize() { tradingSystem = bot.simulationState.tradingSystem tradingEngine = bot.simulationState.tradingEngine - sessionParameters = bot.TRADING_SESSION.parameters + sessionParameters = bot.TRADING_SESSION.tradingParameters } function finalize() { diff --git a/LowFrequencyTrading/TradingExecution.js b/LowFrequencyTrading/TradingExecution.js index ecc3d6f35..b1e5e3e25 100644 --- a/LowFrequencyTrading/TradingExecution.js +++ b/LowFrequencyTrading/TradingExecution.js @@ -24,7 +24,7 @@ exports.newTradingExecution = function newTradingExecution(bot, logger, tradingE function initialize() { tradingSystem = bot.simulationState.tradingSystem tradingEngine = bot.simulationState.tradingEngine - sessionParameters = bot.TRADING_SESSION.parameters + sessionParameters = bot.TRADING_SESSION.tradingParameters tradingOrdersModule.initialize() } diff --git a/LowFrequencyTrading/TradingOrders.js b/LowFrequencyTrading/TradingOrders.js index 651905e9c..2c432eb57 100644 --- a/LowFrequencyTrading/TradingOrders.js +++ b/LowFrequencyTrading/TradingOrders.js @@ -27,7 +27,7 @@ exports.newTradingOrders = function newTradingOrders(bot, logger, tradingEngineM function initialize() { tradingSystem = bot.simulationState.tradingSystem tradingEngine = bot.simulationState.tradingEngine - sessionParameters = bot.TRADING_SESSION.parameters + sessionParameters = bot.TRADING_SESSION.tradingParameters exchangeAPIModule.initialize() announcementsModule.initialize() diff --git a/LowFrequencyTrading/TradingPosition.js b/LowFrequencyTrading/TradingPosition.js index a0448f1b6..8c606d203 100644 --- a/LowFrequencyTrading/TradingPosition.js +++ b/LowFrequencyTrading/TradingPosition.js @@ -31,7 +31,7 @@ exports.newTradingPosition = function newTradingPosition(bot, logger, tradingEng function initialize() { tradingSystem = bot.simulationState.tradingSystem tradingEngine = bot.simulationState.tradingEngine - sessionParameters = bot.TRADING_SESSION.parameters + sessionParameters = bot.TRADING_SESSION.tradingParameters } function finalize() { diff --git a/LowFrequencyTrading/TradingProcess.js b/LowFrequencyTrading/TradingProcess.js index 95c076e1e..1032c04ea 100644 --- a/LowFrequencyTrading/TradingProcess.js +++ b/LowFrequencyTrading/TradingProcess.js @@ -103,7 +103,7 @@ This variable tell us which day we are standing at, specially while working with Daily Files. From this Date is that we are going to load the Daily Files. */ - bot.simulationState.tradingEngine.current.episode.processDate.value = global.REMOVE_TIME(bot.TRADING_SESSION.parameters.timeRange.config.initialDatetime).valueOf() + bot.simulationState.tradingEngine.current.episode.processDate.value = global.REMOVE_TIME(bot.TRADING_SESSION.tradingParameters.timeRange.config.initialDatetime).valueOf() } /* @@ -219,7 +219,7 @@ callBackFunction(global.DEFAULT_OK_RESPONSE) function checkThereAreCandles(chart) { - let sessionParameters = bot.TRADING_SESSION.parameters + let sessionParameters = bot.TRADING_SESSION.tradingParameters let propertyName = 'at' + sessionParameters.timeFrame.config.label.replace('-', '') let candles = chart[propertyName].candles @@ -236,7 +236,7 @@ let statusReport; /* We are going to use the start date as beging of market date. */ - contextVariables.dateBeginOfMarket = global.REMOVE_TIME(bot.TRADING_SESSION.parameters.timeRange.config.initialDatetime) + contextVariables.dateBeginOfMarket = global.REMOVE_TIME(bot.TRADING_SESSION.tradingParameters.timeRange.config.initialDatetime) /* Here we get the status report from the bot who knows which is the end of the market. */ @@ -371,7 +371,7 @@ dataFiles = new Map(); - if (bot.TRADING_SESSION.parameters.timeFrame.config.label === timeFrameLabel) { + if (bot.TRADING_SESSION.tradingParameters.timeFrame.config.label === timeFrameLabel) { currentTimeFrame = global.marketFilesPeriods[n][0]; currentTimeFrameLabel = global.marketFilesPeriods[n][1]; } @@ -384,7 +384,7 @@ } if (dataDependenciesModule.isItADepenency(timeFrameLabel, datasetModule.node.parentNode.config.singularVariableName) !== true) { - if (!(bot.TRADING_SESSION.parameters.timeFrame.config.label === timeFrameLabel && datasetModule.node.parentNode.config.pluralVariableName === 'candles')) { + if (!(bot.TRADING_SESSION.tradingParameters.timeFrame.config.label === timeFrameLabel && datasetModule.node.parentNode.config.pluralVariableName === 'candles')) { continue } } @@ -431,8 +431,8 @@ let dataRecord = dataFile[i] let begin = dataRecord[beginIndex] let end = dataRecord[endIndex] - if (end + timeFrame < bot.TRADING_SESSION.parameters.timeRange.config.initialDatetime - 1) { continue } // /1 because we need the previous closed element - if (begin > bot.TRADING_SESSION.parameters.timeRange.config.finalDatetime) { continue } + if (end + timeFrame < bot.TRADING_SESSION.tradingParameters.timeRange.config.initialDatetime - 1) { continue } // /1 because we need the previous closed element + if (begin > bot.TRADING_SESSION.tradingParameters.timeRange.config.finalDatetime) { continue } result.push(dataRecord) } return result @@ -468,7 +468,7 @@ } } - if (bot.TRADING_SESSION.parameters.timeFrame.config.label === timeFrameLabel) { + if (bot.TRADING_SESSION.tradingParameters.timeFrame.config.label === timeFrameLabel) { currentTimeFrame = global.dailyFilePeriods[n][0]; currentTimeFrameLabel = global.dailyFilePeriods[n][1]; } @@ -488,7 +488,7 @@ } if (dataDependenciesModule.isItADepenency(timeFrameLabel, datasetModule.node.parentNode.config.singularVariableName) !== true) { - if (!(bot.TRADING_SESSION.parameters.timeFrame.config.label === timeFrameLabel && datasetModule.node.parentNode.config.pluralVariableName === 'candles')) { + if (!(bot.TRADING_SESSION.tradingParameters.timeFrame.config.label === timeFrameLabel && datasetModule.node.parentNode.config.pluralVariableName === 'candles')) { continue } } diff --git a/LowFrequencyTrading/TradingRecords.js b/LowFrequencyTrading/TradingRecords.js index 3ae05a2bf..5540158dd 100644 --- a/LowFrequencyTrading/TradingRecords.js +++ b/LowFrequencyTrading/TradingRecords.js @@ -20,7 +20,7 @@ exports.newTradingRecords = function newTradingRecords(bot, logger) { function initialize(pOutputDatasetsMap) { tradingEngine = bot.simulationState.tradingEngine tradingSystem = bot.simulationState.tradingSystem - sessionParameters = bot.TRADING_SESSION.parameters + sessionParameters = bot.TRADING_SESSION.tradingParameters outputDatasetsMap = pOutputDatasetsMap // These are the files turned into arrays, stored in a Map by Product codeName. } diff --git a/LowFrequencyTrading/TradingSimulation.js b/LowFrequencyTrading/TradingSimulation.js index 25f9aa694..3c262e76a 100644 --- a/LowFrequencyTrading/TradingSimulation.js +++ b/LowFrequencyTrading/TradingSimulation.js @@ -28,7 +28,7 @@ exports.newTradingSimulation = function newTradingSimulation(bot, logger, tradin let tradingSystem = bot.simulationState.tradingSystem let tradingEngine = bot.simulationState.tradingEngine - let sessionParameters = bot.TRADING_SESSION.parameters + let sessionParameters = bot.TRADING_SESSION.tradingParameters if (FULL_LOG === true) { logger.write(MODULE_NAME, '[INFO] runSimulation -> initialDatetime = ' + sessionParameters.timeRange.config.initialDatetime) } if (FULL_LOG === true) { logger.write(MODULE_NAME, '[INFO] runSimulation -> finalDatetime = ' + sessionParameters.timeRange.config.finalDatetime) } diff --git a/LowFrequencyTrading/TradingStages.js b/LowFrequencyTrading/TradingStages.js index 9c25e8992..c62fd4b4c 100644 --- a/LowFrequencyTrading/TradingStages.js +++ b/LowFrequencyTrading/TradingStages.js @@ -47,7 +47,7 @@ exports.newTradingStages = function newTradingStages(bot, logger, tradingEngineM function initialize() { tradingSystem = bot.simulationState.tradingSystem tradingEngine = bot.simulationState.tradingEngine - sessionParameters = bot.TRADING_SESSION.parameters + sessionParameters = bot.TRADING_SESSION.tradingParameters tradingStrategyModule.initialize() tradingPositionModule.initialize() diff --git a/LowFrequencyTrading/TradingStrategy.js b/LowFrequencyTrading/TradingStrategy.js index 3c11a59c0..fbd170845 100644 --- a/LowFrequencyTrading/TradingStrategy.js +++ b/LowFrequencyTrading/TradingStrategy.js @@ -19,7 +19,7 @@ exports.newTradingStrategy = function newTradingStrategy(bot, logger, tradingEng function initialize() { tradingEngine = bot.simulationState.tradingEngine - sessionParameters = bot.TRADING_SESSION.parameters + sessionParameters = bot.TRADING_SESSION.tradingParameters } function finalize() { diff --git a/LowFrequencyTrading/TradingSystem.js b/LowFrequencyTrading/TradingSystem.js index 58c3135c5..ddafc6f33 100644 --- a/LowFrequencyTrading/TradingSystem.js +++ b/LowFrequencyTrading/TradingSystem.js @@ -28,7 +28,7 @@ exports.newTradingSystem = function newTradingSystem(bot, logger, tradingEngineM function initialize() { tradingSystem = bot.simulationState.tradingSystem tradingEngine = bot.simulationState.tradingEngine - sessionParameters = bot.TRADING_SESSION.parameters + sessionParameters = bot.TRADING_SESSION.tradingParameters tradingSystem.conditions = new Map() tradingSystem.formulas = new Map() diff --git a/ReinforcementLearning/LearningBot.js b/ReinforcementLearning/LearningBot.js index f12046828..ad887979f 100644 --- a/ReinforcementLearning/LearningBot.js +++ b/ReinforcementLearning/LearningBot.js @@ -562,15 +562,15 @@ exports.newLearningBot = function newLearningBot(bot, parentLogger) { } else { switch (bot.LEARNING_SESSION.type) { case 'Live Trading Session': { - waitTime = bot.LEARNING_SESSION.parameters.timeFrame.config.value + waitTime = bot.LEARNING_SESSION.learningParameters.timeFrame.config.value break } case 'Fordward Tessting Session': { - waitTime = bot.LEARNING_SESSION.parameters.timeFrame.config.value + waitTime = bot.LEARNING_SESSION.learningParameters.timeFrame.config.value break } case 'Paper Trading Session': { - waitTime = bot.LEARNING_SESSION.parameters.timeFrame.config.value + waitTime = bot.LEARNING_SESSION.learningParameters.timeFrame.config.value break } case 'Backtesting Session': { diff --git a/ReinforcementLearning/LearningProcess.js b/ReinforcementLearning/LearningProcess.js index 0ebbd1bb3..9cb44f672 100644 --- a/ReinforcementLearning/LearningProcess.js +++ b/ReinforcementLearning/LearningProcess.js @@ -103,7 +103,7 @@ exports.newLearningProcess = function newLearningProcess(bot, logger, UTILITIES) This variable tell us which day we are standing at, specially while working with Daily Files. From this Date is that we are going to load the Daily Files. */ - bot.simulationState.tradingEngine.current.episode.processDate.value = global.REMOVE_TIME(bot.TRADING_SESSION.parameters.timeRange.config.initialDatetime).valueOf() + bot.simulationState.tradingEngine.current.episode.processDate.value = global.REMOVE_TIME(bot.TRADING_SESSION.tradingParameters.timeRange.config.initialDatetime).valueOf() } /* @@ -219,7 +219,7 @@ exports.newLearningProcess = function newLearningProcess(bot, logger, UTILITIES) callBackFunction(global.DEFAULT_OK_RESPONSE) function checkThereAreCandles(chart) { - let sessionParameters = bot.TRADING_SESSION.parameters + let sessionParameters = bot.TRADING_SESSION.tradingParameters let propertyName = 'at' + sessionParameters.timeFrame.config.label.replace('-', '') let candles = chart[propertyName].candles @@ -236,7 +236,7 @@ exports.newLearningProcess = function newLearningProcess(bot, logger, UTILITIES) let statusReport; /* We are going to use the start date as beging of market date. */ - contextVariables.dateBeginOfMarket = global.REMOVE_TIME(bot.TRADING_SESSION.parameters.timeRange.config.initialDatetime) + contextVariables.dateBeginOfMarket = global.REMOVE_TIME(bot.TRADING_SESSION.tradingParameters.timeRange.config.initialDatetime) /* Here we get the status report from the bot who knows which is the end of the market. */ @@ -371,7 +371,7 @@ exports.newLearningProcess = function newLearningProcess(bot, logger, UTILITIES) dataFiles = new Map(); - if (bot.TRADING_SESSION.parameters.timeFrame.config.label === timeFrameLabel) { + if (bot.TRADING_SESSION.tradingParameters.timeFrame.config.label === timeFrameLabel) { currentTimeFrame = global.marketFilesPeriods[n][0]; currentTimeFrameLabel = global.marketFilesPeriods[n][1]; } @@ -384,7 +384,7 @@ exports.newLearningProcess = function newLearningProcess(bot, logger, UTILITIES) } if (dataDependenciesModule.isItADepenency(timeFrameLabel, datasetModule.node.parentNode.config.singularVariableName) !== true) { - if (!(bot.TRADING_SESSION.parameters.timeFrame.config.label === timeFrameLabel && datasetModule.node.parentNode.config.pluralVariableName === 'candles')) { + if (!(bot.TRADING_SESSION.tradingParameters.timeFrame.config.label === timeFrameLabel && datasetModule.node.parentNode.config.pluralVariableName === 'candles')) { continue } } @@ -431,8 +431,8 @@ exports.newLearningProcess = function newLearningProcess(bot, logger, UTILITIES) let dataRecord = dataFile[i] let begin = dataRecord[beginIndex] let end = dataRecord[endIndex] - if (end + timeFrame < bot.TRADING_SESSION.parameters.timeRange.config.initialDatetime - 1) { continue } // /1 because we need the previous closed element - if (begin > bot.TRADING_SESSION.parameters.timeRange.config.finalDatetime) { continue } + if (end + timeFrame < bot.TRADING_SESSION.tradingParameters.timeRange.config.initialDatetime - 1) { continue } // /1 because we need the previous closed element + if (begin > bot.TRADING_SESSION.tradingParameters.timeRange.config.finalDatetime) { continue } result.push(dataRecord) } return result @@ -468,7 +468,7 @@ exports.newLearningProcess = function newLearningProcess(bot, logger, UTILITIES) } } - if (bot.TRADING_SESSION.parameters.timeFrame.config.label === timeFrameLabel) { + if (bot.TRADING_SESSION.tradingParameters.timeFrame.config.label === timeFrameLabel) { currentTimeFrame = global.dailyFilePeriods[n][0]; currentTimeFrameLabel = global.dailyFilePeriods[n][1]; } @@ -488,7 +488,7 @@ exports.newLearningProcess = function newLearningProcess(bot, logger, UTILITIES) } if (dataDependenciesModule.isItADepenency(timeFrameLabel, datasetModule.node.parentNode.config.singularVariableName) !== true) { - if (!(bot.TRADING_SESSION.parameters.timeFrame.config.label === timeFrameLabel && datasetModule.node.parentNode.config.pluralVariableName === 'candles')) { + if (!(bot.TRADING_SESSION.tradingParameters.timeFrame.config.label === timeFrameLabel && datasetModule.node.parentNode.config.pluralVariableName === 'candles')) { continue } } diff --git a/ReinforcementLearning/MarkovDecisionProcess.js b/ReinforcementLearning/MarkovDecisionProcess.js index 072611a7b..ca46398dc 100644 --- a/ReinforcementLearning/MarkovDecisionProcess.js +++ b/ReinforcementLearning/MarkovDecisionProcess.js @@ -25,7 +25,7 @@ exports.newMarkovDecisionProcess = function newMarkovDecisionProcess(bot, logger function initialize() { tradingEngine = bot.simulationState.tradingEngine - sessionParameters = bot.LEARNING_SESSION.parameters + sessionParameters = bot.LEARNING_SESSION.learningParameters initializeNodeMap(tradingEngine) diff --git a/TradingBot.js b/TradingBot.js index deccc008b..064a3a3c2 100644 --- a/TradingBot.js +++ b/TradingBot.js @@ -562,15 +562,15 @@ } else { switch (bot.TRADING_SESSION.type) { case 'Live Trading Session': { - waitTime = bot.TRADING_SESSION.parameters.timeFrame.config.value + waitTime = bot.TRADING_SESSION.tradingParameters.timeFrame.config.value break } case 'Fordward Tessting Session': { - waitTime = bot.TRADING_SESSION.parameters.timeFrame.config.value + waitTime = bot.TRADING_SESSION.tradingParameters.timeFrame.config.value break } case 'Paper Trading Session': { - waitTime = bot.TRADING_SESSION.parameters.timeFrame.config.value + waitTime = bot.TRADING_SESSION.tradingParameters.timeFrame.config.value break } case 'Backtesting Session': { diff --git a/TradingSession.js b/TradingSession.js index fd8f6c290..5999d48dd 100644 --- a/TradingSession.js +++ b/TradingSession.js @@ -183,7 +183,7 @@ non critical is missing, we complete it with a default value. */ - if (bot.TRADING_SESSION.parameters === undefined) { + if (bot.TRADING_SESSION.tradingParameters === undefined) { let errorMessage = "Session Node with no Parameters." parentLogger.write(MODULE_NAME, "[ERROR] initialize -> checkParemeters -> " + errorMessage) bot.TRADING_SESSIONError(bot.TRADING_SESSION, errorMessage) @@ -191,8 +191,8 @@ } /* Time Range */ - if (bot.TRADING_SESSION.parameters.timeRange === undefined) { // if the Time Range is missing we create a default one. - bot.TRADING_SESSION.parameters.timeRange = { + if (bot.TRADING_SESSION.tradingParameters.timeRange === undefined) { // if the Time Range is missing we create a default one. + bot.TRADING_SESSION.tradingParameters.timeRange = { name: 'Missing Time Range', type: 'Time Range', config: { @@ -203,17 +203,17 @@ } else { /* Check that we received valid dates */ if (bot.TRADING_SESSION.type === 'Backtesting Session') { - if (isNaN(new Date(bot.TRADING_SESSION.parameters.timeRange.config.initialDatetime)).valueOf()) { + if (isNaN(new Date(bot.TRADING_SESSION.tradingParameters.timeRange.config.initialDatetime)).valueOf()) { let errorMessage = "sessionParameters.timeRange.config.initialDatetime is not a valid date." parentLogger.write(MODULE_NAME, "[ERROR] initialize -> checkParemeters -> " + errorMessage) - bot.TRADING_SESSIONError(bot.TRADING_SESSION.parameters, errorMessage) + bot.TRADING_SESSIONError(bot.TRADING_SESSION.tradingParameters, errorMessage) return false } } - if (isNaN(new Date(bot.TRADING_SESSION.parameters.timeRange.config.finalDatetime)).valueOf()) { + if (isNaN(new Date(bot.TRADING_SESSION.tradingParameters.timeRange.config.finalDatetime)).valueOf()) { let errorMessage = "sessionParameters.timeRange.config.initialDatetime is not a valid date." parentLogger.write(MODULE_NAME, "[ERROR] initialize -> checkParemeters -> " + errorMessage) - bot.TRADING_SESSIONError(bot.TRADING_SESSION.parameters, errorMessage) + bot.TRADING_SESSIONError(bot.TRADING_SESSION.tradingParameters, errorMessage) return false } } @@ -249,80 +249,80 @@ /* Initial Datetime */ if (bot.TRADING_SESSION.type === 'Backtesting Session') { - if (bot.TRADING_SESSION.parameters.timeRange.config.initialDatetime === undefined) { - bot.TRADING_SESSION.parameters.timeRange.config.initialDatetime = initialDefault + if (bot.TRADING_SESSION.tradingParameters.timeRange.config.initialDatetime === undefined) { + bot.TRADING_SESSION.tradingParameters.timeRange.config.initialDatetime = initialDefault } else { - bot.TRADING_SESSION.parameters.timeRange.config.initialDatetime = (new Date(bot.TRADING_SESSION.parameters.timeRange.config.initialDatetime)).valueOf() + bot.TRADING_SESSION.tradingParameters.timeRange.config.initialDatetime = (new Date(bot.TRADING_SESSION.tradingParameters.timeRange.config.initialDatetime)).valueOf() } } else { /* Non backtest session can start from the past only if explicitly configured that way */ - if (bot.TRADING_SESSION.parameters.timeRange.config.initialDatetime === undefined || bot.TRADING_SESSION.parameters.timeRange.config.allowStartingFromThePast !== true) { - bot.TRADING_SESSION.parameters.timeRange.config.initialDatetime = initialDefault + if (bot.TRADING_SESSION.tradingParameters.timeRange.config.initialDatetime === undefined || bot.TRADING_SESSION.tradingParameters.timeRange.config.allowStartingFromThePast !== true) { + bot.TRADING_SESSION.tradingParameters.timeRange.config.initialDatetime = initialDefault } else { - bot.TRADING_SESSION.parameters.timeRange.config.initialDatetime = (new Date(bot.TRADING_SESSION.parameters.timeRange.config.initialDatetime)).valueOf() + bot.TRADING_SESSION.tradingParameters.timeRange.config.initialDatetime = (new Date(bot.TRADING_SESSION.tradingParameters.timeRange.config.initialDatetime)).valueOf() } } /* Final Datetime */ - if (bot.TRADING_SESSION.parameters.timeRange.config.finalDatetime === undefined) { - bot.TRADING_SESSION.parameters.timeRange.config.finalDatetime = finalDefault + if (bot.TRADING_SESSION.tradingParameters.timeRange.config.finalDatetime === undefined) { + bot.TRADING_SESSION.tradingParameters.timeRange.config.finalDatetime = finalDefault } else { - bot.TRADING_SESSION.parameters.timeRange.config.finalDatetime = (new Date(bot.TRADING_SESSION.parameters.timeRange.config.finalDatetime)).valueOf() + bot.TRADING_SESSION.tradingParameters.timeRange.config.finalDatetime = (new Date(bot.TRADING_SESSION.tradingParameters.timeRange.config.finalDatetime)).valueOf() } } /* Time Frame */ - if (bot.TRADING_SESSION.parameters.timeFrame === undefined) { + if (bot.TRADING_SESSION.tradingParameters.timeFrame === undefined) { let errorMessage = "Session Parameters Node with no Time Frame." parentLogger.write(MODULE_NAME, "[ERROR] initialize -> checkParemeters -> " + errorMessage) - bot.TRADING_SESSIONError(bot.TRADING_SESSION.parameters, errorMessage) + bot.TRADING_SESSIONError(bot.TRADING_SESSION.tradingParameters, errorMessage) return false } - if (bot.TRADING_SESSION.parameters.timeFrame.config.label === undefined) { + if (bot.TRADING_SESSION.tradingParameters.timeFrame.config.label === undefined) { let errorMessage = "Session Parameters Node with no Time Frame Label configuration." parentLogger.write(MODULE_NAME, "[ERROR] initialize -> checkParemeters -> " + errorMessage) - bot.TRADING_SESSIONError(bot.TRADING_SESSION.parameters.timeFrame, errorMessage) + bot.TRADING_SESSIONError(bot.TRADING_SESSION.tradingParameters.timeFrame, errorMessage) return false } - bot.TRADING_SESSION.parameters.timeFrame.config.value = getTimeFrameFromLabel(bot.TRADING_SESSION.parameters.timeFrame.config.label) - if (bot.TRADING_SESSION.parameters.timeFrame.config.value === undefined) { + bot.TRADING_SESSION.tradingParameters.timeFrame.config.value = getTimeFrameFromLabel(bot.TRADING_SESSION.tradingParameters.timeFrame.config.label) + if (bot.TRADING_SESSION.tradingParameters.timeFrame.config.value === undefined) { let errorMessage = "Config error: label value not recognized. Try 01-min or 01-hs for example." parentLogger.write(MODULE_NAME, "[ERROR] initialize -> checkParemeters -> " + errorMessage) - bot.TRADING_SESSIONError(bot.TRADING_SESSION.parameters.timeFrame, errorMessage) + bot.TRADING_SESSIONError(bot.TRADING_SESSION.tradingParameters.timeFrame, errorMessage) return false } /* Session Base Asset */ - if (bot.TRADING_SESSION.parameters.sessionBaseAsset === undefined) { + if (bot.TRADING_SESSION.tradingParameters.sessionBaseAsset === undefined) { let errorMessage = "Session Parameters Node with no Session Base Asset." parentLogger.write(MODULE_NAME, "[ERROR] initialize -> checkParemeters -> " + errorMessage) - bot.TRADING_SESSIONError(bot.TRADING_SESSION.parameters, errorMessage) + bot.TRADING_SESSIONError(bot.TRADING_SESSION.tradingParameters, errorMessage) return false } - if (bot.TRADING_SESSION.parameters.sessionBaseAsset.config.initialBalance === undefined) { + if (bot.TRADING_SESSION.tradingParameters.sessionBaseAsset.config.initialBalance === undefined) { let errorMessage = "Session Parameters Session Base Asset with no initialBalance configuration." parentLogger.write(MODULE_NAME, "[ERROR] initialize -> checkParemeters -> " + errorMessage) - bot.TRADING_SESSIONError(bot.TRADING_SESSION.parameters.sessionBaseAsset, errorMessage) + bot.TRADING_SESSIONError(bot.TRADING_SESSION.tradingParameters.sessionBaseAsset, errorMessage) return false } /* Session Quoted Asset */ - if (bot.TRADING_SESSION.parameters.sessionQuotedAsset === undefined) { + if (bot.TRADING_SESSION.tradingParameters.sessionQuotedAsset === undefined) { let errorMessage = "Session Parameters Node with no Session Quoted Asset." parentLogger.write(MODULE_NAME, "[ERROR] initialize -> checkParemeters -> " + errorMessage) - bot.TRADING_SESSIONError(bot.TRADING_SESSION.parameters, errorMessage) + bot.TRADING_SESSIONError(bot.TRADING_SESSION.tradingParameters, errorMessage) return false } - if (bot.TRADING_SESSION.parameters.sessionQuotedAsset.config.initialBalance === undefined) { + if (bot.TRADING_SESSION.tradingParameters.sessionQuotedAsset.config.initialBalance === undefined) { let errorMessage = "Session Parameters Session Quoted Asset with no initialBalance configuration." parentLogger.write(MODULE_NAME, "[ERROR] initialize -> checkParemeters -> " + errorMessage) - bot.TRADING_SESSIONError(bot.TRADING_SESSION.parameters.sessionQuotedAsset, errorMessage) + bot.TRADING_SESSIONError(bot.TRADING_SESSION.tradingParameters.sessionQuotedAsset, errorMessage) return false } /* Slippage */ - if (bot.TRADING_SESSION.parameters.slippage === undefined) { // if the Slippage is missing we create a default one. - bot.TRADING_SESSION.parameters.slippage = { + if (bot.TRADING_SESSION.tradingParameters.slippage === undefined) { // if the Slippage is missing we create a default one. + bot.TRADING_SESSION.tradingParameters.slippage = { name: 'Missing Slippage', type: 'Slippage', config: { @@ -332,19 +332,19 @@ } } } - if (bot.TRADING_SESSION.parameters.slippage.config.marketOrderRate === undefined) { // if the marketOrderRate is missing we create a default one. - bot.TRADING_SESSION.parameters.slippage.config.marketOrderRate = 0 + if (bot.TRADING_SESSION.tradingParameters.slippage.config.marketOrderRate === undefined) { // if the marketOrderRate is missing we create a default one. + bot.TRADING_SESSION.tradingParameters.slippage.config.marketOrderRate = 0 } - if (bot.TRADING_SESSION.parameters.slippage.config.stopLoss === undefined) { // if the stopLoss is missing we create a default one. - bot.TRADING_SESSION.parameters.slippage.config.stopLoss = 0 + if (bot.TRADING_SESSION.tradingParameters.slippage.config.stopLoss === undefined) { // if the stopLoss is missing we create a default one. + bot.TRADING_SESSION.tradingParameters.slippage.config.stopLoss = 0 } - if (bot.TRADING_SESSION.parameters.slippage.config.takeProfit === undefined) { // if the takeProfit is missing we create a default one. - bot.TRADING_SESSION.parameters.slippage.config.takeProfit = 0 + if (bot.TRADING_SESSION.tradingParameters.slippage.config.takeProfit === undefined) { // if the takeProfit is missing we create a default one. + bot.TRADING_SESSION.tradingParameters.slippage.config.takeProfit = 0 } /* Fee Structure */ - if (bot.TRADING_SESSION.parameters.feeStructure === undefined) { // if the Fee Structure is missing we create a default one. - bot.TRADING_SESSION.parameters.feeStructure = { + if (bot.TRADING_SESSION.tradingParameters.feeStructure === undefined) { // if the Fee Structure is missing we create a default one. + bot.TRADING_SESSION.tradingParameters.feeStructure = { name: 'Missing Fee Structure', type: 'Fee Structure', config: { @@ -353,11 +353,11 @@ } } } - if (bot.TRADING_SESSION.parameters.feeStructure.config.maker === undefined) { // if the maker is missing we create a default one. - bot.TRADING_SESSION.parameters.feeStructure.config.maker = 0 + if (bot.TRADING_SESSION.tradingParameters.feeStructure.config.maker === undefined) { // if the maker is missing we create a default one. + bot.TRADING_SESSION.tradingParameters.feeStructure.config.maker = 0 } - if (bot.TRADING_SESSION.parameters.feeStructure.config.taker === undefined) { // if the taker is missing we create a default one. - bot.TRADING_SESSION.parameters.feeStructure.config.taker = 0 + if (bot.TRADING_SESSION.tradingParameters.feeStructure.config.taker === undefined) { // if the taker is missing we create a default one. + bot.TRADING_SESSION.tradingParameters.feeStructure.config.taker = 0 } return true @@ -391,16 +391,16 @@ balancePercentage = bot.TRADING_SESSION.config.balancePercentage } - bot.TRADING_SESSION.parameters.sessionBaseAsset.config.initialBalance = bot.TRADING_SESSION.parameters.sessionBaseAsset.config.initialBalance * balancePercentage / 100 - bot.TRADING_SESSION.parameters.sessionQuotedAsset.config.initialBalance = bot.TRADING_SESSION.parameters.sessionQuotedAsset.config.initialBalance * balancePercentage / 100 + bot.TRADING_SESSION.tradingParameters.sessionBaseAsset.config.initialBalance = bot.TRADING_SESSION.tradingParameters.sessionBaseAsset.config.initialBalance * balancePercentage / 100 + bot.TRADING_SESSION.tradingParameters.sessionQuotedAsset.config.initialBalance = bot.TRADING_SESSION.tradingParameters.sessionQuotedAsset.config.initialBalance * balancePercentage / 100 - bot.TRADING_SESSION.parameters.sessionBaseAsset.config.minimumBalance = bot.TRADING_SESSION.parameters.sessionBaseAsset.config.minimumBalance * balancePercentage / 100 - bot.TRADING_SESSION.parameters.sessionQuotedAsset.config.minimumBalance = bot.TRADING_SESSION.parameters.sessionQuotedAsset.config.minimumBalance * balancePercentage / 100 + bot.TRADING_SESSION.tradingParameters.sessionBaseAsset.config.minimumBalance = bot.TRADING_SESSION.tradingParameters.sessionBaseAsset.config.minimumBalance * balancePercentage / 100 + bot.TRADING_SESSION.tradingParameters.sessionQuotedAsset.config.minimumBalance = bot.TRADING_SESSION.tradingParameters.sessionQuotedAsset.config.minimumBalance * balancePercentage / 100 - bot.TRADING_SESSION.parameters.sessionBaseAsset.config.maximumBalance = bot.TRADING_SESSION.parameters.sessionBaseAsset.config.maximumBalance * balancePercentage / 100 - bot.TRADING_SESSION.parameters.sessionQuotedAsset.config.maximumBalance = bot.TRADING_SESSION.parameters.sessionQuotedAsset.config.maximumBalance * balancePercentage / 100 + bot.TRADING_SESSION.tradingParameters.sessionBaseAsset.config.maximumBalance = bot.TRADING_SESSION.tradingParameters.sessionBaseAsset.config.maximumBalance * balancePercentage / 100 + bot.TRADING_SESSION.tradingParameters.sessionQuotedAsset.config.maximumBalance = bot.TRADING_SESSION.tradingParameters.sessionQuotedAsset.config.maximumBalance * balancePercentage / 100 - pProcessConfig.normalWaitTime = bot.TRADING_SESSION.parameters.timeFrame.config.value + pProcessConfig.normalWaitTime = bot.TRADING_SESSION.tradingParameters.timeFrame.config.value return true }