please dont doublepost
please dont doublepost
Sorry, I noticed later that this is the more appropriate forum for my question.
I will delete the other post.
You should reconsider your approach because you are not allowed to use your own licensing scheme according to the market rules:
IV. Products
- ...
- ...
- ...
- ...
- Integrating and applying any third-party sales, accounting, license control and update management systems (including the ones using WebRequestfeatures) in Products are prohibited.
Time-limited licenses are not supported yet.
When a demo is running in the tester it stops a considerable number of bars before today (making it impossible to use for real trading and analysis) - probably this will be sufficient for your product.
You can specify more details, then more suggestions could probably follow.
You should reconsider your approach because you are not allowed to use your own licensing scheme according to the market rules:
Time-limited licenses are not supported yet.
When a demo is running in the tester it stops a considerable number of bars before today (making it impossible to use for real trading and analysis) - probably this will be sufficient for your product.
You can specify more details, then more suggestions could probably follow.
Well, I do not want to implement my own licensing system. What I want is very simple.
1. To detect in runtime if the current downloaded instance of the EA is already paid by the user, or not, according Mql5 market terms. If the user has paid for the EA in Mql5 market environment, or has downloaded only the demo version.
2. According to this information(paid or demo version), to allow(case paid by user) or restrict(case demo) some of the features in tester mode. I need this, because the main usage of my EA is in tester mode. Although it may be useful in real trading, the main purpose my EA is made, is to provide some backtesting benefits to the user. So, if the user has downloaded the demo version and she/he liked it, she/he may decide to pay some amount to unlock some additional features, which may be useful in tester mode(in real trade mode usage of demo version is not possible, according to Mql5 market terms).
That's all.
I have seen that some of the programs on the market here are working in this way, so it is possible and allowed. I just would like to know if my approach(the code above) is right, and if not, to receive some advice and direction how to accomplish this functionality.
Regards.
You don't have to take care of that - I guess. That's why Metaquotes offers their system of the Market.
Download from the Market a free EA or indicator and try to start it on a different (locale) terminal, e.g. a terminal that is paced in your own folder and has to be started in /portable-mode.
You don't have to take care of that - I guess. That's why Metaquotes offers their system of the Market.
Download from the Market a free EA or indicator and try to start it on a different (locale) terminal, e.g. a terminal that is paced in your own folder and has to be started in /portable-mode.
Either you don't understand my question or... what?
My question was how to get an information in runtime if the current instance of a paid EA has been bought, or not.
Well, I do not want to implement my own licensing system. What I want is very simple.
1. Do detect in runtime if the current downloaded instance of the EA is already paid by the user, or not, according Mql5 market terms. If the user has paid for the EA in Mql5 market environment, or has downloaded only the demo version.
2. According to this information(paid or demo version), to allow(case paid by user) or restrict(case demo) some of the features in tester mode. I need this, because the main usage of my EA is in tester mode. Although it may be useful in real trading, the main purpose my EA is made, is to provide some backtesting benefits to the user. So, if the user has downloaded the demo version and she/he liked it, she/he may decide to pay some amount to unlock some additional features, which may be useful in tester mode(in real trade mode usage of demo version is not possible, according to Mql5 market terms).
That's all.
I have seen that some of the programs on the market here are working in this way, so it is possible and allowed. I just would like to know if my approach(the code above) is right, and if not, to receive some advice and direction how to accomplish this functionality.
Regards.
What's your problem actually ? You asked questions, but the code you posted is the answer to these questions.
Of course it works to check the licence type. If you want to test your code, just simulate the licence type to test.
What's your problem actually ? You asked questions, but the code you posted is the answer to these questions.
Of course it works to check the licence type. If you want to test your code, just simulate the licence type to test.
My problem was, that when I submitted an EA with a similar code for checking the license type, for moderator's approval, I received as an answer, that the EA stayed in demo mode.
Without further clarifications. The moderators advised me to search for an answer in this forum.
I put my question here, enclosing the corresponding part of the code, as I do now, but I didn't receive an answer if the code I posted was working, or not.
So, I didn't know what to do further. I was convinced that my code was working, but the moderators insisted otherwise. I couldn't emulate their testing environment(communicating with Mql5 market server, etc.), and therefore obtain the same results as them. Of course, I could have been wrong in my former code, so now I post this one, in order to have enough confidence, before submitting the EA to the moderators.
You write, that the enclosed code does what it is meant for. Thank you, I am glad to read this.
So, I hope, that I do not have a problem anymore(hopefully).
My problem was, that when I submitted an EA with a similar code for checking the license type, for moderator's approval, I received as an answer, that the EA stayed in demo mode.
Without further clarifications. The moderators advised me to search for an answer in this forum.
I put my question here, enclosing the corresponding part of the code, as I do now, but I didn't receive an answer if the code I posted was working, or not.
So, I didn't know what to do further. I was convinced that my code was working, but the moderators insisted otherwise. I couldn't emulate their testing environment(communicating with Mql5 market server, etc.), and therefore obtain the same results as them. Of course, I could have been wrong in my former code, so now I post this one, in order to have enough confidence, before submitting the EA to the moderators.
You write, that the enclosed code does what it is meant for. Thank you, I am glad to read this.
So, I hope, that I do not have a problem anymore(hopefully).
I saw you were using the right functions but didn't check it in details. So I suggested you to test it. You don't need to emulate their testing environment, you just have to simulate the licence type.
input ENUM_LICENSE_TYPE licenseType;
Comment your "licenseType" initialization line. Try each value and check that it's doing what you want.
Your code:
MQLInfoInteger(MQL_LICENSE_TYPE)
should work correctly for experts and indicators. It did not work for scripts and libraries in past, and I don't have an updated information.
Your attept to read license from a file (in else branch) violates the Market rules, not to mention it seems having a flaw (a user can craft a file).

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello,
I need to check in runtime, what is the license type of the EA. In MQL4 terms. If it is free, demo, paid(full), or time trial. I need to check this, because my program is mainly designed to work in a tester mode, and it will have a paid version with more features unlocked.
This is a question I asked before, but I didn't receive a satisfactory answer. Still I know it is possible, because there are programs on the market which are working in that way. In addition, I received a new information about this topic, wrote a code, and now I would like to ask for a help, if my license check function is written properly, before submitting the EA to the moderators.
I can't test this function myself, because I need a server response from Mql5 market, which can't be done if the EA is not already registred in Mql5 market.
Also, I guess, that in tester mode the following expression for obtaining the license type:
will not give a true result. Please, tell me if I am right?
The idea is to check the license only when EA is applied to a live chart(because of the assumption that this can not be done in tester mode), to set the mode(demo or full) then to write the result into a file.
If in tester mode EA just reads the result from the file and sets its mode(demo or full). If there is no such file(EA not applied to a live chart, file corrupted or deleted ), it sets the mode to demo and alerts the user that she/he has to apply the EA to a live chart in order to obtain the license data.
Here is the code excerpt:
Thank you!