Tester supporting MG4 scripts and advisors - page 3

 
AlexeyVik:
Well, I'm not going to prove that it's true. For a person who is not familiar with C++ programming and OOP in general it is rather complicated and not at all for a good word of mouth or creation of a myth. Strange as it may seem, I understood it all in a week and wrote what I needed. This is a completely different myth; this shows that learning mql5 is available even to non-professionals, like me.
In any OOP you can program algorithmically, and use OOP itself only as a wrapper. When I started coding in Java, I also didn't understand OOP at first, but I haven't seen any particular problems. Problems arise later, because it's very difficult to read the raw materials in algorithmic languages. It is much harder to use libraries in algorithmic languages, because you have to bolt them on before using them.
 
Reshetov:
You can program algorithmically in any OOP, but use OOP only as a wrapper. When I started coding in Java, I didn't understand OOP at first either, but I didn't see any problems. Problems arise later, because it's very difficult to read the raw materials in algorithmic languages. Using libraries in algorithmic is many times more difficult, because you have to screw them on before you use them.
Yuri, why are you explaining to me how easy it is? For one person it is simple, for another person it is very simple, and for someone it is inaccessible. I didn't say it was impossible to master... I was only talking about the differences between languages... the familiar and the new.
 
Renat:
Not different at all. They are two identical languages with a single compiler.
In that vein, C++ is no different from JavaScript. And it's true!
 
Integer:
In that vein, C++ is no different from JavaScript either. And it's true!

You cannot see anything else on our forum.

But there's no responsibility. You can blurt out anything you like.

 
AlexeyVik:
Yuri, why are you explaining to me how easy it is? Some people find it simple, some people find it very simple, and some people find it inaccessible.
It is difficult to understand if there is no documentation, no examples, no articles. But when you have it all, and when you can ask questions in a problematic case on the forum, it's a rotten excuse to talk about inaccessibility.
 
Reshetov:
It's hard to understand if there is no documentation, no examples, no articles. But when it's all there, and you can ask questions in a problematic case on a forum, it's a rotten excuse to talk about inaccessibility.

Go away. Personally, I can master this language without any problems or questions. But for someone it is inaccessible by virtue of his character, you can write him anything.

I still can't understand why you entered into a dialogue and express an opinion on a completely different topic.

 
Renat:

What you don't see on this forum.

Why, there's no responsibility. You can say anything.

Yeah, that's right. Especially using the authority of one's superior position.

All languages are the same, except for the extravagant ones. All of them can be learned in 21 days by any dummy. All for, while, if, switch may have a different notation, but it doesn't make any difference in principle. It is not the way the operators are written that is of importance, but the infrastructure with which the language interacts. In this respect MT4 and MT5 are two different worlds.

The difference in everything. Starting with the small - with the numbering of the bars in the indicator, in MT4 from right to left, in MT5 from left to right. Continuing with the more significant one - the aggregate position and the organization of the trade history data. The biggest difference in what is often required - in the way of accessing the data of quotes and indicators, the copying of data requires checking, indexing from left to right and from right to left, the time of the bar is either included in the range, or not. Take alone the discussion of the iBarShift() function in CodeBase.

In MT4, to ensure the stable operation of the EA it was sufficient to check the return value of OrderSelect(), but in MT5 it is necessary to do checks at every step, even at data of the last tick. There are also some subtleties of MT5 programming, which you will learn only after you have suffered a lot, because there are many pitfalls.

 

I wholeheartedly support your opinion!

Extending the functionality is of course a good thing, but under the bonnet of MT5 we should have left MT4 functions for compatibility. Of course, only those that fit into the framework of MT5 trading model.

So that the sources of MT4 would be ported with minimal changes.

Although I use MT5 as multicurrency tester, but unreasonably complex function calls repel me.

