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

rahul6789sharma
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
  • rahul6789sharma
    rahul6789sharma edited September 2022
    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);
    }
    });
  • sujith
    Can you let us know the version of javakiteconnect you are using?
Sign In or Register to comment.