Download MetaTrader 5

How to lock EA/Script based on the login account name?

To add comments, please log in or register
win19
18
win19  

I need a help how to lock my EA/Script based on my login account name ?

how to make the this script can run only account name of jeo mex for the example ? 

Icham Aidibe
10815
Icham Aidibe  
win19:

I need a help how to lock my EA/Script based on my login account name ?

how to make the this script can run only account name of jeo mex for the example ? 

https://www.mql5.com/en/articles/359

Securing MQL5 code: Password Protection, Key Generators, Time-limits, Remote Licenses and Advanced EA License Key Encryption Techniques
Securing MQL5 code: Password Protection, Key Generators, Time-limits, Remote Licenses and Advanced EA License Key Encryption Techniques
  • 2012.02.17
  • investeo
  • www.mql5.com
Most developers need to have their code secured. This article will present a few different ways to protect MQL5 software. All examples in the article will refer to Expert Advisors but the same rules can be applied to Scripts and Indicators. The article starts with simple password protection and follows with key generators, licensing a given...
Siti Latifah
12440
Siti Latifah  
win19:

I need a help how to lock my EA/Script based on my login account name ?

how to make the this script can run only account name of jeo mex for the example ? 

if(AccountName()!="win19") ( Print("Wrong Name") ; return; }
win19
18
win19  
Icham Aidibe:

https://www.mql5.com/en/articles/359

thank you

win19
18
win19  
Siti Latifah:

thank you

where should I put it?

Siti Latifah
12440
Siti Latifah  
win19:

thank you

where should I put it?

you can put below

OnTick()

{

..............



}

whroeder1
17092
whroeder1  
win19: where should I put it?
Siti Latifah: you can put below OnTick()
Don't try to use any price or server related functions in OnInit (or on load,) as there may be no connection/chart yet:
  1. Terminal starts.
  2. Indicators/EAs are loaded. Static and globally declared variables are initialized. (Do not depend on a specific order.)
  3. OnInit is called.
  4. For indicators OnCalculate is called with any existing history.
  5. Human may have to enter password, connection to server begins.
  6. New history is received, OnCalculate called again.
  7. New tick is received, OnCalculate/OnTick is called. Now TickValue, TimeCurrent and prices are valid.
win19
18
win19  
Siti Latifah:

you can put below

OnTick()

{

..............



}

thank you

win19
18
win19  
whroeder1:

thank you

To add comments, please log in or register