Persistent variables JUST WORK. There no problems.
The only problem is that you are making incorrect assumptions. Checking modification date is NOT method to check if persistent variables are working
because they are NOT saved at exact moment when you call StaticVarSet.
Doing so would be highly ineffective.
AmiBroker is multithreaded program and various things occur at the same time asynchronously and persistent variables are always in RAM, and they are saved to disk asynchronously, periodically, later during "idle" time in other thread and/or on program EXIT .
Instead of making wrong assumptions, you should read the manual:
that says:
Persistency
Starting from version 5.80 there is a new parameter persist. If it is set to True then static variable will be stored in PersistVars.bin file when AmiBroker is closing and reloaded automatically on next startup, preserving the values of static variables between application runs). In addition to saving them automatically on exit, persistent static variables can be auto-saved at user-specified intervals using SetOption("StaticVarAutoSave", interval );