What I don't like about calculating average like data[stock].mavg(5) is that the information across the whole week gets equal weight - while recent ones should be more reliable to predict future values. Hence I used an alternate way to calculate average: add up mavg(i) for i in range, say (1,6). It can be argued that this average is closer to exponential average as the number of days gets big.
However I've been debugging for many hours without knowing why
for k in range(1,6):
avg_Price[i] += data[stock].mavg(k)
always return a runtime error - silly question but I eventually decided to use the more traditional way to write the entire expression out. Again, any suggestion are enthusiastically welcomed!