How to protect MT4 Expert Advisors and Indicators with License Key using EA Licensing system from Signal Magician

In this tutorial, Rimantas explains how anyone can protect MT4 Expert Advisors and Indicators with EA Licensing system (EAL) from Signal Magician.
EAL will give you a custom MQL4 code to add to your EA or Indicator so you can connect it with the EAL system. You can create time-limited license keys with expiration date and also limit the amount of MT4 accounts for each license.

STEP #1: Creating a new product in the EA Licensing system on the Signal Magician

 

Open page: Create new product

Open page: Create new product;We will start with creating a new product on the 'EA Licensing' system inside the Signal Magician. You must add each EA and Indicator to the EAL system as a product if you want to protect them with the License Key. Each product can have multiple license types like Standard, PRO, Gold, Platinum, or whatever you want to call them. Each license type will have its ID which we will have to add to the MQL4 code of the EA. It is how EAL system will know which EA is connecting for the authorization of a License Key. To begin, click on the 'Create new product' in the EA Licensing page.

We will start with creating a new product on the ‘EA Licensing’ system inside the Signal Magician.

You must add each EA and Indicator to the EAL system as a product if you want to protect them with the License Key.

Each product can have multiple license types like Standard, PRO, Gold, Platinum, or whatever you want to call them.

Each license type will have its ID which we will have to add to the MQL4 code of the EA. It is how EAL system will know which EA is connecting for the authorization of a License Key.

To begin, click on the ‘Create new product’ in the EA Licensing page.

Create a new product

Create a new product;We fill in the form with relevant information and click on 'Create new product' button. For this example, we will use Moving Average Expert Advisor which is available in every MT4 default installation. We give this product a name and make it published. We also add product website which is the URL of the website where users can find more information about the product and buy it. I use my website URL as an example, but apparently, you should put your website URL there :-)

We fill in the form with relevant information and click on ‘Create new product’ button.

For this example, we will use Moving Average Expert Advisor which is available in every MT4 default installation.

We give this product a name and make it published.

We also add product website which is the URL of the website where users can find more information about the product and buy it. I use my website URL as an example, but apparently, you should put your website URL there ๐Ÿ™‚

Open page: Create a new license type

Open page: Create a new license type;Once you create a new product, add at least one license type for it. Click on the 'Create a new license type' link in the 'Types of licenses' table. Once you create license types, they will appear on this table.

Once you create a new product, add at least one license type for it.

Click on the ‘Create a new license type’ link in the ‘Types of licenses’ table.

Once you create license types, they will appear on this table.

Create a new license type PRO

Create a new license type PRO;Fill in the form and then click on 'Create a new license type' button. License name: PRO, Standard, Gold, Platinum, Premium, etc. Anything you like :-) Current version - this is where you enter the version number of your product. It will be visible on the EAL system, and users will always know if they have the latest version or not. If you upgrade your EA with new features or fix bugs, you should update this number too as you release the new version of your EA. MT4 Real account limit - this is where you enter the amount of Live MT4 accounts this particular license type allows to use with the product. MT4 Demo account limit - this is where you enter the amount of Demo MT4 accounts this particular license type allows to use with the product. For example, we create PRO license and allow to use it on 5 Live MT4 accounts and 10 Demo MT4 accounts at the same time. EAL system will automatically lock License Key to each MT4 account number where the EA is attached. We call it Activation. For this particular license type, we give 15 Activations. Users are allowed to delete old Activations and transfer the License Key anytime to any other MT4 account if there are free Activations left for his license. There's no limit of how many times users can transfer the License Key to another MT4 as long as the total amount of MT4 accounts in use is 15 (5 Live + 10 Demo accounts). If a user has 5 Live MT4 accounts already in use with the License Key, he won't be able to use it on another Live MT4 account without deleting Activation to allow new account.

Fill in the form and then click on ‘Create a new license type’ button.

License name: PRO, Standard, Gold, Platinum, Premium, etc. Anything you like ๐Ÿ™‚

Current version – this is where you enter the version number of your product. It will be visible on the EAL system, and users will always know if they have the latest version or not. If you upgrade your EA with new features or fix bugs, you should update this number too as you release the new version of your EA.

MT4 Real account limit – this is where you enter the amount of Live MT4 accounts this particular license type allows to use with the product.

MT4 Demo account limit – this is where you enter the amount of Demo MT4 accounts this particular license type allows to use with the product.

For example, we create PRO license and allow to use it on 5 Live MT4 accounts and 10 Demo MT4 accounts at the same time.

EAL system will automatically lock License Key to each MT4 account number where the EA is attached. We call it Activation. For this particular license type, we give 15 Activations.

Users are allowed to delete old Activations and transfer the License Key anytime to any other MT4 account if there are free Activations left for his license.

There’s no limit of how many times users can transfer the License Key to another MT4 as long as the total amount of MT4 accounts in use is 15 (5 Live + 10 Demo accounts).

If a user has 5 Live MT4 accounts already in use with the License Key, he won’t be able to use it on another Live MT4 account without deleting Activation to allow new account.

Go back to the product page

Go back to the product page;When you create a new license type, you'll see Offers list table below. It is where you can select Offers that should activate this particular license type upon purchase. I will not cover this part here and create another tutorial for setting up payment systems. You can also create trial access to products on Signal Magician via MailChimp signup form. Click on 'Back to product' to create another license type.

When you create a new license type, you’ll see Offers list table below.

It is where you can select Offers that should activate this particular license type upon purchase. I will not cover this part here and create another tutorial for setting up payment systems. You can also create trial access to products on Signal Magician via MailChimp signup form.

Click on ‘Back to product’ to create another license type.

Open page again: Create a new license type

Open page again: Create a new license type;We can see PRO license type already created. Now we will create 'Standard' license. Click on the 'Create a new license type' link in the 'Types of licenses' table.

We can see PRO license type already created. Now we will create ‘Standard’ license.

Click on the ‘Create a new license type’ link in the ‘Types of licenses’ table.

Create a new license type Standard

Create a new license type Standard;Fill in the form and then click on 'Create a new license type' button once again to create another license type. We set the Standard license to work on 1 Live MT4 account and 2 Demo MT4 account at the same time.

Fill in the form and then click on ‘Create a new license type’ button once again to create another license type.

We set the Standard license to work on 1 Live MT4 account and 2 Demo MT4 account at the same time.

Go back to the product page

Go back to the product page;'Standard' license type is created. Click on 'Back to product' to see all license types for this product.

‘Standard’ license type is created.

Click on ‘Back to product’ to see all license types for this product.

Notice the License ID

Notice the License ID;Now that we have license types created we can proceed to the next step and prepare the files required for the protected EA. But before that, note the License ID of both license types. We will need these numbers later when we add MQL4 code to the EA. PRO License ID = 11 Standard License ID = 12

