I'm facing an issue in kc.orderCancel There is one order in the market which algo needs to be cancel..its been sending cancel request for one hour but every time, it goes to catch block and throws this error
No. Orders are getting placed easily on same route. Send me detailed order logs for this order asap pls. ORDER ID 170420000425516 EXCHANGE ORDER ID 1000000002734877
kc.orderCancel(order_id).then(function(response) { //If order is canceled place new order placeOrder(algo.symbol,buysell,size,Const.ALGO_NAME,record); } }).catch(function(err) { console.log(new Date() + "/" + err); // Something went wrong. });
@sujith Is there any way to get more information from error object in catch block. Right now it just prints this StatusCodeError: 404 - "{\"status\": \"error\", \"message\": \"Route not found\", \"error_type\": \"GeneralException\"}"
Can you paste your cancel code here and details about that order?
Seems like you are trying to access route that doesn't exist.
Send me detailed order logs for this order asap pls.
ORDER ID
170420000425516
EXCHANGE ORDER ID
1000000002734877
//If order is canceled place new order
placeOrder(algo.symbol,buysell,size,Const.ALGO_NAME,record);
}
}).catch(function(err) {
console.log(new Date() + "/" + err);
// Something went wrong.
});
{ exchange_order_id: '1000000002734877',
disclosed_quantity: 0,
market_protection: 0,
tradingsymbol: 'COALINDIA',
tag: '****',
order_type: 'LIMIT',
trigger_price: 0,
cancelled_quantity: 0,
instrument_token: 5215745,
status_message: null,
status: 'OPEN',
product: 'MIS',
exchange: 'NSE',
order_id: '170420000425516',
price: 280.55,
pending_quantity: 371,
validity: 'DAY',
placed_by: 'RD4442',
order_timestamp: '2017-04-20 12:28:11',
parent_order_id: null,
exchange_timestamp: '2017-04-20 12:28:11',
average_price: 0,
variety: 'regular',
transaction_type: 'SELL',
filled_quantity: 0,
quantity: 371 }
Your code looks fine. I think you must be using old version of kiteconnectjs client, update to latest verison.
StatusCodeError: 404 - "{\"status\": \"error\", \"message\": \"Route not found\", \"error_type\": \"GeneralException\"}"
Which is not helpful at all.
In older version it was trying access invalid url, hence it says Route not found.