diff --git a/LowFrequencyTrading/TradingRecords.js b/LowFrequencyTrading/TradingRecords.js index d2dc16ed1..274a60380 100644 --- a/LowFrequencyTrading/TradingRecords.js +++ b/LowFrequencyTrading/TradingRecords.js @@ -337,7 +337,12 @@ exports.newTradingRecords = function newTradingRecords(bot, logger) { let end = record[j] if (end >= tradingEngine.current.episode.candle.end.value) { outputFile.splice(i, 1) - pruneOutputFile(product, outputFile) + /* + This will execute the next prune call in the next iteration of the NodeJs event loop + allowing for other callbacks to be executed. It also prevents the error + 'Maximum call stack size exceeded', since the call is not placed at the call stack. + */ + setImmediate(pruneOutputFile, product, outputFile) return } } diff --git a/LowFrequencyTrading/TradingSimulation.js b/LowFrequencyTrading/TradingSimulation.js index 9827d3a9d..6a8e98a75 100644 --- a/LowFrequencyTrading/TradingSimulation.js +++ b/LowFrequencyTrading/TradingSimulation.js @@ -202,7 +202,12 @@ exports.newTradingSimulation = function newTradingSimulation(bot, logger, UTILIT tradingEngine.current.episode.candle.index.value++ - setImmediate(loop) // This will execute the next loop in the next iteration of the NodeJs event loop allowing for other callbacks to be executed. + /* + This will execute the next loop in the next iteration of the NodeJs event loop + allowing for other callbacks to be executed. It also prevents the error + 'Maximum call stack size exceeded', since the call is not placed at the call stack. + */ + setImmediate(loop) } else { updateEpisode('All Candles Processed') } diff --git a/TaskServer.sln b/TaskServer.sln deleted file mode 100644 index a21837e88..000000000 --- a/TaskServer.sln +++ /dev/null @@ -1,25 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27130.2027 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9092AA53-FB77-4645-B42D-1CCCA6BD08BD}") = "Project", "Project.njsproj", "{AE0A3FE2-7021-4CC2-9922-A887CA5CDD7C}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {AE0A3FE2-7021-4CC2-9922-A887CA5CDD7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AE0A3FE2-7021-4CC2-9922-A887CA5CDD7C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AE0A3FE2-7021-4CC2-9922-A887CA5CDD7C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AE0A3FE2-7021-4CC2-9922-A887CA5CDD7C}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {9128DF06-8CA5-497C-8BF7-B924571C5394} - EndGlobalSection -EndGlobal diff --git a/server.js b/server.js index 80d7a1c9e..4aa0957d2 100644 --- a/server.js +++ b/server.js @@ -1,3 +1,5 @@ + + /* Callbacks default responses. */ global.DEFAULT_OK_RESPONSE = { result: "Ok",