@@ -253,6 +253,23 @@ public Order cancelOrder(String orderId, String variety) throws KiteException, J
253253 return order ;
254254 }
255255
256+ /**
257+ * Cancels special orders like BO, CO
258+ * @param params is map that contains parent_order_id
259+ * @param orderId order id of the order to be cancelled.
260+ * @param variety [variety="regular"]. Order variety can be bo, co, amo, regular.
261+ * @return Order object contains only orderId
262+ * */
263+ public Order cancelOrder (Map <String , Object > params , String orderId , String variety ) throws KiteException {
264+ String url = routes .get ("orders.cancel" ).replace (":variety" , variety ).replace (":order_id" , orderId );
265+ params = authorize (params );
266+
267+ JSONObject jsonObject = new KiteRequest ().deleteRequest (url , params );
268+ Order order = new Order ();
269+ order .parseOrderPlacedResponse (jsonObject );
270+ return order ;
271+ }
272+
256273 /**Gets collection of orders from the orderbook..
257274 * @return Order object contains orders which is list of orders.
258275 * */
@@ -399,6 +416,19 @@ public Quote getQuote(String exchange, String tradingSymbol) throws KiteExceptio
399416 return new Quote ().parseResponse (kiteRequest .getRequest (routes .get ("market.quote" ).replace (":exchange" , exchange ).replace (":tradingsymbol" , tradingSymbol ), authorize (params )));
400417 }
401418
419+ /**
420+ * Retrieves quote for an index
421+ *
422+ * @param exchange Exchange in which instrument is listed. exchange can be NSE, BSE.
423+ * @param tradingSymbol Tradingsymbol of the instrument (ex. NIFTY 50).
424+ * @return Quote object.
425+ */
426+ public Quote getQuoteIndices (String exchange , String tradingSymbol ) throws KiteException , JSONException {
427+ Map <String , Object > params = new HashMap <String , Object >();
428+ KiteRequest kiteRequest = new KiteRequest ();
429+ return new Quote ().parseIndicesResponse (kiteRequest .getRequest (routes .get ("market.quote" ).replace (":exchange" , exchange ).replace (":tradingsymbol" , tradingSymbol ), authorize (params )));
430+ }
431+
402432 /**
403433 * Retrieves buy or sell trigger range for Cover Orders.
404434 * @param exchange
0 commit comments