how to create GTT OCO order
-
Hi @admin
How do i create a GTT rule for OCO order for example, Sell at target or sell at stoploss -
What about the target price? This is only stoplossprice
-
@Moderator_3
Please share the parameters to create a GTT OCO order where I can mention the stoploss price and profit target price.The below order is manually created and I want to the same order to be created using API. This has both stoploss and target mentioned for OCO order.
-
@admin
Thank you for the response ,
But getting error while placing gtttype OCO
sample request
{
tradingsymbol: 'symbol',
symboltoken: 'token',
exchange: 'NFO',
qty: '15',
producttype: 'CARRYFORWARD',
transactiontype: 'SELL',
price: 401,
disclosedqty: '15',
triggerprice: 400,
timeperiod: 1,
gttType: 'OCO',
stoplossprice: 370,
stoplosstriggerprice: 372
} -
Hi @balrajsand2002,
POST: /rest/secure/angelbroking/gtt/v1/createRule
Request Body :
{
"disclosedqty": 0,
"exchange": "BSE",
"gttType": "",
"ltp": 0,
"price": 0,
"producttype": "CARRYFORWARD",
"qty": 0,
"stoplossprice": 0,
"stoplosstriggerprice": 0,
"symboltoken": "string",
"timeperiod": 0,
"tradingsymbol": "string",
"transactiontype": "BUY",
"triggerprice": 0
}On above request pass OCO for gttType key and mandatory pass values for stoplossprice & stoplosstriggerprice.
Thank You
Smart API Team