are you really want to close?

 

I closed meta trader last week by mistake and my EA is accumulating some variables, so once it been closed it reset to initial value

is there is any way at meta trader to prevent this action, like when I click close it gives me a pop up window for confirmation " Do you really want to close ... Yes/No"

 

Nope.

EA's must be coded to recover from accidental closures of the terminal, OS crashes, power glitches rebooting the machine, etc.

On startup, either you find your open orders and recreate what ever values you require or you must write them in a file each modification. (Global variables will not be written to disk except in a proper terminal shutdown.)