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

To add comments, please log in or register
Ahmed Soliman
19855
Ahmed Soliman  

Add-ins (Plugins)

Where the ability to write add-ins to the MetaEditor.

Add-ins like the ones wrote to Visual Basic and HTML Kit. For example add ins that insert saved code or comment multi lines etc.


Give HTML-KIT a look and you will know what I'm talking about.

Ahmed Soliman
19855
Ahmed Soliman  

Protection!!!


What's the new method of protection you are going to add to the EX4 programs.

Crackers everywhere cracking the code!



I hope you give protection a top priority.

Ahmed Soliman
19855
Ahmed Soliman  

Are there more new Events (beside init, deinit and start)

Like:

OnTakeProfit()

OnStopLoss()

OnOrderClose()

OnChartClick()

OnPropertyWindow()


etc...

I eager to see these events!

Ian Smith
1595
Ian Smith  
codersguru:

Protection!!!


What's the new method of protection you are going to add to the EX4 programs.

Crackers everywhere cracking the code!



I hope you give protection a top priority.


https://forum.mql4.com/12328 That's my comments and suggestions about protecting .ex5 files and how to do it easily now.

Slava
Moderator
7544
Slava  
Why OnPropertyWindow? No sence imho
Ian Smith
1595
Ian Smith  
stringo:
Why OnPropertyWindow? No sence imho

It wasn't my suggestion, but I'd love to have a control panel where I can press buttons on the window and tell my EA to do things on offtick.

ukt
473
ukt  

Hello Development Team - a few MQL5 oriented queries.

1. Does language design contain a more flexible (read usable)#define syntax; eg, parameters

Basically, minimal implementation as per C

Preprocessing of source code is old and known task with many code bases to choose from. Preprocessing does not impact compiler and added benefits of macro/define functionality are enormous.

2. Regular expressions: basically same sort of comments as above. Or, regex integration as callable builtin. Again, massive well proven open source code base to choose from.

Requiring minimal implementation/integration efforts for Team (unless your code is written in say Coral-66 ;)

Thank you

Ian Smith
1595
Ian Smith  
While we're on the topic of Regex, how about split(string1,string2) because I don't like how slow my 10 line hack is and I don't want to build a DLL wrapper that passes array chunks around. Also, passing all datatypes (including arrays) by reference would be *really* nice because then the DLL wrappers I would write wouldn't need to be split() when the data-as-string comes back out.
ukt
473
ukt  

futher MQL5 comments:


3. You have already stated that ternary opperator "?: " will not be supported

- Final word then is "never" ?


4. postfix ( [++|--]operand ), prefix ( operand[++|--] ) notation

Currently: postfix allowed

- will prefix notation?


5. Increment and Decrement Operators ( "++", "--" )

Currently: "The operations of adding/subtracting 1 (increment/decrement) cannot be used in expressions."

- Will there be a fuller/widening implementation of these operators:

- eg: s[j++] = s[i];

- eg: if ( ch == '\n' ) buf[ i++ ] = ch; instead of: if ( ch == '\n' ) { buf[ i ] = ch; i++; }

- eg: prefix operator: buf[--i ]


6. Flow control

Currently have while( expr ) statement and for( expr1; expr2; expr3 ) statement

- what about: do statement while (expr);


7. short circuit evaluation within (expr)

Currently: "short estimate" method does not apply to them." and "calculation of a logical expression is always completed, never early terminated."

ie, Logical expressions are calculated completely...

- Only method of safe/pseudo-shortCircuit multi-part boolean expression evaluation is to use nested series of if's each with single-test (expr)

- If unable to implement, can you warrant that code generation for nested if's, upon evaluation of first false/0 result from an (expr) results in code-level jmp to end of aforementioned series of nested if's ?

