fix market order issue

This commit is contained in:
Piyush Dixit 2021-05-23 01:37:35 +05:30 committed by GitHub
parent 127da47a8a
commit f77d568498
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)) { if (["BNB", "BTC", "XRP", "TRX", "ETH", "AUD", "BRL", "EUR", "GBP", "RUB", "TRY", "PAX", "DAI", "UAH", "NGN", "VAI"].includes(str3)) {
sy = str3 sy = str3
} }
let total = `${fixFloat(Number(price) * Number(quantity))} ${sy}` let total
if (orderType !== "LIMIT") { if (orderType !== "LIMIT") {
total = `${fixFloat(Number(price) * Number(quantity))} ${sy}`
let { let {
L: Lprice L: Last_price
} = data; } = data;
price = Lprice price = Last_price
} }
if (executionType === 'NEW') { if (executionType === 'NEW') {
if (orderStatus === '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') { } 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') { } else if (executionType === 'CANCELED') {
if (orderStatus === 'CANCELED') { if (orderStatus === 'CANCELED') {