Forums › ProRealTime English forum › ProBuilder support › How big is this stock market drop? › Reply To: How big is this stock market drop?
03/16/2020 at 6:04 PM
#122275
I turned the rate of drop calculator into an indicator that draws lines on price. One line that is the value for the average drop in p bars and the other is the value for the maximum drop. Both are calculated from the high p bars back.
In the example in the image we can see that last week the DJI price almost hit the maximum drop price compared to the biggest three week price drop ever.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
//p = 3 if barindex > p then drop = max(0,high[p-1] - low) dropperc = (drop/high[p-1])*100 maxdrop = max(dropperc,maxdrop) if drop <> 0 then total = total + dropperc count = count + 1 avg = total/count endif endif maxdroplev = high[p] * (1 - (maxdrop[1]/100)) avgdroplev = high[p] * (1 - (avg[1]/100)) return maxdroplev as "max drop", avgdroplev as "average drop" |