What mql5 code can do that mql4 can't? - page 2

 
Marco vd Heijden:

For me it is.

Yesterday i was reading a topic from imamushroom

He was wanting to create a trendline by angle.

i put it in the compiler and it read:


97 lines.

He asked for help and i told him i never use it like that.

I  simply use:

For example, which is just one line, but i was unable to help him so i redirected him to Doerk Hilger

But i am not here to prove anything to anybody i just share my experience and for me there is no right or wrong.

You see it's all the same thing.

Wrong is simply less right, and likewise right is less wrong, but they are both one the same thing.

Yeah...no way to discuss seriously.
 

Thank you for recommendation, Marco.

But I agree with Alain. Absoluteley everything which has to do with objects - and this also include any chart objects - is done with OOP much much easier and just more "readable". When I see some native MQL4 code where people just create a simple label, I cant understand why they write tons of code instead of using the standard classes and do it with just 2-3 lines. 

One idea behind OOP is: Code it one time right, then do it never again. This includes also the usage of the contained standard classes - its already coded and there is no reason to code it all again the native way and to reinvent the wheel over and over again for such simple things. Just an example, but the principe is always the same. 

For simple things, native MQL4 may be ok, but for complex EAs? I dont think so.   

 

It just has to do the job it does not matter how.

Sure everybody has his personal preferences but it is impossible to label them as being right or wrong.

It depends on the goal it was designed for.

A good example is a championship or contest.

It does not matter what language is used or in what way, what matters is that you compile a winner.

And it's that simple.

You can have the most beautiful OOP robot in the world, but if it fails in the market, it sucks.

Like i said it's not about being right or wrong, it's about PERFORMANCE.

And everybody is welcome to argue about this fact, but in the end, it is all that matters.

 

This topic is about what can do mql5 which mql4 can't do. Up to now there is no 1 valid post to answer that.

@Dirk :

1° OOP is not an answer as it's usage is exactly the same in mql4 and mql5, no difference.It's off-topic.

2° mql4 and mql5 "are not basically the same" for several reasons :

  • Most people continue to use what you are calling native mql4 (for example usage of Predefined variables which (most)are not available in mql5).
  • Indicators are not coded with the exact same logic, mql5 offers a lot more possibilities.
  • The trading system is completely different, and I can assure you that the difference is big for most people which are not professional coders.
  • You have access to more objects in mql5 (MT5), for example the Chart object which is just an amazing tool.
  • Even for the subset of common functions there is a lot of little differences, just 1 example, check the StringConcatenate() function.
  • If you are coding a GUI for example, and you are using the common language functions, you will still find there is some differences when you will run your code.
  • And more, I am not trying to be comprehensive here.

@cozyman :

You are mixing all in a big soup.

1° 32/64 bits architecture has nothing to do with the topic, which is about mql4 versus mql5. Having a 32 bits or 64 bits computer will change nothing about mql4 or mql5.

2° Multi-threading has nothing to do with 32/64 bits architecture. And is also off-topic, mql5 doesn't allow multi-threading at all.

@Marco :

1° You are just wrong about your answer to this topic which is not about the disadvantages of mql5.

2° There is no way to discuss with you constructively as you saying one think in a post and the opposite in other. Yes mql5 is slightly more verbose than mql4, the underlying reason is performance, but of course it's more difficult to control for amateurs.

3° You should just avoid to talk about what you don't know/understand.

4° mql5 is by far more efficient as mql5. Trading performance is off-topic.

@coringajoker :

  1. You can do a lot of things in mql5 which you can't do in mql4. I already mentioned some examples above. You have access to more events, mainly trading events and strategy tester events.
  2. You have access to all ticks history.
  3. You can send orders asynchronously.
  4. You can add indicators to your charts easily, copy all values of an indicator buffer in 1 line of code.
  5. You can use OpenCL to take profit of your GPU.

And more...

I don't want to offend anyone, but I am really fed up to see so much people talking about what they don't know.

 
Marco vd Heijden:

For me it is.

Yesterday i was reading a topic from imamushroom

He was wanting to create a trendline by angle.

i put it in the compiler and it read:


97 lines.

He asked for help and i told him i never use it like that.

I  simply use:

For example, which is just one line, but i was unable to help him so i redirected him to Doerk Hilger

But i am not here to prove anything to anybody i just share my experience and for me there is no right or wrong.

You see it's all the same thing.

Wrong is simply less right, and likewise right is less wrong, but they are both one the same thing.

This doesn't prove anything OBJ_TRENDBYANGLE still exists in mql5. ObjectCreate() exists in both mql4 and mql5 with exactly the same parameters. 
 
Alain Verleyen:

@Marco :

1° You are just wrong about your answer to this topic which is not about the disadvantages of mql5.

2° There is no way to discuss with you constructively as you saying one think in a post and the opposite in other. Yes mql5 is slightly more verbose than mql4, the underlying reason is performance, but of course it's more difficult to control for amateurs.

3° You should just avoid to talk about what you don't know/understand.

4° mql5 is by far more efficient as mql5. Trading performance is off-topic.

It's all good, i have tried both and made my decisions.

twalk:
This doesn't prove anything OBJ_TRENDBYANGLE still exists in mql5. ObjectCreate() exists in both mql4 and mql5 with exactly the same parameters. 

Of course but you can not use iOpen iTime iClose etc. in the same classical sense/line and that was exactly the point of having to write more code for the same thing.

 
LOL. This is just a matter of declaring an array and calling CopyTime() and CopyRates().
 
twalk:
LOL. This is just a matter of declaring an array and calling CopyTime() and CopyRates().

LOL indeed.

Looks like 3 additional steps right there.

 

Alain, 

1 - I am not sure if OOP is off-topic. I guess when you ask 100 developers, 95 would claim that MQL4 is top-down (native) coding and MQL5 is OOP. We had this discussion already and the definition of MQL4 and MQL5 is totally confusing. Just take a look at MQL4.com, 99% of the codes are not OOP while MQL5.com is mainly about it. And the thread creator asked for the difference between MQL4/5 and not MT4/5, furhtermore he mentioned that MQL5 is based on C++, not MQL4 and therefore I had to assume, that he is talking about excactly this.

2 - When I say "basically" I mean the basics of the language, the syntax, not all platform specific functions.  

3 - Indicators, agree

4 - Trading concept, agree and wrote that already

5 - The CChart class is also available in MQL4, or do you mean something else? (And by the way, many classes of the MQL5 standard library can be used in MQL4 with just a few changes. And this makes sense, cause with conditional compiling you get a higher level of compatibility when you work with such mods.)

6 - I developed a very complex GUI as you know, and the code compiles without changes with the MT4 and MT5 compiler and it works perfectly on both platforms. Maybe you are right and it surely depends on which functions you use, but its also right that you can develop for both platforms without changes. Anyway, I avoid the usage of common functions whenever its possible and use macros or own functions instead to make the code as independend as possible.

7 - Exhausting? Dont, you will be needed ;)

Doerk 

 

@Marco

Maybe there is no right or wrong, but I think there is a good and a bad.

Using common functions and coding native produces a code, which is very sensitive for all changes and which is hard or impossible to convert from one platform to another. Imo this is the bad way.

Strictly using classes produces a code, which is very insensitive against changes and which is easy to convert, is imho the better way which maybe makes a bit more work in the beginning, but at least produces less headache in the future - and - its always reusable when it's coded "right" ;)

Reason: