Mihkel00 modified Glaz's script, I modified Mihkel00 's script again.
This is a QQE Mod original version by Mihkel00 :
I simply changed the above script to update pine script 5.0 and extracted two functions.
Thank you to the two authors for sharing such a great script.
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 a publication is governed by House Rules. You can favorite it to use it on a chart.