Goodbye robot - hello marasmus - page 3

 

I was apprehensive about switching to new builds, but it turned out that all the indicators, EAs and scripts worked as is. Compiled, however, with a set of warnings. But the new compiled code works much faster. The only new features that I use are OnTimer(), new options for working with files, increased number of indicator buffers, some new functions (their increase is only a matter of time). Very useful is control of array overruns with string indication in the code. It used to be: divide by zero, and look where you want. And it would be even worse if the error did not occur.

"What's new in MQL4" can be written for those who remember the old stuff. No more newbies?

If you want to give them a description of MQL4 Lite, you may leave out of documentation everything that is fundamentally new and unnecessary: structures, classes, resources, object pointers, OOP, debugger, signals, graphics events, all functions that use this new knowledge, etc. Everything that will be left behind will be not much more complicated than the old MQL4. To slightly modify the textbook for the new one, which was not cleaned up.

.

 

Renat 09.09.2014 02:55 #

You can methodically make arguments again, explain about multiplication of features, saving old code, fixing bugs, etc. This has been done many times, described in articles and discussed in forums. But it's easier and more accurate to say that the author is absolutely wrong and is making up problems out of nothing.

Response to Renat!

----------------------------------------------------------------

You are trying to make shit up about me!

You, as a developer, serve the banks,

not the community! You're building a race car

with a pedal-powered child's bike!

So I have to give you the facts.

Question:

Where did User32. dll

with the functions to call the script from the eXpert, the indicator.

All of it is gone! Below is the proof.

the linker itself made me an ehpert for a fee, which

to call the script when needed.

now the script is only called manually.

the call itself is surrounded by different windows-allow to call

or want to invoke a second script - the window "do you want to leave the

Only manual trading is possible!

What should a robot do? And all robot writers?

I'm not against the OOP and the supposedly faster performance of MT4.

If you wanted to speed up MT4, you would have limited the

I use 5-6 and get hundreds of dates!

Unnecessary symbols are rubbish.

and they only come! That's where the speed and responsiveness

But it is bad for banks!

Pansa

Import of functions from User32. If their purpose isn't pretty much immediately

// clear, then documenting it here frankly isn't going to help much. Requires

// "Allow DLL imports" to be turned on.

#import "user32.dll"

int RegisterWindowMessageA(string MessageName);

int PostMessageA(int hwnd, int msg, int wparam, string Name);

void keybd_event(int VirtualKey, int ScanCode, int Flags, int ExtraInfo);

#import

// The hWnd parameter for all these functions is obtained using WindowHandle().

// For example, an EA/script can get the handle of its own chart using

// WindowHandle(Symbol(), 0). If the EA/script knows that another chart

// is open, then its handle can be obtained using the known symbol and

// timeframe. Unpredictable behaviour if there are multiple charts for

// the same symbol and timeframe. AutomaticallyAcceptDefaults clears

// the configuration window for the new indicator/EA/script by simulating

// a press of the Enter key after a small wait. A longer wait might

// prove to be more robust. None of this is for the faint-hearted...

void StartStandardIndicator(int hWnd, string IndicatorName, bool AutomaticallyAcceptDefaults = false)

{

int MessageNumber = RegisterWindowMessageA("MetaTrader4_Internal_Message");

PostMessageA(hWnd, MessageNumber, 13, IndicatorName);

if (AutomaticallyAcceptDefaults) ClearConfigDialog();

}

void StartCustomIndicator(int hWnd, string IndicatorName, bool AutomaticallyAcceptDefaults = false)

{

int MessageNumber = RegisterWindowMessageA("MetaTrader4_Internal_Message");

PostMessageA(hWnd, MessageNumber, 15, IndicatorName);

if (AutomaticallyAcceptDefaults) ClearConfigDialog();

}

void StartEA(int hWnd, string EAName, bool AutomaticallyAcceptDefaults = false)

