Questions from Beginners MQL5 MT5 MetaTrader 5 - page 188
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello!
I can't figure out which interval to display a graphical object
on all timeframes.
Thank you.
OBJ_ALL_PERIODS=2097151
Does anyone know if the compiler has a key to get messages about unused functions and variables, like it is done in MQL4 ?
How is this done in mql4 ?
Asked about not displaying warnings about unused functions, Renat said it wouldn't. In connection with the use of pluggable libraries. It used to be in the old build. Now it isn't. It is very inconvenient to search for those functions in the EA body that are not used. It only talks about unused variables if it finds them in the body of a function, not start() or OnTick()
How is it done in mql4 ?
Asked about not displaying warnings about unused functions, Renat said it wouldn't. Due to the use of plugin libraries. It used to be in the old build. Now it doesn't. It is very inconvenient to search for those functions in the EA body that are not used. It only talks about unused variables if it finds them in the body of a function, not start() or OnTick()
Because in OOP it's not functions, but methods. Each library may have a bunch of classes with many methods, some of which are not used. Additionally classes also refer to other libraries, some of methods of which are also not used. This can result in a huge mess of unused methods.
Judging by the amount of compiled code, the compiler automatically eliminates unused methods. I.e., there is no point in searching for them by yourself, because this work is done by the compiler.
Because in OOP, not functions, but methods. Each library may have a bunch of classes with many methods, some of which are not used. Additionally, classes also refer to other libraries, some of whose methods are also unused. This can result in a huge stack of unused methods.
Judging by the size of the compiled code, the compiler automatically eliminates unused methods. That is, there is no point in looking for them by yourself because the compiler does this job.
Because in OOP, it's not functions, but methods. Each library may have a bunch of classes with many methods, some of which are not used. Additionally, classes also refer to other libraries, some of whose methods are also unused. This can result in a huge stack of unused methods.
Judging by the size of the compiled code, the compiler automatically eliminates unused methods. That is, there is no point in looking for them by yourself because the compiler does this job.
I hope the discussion of the previous question is over. It is difficult to know when the topic is closed and it is appropriate to ask your question. Can you give me a hint? I can't figure out how to fill one 2D array with results ofSt_handle andMA_handle calculations, I can only pass them to one-dimensional array.
This is not the problem. The problem is exactly finding unused methods in your classes.
What do you mean: unused methods in your classes? This is not the practice in OOP. A normal OOP programmer, in contrast to algorithmic programming, creates classes with all the necessary fields and methods, as they say, for all occasions, because the same class may be later used in other applications or become a part of class library. Not to mention the fact that even within one project it is better to create full classes, not stripped-down, so that you don't have to search through the source code and add the required fields and methods later.
In OOP any economy, which many people get used to in algorithmic programming, may turn out to be detrimental later. Everything what is not used must be excluded from the code by the compiler and not by the programmer.
Of course, OOP results in a larger source code compared to algorithmic programming. But this is not a disadvantage, but an advantage, because much of the "extra" code in this project can be reused in other projects.
I have over five hundred methods of my own. The interrelationships are very complex. Rudimentary code is unavoidable. It is very useful to quickly see what is not used anymore.
Can you give me a hint? I can't figure out how to fill one two-dimensional array withSt_handle andMA_handle calculation results, I can only pass them to one-dimensional array.
What is the point? I.e. why make a hump instead of using Occam's razor? I.e. what's the advantage of a two-dimensional array over two one-dimensional arrays? After all, you first need to shove something from two one-dimensional ones created by default indicators into a two-dimensional one, and then take something out of there. You are doing unnecessary work and trying to drag others into it.
If there was a problem with one-dimensional arrays, then it would be worth the trouble.
Sorry if this is off topic ...
help who can ...
in delphi 7 dll procedure...
procedure test1(var data: array of Double); stdcall;
begin
ShowMessage('Entered ');
end;
in mt4 :
#import "gayss.dll"
void test1( double &data[] );
#import
ArrayResize(data, 6);
data[0]= 2;
data[1]= 4;
data[2]= 8;
data[3]= 16;
data[4]= 21;
data[5]= 3;
test1(data);
and an error pops up... 2014.02.06 17:39:04.241 stack damaged, check DLL function call in 'SOG_2014.mq4' (80,7)
Who knows how to do it right...