From 616c5e39e4b8b52edfb389ef5d901a4bca80d260 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Thu, 11 Jul 2019 18:10:19 +0200 Subject: [PATCH] Trade Close Signal to Executor --- Commons.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Commons.js b/Commons.js index 42812685f..89809d74e 100644 --- a/Commons.js +++ b/Commons.js @@ -1491,10 +1491,18 @@ exports.newCommons = function newCommons(bot, logger, UTILITIES) { if (type === '"Close@TakeProfit"' || type === '"Close@StopLoss"') { messageType = MESSAGE_TYPE.OrderUpdate; } else { - messageType = MESSAGE_TYPE.OrderUpdate; + messageType = MESSAGE_TYPE.OrderClose; } } + let exitOutcome = "" + if (messageType === MESSAGE_TYPE.OrderClose && type === '"Close@TakeProfit"') { + exitOutcome = "TP" + } + if (messageType === MESSAGE_TYPE.OrderClose && type === '"Close@TakeProfit"') { + exitOutcome = "SL" + } + executionMessage = createMessage( messageId, MESSAGE_ENTITY.SimulationEngine, @@ -1516,7 +1524,7 @@ exports.newCommons = function newCommons(bot, logger, UTILITIES) { -1, ORDER_STATUS.Signaled, 0, - "") + exitOutcome) } else {