Lets say I placed 2 options order using kite connect 3 javascript api, for which in return I get 2 order IDs (let them me x and y), now in order to make sure this order gets executed, I need to be able to get it's updates, Could you give me an example code of api call using the order IDs x and y?
I want to be able to receive the updates over websocket, in kite connect js I have this Ticker function: ---------------------------------------------------------------------------------------------- var KiteTicker = require("kiteconnect").KiteTicker; var ticker = new KiteTicker({ api_key: "api_key", access_token: "access_token" });
----------------------------------------------------------------------------------------------
var KiteTicker = require("kiteconnect").KiteTicker;
var ticker = new KiteTicker({
api_key: "api_key",
access_token: "access_token"
});
ticker.connect();
ticker.on("ticks", onTicks);
ticker.on("connect", subscribe);
function onTicks(ticks) {
console.log("Ticks", ticks);
}
function subscribe() {
var items = [738561];
ticker.subscribe(items);
ticker.setMode(ticker.modeFull, items);
}
----------------------------------------------------------------------------------------------
So do I have to subscribe using order id? or what, how can I get updates for my new placed orders here? also how long will the updates come?
You will keep getting order updates until your connection is open.