method to get live pricevolume data of about 500+ stocks i.e timestamp,open,high,low,close,volume

vasisht
Hi,

In java Which method should i use to get pricevolume data of about 500+ stocks.volume esp.from the examples i saw,KiteTicker is the one that provides live data.but does it provide total traded volume.or just the marketdepth(outstanding buys and sells) as shown below.where can i get traded volume data live.i actually need it to construct 5 min candle OHLC and volume data.Please help.

tickerProvider.setOnTickerArrivalListener(new OnTicks() {
@Override
public void onTicks(ArrayList ticks) {
NumberFormat formatter = new DecimalFormat();
System.out.println("ticks size "+ticks.size());
if(ticks.size() > 0) {
System.out.println("last price "+ticks.get(0).getLastTradedPrice());
System.out.println("open interest "+formatter.format(ticks.get(0).getOi()));
System.out.println("day high OI "+formatter.format(ticks.get(0).getOpenInterestDayHigh()));
System.out.println("day low OI "+formatter.format(ticks.get(0).getOpenInterestDayLow()));
System.out.println("change "+formatter.format(ticks.get(0).getChange()));
System.out.println("tick timestamp "+ticks.get(0).getTickTimestamp());
System.out.println("tick timestamp date "+ticks.get(0).getTickTimestamp());
System.out.println("last traded time "+ticks.get(0).getLastTradedTime());
System.out.println(ticks.get(0).getMarketDepth().get("buy").size());
}
}

Thanks and Regards
Vasisht
  • sujith
    @vasisht,
    You can check out all the parameters that are present in the live market data provided by the Kite Connect.

    It is a binary data, you don't need to worry about the parsing since javakiteconnect does it for you. You may also check the Tick model in the package.
    The volume received in the live market data is a cumulative volume which contains volume traded for the whole day.
  • vasisht
    vasisht edited June 2019
    Thanks @sujith.the parameters does contain "Last traded quantity" which is the volume for the latest tick.correct me if im wrong.
    i have following more questions.

    1.is it right that the class for websockets is "KiteTicker".is there any other class/method for websockets.

    2.Also,i need last 50 5 min candles which i plan to setup using live streaming through websockets.if there is a gap in streaming of data because of internet disconnect,then i need to check through ohlc data.i presume that any ohlc data comes under historical subscription which i have not subscribed to.am i right in saying that or i can get ohlc data of last 50 5 min candle in kite connect subscription in any way?

    3.now,what happens if internet goes of a few seconds or minutes which it does in my home?does anyone know what is the most consistent internet connection that does not go off even for a few seconds a day.basically,the internet connection most suited for websockets streaming.im currently using bsnl broadband at home in bangalore.

    Thanks & Regards
    Vasisht
  • sujith
    You need to look at
    Volume traded for the day
    and not the last traded quantity.
    Yes, it is KiteTicker class.
    You need a historical data subscription to fetch candle data.

    You may host the solution on the cloud which is far more reliable than the local system.
  • vasisht
    vasisht edited June 2019
    @sujith volume traded for the day is volume for the entire day.i don't need volume for the entire day.i need volume only for 5 min candles for the last 50 candles.so i thought i can use last traded quantity and collate it for every 5 mins and use it as the 5 min candle volume.please let me know why thats not right?
  • sujith
    The live market data is a snapshot of 1 second approximately. It is not a TBT data. There can be hundreds or thousands of ticks in a second at the exchange, one can't stream everything over the internet.

    Your sum of last traded quantity won't match the volume traded in that interval.
  • vasisht
    vasisht edited June 2019
    @sujith i was told by one of zerodha people over the phone that the kite connect data is the same as that which is used for zerodha pi charts or kite web platform.please let me know if that(pi scanner or pi charts or kite web)is also snapshot data and whether websockets "last traded quantity" will match with pi charts volume data.or is pi charts is constructed using level 1 data? please let me know.
  • vasisht
    @sujith please correct me if im wrong but i was using pi scanner for applying my logic.due to too much load,it started becoming slow and incorrect.so if pi scanner also uses level 2 data and kite connect websocket also uses level 2 data,then its fine for me to go ahead and apply the logic which is based on volume.
  • sujith
    Kite Ticker does provide level 2 data.
    You may refer to this thread for a clear picture.

    You can also refer to this thread for more insight about volume calculation.
  • vasisht
    @sujith thanks for the info.i got the answer i was looking for.

    also,can you give me some info on how to host the application on the cloud
Sign In or Register to comment.