Unsubscribe order update
Request details: Parameter
Parameter | Description |
---|---|
t | ‘uo’ represents Unsubscribe Order update |
from typing import Any
from thefirstock.firstockModules import firstockWebSockets
from thefirstock.pyClient.websocket import WsClient
from thefirstock.pyClient.websocket.enums import MessageTopic
client = firstockWebSockets.webSocketLogin()
ws = client.ws
@ws.on_connect
def connected(client, message):
if message.get('s') == 'OK':
client.unsubscribe_depth('NSE', '22')
@ws.on_message(MessageTopic.DEPTH_UNSUB)
def msg_handler(client: WsClient, message: Any):
print(message)
ws.connect(uid='userId', actid='userId')
ws.run_forever()
const Firstock = require("thefirstock");
const firstock = new Firstock();
const ws = firstock.initializeWebSocket();
ws.on("open", function open() {
firstock.getWebSocketDetails((err, result) => {
if (!err) {
firstock.initialSendWebSocketDetails(ws, result, () => {
ws.send(firstock.unsubscribeOrderUpdate("NSE|26000#NSE|26009"));
});
}
});
});
ws.on("error", function error(error) {
console.log(`WebSocket error: ${error}`);
});
ws.on("message", function message(data) {
const result = firstock.receiveWebSocketDetails(data);
console.log("message: ", result);
});
using thefirstock;
var exitEvent = new ManualResetEvent(false);
using (var client = firstock.initializeWebSocket())
{
client.MessageReceived.Subscribe(msg =>
{
Console.WriteLine("Message received: " + msg);
client.Send(firstock.unsubscribeOrderUpdate());
});
client.Start();
client.Send(firstock.startWebsockets());
exitEvent.WaitOne();
}
Response details
Parameter | Description |
---|---|
t | ‘uok’ represents Unsubscribe Order update acknowledgement |