Now that we have license types created we can proceed to the next step and prepare the files required for the protected EA.

But before that, note the License ID of both license types. We will need these numbers later when we add MQL4 code to the EA.

PRO License ID = 11

Standard License ID = 12

STEP #2: Preparing required files

 

Click on Open Data Folder menu

Click on Open Data Folder menu;It will open MT4 Data Folder where you need to add additional files before creating and compiling protected Expert Advisors. If you have multiple MT4 terminals on your computer and do not know which one to use, then my simple recommendation is to use the one which already has your EA or Indicator code. In any case, just decide which one you'll use and then stick to it when creating and compiling protected EA files. You can change the terminal later if you want.

It will open MT4 Data Folder where you need to add additional files before creating and compiling protected Expert Advisors.

If you have multiple MT4 terminals on your computer and do not know which one to use, then my simple recommendation is to use the one which already has your EA or Indicator code. In any case, just decide which one you’ll use and then stick to it when creating and compiling protected EA files. You can change the terminal later if you want.

Open the MQL4 code generator

Open the MQL4 code generator;Open the MQL4 code generator which can be found on the EA Licensing page.

Open the MQL4 code generator which can be found on the EA Licensing page.

Download the EAL files package

Download the EAL files package;On the MQl4 code generator page, you'll find a link to download the EAL files package. Click that link and open the downloaded package.

On the MQl4 code generator page, you’ll find a link to download the EAL files package. Click that link and open the downloaded package.

Copy the EAL files into the MT4 Data Folder

Copy the EAL files into the MT4 Data Folder;Now you have two folders open, the MT4 'Data Folder' and a folder with the EAL files. Move both windows next to each other as illustrated in the image. Inside the EAL files package right-click on the MQL4 folder and then click on Copy menu.

Now you have two folders open, the MT4 ‘Data Folder’ and a folder with the EAL files. Move both windows next to each other as illustrated in the image.

Inside the EAL files package right-click on the MQL4 folder and then click on Copy menu.

Paste the EAL files into MT4 Data Folder

Paste the EAL files into MT4 Data Folder;Now right-click anywhere on the white area in the MT4 Data Folder on the left and then click on Paste menu.

Now right-click anywhere on the white area in the MT4 Data Folder on the left and then click on Paste menu.

Replace the files if prompted

Replace the files if prompted;Click on 'Replace the files in the destination' button if you'll see such window. Usually, it should not appear, unless it is not the first time you are copying these files. Now let's look at the files we've copied.

Click on ‘Replace the files in the destination’ button if you’ll see such window. Usually, it should not appear, unless it is not the first time you are copying these files.

Now let’s look at the files we’ve copied.

Image files for EAL protected EA

Image files for EAL protected EA;MetaEditor uses these files during the EA compilation. They give a visual explanation in case the user sets something incorrectly in the MT4 or EA settings. IMPORTANT! Your users will NOT need these files to use the EA. You need to keep these files secret and not reveal to anyone.

MetaEditor uses these files during the EA compilation. They give a visual explanation in case the user sets something incorrectly in the MT4 or EA settings.

IMPORTANT! Your users will NOT need these files to use the EA. You need to keep these files secret and not reveal to anyone.

;For example, if the user does not allow DLL library calls (which are necessary for the EAL), the EA will display a screenshot explaining how to enable them.

For example, if the user does not allow DLL library calls (which are necessary for the EAL), the EA will display a screenshot explaining how to enable them.

;If the user does not install the DLL library into his MT4, the EA will not be able to function because the DLL file is missing. In such case, the user will see this screenshot on his MT4. It helps to understand what to do next quickly.

If the user does not install the DLL library into his MT4, the EA will not be able to function because the DLL file is missing. In such case, the user will see this screenshot on his MT4.

It helps to understand what to do next quickly.

;If the user does not enter the License Key, he will see this screenshot on his MT4. It gives a clue where to enter the License Key.

If the user does not enter the License Key, he will see this screenshot on his MT4. It gives a clue where to enter the License Key.

;And if the user inputs a wrong License Key, then the EA will display this screenshot. It shows where the user can find his License Key.

And if the user inputs a wrong License Key, then the EA will display this screenshot. It shows where the user can find his License Key.

MQH Include file for EAL protected EA

MQH Include file for EAL protected EA;Most of the EAL MQL4 code is in this MQH file. This way I made it easier to add MQL4 code to the Expert Advisors we want to protect. It is because now we do not need adding 600+ lines of code which is in this file (SM EA Licensing Library 2018-04-17.mqh). We'll tell the EA to include the code from this file with just one line of code. Note the date in the file name. It is the file version. I never change this file. If I make any changes to this file, it will have another date in its name. If you see multiple versions of this file, then use the latest one. If you start using one version and later want to use another version you should make sure the rest of the MQL4 code in your EA matches the same version too. IMPORTANT! Your users will NOT need this file to use the EA. You need to keep this file secret and not reveal to anyone.

Most of the EAL MQL4 code is in this MQH file.

This way I made it easier to add MQL4 code to the Expert Advisors we want to protect. It is because now we do not need adding 600+ lines of code which is in this file (SM EA Licensing Library 2018-04-17.mqh). We’ll tell the EA to include the code from this file with just one line of code.

Note the date in the file name. It is the file version. I never change this file. If I make any changes to this file, it will have another date in its name.

If you see multiple versions of this file, then use the latest one.

If you start using one version and later want to use another version you should make sure the rest of the MQL4 code in your EA matches the same version too.

IMPORTANT! Your users will NOT need this file to use the EA. You need to keep this file secret and not reveal to anyone.

DLL file for EAL protected EA

DLL file for EAL protected EA;It is the DLL library file. EA protected with the EAL code will not work without this DLL file. To use this DLL file for the EA, we will make a copy of it and give it a new name. It is best always to keep the original file and make copies from it. Each product (EA or Indicator) needs to have their own DLL file.

It is the DLL library file. EA protected with the EAL code will not work without this DLL file.

To use this DLL file for the EA, we will make a copy of it and give it a new name.

It is best always to keep the original file and make copies from it.

Each product (EA or Indicator) needs to have their own DLL file.

Copy the DLL file

Copy the DLL file;Right-click on the DLL file and click on the 'Copy' menu.

Right-click on the DLL file and click on the ‘Copy’ menu.

Paste the DLL file to create a copy

Paste the DLL file to create a copy;Right-click anywhere in the white empty area and click on the 'Paste' menu. It will create a copy of the DLL file.

Right-click anywhere in the white empty area and click on the ‘Paste’ menu.

It will create a copy of the DLL file.

Rename the DLL file

Rename the DLL file;Right-click on the newly created DLL file copy and click on the 'Rename' menu.

