It’s not worth wasting time putting any protection INSIDE the EA (.ex4 file); It doesn’t matter if it’s time/date protection or limited by email or account number. As long as it is fully featured and decompilable, this protection can be removed and the Expert Advisor can be used without permission. If the idea is to sell to the expert, better think about serious protection.

The DLL file is serious protection. It can be done in several ways. Image You have your EA to make the decision to enter a BUY trade using the RSI and MACD indicators. If you code this inside the EA (.ex4 file), everyone can see how your EA decides to place a trade. But if you move these calculations to the DLL, no code will be seen in the EA. The functions in the DLL file will return TRUE or FALSE so your EA knows if it can accept a trade or not. All calculations for RSI and MACD (or any other indicator) will be done in the DLL file.

Once this is done, you can either sell your EA or add more protection.

You can have your own database of your users who can be accessed to trade the EA. The DLL file can connect, say, every 5 minutes to your website and perform an authorization with the user’s password. In this way, no one can use Your EA without Your knowledge. If the EA cannot perform an authorization, the DLL will refuse to perform any calculations and the EA will not know when to BUY or SELL the market.