Interview with Stanislav Starikov: Features of New MQL5 - page 7

To add comments, please log in or register
Chen Han
35
Chen Han  

in MQL5 I hope you can add about AccountGroup() to check about group user that is listed in the metamanager, it really helpfull for us that selling EA

because using AccountNumber() is not enough to protect our EA


also adding a function that can read file from the URL, so no need again to use external program like getright when want to displaying a news calendar.

I think this function is really usefull too, and can be used for other purpose like displaying a text information from the web, and etc...


Thank you

Jimmy
490
Jimmy  
There are two main threats. One is unauthorized use of the EA, and the other is illegal decompilation of the EA.
I think protection of EA is the least priority in the developer's mind, unfortunately :(.

If possible, I propose encryption of the bytecodes during compilation to enhance protection of the EA.
In general this is how it works:
1. During compilation, there is an option to encrypt the compiled code
2. If the programmer chooses to encrypt the code, there can be two options:
a. The user enter a master/generic password for the encryption process, or
b. The user enter a master password and a specific string uniquely defined a specific user terminal/machine.

In case of the programmer chooses:
1. No encryption, the result is the usual bytecode, directly runnable on any installed MTs.
2. Generic password, each time a user try to run the EA, he/she will be first asked to enter the password,
then the MT will decrypt the EA using the password, and deploy it.
3. Master password+unique string:
a. The unique string must be generated by the MT. This can be done because the claim during last championship,
that the organizer can detect if several EAs come from the same machine.
b. The string is sent to the programmer, and the programmer uses this string and his master password
to encrypt the EA and generates a new 'license-key'
c. The user accepts the EA and the license-key.
d. When the user deploys the EA on his MT, it will ask for the key, verify the key against the machine/MT, and
to decrypt and enable the EA.

This way the intellectual property of the programmer can be increasingly protected.
Unfortunately, because to be able to run it properly, the EA must be fully decrypted. There is a chance for somebody to
illegally decompile the code (albeit much smaller chance to decompile than current compilation result).
Slava
Moderator
7443
Slava  
fireflies, we're thinking in the same direction. But I don't know anything about implementation
Jimmy
490
Jimmy  

I'm glad you've been thinking in this direction as well.

If you mean implementation of encryption-decryption, some samples can be found thru googling.

True that many of the algorithms are unfortunately patented or export licenced or whatever that makes its used is limited.

However you can get away with, either looking for the one that is not patented, or create a hook-up where a plugin to an external encryption utility can be called.

This option to store the external program name can be part of the tools option.

So the important part will be calling this plugin to encrypt bytecode during compilation, decrypt it during EA loading, and a good key management so it doesn't have to ask the user each time the EA is being loaded.

Btw, If the detail structure of the implementation is what your're trying to find, send an email. We can discuss it offline.

I hope the new MT5 and MQL5 will be released soon, can't wait to test it.

ukt
473
ukt  

On 12May you replied to my itemized post. One item was summarized as:

When init() called, the EA runtime environment does Not reset EA Global Scoped declarations OR [any scope] declarations having static attribute,

if previous launch ends (deinit() called), with reasons: REASON_CHARTCHANGE, REASON_PARAMETER

You stated that would discuss.

What, if any, new platform design decisions have you come to regarding this issue in current platform?

Additionally, have you made decision on ternary operator?

Slava
Moderator
7443
Slava  

ukt, there are "global_initialization" and "global_deinitialization" functions in addition to custom init and deinit functions.

-

global_initialization called once after loading program. global and static variables are initialized, constructors of global and static objects are called.

global_deinitialization called once before unloading progfam. destructors of global and static objects are called, global and static dynamic arrays are destroyed.

-

Custom deinit function can not call global destructors, but can explicitly resize to zero global dynamic arrays.

Custom init function can not call global constructors, but can explicitly reinitialize global variables.

Static variables is matter of theyr functions. Only static variable's owner function can explicitly change this static variable.

Slava
Moderator
7443
Slava  

ukt, prodolzhaem razgovor. We continue discussion.

It will be special function "DeinitializeAll". This function calls global deinitialization routine and sets critical error "forced deinitialization". You can call this function from custom deinit after deinit reason analyze. You can call this function from any your function. But in this case EA's functions (start, OnSomeEvent, deinit and so on) cannot be called. First custom init function must be called.

ukt
473
ukt  

stringo, your replies much appreciated and full of information - I must relearn some OOP speak/concepts and then consider your reply contents in the light of refound knowledge.

important issues - I must understand completely otherwise to answer hastily not honor your reply or team's work.

chow

MaxPayne
49
MaxPayne  
stringo:
1. You can use C++ BNF description (we cannot publish it because this form is hardcoded in our project)

The differences as compared to C++ are:

  • No class inheritance
  • No address arithmetic
  • No operators overload (it will probably be included later)
  • No 'goto' operator
  • No ternary operation expr ? op1 : op2; (it will probably be included later)

The syntax description will be embedded in MetaEditor help files.


...


Dear Stringo,


I think you guys do a terrific job, but please allow me one critical remark.


As inheritance is one of the pivotal characteristics of any object-oriented language

I would rather not call MQL5 object-oriented (as the movie suggests)!

However, you could use the term object-based instead.


Cheers!


Max

Slava
Moderator
7443
Slava  
Ok, Max. Object based. It is just terminology.
To add comments, please log in or register