Right-click on the newly created DLL file copy and click on the ‘Rename’ menu.

Newly created DLL file

Newly created DLL file;Here's the newly created DLL file which we will use for the new product 'Moving Average' EA. Users will also require installing this file into their MT4 Data Folder together with the EA. In summary, users will have to install these two files to use your protected EA: 1) EA file 2) DLL file Of course, if your EA requires using some other files, then these will be necessary too, but that's different from the EAL MQL4 code. Note the file name because we will use it in the EA. It will be a part of the EAL MQL4 code. I named the DLL file to match the product name and added EAL at the beginning to give myself a clue that this DLL is for EA Licensing system. You can name the DLL file any way you like, but I strongly recommend you keep the 'v1.0' part at the end. It will help to differentiate between different DLL file versions if there happen to be new versions in the future as the EAL system gets upgrades.

Here’s the newly created DLL file which we will use for the new product ‘Moving Average’ EA.

Users will also require installing this file into their MT4 Data Folder together with the EA.

In summary, users will have to install these two files to use your protected EA:

1) EA file

2) DLL file

Of course, if your EA requires using some other files, then these will be necessary too, but that’s different from the EAL MQL4 code.

Note the file name because we will use it in the EA. It will be a part of the EAL MQL4 code.

I named the DLL file to match the product name and added EAL at the beginning to give myself a clue that this DLL is for EA Licensing system.

You can name the DLL file any way you like, but I strongly recommend you keep the ‘v1.0’ part at the end. It will help to differentiate between different DLL file versions if there happen to be new versions in the future as the EAL system gets upgrades.

STEP #3: Preparing Expert Advisor files for protection

 

Open MetaEditor from MT4

Open MetaEditor from MT4;In this tutorial, I will use Moving Average EA as an example and add a License Key into this EA. It can be any EA or Indicator you have. I will continue explaining how to add the MQL4 code to the Expert Advisor, but the same steps can be applied to the Indicator as well. You will need a little knowledge of MQL4 to add the custom code, but even if you've never seen MQL4 code before it should be quite an easy task. In fact, you might also learn some MQL4 code after this implementation :-) The first step is to open the MetaEditor. It is the software which allows to edit MQL4 code and compile apps for MT4. There are two ways to open the MetaEditor. One way is to right-click on the EA from the 'Expert Advisors' list in the 'Navigator' window and then choose

In this tutorial, I will use Moving Average EA as an example and add a License Key into this EA.

It can be any EA or Indicator you have. I will continue explaining how to add the MQL4 code to the Expert Advisor, but the same steps can be applied to the Indicator as well.

You will need a little knowledge of MQL4 to add the custom code, but even if you’ve never seen MQL4 code before it should be quite an easy task. In fact, you might also learn some MQL4 code after this implementation ๐Ÿ™‚

The first step is to open the MetaEditor. It is the software which allows to edit MQL4 code and compile apps for MT4.

There are two ways to open the MetaEditor.

One way is to right-click on the EA from the ‘Expert Advisors’ list in the ‘Navigator’ window and then choose “Modify” from the menu. It will load the MetaEditor and should have the Moving Average EA already loaded for editing.

Another way to open MetaEditor

Another way to open MetaEditor;You can also click on the yellow icon in the top toolbar of an MT4 terminal to open the MetaEditor. This way the MetaEditor should open and load all previously opened files. If you're loading it for the first time, it should load without any files open.

You can also click on the yellow icon in the top toolbar of an MT4 terminal to open the MetaEditor. This way the MetaEditor should open and load all previously opened files. If you’re loading it for the first time, it should load without any files open.

Load the EA or Indicator you want to edit

Load the EA or Indicator you want to edit;If your EA/Indicator is not opened, you can always find it in the Experts or Indicators section in the Navigator window.

If your EA/Indicator is not opened, you can always find it in the Experts or Indicators section in the Navigator window.

Create a copy of the EA

Create a copy of the EA;We have 'Moving Average.mq4' file loaded and now we'll create a copy of it. From the top menu choose 'File' and then 'Save As'.

We have ‘Moving Average.mq4’ file loaded and now we’ll create a copy of it.

From the top menu choose ‘File’ and then ‘Save As’.

Click Save to create the new EA file

Click Save to create the new EA file;We name the new EA differently. We use the same original name and add the PRO at the end which indicates that this is the PRO version of the EA. We already know that the PRO version allows more MT4 account numbers as we created previously in the EAL system of the Signal Magician panel. As you notice, we've added 'v1.0' to the file name which indicates that this is the version number 1.0 of this EA. I recommend you keep this practice and always change version number when you update the EA. For example, you add new features or fix bugs in the 1.0 version, but instead of keeping the same file name you would want to name it 'Moving Average PRO v1.1'. This way your users will know that this is a new version and it will be less confusing for yourself too. Also, it is very convenient when helping customers if they have trouble with the EA. Imagine a scenario where a user reports a bug. You fix it and send EA version 1.1, but the user still claims that he gets the same problems with the EA. You see everything works fine on your end and now you are confused to understand what's going on. You ask the user to send the screenshots of the chart and then notice that there is an old EA 1.0 attached to it. If the file name did not have a version number, you would not saw that coming :-) It happened to me several times, and for the past six years I am always adding a version number in the file name. But know that you have the right to have any file name you want ;-)

We name the new EA differently.

We use the same original name and add the PRO at the end which indicates that this is the PRO version of the EA.

We already know that the PRO version allows more MT4 account numbers as we created previously in the EAL system of the Signal Magician panel.

As you notice, we’ve added ‘v1.0’ to the file name which indicates that this is the version number 1.0 of this EA. I recommend you keep this practice and always change version number when you update the EA.

For example, you add new features or fix bugs in the 1.0 version, but instead of keeping the same file name you would want to name it ‘Moving Average PRO v1.1’.

This way your users will know that this is a new version and it will be less confusing for yourself too.

Also, it is very convenient when helping customers if they have trouble with the EA. Imagine a scenario where a user reports a bug. You fix it and send EA version 1.1, but the user still claims that he gets the same problems with the EA. You see everything works fine on your end and now you are confused to understand what’s going on.

You ask the user to send the screenshots of the chart and then notice that there is an old EA 1.0 attached to it. If the file name did not have a version number, you would not saw that coming ๐Ÿ™‚ It happened to me several times, and for the past six years I am always adding a version number in the file name.

But know that you have the right to have any file name you want ๐Ÿ˜‰

Create one more copy of the EA

Create one more copy of the EA;We need to create two copies of this EA because we need one for the PRO license and another for the Standard license. Having different files for each license type also means that they can have different features or parameters. For example, the Standard license might have fewer parameters available in the EA Inputs. We will get to this later. Important to mention that it would make more sense to create this copy only after implementing the EAL MQL4 code, but we will do this before adding the code to illustrate how the same EA can have different license types with slightly different parameters or features.

