Maybe it’s possible, after reading the formula, but it will surely slow down charts.
As reported by https://www.blockchaincenter.net/bitcoin-rainbow-chart/, “The Rainbow Chart is meant to be be a fun way of looking at long term price movements“.
This website https://cryptonomist.ch/2020/04/17/cose-bitcoin-rainbow-chart/ says clearly “Holger admits, however, that these bands are completely arbitrary and without any scientific basis, so they turn out to be correct only until one day perhaps they will no longer be correct“.
Post the formula and the code so that they can be evaluated.