Running multiple instances from same folder and persistent static variables not getting saved

So i am running 2 instances of Amibroker , one for live trading and one for testing. Both run on different databases. I am facing a situation in which my persistent static variables from live trading are not getting saved, when i run 2 instances of amibroker. If i just run my live trading amibroker, then the persistent static variables get saved. I am also using SetOption("StaticVarAutoSave", 300). Any guidance on what am i doing wrong ?

Static variables are saved in single file (persistvar.bin). If you run two instances and both save to the very same file then "last write" counts. You either need to have persistent variables only in ONE instances or if you need to run these instances at the same you need to run them from DIFFERENT folders (working directories) to keep variables separate.

3 Likes