D
@admin This is really awesome! Saves lot of time.
Just one difference I found. The prices received are multiplied by 100 and user has to divide it by 100 to get right price.
Is it correct implementation or some bug.
I dont understand the reason to do so.
@Override
public void onQuoteArrival(Quote quote) {
ZonedDateTime exchangeTime = ZonedDateTime.ofInstant(Instant.ofEpochMilli(quote.getExchangeFeedTimeEpochMillis()), TZ_IST);
String data = String.format("token: %s"
+ " sequenceNumber: %d"
+ " ltp: %.2f"
+ " open: %.2f"
+ " high: %.2f"
+ " low: %.2f"
+ " close: %.2f"
+ " exchangeTime: %s"
+ " exchangeToClientLatency: %s",
quote.getToken().toString(),
quote.getSequenceNumber(),
(quote.getLastTradedPrice() / 100.0),
(quote.getOpenPrice() / 100.0),
(quote.getHighPrice() / 100.0),
(quote.getLowPrice() / 100.0),
(quote.getClosePrice() / 100.0),
exchangeTime,
Instant.now().toEpochMilli() - quote.getExchangeFeedTimeEpochMillis());
System.out.println(data);
}