Thanks to Dead_Hunter to the base code which I modified. This code will now use the last 21 daily candles of the earnings cycle to calculate the average percent price move. Then using Dead_Hunters code looking at the past 8 earnings cycles, the final average percent price move is calculated. This is the Average value which is displayed and used to calculate the Price Increase and Price Decrease on the up Earning date. this script can be useful for planning Strangle and Straddle options trades.