aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiyush Dixit <79581397+PiyushDixit96@users.noreply.github.com>2021-05-23 01:37:35 +0530
committerGitHub <noreply@github.com>2021-05-23 01:37:35 +0530
commitf77d568498b5c0fd388146bc7526774ff3e34864 (patch)
tree39aa01d3abda4edcee99494ac323be2f9522d6f6
parent127da47a8a83182e080e417c931efacddf54b3d6 (diff)
fix market order issue
-rw-r--r--index.js19
1 files changed, 14 insertions, 5 deletions
diff --git a/index.js b/index.js
index fc94a9f..55cd0a8 100644
--- a/index.js
+++ b/index.js
@@ -79,18 +79,27 @@ function process_data(data) {
if (["BNB", "BTC", "XRP", "TRX", "ETH", "AUD", "BRL", "EUR", "GBP", "RUB", "TRY", "PAX", "DAI", "UAH", "NGN", "VAI"].includes(str3)) {
sy = str3
}
- let total = `${fixFloat(Number(price) * Number(quantity))} ${sy}`
+ let total
if (orderType !== "LIMIT") {
+ total = `${fixFloat(Number(price) * Number(quantity))} ${sy}`
let {
- L: Lprice
+ L: Last_price
} = data;
- price = Lprice
+ price = Last_price
}
if (executionType === 'NEW') {
if (orderStatus === 'NEW') {
- txt = `✅ ✅ ✅\n<b>Spot ${side} Order CREATED</b>\n<b>Symbol:</b> #${symbol}\n<b>Price:</b> ${price}\n<b>Quantity:</b> ${fixFloat(quantity)}\n<b>Total:</b> ${total}\n<b>Order ID:</b> #ID${orderId}`
+ if (orderType === "MARKET") {
+ txt = `✅ ✅ ✅\n<b>Spot ${orderType} ${side} Order CREATED</b>\n<b>Symbol:</b> #${symbol}\n<b>Quantity:</b> ${fixFloat(quantity)}\n<b>Order ID:</b> #ID${orderId}`
+ }else {
+ txt = `✅ ✅ ✅\n<b>Spot ${orderType} ${side} Order CREATED</b>\n<b>Symbol:</b> #${symbol}\n<b>Price:</b> ${price}\n<b>Quantity:</b> ${fixFloat(quantity)}\n<b>Total:</b> ${total}\n<b>Order ID:</b> #ID${orderId}`
+ }
} else if (orderStatus === 'REJECTED') {
- txt = `🚫 🚫 🚫\n<b>Spot ${side} Order REJECTED</b>\n<b>Symbol:</b> #${symbol}\n<b>Price:</b> ${price}\n<b>Quantity:</b> ${fixFloat(quantity)}\n<b>Total:</b> ${total}\n<b>Order ID:</b> #ID${orderId}`
+ if (orderType === "MARKET") {
+ txt = txt = `🚫 🚫 🚫\n<b>Spot ${orderType} ${side} Order CREATED</b>\n<b>Symbol:</b> #${symbol}\n<b>Quantity:</b> ${fixFloat(quantity)}\n<b>Order ID:</b> #ID${orderId}\n<b>Order reject reason:</b> #ID${Order_reject_reason}`
+ }else {
+ txt = `🚫 🚫 🚫\n<b>Spot ${orderType} ${side} Order REJECTED</b>\n<b>Symbol:</b> #${symbol}\n<b>Price:</b> ${price}\n<b>Quantity:</b> ${fixFloat(quantity)}\n<b>Total:</b> ${total}\n<b>Order ID:</b> #ID${orderId}\n<b>Order reject reason:</b> #ID${Order_reject_reason}`
+ }
}
} else if (executionType === 'CANCELED') {
if (orderStatus === 'CANCELED') {