Single Instance

 
What is the best way to make it so only a single instance of my expert will be ran? I.e., they can't attach it to multiple charts, if it's already on one chart it won't run if it's placed on another.

I was thinking about using global variables, but havne't played around with them to be absolutely sure if I remove it in the deinit or they close the program or of the program crashes that it will be deleted.
 
Use some global variable as semaphore. See "MQL4: Global variables"