Password to remove expert advisor

 
As I can request a password from the user so that he can remove the EA from the meta trader, I tried simply putting a return; in the OnDeinit event but it didn't work, AE disappeared from the screen
 
Your topic has been moved to the section: Expert Advisors and Automated Trading — Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
 
Murilo Junqueira: As I can request a password from the user so that he can remove the EA from the meta trader, I tried simply putting a return; in the OnDeinit event but it didn't work, EA disappeared from the screen

You can't impede a user from being able to remove an EA from the chart (or any MQL program for that matter).

It would be a security risk if the MetaTrader application allowed that possibility.

 
Murilo Junqueira: As I can request a password from the user so that he can remove the EA from the meta trader, I tried simply putting a return; in the OnDeinit event but it didn't work, AE disappeared from the screen
You could try (don't know if this works) to open a new chart and apply a template, loading the EA again, inside the OnDeinit().
 
Murilo Junqueira: As I can request a password from the user so that he can remove the EA from the meta trader, I tried simply putting a return; in the OnDeinit event but it didn't work, AE disappeared from the screen

Doesn't OnDeinit run when the EA is removed from the chart or when the application is closed?