Hello Aditya
Even if we code for 5% candles to be outside band and get a % number, how does that ensure it the best value?
SH has arrived at this figure of 5% candles by approximation, once you start coding who know if 4.5% or 5.5.% may be better optimization for the actual trading results . . .
So if any coding efforts has to be made that should be focused towards testing the concept and maybe directly arriving at the MA value & % value for envelop rather than trying to keep x% of candle out of the band
btw, Nice efforts, trading is about catching these Out-liners
Thanks