Angel one tech team has done an amazing job this time. The new smart API works like magic, low latency, consistent connection so far, and easy to process web socket ticks. Keep going guys and hope you become the best API offering in India!
sekharn
@sekharn
Best posts made by sekharn
-
RE: Upgraded SmartAPI Libraries to Support WebSocket 2.0 - Python, Java SDK and Node.js Library
Latest posts made by sekharn
-
RE: Order placement is failing.
any update please? I also wrote to your email.
How can you close the ticket, you replied on 3pm on Friday and today is monday and we don't trade on weekend.
here is the below details - please let me know why you're rate throttling me
Problem statement:
Order placement is failing.Request :
<Please share the api request here, should include all the detail URL, Headers, Request Body. If you can share the Curl that will be best.>025-02-13 11:54:56,187+05:30 [pool-8-thread-1] INFO com.trade.bot.OrbBotLogic - market api handle connected, placing order using params: {"duration":"DAY","exchange":"NFO","orderid":null,"ordertype":"MARKET","price":0.0,"producttype":"INTRADAY","quantity":250,"squareoff":"0","stoploss":"0","symbolToken":"63551","symboltoken":"63551","tradingsymbol":"NIFTY20FEB2523200CE","transactiontype":"BUY","triggerprice":null,"variety":"NORMAL"}
2025-02-13 11:54:56,196+05:30 [pool-7-thread-1] INFO com.trade.ext.telegram.SnsPublisher2 - message ID after pushing to sns : "a5266074-cc73-5f85-8c51-00535e0b3662"
2025-02-13 11:54:56,237+05:30 [pool-8-thread-1] ERROR com.angelbroking.smartapi.http.SmartAPIRequestHandler - Error in POST request. Request URL: https://apiconnect.angelone.in/rest/secure/angelbroking/order/v1/placeOrder, Request Headers: Content-Type: application/json
Authorization: ██
X-ClientLocalIP: 127.0.1.1
X-ClientPublicIP: 223.185.133.239
X-MACAddress: AC-15-A2-90-6E-A8
Accept: application/json
X-PrivateKey: 8DL0sueC
X-UserType: USER
X-SourceID: WEB
, Request Body: {"duration":"DAY","quantity":250,"squareoff":"0","stoploss":"0","variety":"NORMAL","price":0,"tradingsymbol":"NIFTY20FEB2523200CE","exchange":"NFO","transactiontype":"BUY","symboltoken":"63551","producttype":"INTRADAY","ordertype":"MARKET"},Response : Unrecognized token 'Access': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
at [Source: (String)"Access denied because of exceeding access rate"; line: 1, column: 7]
2025-02-13 11:54:56,237+05:30 [pool-8-thread-1] ERROR com.angelbroking.smartapi.http.SmartAPIRequestHandler - Error in POST request. Request URL: https://apiconnect.angelone.in/rest/secure/angelbroking/order/v1/placeOrder, Request Headers: Content-Type: application/json
Authorization: ██
X-ClientLocalIP: 127.0.1.1
X-ClientPublicIP: 223.185.133.239
X-MACAddress: AC-15-A2-90-6E-A8
Accept: application/json
X-PrivateKey: 8DL0sueC
X-UserType: USER
X-SourceID: WEB
, Request Body: {"duration":"DAY","quantity":250,"squareoff":"0","stoploss":"0","variety":"NORMAL","price":0,"tradingsymbol":"NIFTY20FEB2523200CE","exchange":"NFO","transactiontype":"BUY","symboltoken":"63551","producttype":"INTRADAY","ordertype":"MARKET"},Response : Unrecognized token 'Access': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
at [Source: (String)"Access denied because of exceeding access rate"; line: 1, column: 7]
2025-02-13 11:54:56,237+05:30 [pool-8-thread-1] ERROR com.angelbroking.smartapi.SmartConnect - Unrecognized token 'Access': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
at [Source: (String)"Access denied because of exceeding access rate"; line: 1, column: 7]
2025-02-13 11:54:56,237+05:30 [pool-8-thread-1] ERROR com.angelbroking.smartapi.SmartConnect - Unrecognized token 'Access': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
at [Source: (String)"Access denied because of exceeding access rate"; line: 1, column: 7]
2025-02-13 11:54:56,237+05:30 [pool-8-thread-1] WARN com.trade.bot.OrbBotLogic - Order not sent to broker, so will not persist.
Response:
see above.User ID:
C66377Time of issue:
See above. it is happening everydayEndPoint Name:
SmartConnect Java SDK, https://apiconnect.angelone.in/rest/secure/angelbroking/order/v1/placeOrder -
RE: Order placement is failing.
I send one order per two seconds max. why are you rate limiting me? Client ID is C66377 and I use your SmartConnect SDK for the past three years. No orders were sent past three weeks.
-
RE: Order placement is failing.
I think you're rate limiting me.
2025-02-13 11:54:56,186+05:30 [pool-8-thread-1] INFO com.trade.MarketFeedSync - RMS result: {"utilisedexposure":null,"availableintradaypayin":"0.0000","utiliseddebits":"0.0000","utilisedholdingsales":null,"utilisedturnover":null,"utilisedpayout":"97421.0500","m2munrealized":"0.0000","m2mrealized":"0.0000","availablecash":"97421.0500","availablelimitmargin":"0.0000","utilisedoptionpremium":null,"net":"97421.0500","collateral":"0.0000","utilisedspan":null}
2025-02-13 11:54:56,187+05:30 [pool-8-thread-1] INFO com.trade.bot.OrbBotLogic - market api handle connected, placing order using params: {"duration":"DAY","exchange":"NFO","orderid":null,"ordertype":"MARKET","price":0.0,"producttype":"INTRADAY","quantity":250,"squareoff":"0","stoploss":"0","symbolToken":"63551","symboltoken":"63551","tradingsymbol":"NIFTY20FEB2523200CE","transactiontype":"BUY","triggerprice":null,"variety":"NORMAL"}
2025-02-13 11:54:56,196+05:30 [pool-7-thread-1] INFO com.trade.ext.telegram.SnsPublisher2 - message ID after pushing to sns : "a5266074-cc73-5f85-8c51-00535e0b3662"
2025-02-13 11:54:56,237+05:30 [pool-8-thread-1] ERROR com.angelbroking.smartapi.http.SmartAPIRequestHandler - Error in POST request. Request URL: https://apiconnect.angelone.in/rest/secure/angelbroking/order/v1/placeOrder, Request Headers: Content-Type: application/json
Authorization: ██
X-ClientLocalIP: 127.0.1.1
X-ClientPublicIP: 223.185.133.239
X-MACAddress: AC-15-A2-90-6E-A8
Accept: application/json
X-PrivateKey: 8DL0sueC
X-UserType: USER
X-SourceID: WEB
, Request Body: {"duration":"DAY","quantity":250,"squareoff":"0","stoploss":"0","variety":"NORMAL","price":0,"tradingsymbol":"NIFTY20FEB2523200CE","exchange":"NFO","transactiontype":"BUY","symboltoken":"63551","producttype":"INTRADAY","ordertype":"MARKET"},Response : Unrecognized token 'Access': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
at [Source: (String)"Access denied because of exceeding access rate"; line: 1, column: 7]
2025-02-13 11:54:56,237+05:30 [pool-8-thread-1] ERROR com.angelbroking.smartapi.http.SmartAPIRequestHandler - Error in POST request. Request URL: https://apiconnect.angelone.in/rest/secure/angelbroking/order/v1/placeOrder, Request Headers: Content-Type: application/json
Authorization: ██
X-ClientLocalIP: 127.0.1.1
X-ClientPublicIP: 223.185.133.239
X-MACAddress: AC-15-A2-90-6E-A8
Accept: application/json
X-PrivateKey: 8DL0sueC
X-UserType: USER
X-SourceID: WEB
, Request Body: {"duration":"DAY","quantity":250,"squareoff":"0","stoploss":"0","variety":"NORMAL","price":0,"tradingsymbol":"NIFTY20FEB2523200CE","exchange":"NFO","transactiontype":"BUY","symboltoken":"63551","producttype":"INTRADAY","ordertype":"MARKET"},Response : Unrecognized token 'Access': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
at [Source: (String)"Access denied because of exceeding access rate"; line: 1, column: 7]
2025-02-13 11:54:56,237+05:30 [pool-8-thread-1] ERROR com.angelbroking.smartapi.SmartConnect - Unrecognized token 'Access': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
at [Source: (String)"Access denied because of exceeding access rate"; line: 1, column: 7]
2025-02-13 11:54:56,237+05:30 [pool-8-thread-1] ERROR com.angelbroking.smartapi.SmartConnect - Unrecognized token 'Access': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
at [Source: (String)"Access denied because of exceeding access rate"; line: 1, column: 7]
2025-02-13 11:54:56,237+05:30 [pool-8-thread-1] WARN com.trade.bot.OrbBotLogic - Order not sent to broker, so will not persist.However, as per this post, this shouldn't happen as my algorithm runs only once every two seconds. https://smartapi.angelbroking.com/topic/4387/changes-in-api-rate-limit
Can you please help debug and let me know why this is happening?
-
RE: Order placement is failing.
Below is the client code
OrderParams orderParams = new OrderParams(); orderParams.transactiontype = Constants.TRANSACTION_TYPE_BUY; orderParams.tradingsymbol = in.getSymbol(); orderParams.symboltoken = in.getToken(); orderParams.symbolToken = in.getToken(); orderParams.variety = Constants.VARIETY_NORMAL; orderParams.quantity = LOT_SIZE_NIFTY_25 * (this.currentIntervalPojo.getLots1() + this.currentIntervalPojo.getLots2() + this.currentIntervalPojo.getLots3()); orderParams.exchange = Constants.EXCHANGE_NFO; orderParams.ordertype = Constants.ORDER_TYPE_MARKET; orderParams.producttype = Constants.PRODUCT_INTRADAY; orderParams.duration = Constants.DURATION_DAY; orderParams.price = 0.0; orderParams.squareoff = "0"; orderParams.stoploss = "0";
...
Order order =
market.getSmartConnect().placeOrder(orderParams, Constants.VARIETY_NORMAL);
... -
RE: Order placement is failing.
Why are there no logging on why it failed. I turned on logging DEBUG for Smartconnect and doesn't put anything in the logs.
-
RE: Order placement is failing.
The same code for order management was working and I am hitting these issues recently. not a single order went through since past one month. did anything change?
if you see, the client is connected and RMS result is also accurate.
Are there some issues with the OrderParams? -
Order placement is failing.
2025-02-13 11:26:52,713+05:30 [pool-8-thread-1] INFO com.trade.MarketFeedSync - RMS result: {"utilisedexposure":null,"availableintradaypayin":"0.0000","utiliseddebits":"0.0000","utilisedholdingsales":null,"utilisedturnover":null,"utilisedpayout":"97421.0500","m2munrealized":"0.0000","m2mrealized":"0.0000","availablecash":"97421.0500","availablelimitmargin":"0.0000","utilisedoptionpremium":null,"net":"97421.0500","collateral":"0.0000","utilisedspan":null}
2025-02-13 11:26:52,714+05:30 [pool-8-thread-1] INFO com.trade.bot.OrbBotLogic - market api handle connected, placing order using params: {"duration":"DAY","exchange":"NFO","orderid":null,"ordertype":"MARKET","price":0.0,"producttype":"INTRADAY","quantity":250,"squareoff":"0","stoploss":"0","symbolToken":null,"symboltoken":"63551","tradingsymbol":"NIFTY20FEB2523200CE","transactiontype":"BUY","triggerprice":null,"variety":"NORMAL"}
2025-02-13 11:26:52,786+05:30 [pool-8-thread-1] INFO com.angelbroking.smartapi.http.SmartAPIResponseHandler - ***************************
2025-02-13 11:26:52,786+05:30 [pool-8-thread-1] INFO com.angelbroking.smartapi.http.SmartAPIResponseHandler - ***************************
2025-02-13 11:26:52,786+05:30 [pool-8-thread-1] ERROR com.angelbroking.smartapi.SmartConnect - JSONObject["data"] is not a JSONObject.
2025-02-13 11:26:52,786+05:30 [pool-8-thread-1] ERROR com.angelbroking.smartapi.SmartConnect - JSONObject["data"] is not a JSONObject.
2025-02-13 11:26:52,787+05:30 [pool-8-thread-1] WARN com.trade.bot.OrbBotLogic - Order not sent to broker, so will not persist. -
Order placement fails intermittently using Java SDK
There is no logging enabled on the client SDK, so I cannot see the real reason behind it. This happens sometimes only.
can you help me debug and tell what's the issue? below are the log statements. this same code runs sometimes. I even added a check to see if the client is connected.
2025-01-20 05:47:28,402Z [pool-8-thread-1] INFO com.trade.bot.OrbBotLogic - might place buy order on NIFTY23JAN2523300CE if not in DB: {"orderid":null,"exchange":"NFO","symbolToken":null,"transactiontype":"BUY","quantity":350,"price":0.0,"producttype":"INTRADAY","ordertype":"MARKET","duration":"DAY","variety":"NORMAL","tradingsymbol":"NIFTY23JAN2523300CE","triggerprice":null,"squareoff":"0","stoploss":"0","symboltoken":"54937"}
2025-01-20 05:47:28,446Z [pool-8-thread-1] INFO c.a.s.http.SmartAPIResponseHandler - ***************************
2025-01-20 05:47:28,446Z [pool-8-thread-1] INFO com.trade.MarketFeedSync - checking if smart connect is still connected with some call User [userName=C**** , userId=C*, mobileNo=, brokerName=, email=, lastLoginTime=null, accessToken=null, refreshToken=null, products=[MARGIN, MIS, NRML, CNC, CO, BO], exchanges=[nse_fo, nse_cm, cde_fo, ncx_fo, bse_fo, bse_cm, mcx_fo], feedToken=null]
2025-01-20 05:47:28,446Z [pool-8-thread-1] INFO com.trade.bot.OrbBotLogic - market api handle connected, placing order...com.angelbroking.smartapi.models.OrderParams@463464c8
2025-01-20 05:47:28,508Z [pool-8-thread-1] INFO c.a.s.http.SmartAPIResponseHandler - ***************************
2025-01-20 05:47:28,508Z [pool-8-thread-1] ERROR c.angelbroking.smartapi.SmartConnect - JSONObject["data"] is not a JSONObject.
2025-01-20 05:47:28,508Z [pool-8-thread-1] WARN com.trade.bot.OrbBotLogic - Order not sent to broker, so will not persist. -
RE: Upgraded SmartAPI Libraries to Support WebSocket 2.0 - Python, Java SDK and Node.js Library
Angel one tech team has done an amazing job this time. The new smart API works like magic, low latency, consistent connection so far, and easy to process web socket ticks. Keep going guys and hope you become the best API offering in India!