@Override public OHLCV next() { String[] parts = line.split(","); OHLCV o = new OHLCV(); o.setMdiId(mdiId); o.setOpen(Double.parseDouble(parts[1])); o.setHigh(Double.parseDouble(parts[2])); o.setLow(Double.parseDouble(parts[3])); o.setClose(Double.parseDouble(parts[4])); o.setVolume(0.0); o.setResolutionInSeconds(resInSeconds); // shift it, so that it looks as if it emitted at the end of a candle. try { if(isShiftTime()) o.setTimeStamp(new TimeStamp(sdf.parse(parts[0]).getTime() * 1000 * 1000 + offset)); else o.setTimeStamp(new TimeStamp(sdf.parse(parts[0]).getTime() * 1000 * 1000 )); line = br.readLine(); } catch (Exception e) { throw new RuntimeException(e); } return o; }