Download MetaTrader 5

Demo version or full version. How to detect?

To add comments, please log in or register
Boyan Taksirov
2749
Boyan Taksirov  

Hello.

I am trying to release my first program on the market. It is a trading simulator/trading panel with many features. Its main purpose is to allow traders to test their manual strategies in MT4 Tester mode to save time, but it can be used in real trade mode as well.

In demo mode the number of orders is restricted, in both tester and real trade mode.


So, what I know by now is, that program should check the environment if the license type is demo, full or else. The license type is set somehow outside the program, from the moderators of mql5 market I guess(please, tell me if I am wrong).

Here is the code excerpt(mql4) which is responsive for that check:

int OnInit()
  {
//---         
     TESTER_MODE = MQLInfoInteger(MQL_TESTER);

     
//-----------------If demo version is decided here-------------------------------------------------------     

     ENUM_LICENSE_TYPE licenseType = (ENUM_LICENSE_TYPE)MQLInfoInteger(MQL_LICENSE_TYPE);
    
     if(licenseType == LICENSE_DEMO)
     {
       IS_DEMO = true;         
     }
     else if(licenseType == LICENSE_FULL)
     {
       IS_DEMO = false;        
     }

//---------------------------------------------------------------------------------------------------


Pretty straightforward, but the moderator response is that during the testing, the program was in demo mode. Without further clarifications.

I don't know how to emulate setting the license type in my environment. I think this is done somehow on mql5 market level from moderators.


So, is my approach correct, or am i missing something?

Carl Schreiber
Moderator
7945
Carl Schreiber  
As far as I know Demo or No-Demo depends on the account the EA is trading or the terminal is logged in.
Stanislav Korotky
23350
Stanislav Korotky  
Carl Schreiber:
As far as I know Demo or No-Demo depends on the account the EA is trading or the terminal is logged in.

This is incorrect. A demo version (downloaded via Free Demo button) is available on any type of account, but it works in the tester only, with a limitation that most recent realtime bars (~100 - as I remember correctly) are not accessible.

Unfortunately, the licensing MQL API is not completed yet.

To add comments, please log in or register