title: Calculating intraday candlesticks by time intervals
body: <p>This maybe an over asked question, but my mind draws blank at this moment. I know what a <a href="http://en.wikipedia.org/wiki/Candlestick_chart" rel="nofollow noreferrer">candlestick chart</a> is and how to draw it daily. But how to draw it intraday at asked time periods. I have this server, written in Java, that gives me trade depth (each trade done since the start of the day). Its just a stream of raw data: price, shares, timestamp. </p>
  
  <p>How does one go about calculating candlestick data from that? Lets say, they want to have 5 min candlestick or 1min candlestick. Or is there a library that will do that for me if I feed it data?</p>
  
  <p>Any help is appreciated!</p>