I want to figure out which API to use for following requirement. I want to short a NIFTY Call option say 11800CE as MIS order. Before shorting, I check its LTP. So for example, if the LTP is 100rs, I want to place a STOPLOSS BUY order for Rs 175.
I tried it with CO order. The order got placed, but was rejected with reason that "The stop loss trigger price is beyond the allowed range of 20%." So, for this requirement, can I place 1 Market order for SHORT and 1 SL LIMIT order for long ?
Thanks Rakesh, but I need to SL to be 75%. SO what's the workaround ? One I could think of is- I can place a regular SHORT order and then, every x mins, keep checking the ltp, if the ltp is > the 75% SL, I exit the position. Wanted to verify following pseudo code for this purpose. Could you please confirm ? if( SL Hit ){ OrderParams orderParams = new OrderParams(); orderParams.price = 0.0; orderParams.quantity = 75; orderParams.transactionType = Constants.TRANSACTION_TYPE_BUY; orderParams.orderType = Constants.ORDER_TYPE_MARKET; orderParams.tradingsymbol = ; orderParams.exchange = Constants.EXCHANGE_NFO; orderParams.validity = Constants.VALIDITY_DAY; orderParams.product = Constants.PRODUCT_MIS; Order order = kiteConnect.placeOrder(orderParams, Constants.VARIETY_REGULAR);
if( SL Hit ){
OrderParams orderParams = new OrderParams();
orderParams.price = 0.0;
orderParams.quantity = 75;
orderParams.transactionType = Constants.TRANSACTION_TYPE_BUY;
orderParams.orderType = Constants.ORDER_TYPE_MARKET;
orderParams.tradingsymbol = ;
orderParams.exchange = Constants.EXCHANGE_NFO;
orderParams.validity = Constants.VALIDITY_DAY;
orderParams.product = Constants.PRODUCT_MIS;
Order order = kiteConnect.placeOrder(orderParams, Constants.VARIETY_REGULAR);
}
Thanks