We need to create two copies of this EA because we need one for the PRO license and another for the Standard license.

Having different files for each license type also means that they can have different features or parameters.

For example, the Standard license might have fewer parameters available in the EA Inputs. We will get to this later.

Important to mention that it would make more sense to create this copy only after implementing the EAL MQL4 code, but we will do this before adding the code to illustrate how the same EA can have different license types with slightly different parameters or features.

Click Save to create one more EA file

Click Save to create one more EA file;Again, we name the new EA differently. We use the same original name and add the 'Standard' at the end which indicates that this is the Standard version of the EA. We already know that the Standard version allows less MT4 account numbers as we created previously in the EAL system of the Signal Magician panel. However, additionally, we can make this EA version have fewer features or less EA Inputs.

Again, we name the new EA differently.

We use the same original name and add the ‘Standard’ at the end which indicates that this is the Standard version of the EA.

We already know that the Standard version allows less MT4 account numbers as we created previously in the EAL system of the Signal Magician panel.

However, additionally, we can make this EA version have fewer features or less EA Inputs.

Let’s hide some EA Input parameters

Let's hide some EA Input parameters;In this example, we hide parameters DecreaseFactor, MovingPeriod, and MovingShift. To do this, we need to change the input to /*input */ (without quotes). Note that the word 'input' might also be 'extern'. It turns these 3 parameters into regular global parameters. Users will not see them in the EA Inputs tab. It is an example of how you can have different parameters or features for each EA license. After the changes, we need to compile the file. Click the 'Compile' button in the top toolbar. Watch for the result at the bottom of MetaEditor.

In this example, we hide parameters DecreaseFactor, MovingPeriod, and MovingShift.

To do this, we need to change the input to /*input */ (without quotes). Note that the word ‘input’ might also be ‘extern’.

It turns these 3 parameters into regular global parameters. Users will not see them in the EA Inputs tab.

It is an example of how you can have different parameters or features for each EA license.

After the changes, we need to compile the file.

Click the ‘Compile’ button in the top toolbar.

Watch for the result at the bottom of MetaEditor.

Check for error and warning messages after each Compilation

Check for error and warning messages after each Compilation;After each compilation, you should check the bottom Toolbox for any error or warning messages. Warning messages are usually not that bad, and the EA might still work, but if you get error messages, it means your EA did not compile (no EX4 file created), and you cannot use it. In case there are errors they will be explained in the Toolbox and tell you on which line MetaEditor found the error. You will need MQL4 knowledge to fix these errors. But if you do everything right, there should be no errors, unless your EA is coded in some unusual way. In this case, we got 0 errors and 0 warnings. It means the EA did compile successfully and MetaEditor created the EX4 file. We can now use the EA. The EX4 file is what you'll give to the users. Never provide the MQ4 file or MQH files and keep them secret. Let's check how both EA versions have different EA Input parameters.

After each compilation, you should check the bottom Toolbox for any error or warning messages.

Warning messages are usually not that bad, and the EA might still work, but if you get error messages, it means your EA did not compile (no EX4 file created), and you cannot use it.

In case there are errors they will be explained in the Toolbox and tell you on which line MetaEditor found the error.

You will need MQL4 knowledge to fix these errors.

But if you do everything right, there should be no errors, unless your EA is coded in some unusual way.

In this case, we got 0 errors and 0 warnings. It means the EA did compile successfully and MetaEditor created the EX4 file. We can now use the EA.

The EX4 file is what you’ll give to the users. Never provide the MQ4 file or MQH files and keep them secret.

Let’s check how both EA versions have different EA Input parameters.

EA Inputs of the Standard version

EA Inputs of the Standard version;We attach the EA to the chart and get this window loaded. Then we switch to the Inputs tab and see two parameters here. Remember, we hide the other 3 parameters. It means the EA still uses them at their default values, but users cannot change them. Now let's see how this looks like for the PRO version.

We attach the EA to the chart and get this window loaded. Then we switch to the Inputs tab and see two parameters here.

Remember, we hide the other 3 parameters. It means the EA still uses them at their default values, but users cannot change them.

Now let’s see how this looks like for the PRO version.

EA Inputs of the PRO version

EA Inputs of the PRO version;The PRO version has more parameters because we did not hide them. It is an example of how you can have different license types offer various features and parameters for customers. Mostly, users probably will use the Standard license, but those who need more advanced features and parameters will gladly pay more for the PRO version. As you may already know, this is a common practice that almost all software companies use.

The PRO version has more parameters because we did not hide them.

It is an example of how you can have different license types offer various features and parameters for customers.

Mostly, users probably will use the Standard license, but those who need more advanced features and parameters will gladly pay more for the PRO version.

As you may already know, this is a common practice that almost all software companies use.

STEP #4: Adding EAL MQL4 code to protect Expert Advisors with the License Key

 

Add property strict

Add property strict;Before we are adding MQL4 code, we need to make sure that the EA has a strict property set. If EA does not have it the protection and License Key authorization will work fine, but it is strongly recommended to have the strict property set. This way you make sure that your EA meets the latest MQL4 coding standards. Now let's continue and add EAL MQL4 code to protect the EA with the License Key.

Before we are adding MQL4 code, we need to make sure that the EA has a strict property set.

If EA does not have it the protection and License Key authorization will work fine, but it is strongly recommended to have the strict property set. This way you make sure that your EA meets the latest MQL4 coding standards.

Now let’s continue and add EAL MQL4 code to protect the EA with the License Key.

Generate EAL MQL4 code

Generate EAL MQL4 code;Open the MQl4 code generator from the 'EA Licensing' page, choose a product license, set other parameters if necessary and click 'Continue' button.

Open the MQl4 code generator from the ‘EA Licensing’ page, choose a product license, set other parameters if necessary and click ‘Continue’ button.

Copy and paste all MQL4 code sections one at a time to your EA code

Copy and paste all MQL4 code sections one at a time to your EA code;The MQL4 code generator will generate 4 sections of the MQL4 code. You need to copy and paste each of then one at a time to your EA code. In the next steps, I explain where exactly you need to add each MQL4 code section. To copy the MQL4 code you need to click the 'Select All' button, then right-click on the select text and choose 'Copy' from the menu. Now you can switch to the MetaEditor where you have your EA open and paste the code in the right place. See further steps to know the exact location.

The MQL4 code generator will generate 4 sections of the MQL4 code. You need to copy and paste each of then one at a time to your EA code. In the next steps, I explain where exactly you need to add each MQL4 code section.

To copy the MQL4 code you need to click the ‘Select All’ button, then right-click on the select text and choose ‘Copy’ from the menu.

Now you can switch to the MetaEditor where you have your EA open and paste the code in the right place.

