Getting order history


  • Hello sir,

    I am using smartapi-java-2.2.5.jar and everything is working smoothly.

    I am able to place the order.

    These are the main order parameters set :

    orderParams.exchange = Constants.EXCHANGE_MCX;
    orderParams.ordertype = Constants.ORDER_TYPE_MARKET;
    orderParams.producttype = Constants.PRODUCT_CARRYFORWARD;
    orderParams.duration = Constants.DURATION_IOC;

    The order is getting placed correctly, the order object returns orderid only.

    I want to get order history like status and price. I tried getOrderHistory() and getTrades() functions but it is returning null as data.

    Can you help for the same?


  • @admin Hello sir, thank you for checking the code.

    Right now my code is
    smartConnect.getOrderHistory(smartConnect.getUserId());

    And the response is
    Order history : {"data":null,"message":"SUCCESS","errorcode":"","status":true}

    I am not getting any error but the data is null.

    Can you provide the correct way which is compatible with latest jar to solve this?

    Thank you.


  • @Rajen we checked, and it is working fine. There is an issue with your code.