how to calculate the linearly weighted moving average lwma 
let s say we are interested in calculating the linearly weighted moving average of the closing price of a stock over the last five days begin by multiplying today s price by 5 yesterday s by 4 and the price of the day before by 3 continue multiplying each day s price by its position in the data series until reaching the first price in the data series which is multiplied by 1 add these results together divide by the sum of the weights and you will have the linearly weighted moving average for this period p5 5 p4 4 p3 3 p2 2 p1 1 5 4 3 2 1 let s say that the price of this stock fluctuates as so day 5 90 90day 4 90 36day 3 90 28day 2 90 83day 1 90 91 90 90 5 90 36 4 90 28 3 90 83 2 90 91 1 5 4 3 2 1 90 62the lwma of this stock over this time period is 90 62 