expands get_avg_price: last time interval is included in the calculation
changes the way data is saved, so that now only changes in price are recorded