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.
I don't really see it my place to comment on such coding of a beauty!
But, it's a pity if you don't make this modification.
I believe it would serve better when you're using the "tickerid", to replace the "lookahead=true" with the more logical variable "barmerge.gaps_off, barmerge.lookahead_on".
Exclude the "barmerge.lookahead_on" when publishing the back-test versions.
Give it a try, and keep it up, pal ;-)