pocketful logo light
pocketful logo light

Place Cover Order

A Cover Order help traders protect against losses by placing a stop loss order together with a regular order. This means that if the price moves in an unexpected way, the stop loss order kicks in to limit losses. When buying a Cover Order, the limit price must be higher than the stop-loss trigger price. Conversely, when selling a Cover Order, the limit price must be lower than the stop loss trigger price.

Endpoint: /api/v1/orders/kart
Method-Type: POST

Request Packet

{
    "exchange": "NSE",
    "instrument_token": "14366",
    "client_id": "clientId",
    "order_type": "LIMIT",
    "price": 13,
    "quantity": 1,
    "disclosed_quantity": 0,
    "validity": "DAY",
    "product": "MIS",
    "order_side": "BUY",
    "device": "WEB",
    "execution_type": "CO",
    "is_trailing": true,
    "stop_loss_value": 12,
    "trailing_stop_loss": "0.05",
    "trigger_price": 0,
    "user_order_id": 10002,
}

Body Params

FieldNameDatatypeDescription
exchangeStringNSEBSENFOMCX
instrument_tokenStringRepresents the unique id of instrument.
client_idStringRepresents the unique id of user or username.
order_typeStringLIMITSL
priceFloatthe price at which order needs to be placed
quantityIntegertotal quantity to buy
disclosed_quantityIntegerhidden quantity from the market.
validityStringDAY or IOC
productStringCNCMISNRML
order_sideStringBUY or SELL
deviceStringWeb or Mobile
is_trailingBooleanTrue or False
execution_typeStringCO
stop_loss_valueFloatvalue at which Sl will get hit
trailing_stop_lossFloatadjusts sell order accordingly to reduce losses.

Example Code

response = pocket.placeConditionalOrder({
    "exchange": "NSE",
    "instrument_token": "14366",
    "client_id": "clientId",
    "order_type": "LIMIT",
    "price": 13,
    "quantity": 1,
    "disclosed_quantity": 0,
    "validity": "DAY"
    "product": "MIS",
    "order_side": "BUY",
    "device": "WEB",
    "execution_type": "CO",
    "is_trailing": True,
    "stop_loss_value": 12,
    "trailing_stop_loss": "0.05",
    "trigger_price": 0,
    "user_order_id": 10002,
})

Response

{
    "data":{
        "data":{
            "basket_id": "20210531-23",
            "message": "basket Order Placed Successfully"}
        },
        "message": "Order place successfully",
        "status": "success"
 }

Error Response

{
    "data": {},
    "error_code": 44000,
    "message": "`product` is invalid",
    "status": "error"
 }
Error CodeDescription
44000In case of any of the parameter like Exchangeorder_typeproduct being invalid or order price is out of DPR range.
45000In case of Invalid Price or Quantity.
45010Something Went Wrong message occurs if you have given wrong instrument token