orderparams = {
"variety": "STOPLOSS",
"tradingsymbol": "SBIN-EQ",
"symboltoken": "3045",
"transactiontype": "BUY",
"exchange": "NSE",
"ordertype": "STOPLOSS_LIMIT",
"producttype": "INTRADAY",
"duration": "DAY",
"price": "302.50",
"squareoff": "0",
"stoploss": "280",
"quantity": "1"
}
Deepak8052
@Deepak8052
Best posts made by Deepak8052
Latest posts made by Deepak8052
-
RE: Please give an example for buy, stoploss and sell order in intraday trading
-
Margin Calculator in Python
Hi, Can someone help me share the code of the Margin calculator I tried the one shared on https://smartapi.angelbroking.com/docs/MarginCalculator but it's not working for me.
Below is the code:
import http.clientconn = http.client.HTTPSConnection("apiconnect.angelbroking.com")
payload = "{\n" +
" "positions": [\n" +
" {\n" +
" "exchange": "NFO",\n" +
" "qty": 50,\n" +
" "price": 0,\n" +
" "productType": "INTRADAY",\n" +
" "token": "67300",\n" +
" "tradeType": "BUY"\n" +
" },\n" +
" {\n" +
" "exchange": "NFO",\n" +
" "qty": 50,\n" +
" "price": 0,\n" +
" "productType": "INTRADAY",\n" +
" "token": "67308",\n" +
" "tradeType": "SELL"\n" +
" }\n" +
" ]\n" +
"}"
headers = {
'X-PrivateKey': 'API_KEY',
'Accept': 'application/json',
'X-SourceID': 'WEB',
'X-ClientLocalIP': 'CLIENT_LOCAL_IP',
'X-ClientPublicIP': 'CLIENT_PUBLIC_IP',
'X-MACAddress': 'MAC_ADDRESS',
'X-UserType': 'USER',
'Authorization': 'Bearer AUTHORIZATION_TOKEN',
'Accept': 'application/json',
'X-SourceID': 'WEB',
'Content-Type': 'application/json'
}
conn.request("POST", "/rest/secure/angelbroking/margin/v1/batch", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))pls help me out.
-
RE: While fetching margin calculator data, getting an error as "Internal error AB200"."1
could you please share the code?
-
TOTP Error
Hi All,
Getting below error:
[I 240628 18:01:13 smartConnect:121] in pool
[E 240628 18:01:14 smartConnect:243] Error occurred while making a POST request to https://apiconnect.angelbroking.com/rest/auth/angelbroking/user/v1/loginByPassword. Error: Invalid totp. URL: https://apiconnect.angelbroking.com/rest/auth/angelbroking/user/v1/loginByPassword, Headers: {'Content-type': 'application/json', 'X-ClientLocalIP': '127.0.0.1', 'X-ClientPublicIP': '106.193.148.78', 'X-MACAddress': 'f4:b7:e2:59:92:8c', 'Accept': 'application/json', 'X-PrivateKey': '72Kc4WgZ', 'X-UserType': 'USER', 'X-SourceID': 'WEB'}, Request: {'clientcode': 'D248489', 'password': '0992', 'totp': '136646'}, Response: {'status': False, 'message': 'Invalid totp', 'errorcode': 'AB1050', 'data': None}
[E 240628 18:01:14 Automating AngelBroking:22] {'status': False, 'message': 'Invalid totp', 'errorcode': 'AB1050', 'data': None} -
RE: Totp error
@Moderator_3
Below is the error:
[I 240628 18:01:13 smartConnect:121] in pool
[E 240628 18:01:14 smartConnect:243] Error occurred while making a POST request to https://apiconnect.angelbroking.com/rest/auth/angelbroking/user/v1/loginByPassword. Error: Invalid totp. URL: https://apiconnect.angelbroking.com/rest/auth/angelbroking/user/v1/loginByPassword, Headers: {'Content-type': 'application/json', 'X-ClientLocalIP': '127.0.0.1', 'X-ClientPublicIP': '106.193.157.96', 'X-MACAddress': 'f4:b7:e2:59:92:8c', 'Accept': 'application/json', 'X-PrivateKey': '72Kc4WgZ', 'X-UserType': 'USER', 'X-SourceID': 'WEB'}, Request: {'clientcode': 'D248489', 'password': '0992', 'totp': '136646'}, Response: {'status': False, 'message': 'Invalid totp', 'errorcode': 'AB1050', 'data': None}
[E 240628 18:01:14 Automating AngelBroking:22] {'status': False, 'message': 'Invalid totp', 'errorcode': 'AB1050', 'data': None} -
RE: Totp error
@Moderator_3
Headers: {'Content-type': 'application/json', 'X-ClientLocalIP': '127.0.0.1', 'X-ClientPublicIP': '106.193.157.99', 'X-MACAddress': 'f4:b7:e2:59:92:8c', 'Accept': 'application/json', 'X-PrivateKey': '72Kc4WgZ', 'X-UserType': 'USER', 'X-SourceID': 'WEB'}, Request: {'clientcode': 'D248489', 'password': '0698', 'totp': '136646'}, Response: {'status': False, 'message': 'Invalid totp', 'errorcode': 'AB1050', 'data': None}
[E 240628 18:01:14 Automating AngelBroking:22] {'status': False, 'message': 'Invalid totp', 'errorcode': 'AB1050', 'data': None} -
Totp error
Hi All, I'm getting the below error:
[E 240628 02:24:35 smartConnect:243] Error occurred while making a POST request to https://apiconnect.angelbroking.com/rest/auth/angelbroking/user/v1/loginByPassword. Error: Invalid totp.The same code is running on one of my laptops, but it's not working on the other.