See further steps to know the exact location.

Add MQL4 code Section #1 (Top)

Add MQL4 code Section #1 (Top);There are 4 sections of MQL4 code to add to the EA.<br /> Add the first section to the very top of the EA.<br /> It is the section where you can control how License Key authorization should work for your app. The EAL system will prepare everything for you, but if you have some MQL4 knowledge, you can change some parameters yourself to fit your needs.<br /> Let me explain these parameters.<br /> LicenseKey - the most important parameter :-) This is the exactly what its name tells - License Key. Default = empty.<br /> APP_USE_MillisecondTimer - set this to false your EA does not use EventSetTimer() or EventSetMillisecondTimer(). Otherwise, set it to true. Default = false.<br /> APP_USE_AUTH - this tells the EA whether it should use the License Key authorization and protect the EA or not. Uncomment this parameter if you want this EA to use License Key and authentication. Comment this line to disable License Key and all authorization functions on the EA.<br /> AUTH_RATE_MINUTES - this tells how often the EA should connect to the EAL web-server to authorize the License Key. Default = 60.<br /> AUTH_FAIL_AFTER_MINUTES - this tells how many minutes EA is allowed to work without successful License Key authorization (in case of Internet connection issues). Default = 5760. It means if EA cannot authorize the License Key for 5760 minutes (96 hours or 4 days) it will shut down. We set the long period on purpose, which means if your server is down on Friday night and you are away for the weekend you will still have time to fix things when you get back on Monday. Smart, I know :-)<br /> APP_LICENSE_TYPE_ID - This is the License ID from the EAL system on Signal Magician. Go to 'EA Licensing' and open this particular product to find the list of license types and their IDs.<br /> For this example, I use 11 here because this is the ID of the license type PRO we've created in the previous steps. We also need to add the same code to the Standard version of the EA, except the APP_LICENSE_TYPE_ID value must be set to 12.<br /> APP_NAME - this is the name of the product. For best practice make it match the EA file name and product name on the EAL system on Signal Magician.<br /> APP_VERSION - this is the version of the EA. For best practice make it match the version number in the EA file name and the product version on the EAL system on Signal Magician.<br /> APP_MODE_EA - this tells if the app is Expert Advisor or Indicator. Possible values are APP_MODE_INDICATOR or APP_MODE_EA, and if you set the wrong one, your file will not compile.<br /> order_url - this is the URL of the website where users can buy your product and get more info about it.<br /> DLLFName - this is the DLL file name. Each product should have a different DLL file which we create from the original DLL. For best practice make the DLL file name and version match the EA file name and its version.<br /> SECRET_CODE - this code is used to encrypt the License Key and store it on computer disk. It is the same for all your products.<br /> URL_Full - this is the URL to your Signal Magician system, and it is the same for all your products. Leave empty to disable all auth functions on this app.<br /> #include <SM EA Licensing Library 2018-04-17.mqh><br /> This line above contains the file name to include which stores all the important EAL MQL4 code. Do not change its contents and keep it secret.<br />

There are 4 sections of MQL4 code to add to the EA.

Add the first section to the very top of the EA.

It is the section where you can control how License Key authorization should work for your app. The EAL system will prepare everything for you, but if you have some MQL4 knowledge, you can change some parameters yourself to fit your needs.

Let me explain these parameters.

LicenseKey – the most important parameter ๐Ÿ™‚ This is the exactly what its name tells – License Key. Default = empty.

APP_USE_MillisecondTimer – set this to false your EA does not use EventSetTimer() or EventSetMillisecondTimer(). Otherwise, set it to true. Default = false.

APP_USE_AUTH – this tells the EA whether it should use the License Key authorization and protect the EA or not. Uncomment this parameter if you want this EA to use License Key and authentication. Comment this line to disable License Key and all authorization functions on the EA.

AUTH_RATE_MINUTES – this tells how often the EA should connect to the EAL web-server to authorize the License Key. Default = 60.

AUTH_FAIL_AFTER_MINUTES – this tells how many minutes EA is allowed to work without successful License Key authorization (in case of Internet connection issues). Default = 5760. It means if EA cannot authorize the License Key for 5760 minutes (96 hours or 4 days) it will shut down. We set the long period on purpose, which means if your server is down on Friday night and you are away for the weekend you will still have time to fix things when you get back on Monday. Smart, I know ๐Ÿ™‚

APP_LICENSE_TYPE_ID – This is the License ID from the EAL system on Signal Magician. Go to ‘EA Licensing’ and open this particular product to find the list of license types and their IDs.

For this example, I use 11 here because this is the ID of the license type PRO we’ve created in the previous steps. We also need to add the same code to the Standard version of the EA, except the APP_LICENSE_TYPE_ID value must be set to 12.

APP_NAME – this is the name of the product. For best practice make it match the EA file name and product name on the EAL system on Signal Magician.

APP_VERSION – this is the version of the EA. For best practice make it match the version number in the EA file name and the product version on the EAL system on Signal Magician.

APP_MODE_EA – this tells if the app is Expert Advisor or Indicator. Possible values are APP_MODE_INDICATOR or APP_MODE_EA, and if you set the wrong one, your file will not compile.

order_url – this is the URL of the website where users can buy your product and get more info about it.

DLLFName – this is the DLL file name. Each product should have a different DLL file which we create from the original DLL. For best practice make the DLL file name and version match the EA file name and its version.

SECRET_CODE – this code is used to encrypt the License Key and store it on computer disk. It is the same for all your products.

URL_Full – this is the URL to your Signal Magician system, and it is the same for all your products. Leave empty to disable all auth functions on this app.

#include <SM EA Licensing Library 2018-04-17.mqh>

This line above contains the file name to include which stores all the important EAL MQL4 code. Do not change its contents and keep it secret.

Add MQL4 code Section #2 (OnInit)

Add MQL4 code Section #2 (OnInit);The other three sections contain less MQL4 code than the first one, but they are essential for EA functionality, protection, and License Key authorization. The MQL4 code of Section #2 must be added right after the opening { of the OnInit() event. Also, make sure that your OnInit() is of int type. The older MQL4 code might have some other type, for example, void. Having any other type than int for this function will not compile your EA. If your EA needs code upgrade after you change this from void to int, then you should contact your developer about it. You need to make sure that your MQL4 code meets the latest standards. Some EAs might not have the OnInit() function at all. In such case you have to create it which means simply adding this code: int OnInit() { ย ย ย //EAL MQL4 code Section #2 goes here //The rest of the code ย ย ย return (INIT_SUCCEEDED); }

The other three sections contain less MQL4 code than the first one, but they are essential for EA functionality, protection, and License Key authorization.

The MQL4 code of Section #2 must be added right after the opening { of the OnInit() event.

