☰
Login
Signup
Home
›
Java client
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Register
Categories
Recent Discussions
Activity
Categories
13.2K
All Categories
0
Incidents
127
Node JS client
36
Go client
765
.Net API client
360
Kite Publisher
532
.Net / VBA / Excel (3rd party)
433
Algorithms and Strategies
964
Java client
1K
API clients
400
PHP client
3.8K
Python client
331
Mobile and Desktop apps
1.3K
Market data (WebSockets)
3.1K
General
In this Discussion
September 2022
sujith
September 2022
rahul6789sharma
change data on Tick class is different for nifty Index and Nifty Future
rahul6789sharma
September 2022
in
Java client
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
September 2022
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
September 2022
Can you let us know the version of javakiteconnect you are using?
Sign In
or
Register
to comment.
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);
}
});