Fordward Test finished

This commit is contained in:
Luis Fernando Molina committed 2019-10-18 09:42:34 +02:00
1 parent 0ff6e43075
commit d2bdd1f5df
2 files changed
+33 -1

No files matched your search

+32
View File
@@ -136,6 +136,28 @@
bot.multiPeriodProcessDatetime = new Date(bot.VALUES_TO_USE.timeRange.initialDatetime.valueOf())
bot.hasTheBotJustStarted = true
/* Reduce the balance */
let balancePercentage = 1 // This is the default value
try {
let code = JSON.parse(bot.SESSION.code)
if (code.balancePercentage !== undefined) {
balancePercentage = code.balancePercentage
}
} catch (err) {
parentLogger.write(MODULE_NAME, "[WARN] initialize -> startFordwardTesting -> Invalid value por balancePercentage. Using Default.");
}
bot.VALUES_TO_USE.initialBalanceA = bot.VALUES_TO_USE.initialBalanceA * balancePercentage / 100
bot.VALUES_TO_USE.initialBalanceB = bot.VALUES_TO_USE.initialBalanceB * balancePercentage / 100
bot.VALUES_TO_USE.minimumBalanceA = bot.VALUES_TO_USE.minimumBalanceA * balancePercentage / 100
bot.VALUES_TO_USE.minimumBalanceB = bot.VALUES_TO_USE.minimumBalanceB * balancePercentage / 100
bot.VALUES_TO_USE.maximumBalanceA = bot.VALUES_TO_USE.maximumBalanceA * balancePercentage / 100
bot.VALUES_TO_USE.maximumBalanceB = bot.VALUES_TO_USE.maximumBalanceB * balancePercentage / 100
}
function startPaperTrading(message) {
@@ -236,6 +258,16 @@
bot.VALUES_TO_USE.timeRange.finalDatetime = new Date((new Date()).valueOf() + ONE_YEAR_IN_MILISECONDS)
break
}
case 'Fordward Testing Session': {
bot.VALUES_TO_USE.timeRange.initialDatetime = new Date()
bot.VALUES_TO_USE.timeRange.finalDatetime = new Date((new Date()).valueOf() + ONE_YEAR_IN_MILISECONDS)
break
}
case 'Paper Trading Session': {
bot.VALUES_TO_USE.timeRange.initialDatetime = new Date()
bot.VALUES_TO_USE.timeRange.finalDatetime = new Date((new Date()).valueOf() + ONE_YEAR_IN_MILISECONDS)
break
}
}
let tradingSystem = bot.DEFINITION.tradingSystem
+1 -1
View File
@@ -112,7 +112,7 @@ process.on('message', message => {
There are some process that might no be able to end grafully, for example the ones schedulle to process information in a future day or month.
In order to be sure that the process will be terminated, we schedulle one forced exit in 2 minutes from now.
*/
console.log('[INFO] Task Server -> server -> process.on -> Executing order received from Task Manager to Stop this Task. Nodejs process will be exited in less than 1 minutes.')
console.log('[INFO] Task Server -> server -> process.on -> Executing order received from Task Manager to Stop this Task. Nodejs process will be exited in less than 1 minute.')
setTimeout(global.EXIT_NODE_PROCESS, 60000);
}
});