Skip to content

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

Open
@rahul6789sharma

Description

@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

`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);
}
});`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions