Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs

    Order placement is failing.

    NodeJS SDK
    0
    9
    35
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      sekharn last edited by

      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.

      S 1 Reply Last reply Reply Quote 0
      • S
        sekharn @sekharn last edited by

        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?

        1 Reply Last reply Reply Quote 0
        • S
          sekharn last edited by sekharn

          Why are there no logging on why it failed. I turned on logging DEBUG for Smartconnect and doesn't put anything in the logs.

          1 Reply Last reply Reply Quote 0
          • S
            sekharn last edited by

            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);
            ...

            1 Reply Last reply Reply Quote 0
            • S
              sekharn last edited by

              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?

              1 Reply Last reply Reply Quote 0
              • S
                sekharn last edited by

                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.

                1 Reply Last reply Reply Quote 0
                • S
                  sekharn last edited by

                  any update please?

                  1 Reply Last reply Reply Quote 0
                  • S
                    sekharn last edited by

                    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:
                    C66377

                    Time of issue:
                    See above. it is happening everyday

                    EndPoint Name:
                    SmartConnect Java SDK, https://apiconnect.angelone.in/rest/secure/angelbroking/order/v1/placeOrder

                    1 Reply Last reply Reply Quote 0
                    • A
                      admin last edited by

                      @sekharn You are exceeding another rate limit that is, 1000 orders per hour.

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post