Also, make sure that your OnInit() is of int type. The older MQL4 code might have some other type, for example, void. Having any other type than int for this function will not compile your EA.

If your EA needs code upgrade after you change this from void to int, then you should contact your developer about it. You need to make sure that your MQL4 code meets the latest standards.

Some EAs might not have the OnInit() function at all. In such case you have to create it which means simply adding this code:

int OnInit()

{

//EAL MQL4 code Section #2 goes here

//The rest of the code

return (INIT_SUCCEEDED);

}

Add MQL4 code Section #3 (OnTick/OnCalculate)

Add MQL4 code Section #3 (OnTick/OnCalculate);The MQL4 code of Section #3 must be added right after the opening { of the OnTick() event for the Expert Advisor. If you are adding this for the indicator, then the Section #3 code must be added right after the opening { of the OnCalculate() event. Also, make sure that your OnTick() is of void type, and your OnCalculate() is of int type. The older MQL4 code might have some other type, and if that's the case, you'll have to change it to meet the latest MQL4 standards.

The MQL4 code of Section #3 must be added right after the opening { of the OnTick() event for the Expert Advisor.

If you are adding this for the indicator, then the Section #3 code must be added right after the opening { of the OnCalculate() event.

Also, make sure that your OnTick() is of void type, and your OnCalculate() is of int type. The older MQL4 code might have some other type, and if that’s the case, you’ll have to change it to meet the latest MQL4 standards.

Add MQL4 code Section #3A if applicable (OnTimer)

Add MQL4 code Section #3A if applicable (OnTimer);If your EA uses EventSetTimer() or EventSetMillisecondTimer() then it will also have OnTimer() function. This one probably will need the EAL MQL4 code too (depends on how your EA is structured and what it does in the OnTimer exactly). To add the code to the OnTimer, you follow the same rules and add the Section #3A code right after the opening { of the OnTimer() event for the Expert Advisor and Indicator.

If your EA uses EventSetTimer() or EventSetMillisecondTimer() then it will also have OnTimer() function. This one probably will need the EAL MQL4 code too (depends on how your EA is structured and what it does in the OnTimer exactly).

To add the code to the OnTimer, you follow the same rules and add the Section #3A code right after the opening { of the OnTimer() event for the Expert Advisor and Indicator.

Add MQL4 code Section #4 (OnDeinit)

Add MQL4 code Section #4 (OnDeinit);The MQL4 code of Section #4 must be added right BEFORE the closing } of the OnDeinit() event. OnDeinit() usually does not exist in Indicators, but I recommend adding it for the best experience. int OnDeinit() { //The rest of the code ย ย ย //EAL MQL4 code Section #4 goes here }

The MQL4 code of Section #4 must be added right BEFORE the closing } of the OnDeinit() event.

OnDeinit() usually does not exist in Indicators, but I recommend adding it for the best experience.

int OnDeinit()

{

//The rest of the code

//EAL MQL4 code Section #4 goes here

}

Compile the Expert Advisor

Compile the Expert Advisor;We've added the EAL MQL4 code, and now it is time to compile the EA file. Click the 'Compile' button in the top toolbar. Watch for the result at the bottom of MetaEditor.

We’ve added the EAL MQL4 code, and now it is time to compile the EA file.

Click the ‘Compile’ button in the top toolbar.

Watch for the result at the bottom of MetaEditor.

Check for error and warning messages

Check for error and warning messages;We got 0 errors and 0 warnings. It means the EA was compiled successfully and the EX4 file was created. We can now use the EA. Notice this time the MetaEditor compiled two files into one EX4 file. It is because we have instructed to include the EAL library file (.mqh). Now repeat these few last steps to add the EAL MQL4 code into the

We got 0 errors and 0 warnings. It means the EA was compiled successfully and the EX4 file was created. We can now use the EA.

Notice this time the MetaEditor compiled two files into one EX4 file. It is because we have instructed to include the EAL library file (.mqh).

Now repeat these few last steps to add the EAL MQL4 code into the “Standard” version of the EA and compile it as well.

Remember to use a different License ID for the Standard EA version (in this example it is 12).

STEP #5: Test the new protected Expert Advisors

 

Switch to MT4 to find new protected Expert Advisors

Switch to MT4 to find new protected Expert Advisors;If you double-click the EA or drag-drop it on the chart, you will see the EA properties window. Switch to the Inputs tab to find the LicenseKey parameter. It is where users need to put their License Key to start using the EA. Note, that EA needs only one successful authorization with the correct License Key. After that, users might start the EA without the License Key on the same computer. In such case, the EA will read the License Key from a computer disk. EA stores encrypted License Keys in this folder: %LOCALAPPDATA%\sm-data\ You can open this folder by typing this name into the file explorer or Start->Run window (CTRL+R).<br /> There is nothing to do with this folder for you, but still, it is essential to know where the EA store encrypted license keys. And just to remind, they are encrypted using the SECRET_CODE value that you've added into the EA. This code is always the same for all your products.<br /> Now let's test the newly created and protected Expert Advisors. We will have to create a License Key to use the PRO or Standard version of the EA.

If you double-click the EA or drag-drop it on the chart, you will see the EA properties window. Switch to the Inputs tab to find the LicenseKey parameter. It is where users need to put their License Key to start using the EA.

Note, that EA needs only one successful authorization with the correct License Key. After that, users might start the EA without the License Key on the same computer. In such case, the EA will read the License Key from a computer disk.

EA stores encrypted License Keys in this folder:

%LOCALAPPDATA%\sm-data\

You can open this folder by typing this name into the file explorer or Start->Run window (CTRL+R).

There is nothing to do with this folder for you, but still, it is essential to know where the EA store encrypted license keys. And just to remind, they are encrypted using the SECRET_CODE value that you’ve added into the EA. This code is always the same for all your products.

Now let’s test the newly created and protected Expert Advisors. We will have to create a License Key to use the PRO or Standard version of the EA.

Open Users page

Open Users page;Open 'Users' page from the left menu in the Signal Magician web-panel. You will see a small keys icon next to each user. Click the keys icon next to the user for whom you want to create a new License Key.

Open ‘Users’ page from the left menu in the Signal Magician web-panel.

You will see a small keys icon next to each user. Click the keys icon next to the user for whom you want to create a new License Key.

Create a new License Key

