Indicator returns different results if called from EA

Hello

I am trying to understand why/how an indicator (DT-ZigZag-Lauer) returns different results from an EA than when it is attached to a chart. I have checked and re-checked the code.

If anyone can help, of has an explanation, I would be very grateful!

UPDATE: Found a workaround using GlobalVariables, so Iā€™m a happy bunny again :smiley: