Emile, I got to the bottom of this issue.
Indicator is all ok, no coding errors. The issue arises when high multiplier and period values are used. Due to the calculation, it is vital to have the same dataset for testing and trading, otherwise the values don't match. For my daily chart I had to use all bars to get values matching. Minimum data bars number needs to be manually adjusted in the EA at line 77 like in the pic below. There's not more I can do with this. Advice - use lower period, multiplier or adjust Min_Num_Bars incrementally until the values match.
Edit: postimage has stopped working... I'll attach the combined screenshot.
Post's attachmentsbal.JPG 55.38 kb, file has never been downloaded.
You don't have the permssions to download the attachments of this post.