Skip to content

Commit cd22161

Browse files
committed
updated examples and readme
1 parent 652b48a commit cd22161

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Kite Connect is a set of REST-like APIs that expose many capabilities required t
1212
##Usage
1313
- [Download jar file](https://github.com/rainmattertech/kiteconnectjava/raw/master/dist/kiteconnectjava.jar) and include it in your build path.
1414

15-
- Include com.rainmatter.kiteconnect into build path from maven. Use version 1.4
15+
- Include com.rainmatter.kiteconnect into build path from maven. Use version 1.4.1
1616

1717
## API usage
1818
```java

sample/src/Examples.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,13 @@ public void cancelOrder(KiteConnect kiteconnect) throws KiteException {
181181
System.out.println(order2.orderId);
182182
}
183183

184+
public void exitBracketOrder(Kiteconnect kiteconnect) throws KiteException {
185+
Map<String, Object> params = new HashMap<>();
186+
params.put("parent_order_id", "161129000165203");
187+
Order order = kiteconnect.cancelOrder(params, "161129000221590", "bo");
188+
System.out.println(order.orderId);
189+
}
190+
184191
/** Get all positions.*/
185192
public void getPositions(KiteConnect kiteconnect) throws KiteException {
186193
// Get positions returns position model which contains list of positions.
@@ -234,6 +241,13 @@ public void getQuote(KiteConnect kiteconnect) throws KiteException {
234241
Quote quote = kiteconnect.getQuote("NSE", "RELIANCE");
235242
}
236243

244+
/** Get quote for a scrip.*/
245+
public void getQuoteIndices(Kiteconnect kiteconnect) throws KiteException {
246+
// Get quotes returns quote for desired tradingsymbol.
247+
Quote quote = kiteconnect.getQuoteIndices("NSE", "NIFTY 50");
248+
System.out.println(quote.lastPrice);
249+
}
250+
237251
/** Get historical data for an instrument.*/
238252
public void getHistoricalData(KiteConnect kiteconnect) throws KiteException {
239253
/** Get historical data dump, requires from and to date, intrument token, interval

0 commit comments

Comments
 (0)