{

int MessageNumber = RegisterWindowMessageA("MetaTrader4_Internal_Message");

PostMessageA(hWnd, MessageNumber, 14, EAName);

if (AutomaticallyAcceptDefaults) ClearConfigDialog();

}

void StartScript(int hWnd, string ScriptName, bool AutomaticallyAcceptDefaults = false)

{

int MessageNumber = RegisterWindowMessageA("MetaTrader4_Internal_Message");

PostMessageA(hWnd, MessageNumber, 16, ScriptName);

if (AutomaticallyAcceptDefaults) ClearConfigDialog();

}

void ClearConfigDialog()

{

Sleep(100);

keybd_event(13, 0, 0, 0);

}

 
pansa:

Renat 09.09.2014 02:55 #

You can methodically make arguments again, explain about multiplication of features, saving old code, fixing bugs, etc. This has been done many times, described in articles and discussed in forums. But it's easier and more accurate to say that the author is absolutely wrong and is making up problems out of nothing.

Response to Renat!

----------------------------------------------------------------

You're trying to badmouth me in a barefaced way!

Why praise when we are at completely different levels of understanding?


user32.dll is not going anywhere - it is an operating system library.

Use W(idechar/unicode) variations of functions instead of A(nsi) functions:

#import "user32.dll"

   int  RegisterWindowMessageW(string MessageName);
   int  PostMessageW(int hwnd, int msg, int wparam, string Name);

   void keybd_event(int VirtualKey, int ScanCode, int Flags, int ExtraInfo);

#import
 
If you remove the symbol from the Market Watch window, no traffic will come through it. This mechanism has worked for 14 years.
 

To the moderator, Renate!

about the level of understanding - it's relative,

I carry a spear alongside the glorious knight Don Quixote

and I'm up to the task.

You, on the other hand, have to meet higher

higher requirements and produce products of higher

higher quality.

well user32,dllrefers to windos.

Your advice to go from A to W had no effect!

Try running the script from the eXpert!

Removing the characters does not affect CPU or network load.

it's a screen call and the thread is the same!

I hope you will agree with me.

Panza

 

I can see that you do, too.

But here we are talking about programming and programs written by programmers. If you do not understand the source code you are using, you need to learn. We have done a lot for that: extensive documentation, tutorial, articles, source base, freelancing, marketplace of ready-made products, signals, forum, etc.

 
pansa:

Try changing the case of the first letter of the script/indicator name. Somehow I was struggling too https://www.mql5.com/ru/forum/152533/page2#982156

P.S: well, change string to char[]

 

DearRenat, I too have got a lot of warnings after compiling EAs, no errors.

I have a question, what do these warnings mean (mainly, they are in front of the return() line)? And will they not negatively affect the Expert Advisors' operation?

Of course, I don't want to learn the language all over again and remake my EAs (I'm a trader, not a programmer).

 
vasabu2012:

DearRenat, I too have got a lot of warnings after compiling EAs, no errors.

I have a question, what do these warnings mean (mainly, they are in front of the return() line)? And will they not negatively affect the Expert Advisors' operation?

Of course, I don't want to learn the language again and remake my EAs (I'm a trader, not a programmer).


Please send me the errors or the code of the Expert Advisor you made some errors in.
 
vasabu2012:

I, too, got a bunch of warnings after compiling EAs - no errors.

And most rubbish warnings popped up because of perfectly legal, correct and standard passing of variable by reference into function, when function's template name matches the variable itself as it should be in this construct in its standard and typical use, when the variable itself is passed into function with its own name.

Unfortunately, MCs could not give a competent and logical explanation for this, saying that sometimes one may have misunderstandings in other constructs when there are similar names. But here is the paradox, for example, when there is a function with one and the same name and different number of parameters, the warning will not pop up.

So we have to attribute it to some religious superstitions and obscure beliefs when there is no logic behind this warning at all. I do not yet consider the version of idiocy, as suggested by the author of the thread to explain this phenomenon)).

Reason: