TickTimestamp incorrect

Sandeep_Prakash
@sujith
I'm accessing the Tick Data from Germany and I find that the TickTimestamp for BANKNIFTY bnfTick.getTickTimestamp() is showing as local German Time. Ideally it should be the exchange Timestamp is it not? If not, where do I get the exchange timestamp?



/** Parses NSE indices data.
* @return Tick is the parsed index data. */
private Tick getIndeciesData(byte[] bin, int x, boolean tradable){
int dec = 100;
Tick tick = new Tick();
tick.setMode(modeQuote);
tick.setTradable(tradable);
tick.setInstrumentToken(x);
tick.setLastTradedPrice(convertToDouble(getBytes(bin, 4, 8)) / dec);
tick.setHighPrice(convertToDouble(getBytes(bin, 8, 12)) / dec);
tick.setLowPrice(convertToDouble(getBytes(bin, 12, 16)) / dec);
tick.setOpenPrice(convertToDouble(getBytes(bin, 16, 20)) / dec);
tick.setClosePrice(convertToDouble(getBytes(bin, 20, 24)) / dec);
tick.setNetPriceChangeFromClosingPrice(convertToDouble(getBytes(bin, 24, 28)) / dec);
if(bin.length > 28) {
tick.setMode(modeFull);
long tickTimeStamp = convertToLong(getBytes(bin, 28, 32)) * 1000;
if(isValidDate(tickTimeStamp)) {
tick.setTickTimestamp(new Date(tickTimeStamp));
} else {
tick.setTickTimestamp(null);
}
}
return tick;
}
Tagged:
  • sujith
    We create date object on the javakiteconnect library here. As you can see, the Date considered will be local time.
    You can either convert it to IST after you get data or fork it and change it while parsing.

    If you are looking at indices data then indices parsing is here.
Sign In or Register to comment.