How it works ? - it calculates main trend direction by using the length that is user-defined. so you can change it as you wish - then it calculates trend direction for each 9 lower lengths. if you set the length = 20 then the lengths are 19, 18,...11 - and it checks if the trend directions that came from lower lengths is same or not with main trend direction. - it changes the trend color of the ribbon.
As far as I can tell this is Lonesomethblue's code for his Donchian Channel indicator from 2020. The only differences I see in the code are that you removed his name and changed the title. What does GMC stand for? Did you just reuse the indicator code without giving credit to either Lonesometheblue or even Richard Donchain? If I'm misunderstanding something, please let me know. Otherwise, consider adding clarification and credit to your description as well as within the code.
#team_gmc is doing a great job for future of crypto trading. They are helping newbies for learning and make them self from others scam and fake peoples♥️