@subodh I have built a solution/workaround but I am still testing it,
@admin can you please share any update on this, I've also suggested to include all the details when you send the orderID just after the order is placed, https://smartapi.angelbroking.com/topic/1893/return-order-details-in-placeorder-function-instead-of-just-the-orderid
Posts made by namanviz
-
RE: unable to connect to websocket order status
-
return order details in placeOrder function instead of just the orderID
@admin @administrators there is a function called 'placeOrder' in the 'SmartConnect' class in the SmartConnect.py file, and the function returns the order ID if the order is placed successfully.
So instead of returning just the order ID can you please change it to return the completely executed order with the details such as orderID, trade executed price, quantity, time, etc.
If this is done then we can possibly avoid the calls to getOrderBook.
I understand that for a single order with large quantities of shares being traded on 'market-type' orders multiple trades will sum into one order but the above mentioned can be implemented.Thank you
-
RE: Websocket Order status handshake 400 error
@ashu27 yes, I am getting the same error.
-
RE: Websocket Order status handshake 400 error
@ashu27 ok, thank you for the update. Let's hope we get some update soon.
-
RE: Websocket Order status handshake 400 error
@ashu27 @admin @administrators Hello, was this issue resolved please? I have also sent an email on api@angelbroking.com, can the admin/s please assist on this?
Best regards.
-
RE: Websocket Order status
@ananya Hello, I have emailed you few queries around this on ananya.aakash@zohomail.in, highly appreciate if you can assist on those.
Best regards. -
RE: making websocket callbacks as async
@Sukhwant280 Hi Sukhwant, actually I am just using tick data and previous day data to trade programmatically so I am not storing any thing, what is your requirement exactly? I'll try to assist.
Best regards.
-
making websocket callbacks as async
Hello,
so below is the code posted on github for accessing real time data.
Can anyone please help me in converting this to a async codefrom smartapi import SmartWebSocket
feed_token=092017047
FEED_TOKEN="YOUR_FEED_TOKEN"
CLIENT_CODE="YOUR_CLIENT_CODE"token="mcx_fo|224395"
token="EXCHANGE|TOKEN_SYMBOL" #SAMPLE: nse_cm|2885&nse_cm|1594&nse_cm|11536&nse_cm|3045
token="mcx_fo|226745&mcx_fo|220822&mcx_fo|227182&mcx_fo|221599"
task="mw" # mw|sfi|dp
ss = SmartWebSocket(FEED_TOKEN, CLIENT_CODE)
def on_message(ws, message):
print("Ticks: {}".format(message))def on_open(ws):
print("on open")
ss.subscribe(task,token)def on_error(ws, error):
print(error)def on_close(ws):
print("Close")Assign the callbacks.
ss._on_open = on_open
ss._on_message = on_message
ss._on_error = on_error
ss._on_close = on_closess.connect()
so i am trying to do something like this:
async with smartapi_websocket(client_id, api_id, etc....) as ws:
here I perform other async calls, and probably do not disturb the main thread*