MQL5 looks very complicated language ... - page 3

 
jcarrion:

I really can't believe there are people claiming to develop "working" EAs  and at the same time find  MQL5 difficult .

C++ is the universal programming language. It is a blessing for us -programmers- that MQL5 is C++. Otherwise , It would lack the power to develop serious systems. Any EA with a remote chance to be profitable , needs to be a very complicated system. Proffesional -real life- Algotraders  are more than 20.000 lines of  C++ , and even so they are *barely* profitable.




I like what you said above, jcarrion. I took a course, maybe two, decades ago in C++ and when I saw MQL4, I was like - OMG...this is wonderful! And I agree, so many of the concepts of C++ including objects, classes, scope, local/global variables are "universal" and can be found in modern languages like Java. I wrote an EA in MQL4 but I could not get the MT4 debugger to work so I decided to write an EA in MQL5. It seems that MQL5 has moved more toward C++ to become more powerful and more applicable. MQL4 hid a lot of the working details behind the scenes for us. 

If you're having trouble with MQL5, I suggest you do what I do. Google what you need and copy blocks of code. I needed to copy everything pertaining to positions (open,close,etc.). Don't let those sections of code that are specific to MQL5 and look wickedly nasty scare you off. Encapsulate them in a function to make your code more readable. Most of your code, especially when starting out, will be the simple boring stuff common to every language. It's a journey for everyone - hopefully, you will find it rewarding. 

 
aglori68:
 hi I’m new so not sure what I’m doing but would like to ask a question 
I’m trying to set up tdi indicator in mt5 but when I get to the bolinger band and look for “ first indicator data “ it only has option for “ previous indicator data “ why is that can anybody help
Appreciate any help thanks 
This belongs into a different thread why don't you open one?
 
desertjedi:

If you're having trouble with MQL5, I suggest you do what I do. Google what you need and copy blocks of code.

Or just ask here in the forum for help.

 
Lachezar Krastev #:

The time proved that I was right – eight years later 90% of the developers are still relying on mql4. Just look the number of the EAs in the MT4 and the MT5 markets.


I began to convert a couple of my own EAs from MQL4 to MQL5 — only because Strategy Tester on MT4 is garbage, nothing else.

And holy moly, I am shocked at how complicated MQL5 is.

I have functions that had like 12 lines of code and now they have 50. Lines that were 50 characters long now are 120. ChartGetInteger used to return an integer, now it returns a long. Shrug. The good old Ask now is SymbolInfoDouble(_Symbol,SYMBOL_ASK). I used to get the moving average value of 3 bars ago with one single line, but they removed the last parameter and now I have to write five lines to achieve the same. OrderSend used to be one line and now it's at least 10!

Horrible. Just plain horrible.

I even suspect this atrocity was specifically designed to protect the market of professional programmers by making it more difficult for people who are more interested in trading than in programming, so traders become more dependent on programmers. Either that or this is designed by someone with a major grudge against the human race.

You were very right, Lachezar. I just wanted to tell you that. You were so right.

 

I like MQL5 in fact like it so much I did write a full auto source to source converter.

MQL5 is great and flexible language thanks Metaquotes.

 

MQL5 is more complex but Strategy tester is much better and worth it.

 

It's great for EAs and it's 64-bits so it's definitely faster, but it sucks for manual traders and many manual traders just moved on to TradingView.

As for the language itself, the syntax is more complicated / verbose, but you can use an include file with macros to make your MQL4 programs compatible with MQL5 (or take advantage of the macros while writing MQl5 code).

 
Philippe Pauleau #:

MQL5 is more complex but Strategy tester is much better and worth it.

yeah right..Only to realise that the things it's emulating are actually making strategy development more tangled up in irrelevant details. If your "strategy" is affected by spread, slippage, etc etc, better find a different one. Any strategy working on open bars is emulated just fine in MT4. MT5 tester is overrated.

Reason: