getLTP error

VIDANANTH2
VIDANANTH2 edited February 2018 in Java client
Hi,

I get below i/o error when I call getLTP. Any idea why?
 public void getLTP(KiteConnect kiteConnect) throws KiteException {
String[] instruments = {"MARUTI18FEBFUT","BSE:INFY", "NSE:INFY", "NSE:NIFTY 50"};
System.out.println(kiteConnect.getLTP(instruments).get("MARUTI18FEBFUT").lastPrice);
}
Error:(41, 46) java: unreported exception java.io.IOException; must be caught or declared to be thrown.

Thanks.
  • sujith
    Hi,
    You need to send a combination of the exchange and tradingsymbol while requesting for quote data.
    You need to send NFO: MARUTI18FEBFUT.
  • VIDANANTH2
    Thanks Suijit. To get OHLC for multiple instruments for 15 Min candle which is accurate and fast? using getOHLC or using webstream and building our own candle every 15 Minutes? Thanks.
  • sujith
    The getOHLC is to fetch OHLC of the day and not the minute interval.
    You need to generate candles using live market data from Websockets.
  • VIDANANTH2
    Thanks. By any chance if you have any sample code or thread please point me to that. To generate OHLC for a time period.
Sign In or Register to comment.