Create a new License Key;Fill in the form and click on 'Create a new License Key' button. You can change any of these fields later if needed, but be careful and make sure you understand how changes will affect the License Key. For the quick creation of a License Key choose the Product name and click on 'Create a new License Key' button. Product name - choose a product/license for which you are creating a new License Key. User ID - it is the User ID of the owner of this License Key. You can find User ID on the Users list. User ID cannot be empty or zero because each License Key must belong to someone. If you come to this page by clicking the keys icons, then the User ID field should be already prefilled with the correct User ID. To the right of this field, you can see the User ID of a currently logged in user. If you click on it, it will set the User ID to that value. It is useful if you are creating a new License Key for yourself or just testing it. License Key - it is a unique automatically generated License Key for a particular product license for one user. Every time you come to this page, it will create a new unique License Key randomly. You can type any other License Key here if you want. It is the License Key the user has to type into the EA Inputs in the Metatrader. If you change this License Key later, the product will stop working until the user types a new License Key into the EA Inputs in the Metatrader. Expiry date - it is the expiry date of this License Key (i.e., 2019-12-18). Type 0000-00-00 for no expiration (lifetime access). If this License Key is linked to an active subscription ID (e.g., PayPal, Stripe) then the expiry date will be adjusted automatically on the next payment. Purchase date - it is a purchase date for your reference. It cannot be empty. If this date is unknown, then use today's date. Enabled - it is the status of this License Key. If Enabled, the user can use this License Key. If Disabled, the user will not be able to use this License Key. Transaction ID - it is a transaction ID or receipt ID for your reference as it appears on your payment processor account (e.g., PayPal, Stripe). It can be empty if you create the License Key manually. Subscription ID - it is a Subscription ID for this License Key. It can be empty if you create the License Key manually. If you need this License Key to be linked to an active subscription ID (e.g., PayPal, Stripe) then enter the corresponding Subscription ID from your payment processor. When the License Key is linked to an active subscription ID, the expiry date will be adjusted automatically on the next payment.

Fill in the form and click on ‘Create a new License Key’ button. You can change any of these fields later if needed, but be careful and make sure you understand how changes will affect the License Key.

For the quick creation of a License Key choose the Product name and click on ‘Create a new License Key’ button.

Product name – choose a product/license for which you are creating a new License Key.

User ID – it is the User ID of the owner of this License Key. You can find User ID on the Users list. User ID cannot be empty or zero because each License Key must belong to someone. If you come to this page by clicking the keys icons, then the User ID field should be already prefilled with the correct User ID. To the right of this field, you can see the User ID of a currently logged in user. If you click on it, it will set the User ID to that value. It is useful if you are creating a new License Key for yourself or just testing it.

License Key – it is a unique automatically generated License Key for a particular product license for one user. Every time you come to this page, it will create a new unique License Key randomly. You can type any other License Key here if you want. It is the License Key the user has to type into the EA Inputs in the Metatrader. If you change this License Key later, the product will stop working until the user types a new License Key into the EA Inputs in the Metatrader.

Expiry date – it is the expiry date of this License Key (i.e., 2019-12-18). Type 0000-00-00 for no expiration (lifetime access). If this License Key is linked to an active subscription ID (e.g., PayPal, Stripe) then the expiry date will be adjusted automatically on the next payment.

Purchase date – it is a purchase date for your reference. It cannot be empty. If this date is unknown, then use today’s date.

Enabled – it is the status of this License Key. If Enabled, the user can use this License Key. If Disabled, the user will not be able to use this License Key.

Transaction ID – it is a transaction ID or receipt ID for your reference as it appears on your payment processor account (e.g., PayPal, Stripe). It can be empty if you create the License Key manually.

Subscription ID – it is a Subscription ID for this License Key. It can be empty if you create the License Key manually. If you need this License Key to be linked to an active subscription ID (e.g., PayPal, Stripe) then enter the corresponding Subscription ID from your payment processor. When the License Key is linked to an active subscription ID, the expiry date will be adjusted automatically on the next payment.

We have created a new License Key

We have created a new License Key;You can always find all License Keys if you go to the 'EA Licensing' on the left menu and then open the 'License Keys' list as in the image above. We can see a newly created License Key R3GTXGTJ which you can already use in the EA. We'll try the new License Key in a moment, but before that, I want to tell you about another way to create License Keys. You can click on 'Create a new License Key' button at the top of this page to load the same form for creating a new License Key. You need to fill in the form for creating a License Key the same way as explained a few steps ago, but this time the difference is that the User ID field will be empty. You must enter the User ID manually, and you already need to know the User ID of the user to whom you are creating this License Key. You can find User ID on the 'Users' page that you can access from the main menu on the left.

You can always find all License Keys if you go to the ‘EA Licensing’ on the left menu and then open the ‘License Keys’ list as in the image above.

We can see a newly created License Key R3GTXGTJ which you can already use in the EA.

We’ll try the new License Key in a moment, but before that, I want to tell you about another way to create License Keys.

You can click on ‘Create a new License Key’ button at the top of this page to load the same form for creating a new License Key.

You need to fill in the form for creating a License Key the same way as explained a few steps ago, but this time the difference is that the User ID field will be empty.

You must enter the User ID manually, and you already need to know the User ID of the user to whom you are creating this License Key. You can find User ID on the ‘Users’ page that you can access from the main menu on the left.

Input the License Key in the EA Inputs

Input the License Key in the EA Inputs;Now switch to the MetaTrader 4 terminal and start the EA. When the EA properties window loads, switch to the Inputs tab where you'll find the LicenseKey parameter. It should be the first one on the list of parameters. Double-click in the empty area of the Value column to the right of the LicenseKey parameter name (where the arrow is pointing in the image). Then, click

Now switch to the MetaTrader 4 terminal and start the EA.

When the EA properties window loads, switch to the Inputs tab where you’ll find the LicenseKey parameter. It should be the first one on the list of parameters.

Double-click in the empty area of the Value column to the right of the LicenseKey parameter name (where the arrow is pointing in the image).

Then, click “Paste” in the menu and hit ENTER (return) on your keyboard.

Start the Expert Advisor

Start the Expert Advisor;When the License Key is in place, click the OK button to start the EA. If you need, set any other parameters before starting the EA. Note that you need to input the License Key only once. After first successful authorization, you'll no longer need to input the License Key on the same computer (even in other MT4 terminals). So next time you load the EA leave the License Key empty.

When the License Key is in place, click the OK button to start the EA.

If you need, set any other parameters before starting the EA.

Note that you need to input the License Key only once. After first successful authorization, you’ll no longer need to input the License Key on the same computer (even in other MT4 terminals).

So next time you load the EA leave the License Key empty.

Expert Advisor is loading …

Expert Advisor is loading ...;When the EA is loading, you'll see it print some information. Take a look at it to understand what's going on :-) Note that the EA might not load during the weekends and it will start working once the Forex market opens on Sunday/Monday.

When the EA is loading, you’ll see it print some information. Take a look at it to understand what’s going on ๐Ÿ™‚

Note that the EA might not load during the weekends and it will start working once the Forex market opens on Sunday/Monday.

The smiley face in the right-top corner indicates that the EA is loaded

