Skip to content

Commit

Permalink
updated examples and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
kssujithcj committed Nov 29, 2016
1 parent 652b48a commit cd22161
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Kite Connect is a set of REST-like APIs that expose many capabilities required t
##Usage
- [Download jar file](https://github.com/rainmattertech/kiteconnectjava/raw/master/dist/kiteconnectjava.jar) and include it in your build path.

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

## API usage
```java
Expand Down
14 changes: 14 additions & 0 deletions sample/src/Examples.java
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,13 @@ public void cancelOrder(KiteConnect kiteconnect) throws KiteException {
System.out.println(order2.orderId);
}

public void exitBracketOrder(Kiteconnect kiteconnect) throws KiteException {
Map<String, Object> params = new HashMap<>();
params.put("parent_order_id", "161129000165203");
Order order = kiteconnect.cancelOrder(params, "161129000221590", "bo");
System.out.println(order.orderId);
}

/** Get all positions.*/
public void getPositions(KiteConnect kiteconnect) throws KiteException {
// Get positions returns position model which contains list of positions.
Expand Down Expand Up @@ -234,6 +241,13 @@ public void getQuote(KiteConnect kiteconnect) throws KiteException {
Quote quote = kiteconnect.getQuote("NSE", "RELIANCE");
}

/** Get quote for a scrip.*/
public void getQuoteIndices(Kiteconnect kiteconnect) throws KiteException {
// Get quotes returns quote for desired tradingsymbol.
Quote quote = kiteconnect.getQuoteIndices("NSE", "NIFTY 50");
System.out.println(quote.lastPrice);
}

/** Get historical data for an instrument.*/
public void getHistoricalData(KiteConnect kiteconnect) throws KiteException {
/** Get historical data dump, requires from and to date, intrument token, interval
Expand Down

0 comments on commit cd22161

Please sign in to comment.