@Moderator_3
actually i solved it the problem was about how the names of option contracts differ for nifty and banknifty its same but sensex is different i eventually figured it out
meet panchal
@meet panchal
Best posts made by meet panchal
Latest posts made by meet panchal
-
RE: sensex symbol name is wrong
-
sensex symbol name is wrong
i wanted to fetch symbol tokens of sensex options so today was 14th november2024 the day is thursday and technically today is the expiry since tomorrow is holiday so the expiry should be 14nov but in the json file it was
available for 24nov
1st occurence
2nd occurrence
as you can see there was a mistake in the expiry dates
please look into it @admin
@admin123 @Moderator_1 @Moderator_2 @Moderator_3 -
RE: NIFTY High/Low option not available
@GaryR01 hey!! got any solutions i also want to store the low of current candle in a variable
-
not able to place fno orders on nifty50 index
import pyotp from SmartApi import SmartConnect from logzero import logger apikey="z1IPZzY0" username="M52500299" pwd="1233" smartApi=SmartConnect(apikey) try: token = "4TZ63NU76235CQV3KFW6HB7A2Y" totp = pyotp.TOTP(token).now() except Exception as e: logger.error("Invalid Token: The provided token is not valid.") raise e data = smartApi.generateSession(username, pwd, totp) if data['status'] == False: logger.error(data) else: # login api call # logger.info(f"You Credentials: {data}") authToken = data['data']['jwtToken'] refreshToken = data['data']['refreshToken'] # fetch the feedtoken feedToken = smartApi.getfeedToken() # fetch User Profile res = smartApi.getProfile(refreshToken) smartApi.generateToken(refreshToken) res=res['data']['exchanges'] #place order try: orderparams = { "variety": "NORMAL", "tradingsymbol": "NIFTY31OCT24400PE", "symboltoken": "99926000", "transactiontype": "BUY", "exchange": "NFO", "ordertype": "MARKET", "producttype": "INTRADAY", "duration": "DAY", "price": "19500", "squareoff": "0", "stoploss": "0", "quantity": "25" } # Method 1: Place an order and return the order ID orderid = smartApi.placeOrder(orderparams) logger.info(f"PlaceOrder : {orderid}") # Method 2: Place an order and return the full response response = smartApi.placeOrderFullResponse(orderparams) logger.info(f"PlaceOrder : {response}") except Exception as e: logger.exception(f"Order placement failed: {e}")
for this code im getting this error
[I 241028 13:21:49 smartConnect:121] in pool
[E 241028 13:21:52 smartConnect:243] Error occurred while making a POST request to https://apiconnect.angelbroking.com/rest/secure/angelbroking/order/v1/placeOrder. Error: Failed to get symbol details. URL: https://apiconnect.angelbroking.com/rest/secure/angelbroking/order/v1/placeOrder, Headers: {'Content-type': 'application/json', 'X-ClientLocalIP': '127.0.0.1', 'X-ClientPublicIP': '106.193.147.98', 'X-MACAddress': '00:50:56:c0:00:08', 'Accept': 'application/json', 'X-PrivateKey': 'z1IPZzY0', 'X-UserType': 'USER', 'X-SourceID': 'WEB'}, Request: {'variety': 'NORMAL', 'tradingsymbol': 'NIFTY31OCT24400PE', 'symboltoken': '99926000', 'transactiontype': 'BUY', 'exchange': 'NFO', 'ordertype': 'MARKET', 'producttype': 'INTRADAY', 'duration': 'DAY', 'price': '19500', 'squareoff': '0', 'stoploss': '0', 'quantity': '25'}, Response: {'message': 'Failed to get symbol details', 'errorcode': 'AB1018', 'status': False, 'data': None}
[E 241028 13:21:52 smartConnect:336] API request failed: {'message': 'Failed to get symbol details', 'errorcode': 'AB1018', 'status': False, 'data': None}
[I 241028 13:21:52 angleone:56] PlaceOrder : None
[E 241028 13:21:52 smartConnect:243] Error occurred while making a POST request to https://apiconnect.angelbroking.com/rest/secure/angelbroking/order/v1/placeOrder. Error: Failed to get symbol details. URL: https://apiconnect.angelbroking.com/rest/secure/angelbroking/order/v1/placeOrder, Headers: {'Content-type': 'application/json', 'X-ClientLocalIP': '127.0.0.1', 'X-ClientPublicIP': '106.193.147.98', 'X-MACAddress': '00:50:56:c0:00:08', 'Accept': 'application/json', 'X-PrivateKey': 'z1IPZzY0', 'X-UserType': 'USER', 'X-SourceID': 'WEB'}, Request: {'variety': 'NORMAL', 'tradingsymbol': 'NIFTY31OCT24400PE', 'symboltoken': '99926000', 'transactiontype': 'BUY', 'exchange': 'NFO', 'ordertype': 'MARKET', 'producttype': 'INTRADAY', 'duration': 'DAY', 'price': '19500', 'squareoff': '0', 'stoploss': '0', 'quantity': '25'}, Response: {'message': 'Failed to get symbol details', 'errorcode': 'AB1018', 'status': False, 'data': None}
[E 241028 13:21:53 smartConnect:352] API request failed: {'message': 'Failed to get symbol details', 'errorcode': 'AB1018', 'status': False, 'data': None}
[I 241028 13:21:53 angleone:59] PlaceOrder : None