The smiley face in the right-top corner indicates that the EA is loaded;If you see a smiley face in the top-right corner of the chart, it means the EA is loaded. Note that it does not necessarily mean that everything is okay with the EA. For example, if your EA has errors and does not enter the trades correctly the smiley face will not know it :-)

If you see a smiley face in the top-right corner of the chart, it means the EA is loaded.

Note that it does not necessarily mean that everything is okay with the EA. For example, if your EA has errors and does not enter the trades correctly the smiley face will not know it ๐Ÿ™‚

Another place to check if the EA loaded successfully

Another place to check if the EA loaded successfully;Another way to check if the EA loaded successfully is the EXPERTS tab at the bottom of the MT4 terminal. Look for messages from your EA. You can see all messages have a time stamp and start with the name of the EA, chart instrument and its time frame. When you see messages like 'Application loaded successfully' and 'License key validation successful' then it means EA was able to validate the License Key and start its operations. The next steps of what the EA should do depends on what your programmer created, etc. It is beyond EAL system and should be taken care of by your programmer.

Another way to check if the EA loaded successfully is the EXPERTS tab at the bottom of the MT4 terminal.

Look for messages from your EA. You can see all messages have a time stamp and start with the name of the EA, chart instrument and its time frame.

When you see messages like ‘Application loaded successfully’ and ‘License key validation successful’ then it means EA was able to validate the License Key and start its operations.

The next steps of what the EA should do depends on what your programmer created, etc. It is beyond EAL system and should be taken care of by your programmer.

Removing Expert Advisor from the chart

Removing Expert Advisor from the chart;If you want to stop the Expert Advisor, you have to remove it from the chart. Right-click anywhere on the chart and then choose 'Expert Advisors->Remove' from the menu.<br /> When you remove the EA from the chart, it will stop all EA operations, and the smiley face disappears.<br /> Removing EA from the chart does not delete it from the MT4 terminal. You can always re-attach the EA to the same or another chart.<br />

If you want to stop the Expert Advisor, you have to remove it from the chart.

Right-click anywhere on the chart and then choose ‘Expert Advisors->Remove’ from the menu.

When you remove the EA from the chart, it will stop all EA operations, and the smiley face disappears.

Removing EA from the chart does not delete it from the MT4 terminal. You can always re-attach the EA to the same or another chart.

Last login information

Last login information;Each time an Expert Advisor or an Indicator connects to the EAL system to verify the License Key the system will log the date, time, and the IP address. It means you can always see when was the last time the EA using a particular License Key connected to the server. You can find this information on the 'License Keys' page in the 'Last login' column. Time is presented in UTC. Additionally, you can see all Activations in detail. This page shows more information about each MT4 account and the computer where the EA is being used. To open this page click on the Activations below any of the License Keys.

Each time an Expert Advisor or an Indicator connects to the EAL system to verify the License Key the system will log the date, time, and the IP address. It means you can always see when was the last time the EA using a particular License Key connected to the server.

You can find this information on the ‘License Keys’ page in the ‘Last login’ column. Time is presented in UTC.

Additionally, you can see all Activations in detail. This page shows more information about each MT4 account and the computer where the EA is being used. To open this page click on the Activations below any of the License Keys.

Activations of one License Key

Activations of one License Key;On this page, we can see where the EA was activated or is still running. It shows information about the computer and the MT4 account. We cannot add Activations manually. EAL system creates them automatically when the EA starts on a new MT4 account that's not yet on the list of Activations for the particular License Key. Also, users can delete any of the Activations to make room for new ones in case they stop using the EA on some accounts. For example, the user has 2 Activations, and both are already in use on two MT4 accounts. But one of the MT4 accounts expired, and the user wants to activate the EA on another account. What the user needs to do is to delete the Activation of the expired MT4 account and start the EA on a new MT4 account. Activation ID - it is the unique ID of the Activation. It makes it easier to identify Activations by the ID number. Locked to MetaTrader account - it is the MT4 account number where the EA is running. License Key - it is the License Key of the Activation. License Key can have multiple Activations, but each Activation can belong only to one License Key. Computer name - this is the name of the computer where the EA was activated. It also shows the Windows username to make it easier to find the EA in case there are multiple usernames on that computer. Last login - various information from the previous login is displayed here such as date, time, IP address, login counter, etc. You can see how long ago the EA was seen active on this particular MT4 account and computer. Also, you can see various information about the MT4 account.

On this page, we can see where the EA was activated or is still running. It shows information about the computer and the MT4 account.

We cannot add Activations manually. EAL system creates them automatically when the EA starts on a new MT4 account that’s not yet on the list of Activations for the particular License Key.

Also, users can delete any of the Activations to make room for new ones in case they stop using the EA on some accounts.

For example, the user has 2 Activations, and both are already in use on two MT4 accounts. But one of the MT4 accounts expired, and the user wants to activate the EA on another account. What the user needs to do is to delete the Activation of the expired MT4 account and start the EA on a new MT4 account.

Activation ID – it is the unique ID of the Activation. It makes it easier to identify Activations by the ID number.

Locked to MetaTrader account – it is the MT4 account number where the EA is running.

License Key – it is the License Key of the Activation. License Key can have multiple Activations, but each Activation can belong only to one License Key.

Computer name – this is the name of the computer where the EA was activated. It also shows the Windows username to make it easier to find the EA in case there are multiple usernames on that computer.

Last login – various information from the previous login is displayed here such as date, time, IP address, login counter, etc. You can see how long ago the EA was seen active on this particular MT4 account and computer. Also, you can see various information about the MT4 account.

Cheat sheet

 

Here’s a summary of all the steps to take to protect the Expert Advisor with License Key

Create a new product on EAL system in Signal Magician.

Create at least one license type (i.e., PRO and Standard) for the new product and note its License ID. We’ll need to add this to the EAL MQL4 code Section #1.

Copy ‘EAL files package’ into the Data Folder of MT4.

Create a copy of DLL file and name it to match your product name.

Open MetaEditor and create a copy of the EA you want to protect for each license type you’ve created (i.e., PRO and Standard).

It is highly recommended to add a strict property in the MQ4 code of your EA to meet the latest MQL4 standards.

Add MQL4 code Section #1 (Top) to each EA.

Add MQL4 code Section #2 (OnInit) to each EA.

Add MQL4 code Section #3 (OnTick/OnCalculate) to each EA.

Add MQL4 code Section #3A (only if your EA is using OnTimer event) to each EA.

Add MQL4 code Section #4 (OnDeinit) to each EA copy.

Compile each EA.

Create License Keys for each license type (i.e., one for PRO and another for Standard).

Load each EA on MetaTrader 4 and input a newly created License Key.

Terms & Conditions | Privacy Policy

Copyright ยฉ 2018 ยท SignalMagician.com ยท All Rights Reserved

WordPress Security