javakiteconnect icon indicating copy to clipboard operation
javakiteconnect copied to clipboard

change data on Tick class is different for nifty Index and Nifty Future

Open rahul6789sharma opened this issue 2 years ago • 0 comments

HI

i have using java library and subscribed for nifty and nifty future via java web socket library. Everything works good, just one issue is there

With Nifty Index. change filed contains net change from yesterday close

With Nifty Future

change filed display percentage change from yesterday close

Please find my logs

Token : 9604354 ltp : 17330.5 Close : 17647.6 change : -1.7968448967564914 Avg traded price : 17441.35 volume : 1.107595E7 OI : 1.21302E7 o : 17587.95 h : 17638.3 l : 17291.15 C :17647.6

Token : 256265 ltp : 17320.55 Close : 17629.8 change : -309.25 Avg traded price : 0.0 volume : 0.0 OI : 0.0 o : 17593.85 h : 17642.15 l : 17291.65 C :17629.8

`Here is my java code

tickerProvider.setOnTickerArrivalListener(new OnTicks() { @Override public void onTicks(ArrayList ticks) { System.out.println("tick "+ ticks.size()); ticks.forEach(i->{ System.out.println("Token : " + i.getInstrumentToken()); System.out.println("ltp : " + i.getLastTradedPrice()); System.out.println("Close : " + i.getClosePrice()); System.out.println("change : " + i.getChange()); System.out.println("Avg traded price : " + i.getAverageTradePrice()); // vwap System.out.println("volume : " + i.getVolumeTradedToday()); // volume System.out.println("OI : " + i.getOi()); // volume System.out.println("o : " + i.getOpenPrice()); System.out.println("h : " + i.getHighPrice()); System.out.println("l : " + i.getLowPrice()); System.out.println("C :" + i.getClosePrice()); });

System.out.println("---------"); // FilterTickToDomain.filter(ticks); } });`

rahul6789sharma avatar Sep 23 '22 10:09 rahul6789sharma