|
CPPKiteConnect
|
kite represents a KiteConnect session. It wraps around the KiteConnect REST API and provides a native interface. More...
#include <kite.hpp>
Public Member Functions | |
| kite (string apikey) | |
| Construct a new kite object. More... | |
| void | setApiKey (const string &arg) |
| Set the API key for current session. More... | |
| string | getApiKey () const |
| Get current session's API key. More... | |
| string | loginURL () const |
| Get the login URL to which the user should be redirected to initiate the login flow. More... | |
| void | setAccessToken (const string &arg) |
| Set the access token current session. More... | |
| string | getAccessToken () const |
| Get access token set for current session. More... | |
| userSession | generateSession (const string &requestToken, const string &apiSecret) |
| Generate an user session. Use this method to generate an access token. More... | |
| bool | invalidateSession () |
| This method invalidates the access token and destroys current session. More... | |
| userProfile | profile () |
| Get user's profile. More... | |
| allMargins | getMargins () |
| Get margins for all segments. More... | |
| margins | getMargins (const string &segment) |
| Get margins for a particular segment. More... | |
| string | placeOrder (const placeOrderParams ¶ms) |
| Place an order. More... | |
| string | modifyOrder (const modifyOrderParams ¶ms) |
| modify an order More... | |
| string | cancelOrder (const string &variety, const string &orderId, const string &parentOrderId="") |
| cancel an order More... | |
| std::vector< order > | orders () |
| Get list of orders. More... | |
| std::vector< order > | orderHistory (const string &orderId) |
| Get history of an order. More... | |
| std::vector< trade > | trades () |
| Get list of trades. More... | |
| std::vector< trade > | orderTrades (const string &orderId) |
| Get the list of trades executed for a particular order. More... | |
| int | placeGtt (const placeGttParams ¶ms) |
| Place a GTT. More... | |
| std::vector< GTT > | triggers () |
| Get list of GTTs. More... | |
| GTT | getGtt (int triggerId) |
| Get details of a particular GTT. More... | |
| int | modifyGtt (const kc::modifyGttParams ¶ms) |
| Modify a GTT. More... | |
| int | deleteGtt (int triggerId) |
| Delete a GTT. More... | |
| std::vector< holding > | holdings () |
| Get holdings. More... | |
| positions | getPositions () |
| Get positions. More... | |
| bool | convertPosition (const convertPositionParams ¶ms) |
| Convert an open position to a different product type. More... | |
| std::vector< instrument > | getInstruments (const string &exchange="") |
| Retrieve the list of market instruments available to trade. More... | |
| std::unordered_map< string, quote > | getQuote (const std::vector< string > &symbols) |
| Retrieve quote for a list of instruments. More... | |
| std::unordered_map< string, ohlcQuote > | getOhlc (const std::vector< string > &symbols) |
| Retrieve OHLC info for a list of instruments. More... | |
| std::unordered_map< string, ltpQuote > | getLtp (const std::vector< string > &symbols) |
| Retrieve Last Traded Price for a list of instruments. More... | |
| std::vector< historicalData > | getHistoricalData (const historicalDataParams ¶ms) |
| Retrieve historical data of an instrument. More... | |
| string | placeMfOrder (const placeMfOrderParams ¶ms) |
| Place a mutual fund order. More... | |
| string | cancelMfOrder (const string &orderId) |
| Cancel a mutual fund order. More... | |
| std::vector< mfOrder > | getMfOrders () |
| Get mutual fund orders. More... | |
| mfOrder | getMfOrder (const string &orderId) |
| Get details of a particular mutual fund order. More... | |
| std::vector< mfHolding > | getMfHoldings () |
| Get mutual fund holdings. More... | |
| placeMfSipResponse | placeMfSip (const placeMfSipParams ¶ms) |
| Place a mutual fund SIP order. More... | |
| string | modifyMfSip (const modifyMfSipParams ¶ms) |
| Modify a mutual SIP order. More... | |
| string | cancelMfSip (const string &sipId) |
| Cancel a mutual fund SIP. More... | |
| std::vector< mfSip > | getSips () |
| Get list of SIPs. More... | |
| mfSip | getSip (const string &sipId) |
| Get details of a particular SIP. More... | |
| std::vector< mfInstrument > | getMfInstruments () |
| Get the list of mutual fund instruments available for trading. More... | |
| std::vector< orderMargins > | getOrderMargins (const std::vector< marginsParams > ¶ms) |
| Get margins required for placing particular orders. More... | |
| basketMargins | getBasketMargins (const std::vector< marginsParams > ¶ms, bool considerPositions) |
| Get margins required for a basket. More... | |
Protected Member Functions | |
| utils::http::response | sendReq (const utils::http::endpoint &endpoint, const utils::http::Params &body, const utils::FmtArgs &fmtArgs) |
| send a http request with the context used by kite More... | |
kite represents a KiteConnect session. It wraps around the KiteConnect REST API and provides a native interface.
|
inlineexplicit |
Construct a new kite object.
| apikey | kiteconnect api key |
|
inline |
Cancel a mutual fund order.
| orderId | ID of order to cancel |
|
inline |
|
inline |
cancel an order
| variety | variety of the order |
| ordID | order ID |
| parentOrdID | parent order ID |
Cancel an order.
| variety | variety of order to cancel |
| orderId | ID of order to cancel |
| parentOrderId | parent order ID of the order to cancel (if any) |
|
inline |
Convert an open position to a different product type.
| params | parameters required to convert a position |
true the if position was successfully modified, false otherwise.
|
inline |
Delete a GTT.
| triggerId | ID of trigger to delete |
|
inline |
Generate an user session. Use this method to generate an access token.
| requestToken | request token to use |
| apiSecret | corresponding API secret |
|
inline |
Get access token set for current session.
|
inline |
Get current session's API key.
|
inline |
Get margins required for a basket.
| params | list of paramters required to fetch margins. each entry represents an order. |
| considerPositions | if true, current positions are considered |
|
inline |
Get details of a particular GTT.
| triggerId | ID of trigger whose details should be fetched |
|
inline |
Retrieve historical data of an instrument.
| params | paramters required to fetch the data. |
|
inline |
Retrieve the list of market instruments available to trade.
| exchange | if specified, only instruments available on this exchange are fetched. |
|
inline |
Retrieve Last Traded Price for a list of instruments.
| symbols | list of instruments whose OHLC info should be fetched. format of each entry should be exchange:tradingsymbol. example: NSE:INFY. |
|
inline |
Get margins for all segments.
|
inline |
Get margins for a particular segment.
| segment | segment whose margins should be fetched |
|
inline |
|
inline |
Get the list of mutual fund instruments available for trading.
|
inline |
Get details of a particular mutual fund order.
| orderId | ID of the order whose details should be fetched |
|
inline |
|
inline |
Retrieve OHLC info for a list of instruments.
| symbols | list of instruments whose OHLC info should be fetched. format of each entry should be exchange:tradingsymbol. example: NSE:INFY. |
|
inline |
Get margins required for placing particular orders.
| params | list of paramters required to fetch margins. each entry represents an order. |
|
inline |
|
inline |
Retrieve quote for a list of instruments.
| symbols | list of instruments whose quotes should be fetched. format of each entry should be exchange:tradingsymbol. example: NSE:INFY. |
|
inline |
Get details of a particular SIP.
| sipId | ID of the SIP whose details should be fetched |
|
inline |
|
inline |
|
inline |
This method invalidates the access token and destroys current session.
true if session was invalidated successfully, false otherwise.
|
inline |
|
inline |
Modify a GTT.
| params | parameters required to modify a GTT |
|
inline |
Modify a mutual SIP order.
| params | parameters required to modify the order |
|
inline |
modify an order
| variety | variety of the order |
| ordID | order ID |
| parentOrdID | parent order ID |
| quantity | quantity to transact |
| price | the min or max price to execute the order at (for LIMIT orders) |
| ordType | order type |
| trigPrice | trigger price |
| validity | order validity |
| discQuantity | disclosed quantity |
Modify an order.
| params | parameters of the order to modify |
|
inline |
Get history of an order.
| orderId | ID of order whose history should be fetched. |
|
inline |
|
inline |
Get the list of trades executed for a particular order.
| orderId | ID of order whose trades should be fetched |
|
inline |
Place a GTT.
| params | parameters of the GTT to place. |
|
inline |
Place a mutual fund order.
| params | parameters required to place the order |
|
inline |
Place a mutual fund SIP order.
| symbol | tradingsymbol (ISIN) of the fund |
|
inline |
Place an order.
| params | parameters of order to place |
|
inline |
Get user's profile.
|
inlineprotected |
send a http request with the context used by kite
| endpoint | request endpoint |
| body | body of the request (sent as form url encoded) |
|
inline |
|
inline |
Set the API key for current session.
| arg | API key is set to arg |
|
inline |
|
inline |