Async Await implementation at Trading Process

This commit is contained in:
Luis Fernando Molina committed 2020-08-18 14:31:52 +02:00
1 parent ea047363af
commit fdbffef52e
17 files changed
+902 -905

No files matched your search

@@ -7,6 +7,7 @@ exports.newTradingStages = function newTradingStages(bot, logger, tradingEngineM
updateChart: updateChart,
mantain: mantain,
reset: reset,
calculateStatistics: calculateStatistics,
runTriggerStage: runTriggerStage,
runOpenStage: runOpenStage,
runManageStage: runManageStage,
@@ -101,6 +102,11 @@ exports.newTradingStages = function newTradingStages(bot, logger, tradingEngineM
resetTradingEngineDataStructure()
}
function calculateStatistics() {
tradingEpisodeModule.calculateStatistics()
tradingPositionModule.calculateStatistics()
}
function runTriggerStage() {
/*
We check if we will be triggering on, off or taking position.
@@ -870,9 +876,6 @@ exports.newTradingStages = function newTradingStages(bot, logger, tradingEngineM
/* Close the Position */
tradingPositionModule.closePosition()
tradingEpisodeModule.calculateResults()
tradingEpisodeModule.calculateStatistics()
/* Close the Strategy */
tradingStrategyModule.closeStrategy('Position Closed')