- (eg, to not have this warrantee implies that even nested if's are actually compiled as a single (expr) without shortCircuit evaluation)


8. Assignments associate right to left.

Currently: "complex assignments are impossible; for example, val1=val2=0; arr[i++]=val; cond=(cnt=OrdersTotal)>0; etc.;"

- what about: i = j = k = 0;


9. type string

Currently: "The length of a string constant lies between 0 and 255 characters." and "Its internal representation is a structure of 8 bytes. The first element of the structure is a long integer that contains the size of the buffer distributed for the line. The second element of the structure is 32-order address of the buffer that contains the line."

- This is a restrictive implementation. Actual mechanics of string storage mentioned above suggest partial implementation which by any standards falls far short of expected implementation whereby length is not artifically restricted.

- Will you please remove length restrictions - the struct and long integer is there, why not make use of it ?

- As am sure you aware: In C strings are '\0' end-delimited


10. Conditional Compilation:

via control lines #ifdef, #ifndef, #else

for example:

#include<eaDefines.mqh> //which contains a line: #define TESTING true

then, in all modules (which could be 'many') we can place following:

#ifdef TESTING

#include<testCode.mqh>

#include<testCodeTrace.mqh>

#include<testCodeLog.mqh>

#define LIMITWORK true

#define IGNORE_ERROR false

#...

#else

#include<eaCode.mqh>

#include<eaCodeTrace.mqh>

#include<eaCodeLog.mqh>

#define LIMITWORK false

#define IGNORE_ERROR true

#...

#endif


11. conditional inline testable assignments:

- one common example is: while ((c = getchar()) != EOF)

- syntax included ?


12. UninitializeReason()

NOTE: what follows is to me a current platform BUG requiring ASAP attention.


Currently,

IF previous launch closure ( deinit() called ), was due to REASONS:

REASON_PARAMETERS or REASON_CHARTCHANGE

THEN any static/state memory *will not* be reset to compile time settings prior to relaunch of EA ie, init() called WHY NOT ?

.

Summary: 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_PARAMETERS

.

see table below derived from testing for above conditions:


UninitializeReason()

reason

stopping EA

deinit() sees

this REASON

was static memory

reset in init() ?

relaunched EA

init() sees

this REASON

0, independentFinish YES

notSeen

deinit() ?
REASON_REMOVE YES YES YES
REASON_RECOMPILE YES YES YES
REASON_CHARTCHANGE YES

NO

YES
REASON_CHARTCLOSE YES YES

NO, whatSeeIs: 0, independentFinish - Why?

REASON_PARAMETERS YES

NO

YES
REASON_ACCOUNT notTested ? ?


Implications:

1. static presets will not be reloaded asif recompile > relaunch state

2. All EA code having static's will not execute as expected eg, trading environment has changed but EA environment has not...


Rationale:

1. It is believed that is reasonable to expect that if start() is entered then this is a brand new EA invocation and all EA components should always reflect this state.

2. Any program that has it's inputs modified by external means has been put into an unstable state if, upon relaunch certain "state of operational environment on launch" warrantees are not adhered to each and every time the program is launched ie, start() is called by Terminal.


My EA Workaround:

- kludge designed/coded but can be hard to maintain as EA code maintenance progresses...

.

As usual - thanks to The Team for reading, commenting on [ and of course giving thought to implementing above :) ]


;o)

Slava
Moderator
7544
Slava  

1. Preprocessing was introduced in the pure C for portability purposes between different platforms and compilers. Preprocessing causes some hardly detectable errors.

The answer is "No". Simplest #define only.

2. Ukt, I don't understand your suggestion about regexp. Do You mean regexp processing in the MetaEditor?

3. This is not a final statement. Maybe.

4. Both postfix and prefix will.

5. There will be a full implementation.

6. Yes, do statement while(expr); is implemented.

7. Yes, short circuit evaluation is implemented properly.

8. Yes, i=j=k=0; is implemented properly.

9. Constant strings are restricted up to 1 Mb.

There is no string type in the C and C++. There are just null terminated char (or wide char) arrays. You can use char arrays instead of our strings.

10. See 1. No conditional precompiling. Use functions IsTesting(), IsDebugging(), and so on.

11. Yes.

12. I agree. It is discussible.

To add comments, please log in or register