-
“Doesn't work” is meaningless — just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires — meaningless.
How To Ask Questions The Smart Way. (2004)
When asking about code
Be precise and informative about your problem -
Use the debugger or print out your variables, including _LastError and prices and find out why. Do you really expect us to debug your code for you?
Code debugging - Developing programs - MetaEditor Help
Error Handling and Logging in MQL5 - MQL5 Articles (2015)
Tracing, Debugging and Structural Analysis of Source Code - MQL5 Articles (2011)
Introduction to MQL5: How to write simple Expert Advisor and Custom Indicator - MQL5 Articles (2010)
As I have explained in my first comment I have done the code as seen by the input and I receive no error message but when I add my expert to a chart on an account then it does not restrict the expert from running on the wrong account as it still loads normal and runs.
Your code is simply checking the account number and printing a message, there is no code shown that will restrict access or remove the expert from the chart?
ACCOUNT_LOGIN is a long data type
also don't run security checks in OnTick it is a massive waste of resources
- www.mql5.com
You were already given example code to study ... https://www.mql5.com/en/forum/444251#comment_45847990
If you were unable to understand it or adapt it to your needs, then there is not much more we can do for you. You may need to hire someone in the Freelance section to do it for you.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi everyone
Could someone please assist with the following. I'm new to coding and are trying to lock my EA so that it will only run on a specific account in order for it not to be copied over. I have attached my code but for some reason its not working. If I add my EA onto a chart it still works even if the account number is the wrong one. Please advise as where i have gone wrong. I managed to set up the expired date setting bit I'm struggling with the account block . I know how to add a password but it will not work for me since the password can just be given to the next person and my EA will still be copied. I have entered th code into my Ontick in my EA and I'm not sure if it is correct.