Navigation

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

    Not able to place AMO order

    NodeJS SDK
    4
    8
    64
    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.
    • M
      Muhammed last edited by

      Hi,

      I am trying to place AMO order using Java SDK. It throws weird exception. Any idea ?

      OrderParams orderParams = new OrderParams();

      		orderParams.quantity = 11;
      		orderParams.variety="AMO";
      		orderParams.symboltoken = "530813";
      		orderParams.exchange ="BSE";
      		orderParams.ordertype = "LIMIIT";
      		orderParams.tradingsymbol = "KRBL";
      		orderParams.producttype = "DELIVERY";
      		orderParams.duration = "DAY";
      		orderParams.transactiontype ="BUY";
      		orderParams.price = (double) 210;
      		smartConnect.placeOrder(orderParams,"AMO");
      

      Exception : Cannot invoke "String.contains(java.lang.CharSequence)" because the return value of "okhttp3.Response.header(String)" is null

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

        HI @Muhammed At what time did you executed the AMO order.

        M 2 Replies Last reply Reply Quote 0
        • M
          Muhammed @admin last edited by

          @admin

          Around 9PM , 23rd June 2021.

          1 Reply Last reply Reply Quote 0
          • M
            Muhammed @admin last edited by

            @admin

            Even tried to place normal order now, 11.42AM, 24 June 2021

            Still same error.

            OrderParams orderParams = new OrderParams();

            		orderParams.quantity = 1;
            		orderParams.variety="NORMAL";
            		orderParams.symboltoken = "530813";
            		orderParams.exchange ="BSE";
            		orderParams.ordertype = "LIMIIT";
            		orderParams.tradingsymbol = "KRBL";
            		orderParams.producttype = "DELIVERY";
            		orderParams.duration = "DAY";
            		orderParams.transactiontype ="BUY";
            		orderParams.price =  210.0;
            		Order order=smartConnect.placeOrder(orderParams,Constants.VARIETY_REGULAR);
            

            Cannot invoke "String.contains(java.lang.CharSequence)" because the return value of "okhttp3.Response.header(String)" is null

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

              Hi @Muhammed Are you able to place the orders today..?

              R 1 Reply Last reply Reply Quote 0
              • R
                rajbahadur @admin last edited by

                @admin Not able to place AMO order. Always getting 400 ( Bad request )

                Params are
                {"quantity":25,"triggerprice":"0","squareoff":"0","stoploss":"0","transactiontype":"BUY","producttype":"NRML","duration":"DAY","variety":"amo","price":0,"tradingsymbol":"BANKNIFTY01JUL2132500PE","exchange":"NFO","symboltoken":"52193","ordertype":"MARKET"}

                punit 1 Reply Last reply Reply Quote 0
                • punit
                  punit @rajbahadur last edited by

                  @rajbahadur , The product type should be either of the below values.
                  Also

                  producttype :
                  DELIVERY
                  CARRYFORWARD
                  MARGIN
                  INTRADAY
                  BO

                  Please refer documentation in the below link:
                  https://smartapi.angelbroking.com/docs/Orders

                  R 1 Reply Last reply Reply Quote 0
                  • R
                    rajbahadur @punit last edited by

                    @Ashok Thanks. It worked.

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