Upgrade to MQService .13
This commit is contained in:
1 parent
52b0cec6b1
commit
38386069fa
3 files changed
+17
-13
No files matched your search
+15
-11
@@ -3,11 +3,14 @@ const auth = require('./utils/auth')
|
||||
|
||||
exports.newCommons = function newCommons(bot, logger, UTILITIES) {
|
||||
|
||||
const { orderMessage } = require("@superalgos/mqservice")
|
||||
|
||||
const {
|
||||
MESSAGE_ENTITY, MESSAGE_TYPE, ORDER_CREATOR, ORDER_TYPE,
|
||||
ORDER_OWNER, ORDER_DIRECTION, ORDER_STATUS, ORDER_EXIT_OUTCOME,
|
||||
createRecord, getRecord, getExpandedRecord
|
||||
} = require("@superalgos/mqservice")
|
||||
MESSAGE_ENTITY, MESSAGE_TYPE, ORDER_CREATOR, ORDER_TYPE,
|
||||
ORDER_OWNER, ORDER_DIRECTION, ORDER_STATUS, ORDER_EXIT_OUTCOME,
|
||||
createMessage, getMessage, getExpandedMessage
|
||||
} = orderMessage.newOrderMessage()
|
||||
|
||||
|
||||
const FULL_LOG = true;
|
||||
const LOG_FILE_CONTENT = false;
|
||||
@@ -754,6 +757,7 @@ exports.newCommons = function newCommons(bot, logger, UTILITIES) {
|
||||
let messageType;
|
||||
let message;
|
||||
let record;
|
||||
let orderRecord;
|
||||
|
||||
messageId++;
|
||||
|
||||
@@ -767,13 +771,13 @@ exports.newCommons = function newCommons(bot, logger, UTILITIES) {
|
||||
messageType = MESSAGE_TYPE.OrderUpdate;
|
||||
}
|
||||
|
||||
record = createRecord(
|
||||
orderRecord = createMessage(
|
||||
messageId,
|
||||
MESSAGE_ENTITY.SimulationEngine,
|
||||
MESSAGE_ENTITY.SimulationExecutor,
|
||||
messageType,
|
||||
(new Date()).valueOf(),
|
||||
orderId,
|
||||
orderId.toString(),
|
||||
ORDER_CREATOR.SimulationEngine,
|
||||
(new Date()).valueOf(),
|
||||
ORDER_OWNER.User,
|
||||
@@ -785,20 +789,20 @@ exports.newCommons = function newCommons(bot, logger, UTILITIES) {
|
||||
stopLoss,
|
||||
buyOrder,
|
||||
ORDER_DIRECTION.Sell,
|
||||
"All",
|
||||
-1,
|
||||
ORDER_STATUS.Signaled,
|
||||
0,
|
||||
"")
|
||||
|
||||
} else {
|
||||
|
||||
record = createRecord(
|
||||
orderRecord = createMessage(
|
||||
messageId,
|
||||
MESSAGE_ENTITY.SimulationEngine,
|
||||
MESSAGE_ENTITY.SimulationExecutor,
|
||||
MESSAGE_TYPE.HeartBeat,
|
||||
(new Date()).valueOf(),
|
||||
0,
|
||||
"",
|
||||
"",
|
||||
0,
|
||||
"",
|
||||
@@ -810,7 +814,7 @@ exports.newCommons = function newCommons(bot, logger, UTILITIES) {
|
||||
0,
|
||||
0,
|
||||
"",
|
||||
"",
|
||||
0,
|
||||
"",
|
||||
0,
|
||||
"")
|
||||
@@ -842,7 +846,7 @@ exports.newCommons = function newCommons(bot, logger, UTILITIES) {
|
||||
buyOrder: buyOrder,
|
||||
stopLossPhase: stopLossPhase,
|
||||
buyOrderPhase: buyOrderPhase,
|
||||
recordToSimulationExecutor: record
|
||||
orderRecord: orderRecord
|
||||
}
|
||||
|
||||
recordsArray.push(record);
|
||||
|
||||
@@ -160,7 +160,7 @@
|
||||
record.buyOrder + "," +
|
||||
record.stopLossPhase + "," +
|
||||
record.buyOrderPhase + "," +
|
||||
JSON.stringify(record.recordToSimulationExecutor) + "]";
|
||||
JSON.stringify(record.orderRecord) + "]";
|
||||
|
||||
if (separator === "") { separator = ","; }
|
||||
|
||||
|
||||
@@ -158,7 +158,7 @@
|
||||
record.buyOrder + "," +
|
||||
record.stopLossPhase + "," +
|
||||
record.buyOrderPhase + "," +
|
||||
JSON.stringify(record.recordToSimulationExecutor) + "]";
|
||||
JSON.stringify(record.orderRecord) + "]";
|
||||
|
||||
if (separator === "") { separator = ","; }
|
||||
|
||||
|
||||
Reference in new issue
Block a user