How to Use Raw Real Time Stock Data to Make 1 Hour Data
- 1). Decide what analytic tool you are most comfortable with. For many, this might be an Excel spreadsheet. Mathematicians might use MATLAB. Experienced programmers might prefer to write a small Visual Basic or Ruby program. Calculations will be relatively basic, so the exact tool you choose is not as important as your familiarity with it.
- 2). Load your data. If you're using a spreadsheet, open your raw data file. If you're writing a program, load the data from disk into memory.
- 3). Divide the data into hour-long blocks. For example, group all data points whose timestamp is between 9 a.m. and 9:59:59 a.m. together into one unit. Repeat this step for each hour in your dataset.
- 4). Pull out the interesting values from each block. When constructing hour bars for historical analysis, you are typically most interested in four values for each hour, the so called "OHLC": open, high, low, and close values. Open and close represent the price at the beginning and end of the hour. High and low are the highest and lowest prices during the period. This is straightforward once the data has been divided into blocks by hour: the open and close are simply the first and last trade data points in the block, and the high and low are simply the maximum and minimum trade prices in the block.