Because they are not simulated in the Strategy Tester! So, use a condition in your code, to only use them when the code is not being run in the tester!
Disregard my comment and see @Alain Verleyen's answer below and the link he provided!
I suppose you mean they are simulated in ST ?
No, I meant "NOT"!
I have not tested this on MT5, but on MT4 any Global Variable manipulated in the tester actually accesses the "real" global variables and not any simulated ones, which can cause havoc because it messes up any variables in use by EAs that are running on the live charts.
I had assumed that the same happens on MT5 as well, but from your statement, it seems that they are simulated in MT5?