Warniings & Infos

This commit is contained in:
Luis Fernando Molina committed 2020-08-29 13:37:51 +02:00
1 parent 7ccd486558
commit 5e16b3e49a
3 files changed
+23 -5

No files matched your search

+7 -2
View File
@@ -104,8 +104,9 @@ exports.newTradingSimulation = function newTradingSimulation(bot, logger, tradin
*/
for (let i = initialCandle; i < candles.length - 1; i++) {
tradingEngine.current.episode.candle.index.value = i
if (FULL_LOG === true) { logger.write(MODULE_NAME, '[INFO] runSimulation -> loop -> Processing candle # ' + tradingEngine.current.episode.candle.index.value) }
let candle = candles[tradingEngine.current.episode.candle.index.value] // This is the current candle the Simulation is working at.
/* This is the current candle the Simulation is working at. */
let candle = candles[tradingEngine.current.episode.candle.index.value]
if (FULL_LOG === true) { logger.write(MODULE_NAME, '[INFO] runSimulation -> loop -> Candle Begin @ ' + (new Date(candle.begin)).toLocaleString()) }
if (FULL_LOG === true) { logger.write(MODULE_NAME, '[INFO] runSimulation -> loop -> Candle End @ ' + (new Date(candle.end)).toLocaleString()) }
@@ -186,6 +187,10 @@ exports.newTradingSimulation = function newTradingSimulation(bot, logger, tradin
tradingEpisodeModule.reset()
tradingEngineModule.reset()
let infoMessage = 'Processing candle # ' + tradingEngine.current.episode.candle.index.value + ' @ the ' + tradingEngine.current.episode.cycle.value + ' cycle.'
if (FULL_LOG === true) { logger.write(MODULE_NAME, '[INFO] runSimulation -> loop -> ' + infoMessage) }
tradingSystem.infos.push([tradingSystem.id, infoMessage])
await tradingSystemModule.run()
}
+4
View File
@@ -87,6 +87,8 @@ exports.newTradingSystem = function newTradingSystem(bot, logger, tradingEngineM
tradingSystem.highlights = undefined
tradingSystem.errors = undefined
tradingSystem.warnings = undefined
tradingSystem.infos = undefined
tradingSystem.values = undefined
tradingSystem.status = undefined
tradingSystem.progress = undefined
@@ -106,6 +108,8 @@ exports.newTradingSystem = function newTradingSystem(bot, logger, tradingEngineM
tradingSystem.highlights = []
tradingSystem.errors = []
tradingSystem.warnings = []
tradingSystem.infos = []
tradingSystem.values = []
tradingSystem.status = []
tradingSystem.progress = []
+12 -3
View File
@@ -214,10 +214,19 @@
*/
/* Initial Datetime */
if (bot.SESSION.parameters.timeRange.config.initialDatetime === undefined || bot.SESSION.parameters.timeRange.config.allowStartingFromThePast !== true ) {
bot.SESSION.parameters.timeRange.config.initialDatetime = initialDefault
if (bot.SESSION.type === 'Backtesting Session') {
if (bot.SESSION.parameters.timeRange.config.initialDatetime === undefined ) {
bot.SESSION.parameters.timeRange.config.initialDatetime = initialDefault
} else {
bot.SESSION.parameters.timeRange.config.initialDatetime = (new Date(bot.SESSION.parameters.timeRange.config.initialDatetime)).valueOf()
}
} else {
bot.SESSION.parameters.timeRange.config.initialDatetime = (new Date(bot.SESSION.parameters.timeRange.config.initialDatetime)).valueOf()
/* Non backtest session can start from the past only if explicitly configured that way */
if (bot.SESSION.parameters.timeRange.config.initialDatetime === undefined || bot.SESSION.parameters.timeRange.config.allowStartingFromThePast !== true ) {
bot.SESSION.parameters.timeRange.config.initialDatetime = initialDefault
} else {
bot.SESSION.parameters.timeRange.config.initialDatetime = (new Date(bot.SESSION.parameters.timeRange.config.initialDatetime)).valueOf()
}
}
/* Final Datetime */