Create GTT Rule
This API is used to place the gtt order. Good Till Triggered is active until the trigger condition is met. The trigger is valid for the given expiry date. Whenever the price condition within this period is met, the order will be placed and executed, provided there are enough funds in the trading account, and the limit price order is filled on the exchange.
Endpoint: api/v1/event/gtt
Method-Type: POST
Request Packet
{
"action_type": "single_order",
"expiry_time": "2024-12-12",
"order":{
"client_id": "<client id>",
"disclosed_quantity": 0,
"exchange": "NSE",
"instrument_token": "14366",
"market_protection_percentage": 0,
"order_side": "BUY",
"order_type": "LIMIT",
"price": 11.3,
"product": "CNC",
"quantity": 1,
"sl_order_price": 0,
"sl_order_quantity": 0,
"sl_trigger_price": 0,
"trigger_price": 13.6,
"user_order_id": 122321
}
}
Body Params
Field Name Data Type Description action_type StringType of action single_order expiry_time StringRepresents a particular date of expiry client_id StringRepresents the unique ID of a user. device StringDevice type: Web, Mobile. disclosed_quantity Integerquantity hidden from market exchange StringExchange: NSE, BSE, NFO, MCX instrument_token StringRepresents the unique ID of an instrument. market_protection_percentage Stringsets limit on the price deviation order_side StringSide of the orderBUY or SELL order_type StringType of order LIMIT, SL price Floatthe price at which order needs to be placed product StringProduct type: CNC, MIS, NRML quantity IntegerQuantity of the order. sl_order_price FloatStop-loss order price. sl_order_quantity IntegerStop-loss order quantity. sl_trigger_price FloatStop-loss trigger price. trigger_price FloatTrigger price. user_order_id IntegerRepresents the unique ID of the order.
Example Code
data = pocket.gttCreateRule(
{
"action_type": "single_order",
"expiry_time": "2024-12-12",
"order":{
"client_id": "<client id>",
"disclosed_quantity": 0,
"exchange": "NSE",
"instrument_token": "14366",
"market_protection_percentage": 0,
"order_side": "BUY",
"order_type": "LIMIT",
"price": 11.3,
"product": "CNC",
"quantity": 1,
"sl_order_price": 0,
"sl_order_quantity": 0,
"sl_trigger_price": 0,
"trigger_price": 13.6,
"user_order_id": 122321
}
})
Response
{
"data":
{
"id": "ea036a20-2073-4bfb-a852-34662c4bd770"
},
"message": "GTT created successfully",
"status": "success"
}
Parameter Description basket_id Identifier for the basket order message Confirmation message for the order status Status of the order modification
Error response
{
"data": {},
"error_code": 44000,
"message": "`order` `product` is invalid",
"status": "error"
}