@Moderator_3, any update on this?
Posts made by aakash2610
-
RE: Websocket Order Status is not giving updated data for "modify pending" and "modified" events
@Moderator_3 , I have faced it several times, sharing data of one of the occurrence below.
I already had an order of IDEA with 2 quantity and 15 price. I modified order to have 4 quantity and 15.5 price. But I receive "modify pending" and "modified" events with stale data (i.e. 2 quantity and 15 price).
- Timestamp: 11-Jun-2024 09:36:14
- Orderid: 240611000191247
- client_code: N255065
Let me know if you need any more information.
-
RE: Websocket Order Status is not giving updated data for "modify pending" and "modified" events
@Moderator_3 I have tried it several times, but every time I am receiving stale data. Sharing data for one of the occurrence below.
So I already had a limit order for IDEA with 2 quantity and Rs.15 price. I modified the order to have 4 quantity and 15.5 price. As you can see, "modify pending" and "modified" events (i.e. AB11 and AB04) have stale data (state before modification request). But open event is being sent with correct and updated data.
{"user-id": "N255065","status-code": "200","order-status": "AB11","error-message": "","orderData": {"variety": "NORMAL","ordertype": "LIMIT","ordertag": "","producttype": "DELIVERY","price": 15.0,"triggerprice": 0.0,"quantity": "2","disclosedquantity": "0","duration": "DAY","squareoff": 0.0,"stoploss": 0.0,"trailingstoploss": 0.0,"tradingsymbol": "IDEA-EQ","transactiontype": "BUY","exchange": "NSE","symboltoken": "14366","instrumenttype": "","strikeprice": -1.0,"optiontype": "","expirydate": "","lotsize": "1","cancelsize": "0","averageprice": 0.0,"filledshares": "0","unfilledshares": "2","orderid": "240611000191247","text": "","status": "modify pending","orderstatus": "modify pending","updatetime": "11-Jun-2024 09:36:14","exchtime": "11-Jun-2024 09:35:01","exchorderupdatetime": "11-Jun-2024 09:35:01","fillid": "","filltime": "","parentorderid": ""}} {"user-id": "N255065","status-code": "200","order-status": "AB04","error-message": "","orderData": {"variety": "NORMAL","ordertype": "LIMIT","ordertag": "","producttype": "DELIVERY","price": 15.0,"triggerprice": 0.0,"quantity": "2","disclosedquantity": "0","duration": "DAY","squareoff": 0.0,"stoploss": 0.0,"trailingstoploss": 0.0,"tradingsymbol": "IDEA-EQ","transactiontype": "BUY","exchange": "NSE","symboltoken": "14366","instrumenttype": "","strikeprice": -1.0,"optiontype": "","expirydate": "","lotsize": "1","cancelsize": "0","averageprice": 0.0,"filledshares": "0","unfilledshares": "2","orderid": "240611000191247","text": "","status": "modified","orderstatus": "open","updatetime": "11-Jun-2024 09:36:14","exchtime": "11-Jun-2024 09:36:14","exchorderupdatetime": "11-Jun-2024 09:36:14","fillid": "","filltime": "","parentorderid": ""}} {"user-id": "N255065","status-code": "200","order-status": "AB01","error-message": "","orderData": {"variety": "NORMAL","ordertype": "LIMIT","ordertag": "","producttype": "DELIVERY","price": 15.5,"triggerprice": 0.0,"quantity": "4","disclosedquantity": "0","duration": "DAY","squareoff": 0.0,"stoploss": 0.0,"trailingstoploss": 0.0,"tradingsymbol": "IDEA-EQ","transactiontype": "BUY","exchange": "NSE","symboltoken": "14366","instrumenttype": "","strikeprice": -1.0,"optiontype": "","expirydate": "","lotsize": "1","cancelsize": "0","averageprice": 0.0,"filledshares": "0","unfilledshares": "4","orderid": "240611000191247","text": "","status": "open","orderstatus": "open","updatetime": "11-Jun-2024 09:36:14","exchtime": "11-Jun-2024 09:36:14","exchorderupdatetime": "11-Jun-2024 09:36:14","fillid": "","filltime": "","parentorderid": ""}}
-
RE: Websocket Order Status is not giving updated data for "modify pending" and "modified" events
@Moderator_3 I tried it several times, every time it was giving me stale data. Sharing details of one of occurrence below:
So I already had a limit open order for IDEA at Rs. 15.7 and quantity 4. I modified the order price to be 15.75 and quantity to be 2. I received the following events from order status websocket. You can see order open event (i.e. AB01) has correct data in it. But data in "modify pending" and "modify" events (i.e. AB11 and AB04) is stale (state from before modification).
{"user-id": "N255065","status-code": "200","order-status": "AB11","error-message": "","orderData": {"variety": "NORMAL","ordertype": "LIMIT","ordertag": "","producttype": "DELIVERY","price": 15.7,"triggerprice": 0.0,"quantity": "4","disclosedquantity": "0","duration": "DAY","squareoff": 0.0,"stoploss": 0.0,"trailingstoploss": 0.0,"tradingsymbol": "IDEA-EQ","transactiontype": "BUY","exchange": "NSE","symboltoken": "14366","instrumenttype": "","strikeprice": -1.0,"optiontype": "","expirydate": "","lotsize": "1","cancelsize": "0","averageprice": 0.0,"filledshares": "0","unfilledshares": "4","orderid": "240610001077257","text": "","status": "modify pending","orderstatus": "modify pending","updatetime": "10-Jun-2024 14:20:34","exchtime": "10-Jun-2024 14:20:06","exchorderupdatetime": "10-Jun-2024 14:20:06","fillid": "","filltime": "","parentorderid": ""}} {"user-id": "N255065","status-code": "200","order-status": "AB04","error-message": "","orderData": {"variety": "NORMAL","ordertype": "LIMIT","ordertag": "","producttype": "DELIVERY","price": 15.7,"triggerprice": 0.0,"quantity": "4","disclosedquantity": "0","duration": "DAY","squareoff": 0.0,"stoploss": 0.0,"trailingstoploss": 0.0,"tradingsymbol": "IDEA-EQ","transactiontype": "BUY","exchange": "NSE","symboltoken": "14366","instrumenttype": "","strikeprice": -1.0,"optiontype": "","expirydate": "","lotsize": "1","cancelsize": "0","averageprice": 0.0,"filledshares": "0","unfilledshares": "4","orderid": "240610001077257","text": "","status": "modified","orderstatus": "open","updatetime": "10-Jun-2024 14:20:34","exchtime": "10-Jun-2024 14:20:34","exchorderupdatetime": "10-Jun-2024 14:20:34","fillid": "","filltime": "","parentorderid": ""}} {"user-id": "N255065","status-code": "200","order-status": "AB01","error-message": "","orderData": {"variety": "NORMAL","ordertype": "LIMIT","ordertag": "","producttype": "DELIVERY","price": 15.75,"triggerprice": 0.0,"quantity": "2","disclosedquantity": "0","duration": "DAY","squareoff": 0.0,"stoploss": 0.0,"trailingstoploss": 0.0,"tradingsymbol": "IDEA-EQ","transactiontype": "BUY","exchange": "NSE","symboltoken": "14366","instrumenttype": "","strikeprice": -1.0,"optiontype": "","expirydate": "","lotsize": "1","cancelsize": "0","averageprice": 0.0,"filledshares": "0","unfilledshares": "2","orderid": "240610001077257","text": "","status": "open","orderstatus": "open","updatetime": "10-Jun-2024 14:20:34","exchtime": "10-Jun-2024 14:20:34","exchorderupdatetime": "10-Jun-2024 14:20:34","fillid": "","filltime": "","parentorderid": ""}}
-
Websocket Order Status is not giving updated data for "modify pending" and "modified" events
I am using python SDK to get real time updates of orders for my account. However, for "modify pending" and "modified" events (i.e. AB11 and AB04), orderData that I am getting is stale (i.e. the state which was before modification). How can I get updated params for this order? Can you guys fix these events to give correct and updated data?
Thanks,
Aakash -
SmartWebSocketOrderUpdate is not giving order updates placed using mobile app
I am using python sdk version 1.4.8. Added my code below. Websocket is getting connected properly.
AUTH_TOKEN = authToken API_KEY = api_key CLIENT_CODE = clientId FEED_TOKEN = feedToken client = SmartWebSocketOrderUpdate(AUTH_TOKEN, API_KEY, CLIENT_CODE, FEED_TOKEN) client.connect()
Response:
[I 240514 22:55:36 smartWebSocketOrderUpdate:38] Connection opened [I 240514 22:55:36 smartWebSocketOrderUpdate:32] Received message: {"user-id": "xxxxxxx","status-code": "200","order-status": "AB00","error-message": "","orderData": {"variety": "","ordertype": "","ordertag": "","producttype": "","price": 0.0,"triggerprice": 0.0,"quantity": "0","disclosedquantity": "0","duration": "","squareoff": 0.0,"stoploss": 0.0,"trailingstoploss": 0.0,"tradingsymbol": "","transactiontype": "","exchange": "","symboltoken": "","instrumenttype": "","strikeprice": 0.0,"optiontype": "","expirydate": "","lotsize": "0","cancelsize": "0","averageprice": 0.0,"filledshares": "","unfilledshares": "","orderid": "","text": "","status": "","orderstatus": "","updatetime": "","exchtime": "","exchorderupdatetime": "","fillid": "","filltime": "","parentorderid": ""}} [I 240514 22:55:56 smartWebSocketOrderUpdate:32] Received message: b'\x00' [I 240514 22:56:06 smartWebSocketOrderUpdate:32] Received message: b'\x00' [I 240514 22:56:16 smartWebSocketOrderUpdate:32] Received message: b'\x00' [I 240514 22:56:26 smartWebSocketOrderUpdate:32] Received message: b'\x00' [I 240514 22:56:36 smartWebSocketOrderUpdate:32] Received message: b'\x00' [I 240514 22:56:46 smartWebSocketOrderUpdate:32] Received message: b'\x00' [I 240514 22:56:56 smartWebSocketOrderUpdate:32] Received message: b'\x00' [I 240514 22:57:06 smartWebSocketOrderUpdate:32] Received message: b'\x00'
When I am placing an order using app on same account, there is no update received on this socket. Is there any issue with code or is there any limitation of order status websocket that I am missing out on?
-
RE: Websocket of Order Status is not working.
@Moderator_2, can you please share a working sample code for Websocket Order Status using Python SDK or general python code?
-
RE: Websocket of Order Status is not working.
@admin, any update on this?
-
Websocket of Order Status is not working.
I want to use web socket of order status mentioned in: https://smartapi.angelbroking.com/docs/WebSocketOrderStatus. But the URL mentioned in it seems to be not responding at all. My script is erroring out saying
Connection to remote host was lost.
Can you please check what is the issue?
Code I am using to connect:
self.ROOT_URI = 'wss://smartapisocket.angelbroking.com/websocket' ROOT_URL = f"{self.ROOT_URI}?jwttoken={self.jwttoken}&clientcode={self.client_code}&apikey={self.apiKey}" print(ROOT_URL) self.ws = websocket.WebSocketApp(ROOT_URL, # header=headers, on_message=self.__on_message, on_close=self.__on_close, on_open=self.__on_open, on_error=self.__on_error ) self.ws.run_forever(sslopt={"cert_reqs": ssl.CERT_NONE})