Not able to place AMO order


  • 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


  • @Ashok Thanks. It worked.


  • @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


  • @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"}


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


  • @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


  • @admin

    Around 9PM , 23rd June 2021.


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