Bug Fixes

This commit is contained in:
Luis Fernando Molina committed 2020-08-06 11:45:01 +02:00
1 parent f5a1d6339b
commit 11aa3d6bf7
2 files changed
+9 -2

No files matched your search

+3 -2
View File
@@ -586,7 +586,7 @@ exports.newTradingStages = function newTradingStages(bot, logger, tradingEngineM
the Position Rate, and we assign the values Above or Below to it.
*/
if (tradingEngine.current.position.stopLoss.stopLossPosition.value === tradingEngine.current.position.stopLoss.stopLossPosition.config.initialValue) {
if (tradingEngine.current.position.stopLoss.value > tradingEngine.current.position.rate.value) {
if (tradingEngine.current.position.stopLoss.value > tradingEngine.current.position.entryTargetRate.value) {
tradingEngine.current.position.stopLoss.stopLossPosition.value = 'Above'
} else {
tradingEngine.current.position.stopLoss.stopLossPosition.value = 'Below'
@@ -602,7 +602,7 @@ exports.newTradingStages = function newTradingStages(bot, logger, tradingEngineM
the Position Rates, and we assign the values Above or Below to it.
*/
if (tradingEngine.current.position.takeProfit.takeProfitPosition.value === tradingEngine.current.position.takeProfit.takeProfitPosition.config.initialValue) {
if (tradingEngine.current.position.takeProfit.value > tradingEngine.current.position.rate.value) {
if (tradingEngine.current.position.takeProfit.value > tradingEngine.current.position.entryTargetRate.value) {
tradingEngine.current.position.takeProfit.takeProfitPosition.value = 'Above'
} else {
tradingEngine.current.position.takeProfit.takeProfitPosition.value = 'Below'
@@ -885,6 +885,7 @@ exports.newTradingStages = function newTradingStages(bot, logger, tradingEngineM
the total filled size of the Open Stage. By skiping execution now
we allow the open stage to get a final value for sizeFilled that we can use.
*/
let stageNode = tradingSystem.tradingStrategies[tradingEngine.current.strategy.index.value].closeStage
/* Exit Position size and rate */
tradingSystem.evalFormulas(stageNode, 'Initial Targets')
+6
View File
@@ -136,6 +136,12 @@ exports.newTradingSystem = function newTradingSystem(bot, logger, tradingEngineM
included at the errors array. That means we need to do nothing here,
just prevent the execution to be halted for not handling exceptions.
*/
if (typeof err === 'string' || err instanceof String) {
logger.write(MODULE_NAME, '[ERROR] runExecution -> err = ' + err)
}
if (err.stack !== undefined) {
logger.write(MODULE_NAME, '[ERROR] runExecution -> err = ' + err.stack)
}
}
}