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.
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publications is governed by House rules. 您可以收藏它以在圖表上使用。