Download MetaTrader 5

Q: Is it possible to check if user is logged in into MQL system with his login from the EA level?

To add comments, please log in or register
Have you installed MetaTrader 5? Find out more about it!
Grzegorz Korycki
52111
Grzegorz Korycki 2014.10.21 09:51 

User wants to buy unlimited copy of my EA, but i am affraid of unlicensed copying.

If i could check if the user is logged on his account on MQL5.com, then EA would have protection against using it by other users.

Is it possible?

i want to do a single check at EA start (recheck every x seconds, if user not logged in to avoid problems while mql5 is down)

Stanislav Korotky
17867
Stanislav Korotky 2014.10.21 12:27  
angreeee:

User wants to buy unlimited copy of my EA, but i am affraid of unlicensed copying.

If i could check if the user is logged on his account on MQL5.com, then EA would have protection against using it by other users.

Is it possible?

i want to do a single check at EA start (recheck every x seconds, if user not logged in to avoid problems while mql5 is down)

You can't do that, but the built-in protection is good enough so you should not worry about copying. Any new copy will require activation, and the number of activations is limited (5 by default, you can change it).
Andrey Barinov
39238
Andrey Barinov 2014.10.21 12:42  
marketeer:
You can't do that, but the built-in protection is good enough so you should not worry about copying. Any new copy will require activation, and the number of activations is limited (5 by default, you can change it).

I think it is possible. Check this out:

https://www.mql5.com/en/docs/constants/environment_state/terminalstatus

TERMINAL_COMMUNITY_ACCOUNT should do the job.

Andrey.

Documentation on MQL5: Standard Constants, Enumerations and Structures / Environment State / Client Terminal Properties
Documentation on MQL5: Standard Constants, Enumerations and Structures / Environment State / Client Terminal Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Environment State / Client Terminal Properties - Reference on algorithmic/automated trading language for MetaTrader 5
Stanislav Korotky
17867
Stanislav Korotky 2014.10.21 13:40  
Wahoo:

I think it is possible. Check this out:

https://www.mql5.com/en/docs/constants/environment_state/terminalstatus

TERMINAL_COMMUNITY_ACCOUNT should do the job.

All these statuses are about your terminal instance status, not statuses of some one else terminal.
Andrey Barinov
39238
Andrey Barinov 2014.10.21 13:43  
marketeer:
All these statuses are about your terminal instance status, not statuses of some one else terminal.
Correct. But all these stats are available FROM THE EA running in that particular terminal. So, if EA is sold to someone else whose login is known, it can be coded to run on THAT particular terminal only. And this is the answer to the question from the first post in this thread.
Grzegorz Korycki
52111
Grzegorz Korycki 2014.10.21 14:09  
Wahoo:

I think it is possible. Check this out:

https://www.mql5.com/en/docs/constants/environment_state/terminalstatus

TERMINAL_COMMUNITY_ACCOUNT should do the job.

Andrey.

almost. i need to check the username of logged in user. there i can only check bool values if user is logged in and balance. None of this information us useful to confirm username. (it can be in some other manner)

Andrey Barinov
39238
Andrey Barinov 2014.10.21 14:14  
angreeee:

almost. i need to check the username of logged in user. there i can only check bool values if user is logged in and balance. None of this information us useful to confirm username. (it can be in some other manner)

true.

I think in your case you better use

https://www.mql5.com/en/docs/constants/environment_state/accountinformation

and this one: ACCOUNT_NAME

Which will give you the NAME of the owner of trading account. I think it provides the same level of protection as MQ login name.

Hope this helps.

Andrey.

Documentation on MQL5: Standard Constants, Enumerations and Structures / Environment State / Account Properties
Documentation on MQL5: Standard Constants, Enumerations and Structures / Environment State / Account Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Environment State / Account Properties - Reference on algorithmic/automated trading language for MetaTrader 5
Stanislav Korotky
17867
Stanislav Korotky 2014.10.21 15:00  
Wahoo:
Correct. But all these stats are available FROM THE EA running in that particular terminal. So, if EA is sold to someone else whose login is known, it can be coded to run on THAT particular terminal only. And this is the answer to the question from the first post in this thread.

TERMINAL_COMMUNITY_ACCOUNT is just a flag indicating that current terminal is logged in into some MQL5 account, but the information about this account is not available. You can't check from EA if terminal is connected to a predefined MQL5 account. The OP asked even more - to identify a situation when MQL5 account is already logged in from some other terminal and if so - prevent execution.

What you suggested next - to bind EA to a specific trader account - this is indeed one of commonly used protection scheme. But bear in mind that it limits the user significantly in the sense that the user may have many accounts, and the developer may want to provide the user with a single sign on. This is why he asked about MQL5 account to my undestanding (this could allow running the same EA on all user's accounts). And this all is impossible at the moment.

To add comments, please log in or register