I am getting the trade data from /rest/secure/angelbroking/order/
v1/getTradeBook but as shown in the response it also should return the uniqueorderid but it does not
V
vishalbordia
@vishalbordia
0
Reputation
4
Posts
1
Profile views
0
Followers
0
Following
Best posts made by vishalbordia
This user hasn't posted anything yet.
Latest posts made by vishalbordia
-
Unique OrderID not returned in API endpoint
-
Websocket V2 OrderStatus
The pong messages do not return the orders, also we do not get all the orders in the first message on open as well. Can you show a working ping pong system and code that works in python using WebSocketsV2 of smartapi library. THe authentication works, but OrderStatus does not work, I am getting the LTP and other stock price but not my order status or trade status.
-
Getting Blank Responses on placing orders
I am getting blank bytes as a response when I place an order.
import http.client import mimetypes import json conn = http.client.HTTPSConnection( "apiconnect.angelbroking.com" ) payload = "{\n\"clientcode\":\"ccode\",\n\"password\":\"password\"\n}" headers = { 'Content-Type': 'application/json', 'Accept': 'application/json', 'X-UserType': 'USER', 'X-SourceID': 'WEB', 'X-ClientLocalIP': 'localip', 'X-ClientPublicIP': 'publicip', 'X-MACAddress': 'macadress', 'X-PrivateKey': 'apikey' } conn.request( "POST", "/rest/auth/angelbroking/user/v1/loginByPassword", payload, headers) import io res = conn.getresponse() data = res.read() d= data.replace(b"'", b'"') s = json.load(io.BytesIO(d)) tok = s['data']['jwtToken'] print(tok) lok = "Bearer " + str(tok) print(lok) payload = "{\n \"exchange\": \"NSE\",\n \"tradingsymbol\": \"SBIN-EQ\",\n \"quantity\": 10,\n \"disclosedquantity\": 10,\n \"transactiontype\": \"BUY\",\n \"ordertype\": \"LIMIT\",\n \"variety\": \"STOPLOSS\",\n \"producttype\": \"AMO_DELIVERY\",\n \"price\": \"380.30\"\n}" headers = { 'Authorization': lok, 'Content-Type': 'application/json', 'Accept': 'application/json', 'X-UserType': 'USER', 'X-SourceID': 'WEB', 'X-ClientLocalIP': 'localip', 'X-ClientPublicIP': 'publicip', 'X-MACAddress': 'macad', 'X-PrivateKey': 'api ' } cont = http.client.HTTPSConnection( "apiconnect.angelbroking.com" ) cont.request("POST","/rest/secure/angelbroking/order/v1/placeOrder",payload,headers) rese = cont.getresponse() dataf = rese.read() print(dataf)
here is my code, some sensetive parts are replaced by generic terms