Calculate Time-Weighted Average Price: Weights on More Recent Price
t = np.arange(len(c)) print "TWAP =", np.average(c, weights=t)