@jstap
Thanks jstap, I greatly appreciate your help.
I was able to resolve the issue by adapting the blocks you provided to my Expert Advisor.
This solution worked because it avoided using the "Bucket of Positions" block.
Important takeaways from this experience:
I believe this issue is caused by the underlying code of the Bucket of Positions block, and the way it interacts with the data feed from the broker.
This issue occurs with some brokers, not all.
One broker I used for years without this issue appearing at any time, then suddenly a few days ago this issue appeared, with the same MT5 Expert Advisor that was working as expected the day before.
This means the broker changed something in their hardware or software which caused a conflict somewhere in the system.
MT4 has the same problem.
With one broker, I converted my MT5 Expert Advisor to MT4, but it made no difference.
The same issue appeared with the MT4 Expert Advisor.
Had my trading algorithm depended on data from the Bucket of Positions block, the consequences could have been more serious than just an error in comments on a chart !
Ultimately, the issue seems to be caused by a conflict between broker infrastructure, MetaQuotes Language (MQL), and the language in which fxDreema is written.
Acknowledgements:
Many thanks to the developers of fxDreema.
There are similar tools for MetaTrader, but nothing comes even close to fxDreema.