Is there anyone that has been able to properly code the Active Boundaries Indicator?

I am not sure if my previous example is correct, is there anyone willing to help?

Thanks.