diff options
author | Piyush Dixit <79581397+PiyushDixit96@users.noreply.github.com> | 2021-05-10 23:43:21 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-10 23:43:21 +0530 |
commit | ac491dc579322bfcf08ce4002fb3832bc330ddd0 (patch) | |
tree | 910eef3d54fd465ed6effa666ea04331d83a5909 | |
parent | 5c51a0a847e428a5525f5176ee9e9712bda9a3f1 (diff) |
fix Price
-rw-r--r-- | index.js | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -62,23 +62,23 @@ function process_data(data) { if (data.eventType === 'executionReport') {
if (data.executionType === 'NEW') {
if (data.orderStatus === 'NEW') {
- txt = `💸 💸 💸\n<b>Spot Order CREATED\nSide:</b> ${data.side}\n<b>Symbol:</b> #${data.symbol}\n<b>Price:</b> ${fixFloat(data.price)}\n<b>Quantity:</b> ${fixFloat(data.quantity)}\n<b>Order ID:</b> #ID${data.orderId}`
+ txt = `💸 💸 💸\n<b>Spot Order CREATED\nSide:</b> ${data.side}\n<b>Symbol:</b> #${data.symbol}\n<b>Price:</b> ${data.price}\n<b>Quantity:</b> ${fixFloat(data.quantity)}\n<b>Order ID:</b> #ID${data.orderId}`
}
else if (data.orderStatus === 'REJECTED') {
- txt = `🚫 🚫 🚫\n<b>Spot Order REJECTED\nSide:</b> ${data.side}\n<b>Symbol:</b> #${data.symbol}\n<b>Price:</b> ${fixFloat(data.price)}\n<b>Quantity:</b> ${fixFloat(data.quantity)}\n<b>Order ID:</b> #ID${data.orderId}`
+ txt = `🚫 🚫 🚫\n<b>Spot Order REJECTED\nSide:</b> ${data.side}\n<b>Symbol:</b> #${data.symbol}\n<b>Price:</b> ${data.price}\n<b>Quantity:</b> ${fixFloat(data.quantity)}\n<b>Order ID:</b> #ID${data.orderId}`
}
} else if (data.executionType === 'CANCELED') {
if (data.orderStatus === 'CANCELED') {
- txt = `🛑 🛑 🛑\n<b>Spot Order CANCELED\nSide:</b> ${data.side}\n<b>Symbol:</b> #${data.symbol}\n<b>Price:</b> ${fixFloat(data.price)}\n<b>Quantity:</b> ${fixFloat(data.quantity)}\n<b>Order ID:</b> #ID${data.orderId}`
+ txt = `🛑 🛑 🛑\n<b>Spot Order CANCELED\nSide:</b> ${data.side}\n<b>Symbol:</b> #${data.symbol}\n<b>Price:</b> ${data.price}\n<b>Quantity:</b> ${fixFloat(data.quantity)}\n<b>Order ID:</b> #ID${data.orderId}`
}
} else if (data.executionType === 'TRADE') {
if (data.orderStatus === 'PARTIALLY_FILLED') {
- txt = `💰 💰 💰\n<b>Spot Order PARTIALLY FILLED\nSide:</b> ${data.side}\n<b>Symbol:</b> #${data.symbol}\n<b>Price:</b> ${fixFloat(data.price)}\n<b>Last Filled:</b> ${fixFloat(data.lastTradeQuantity)}\n<b>Remaining:</b> ${fixFloat(Number(data.quantity) - Number(data.accumulatedQuantity))}\n<b>Order ID:</b> #ID${data.orderId}`
+ txt = `💰 💰 💰\n<b>Spot Order PARTIALLY FILLED\nSide:</b> ${data.side}\n<b>Symbol:</b> #${data.symbol}\n<b>Price:</b> ${data.price}\n<b>Last Filled:</b> ${fixFloat(data.lastTradeQuantity)}\n<b>Remaining:</b> ${fixFloat(Number(data.quantity) - Number(data.accumulatedQuantity))}\n<b>Order ID:</b> #ID${data.orderId}`
} else if (data.orderStatus === 'FILLED') {
- txt = `✅ ✅ ✅\n<b>Spot Order FULLY FILLED\nSide:</b> ${data.side}\n<b>Symbol:</b> #${data.symbol}\n<b>Price:</b> ${fixFloat(data.price)}\n<b>Filled:</b> ${fixFloat(data.accumulatedQuantity)}\n<b>Order ID:</b> #ID${data.orderId}`
+ txt = `✅ ✅ ✅\n<b>Spot Order FULLY FILLED\nSide:</b> ${data.side}\n<b>Symbol:</b> #${data.symbol}\n<b>Price:</b> ${data.price}\n<b>Filled:</b> ${fixFloat(data.accumulatedQuantity)}\n<b>Order ID:</b> #ID${data.orderId}`
}
} else if (['REPLACED', 'EXPIRED', 'PENDING_CANCEL'].includes(data.orderStatus)) {
- txt = `🔴 🟡 🔵\n<b>Spot Order ${data.orderStatus}\nSide:</b> ${data.side}\n<b>Symbol:</b> #${data.symbol}\n<b>Price:</b> ${fixFloat(data.price)}\n<b>Quantity:</b> ${fixFloat(data.quantity)}\n<b>Order ID:</b> #ID${data.orderId}`
+ txt = `🔴 🟡 🔵\n<b>Spot Order ${data.orderStatus}\nSide:</b> ${data.side}\n<b>Symbol:</b> #${data.symbol}\n<b>Price:</b> ${data.price}\n<b>Quantity:</b> ${fixFloat(data.quantity)}\n<b>Order ID:</b> #ID${data.orderId}`
} else {
txt = `⚠️ ⚠️ ⚠️\n<b>Undefined</b>\nExecution Type: ${data.executionType}\nOrder Status ${data.orderStatus}\nFull Details:\n${msg}`
}
|