The same functions for switching to MT5(https://www.mql5.com/ru/articles/81), why not implement them in kernel itself?

Why do you need to rename functions to convert types, for example

CharToStr - CharToString,  StrToDouble - StringToDouble

Seems to be elementary, but... Reforms for the sake of reforms?

Or functions for working with time, for example

int Hour()
int HourMQL4()
  {
   MqlDateTime tm;
   TimeCurrent(tm);
   return(tm.hour);
  }

Function of getting data from a chart

double iClose(string symbol,
              int timeframe,
              int shift)
double iCloseMQL4(string symbol,int tf,int index)
{
   if(index < 0) return(-1);
   double Arr[];
   ENUM_TIMEFRAMES timeframe=TFMigrate(tf);
   if(CopyClose(symbol,timeframe, index, 1, Arr)>0) 
        return(Arr[0]);
   else return(-1);
}

There are hundreds of such examples!

Of course MT5 is more functional, but MT4 is more convenient! And this is sometimes much more important!

 
Integer:

Exactly. Especially taking advantage of the authority of one's superior position.

The statement "C++ is no different from JavaScript in this way either" is nonsense in the vein of discussing the difference between MQL4 and MQL5. And someone blurted it out.

Credibility is earned through a long and hard work. I have fulfilled this volume and I follow what I'm saying.


There is a difference in everything. Starting with a minor one - the numbering of bars in the indicator, in MT4 from right to left, in MT5 from left to right. Continuing with the more significant one - the aggregate position and the organization of the trade history data. The biggest difference in what is often required - in the way of accessing data quotes and indicators, the copying of data requires checking, then indexing from left to right, then from right to left, the time of the bar is either included in the range, or not. Take alone the discussion of the iBarShift() function in CodeBase.

What a strange situation we have. Any language can be learned by a dummy in 21 days but bar numbering and data access become a problem.

Once again, the languages are almost the same, they differ in a small number of functions and have a common compiler. MQL4 has an outdated approach to handling data that is unacceptable for systems with deep and detailed history. Use the new CopyXXX functions in MQL4 and it will be like in MQL5.


In MQL4 to ensure the stability of the EA it was enough to check the return value of OrderSelect(), and in MQL5 the checking is needed at each step, even at data reception of the last tick. There are also some subtleties of MT5 programming, which you will have to learn only after you have had a lot of hitches, because there are a lot of pitfalls.

In MQL4 and MQL5, you need to check the results of functions everywhere.

In MQL4 many traders simply ignored the checking and took the data as is. In MQL5 they write the same, and then their forex programs crash when launched on CFDs, futures, or stocks, simply because the authors were too lazy to check the parameters of instruments or data availability.

 
Nemser:

Even though I use MT5, as a multicurrency tester, but the unnecessarily complicated function calls are repulsive.

Think about what the new data access functions provide and why they are done that way.

MetaTrader 4 has limited depth of history, separate timeframes and direct access to its symbol bars via Open/High/Low/Close/Time[xxx]. Such direct access is very expensive to implement in terms of resources and CPU cost. Consider that each Expert Advisor has its own local copy of this data to avoid conflicts with other Expert Advisors and the terminal itself.

With the increasing number of symbols (for example, in MT5 you can have 5 000-10 000 symbols) and using the deep one-minute history as the basis of all timeframes, it is basically impossible to use the methods of MT4. There is not enough RAM, and copying large chunks kills performance. That's why MT5 no longer automatically maintains a hidden and expensive copy of the chart for each expert.

Instead we've moved to very economical CopyXXX functions where the developer exactly requests to the local array as much data as he needs, not the whole available chart. Next comes the fastest possible local data handling (instead of the old rather expensive Open/High/Low/Close/Time[xxx]), plus the author can cache this data and use it sparingly on the next call. The memory and CPU savings are enormous. Additionally, the platform itself is particularly hands free to manage vast databases - access to them is always on demand (rather than unsupervised direct access) and this allows for flexible management of caches.

It should also be noted that the simplicity of Open/High/Low/Close/Time[xxx] calls in MQL4 was limited to the current symbol and timeframe, and all other data for other symbols and timeframes was obtained using iClose/iLow(...) functions, which caused serious delays. The transition in MQL5 to a single CopyXXX function model has radically improved the situation, allowing developers to obtain the required data chunks in one request, and not to make multiple blocked calls (think about the locks in each single call to iClose).


The same functions for switching to MT5(https://www.mql5.com/ru/articles/81), so why not implement them in the kernel itself?

These aren't our functions and neither is this article. This article is a set of monstrous crutches, but released to show the difference.

I have repeatedly explained the need to use the new features of MQL5, not the horrendous crutches.


Why do they need to rename the type conversion functions, for example

seemingly elementary, but... reforms for the sake of reforms?

This is the right approach to building a quality language architecture. Function names should be comprehensible and not a set of abbreviations.

The new language and convenient autocomplete functions have allowed us to revise the language and make it cleaner.


Or, for example, time functions Get data from a chart And there are hundreds of such examples!

These are examples of crutches (they usually say "to do a tonsillectomy with glandular holes") that should not be used for comparison.

Theoretical material has become outdated since MQL4 was directly reduced to MQL5 and now MQL4 has a lot of compatible functions.


Of course MT5 is more functional, but MT4 is more convenient! And that's sometimes much more important!

I do not agree.

MetaTrader 5 is much more user-friendly, both in terms of software and language.

Reason: