New language for MT

 
I’m MQL4 newbie, but also professional .NET programmer (C# in fact). I’ve written my first EA with many errors (nothing uncommon ;) and found following things:
1. lack of debugger – nowadays programming tools cannot exist without professional debugger with ability of setting breakpoints (the best conditional breakpoints can be applied). Now I’ve to write many prints and analyze logs to find errors. There’s no necessity to tell that investigating variables during step-by-step work is much better solution.
2. language itself – it’s like C as mentioned in documentation. There’s nothing from object-oriented languages, what is strange in these days. E.g. I’ve use error checking similar to MQL4 10 years ago. It’s ages in IT…
I wonder if MQ staff has thought about OO programming language for MetaTrader? Maybe it’s time for it?
May I make an proposal? I’m C# programmer but now that Microsoft has rather bad reputation so don’t want to propose C# incorporating as MQ programming language.
In fact there’s another powerful language based on the same principles: Java. As I know it’s free of license fees and several good compilers and debuggers are available for free (if I’m wrong, please correct me).
Benefits of using Java :
1. object- oriented programming language with debugger;
2. user-friendly editors;
3. sophisticated error handling based on exceptions;
4. huge amount of free libraries (both built in and third –party).
Of course there would be a work to do: translating MQL4 functions into object-oriented framework with classes like Account and Order, interface for implementing own indicators, enumerators and things like that.
I hope that this topic won’t die in natural death and voices from MQ staff will be heard also.
 
One more thing... You'd have to teach me Java
 

No way... I know C# and would have to learn Java myself :)

But take a look from opossite side: you had to learn MQL4 also. The same effort to learn Java. But learning Java is learning all-purpose modern object-oriented language which can be used in many situation. Unfortunately MQL4 is very specialized programming language.

 
LesioS:

No way... I know C# and would have to learn Java myself :)

But take a look from opossite side: you had to learn MQL4 also. The same effort to learn Java. But learning Java is learning all-purpose modern object-oriented language which can be used in many situation. Unfortunately MQL4 is very specialized programming language.

In a way LesioS, you have answered your own question. MQL4 is MQL4 is ... and this system is for financial trading and not for those desiring to be conversant in full blown mainstream HLL with all the functional baggage that goes with it. Please take close look at what most posts on forum relate to and now, please extrapolate the issues you have seen in these posts in relation to factoring in OOPS and boy-oh-boy... you gonna see more of the same multiplied by a great factor and financial trading is the name of the game here... not getting involved with OOPS etc - imho.

In-a-nutshell, there are some site visitors posessing zero or very limited coding skills... what they/we all have in common is the utmost desire to gain financial FREEDOM via financial trading, yes? (well... that's my overriding reason anyway!)

MetaQuotes Software Corp. is amazing in what they allow us all to use at no cost, I still get amazed at what I get to use... regardless of those 'issues' which appear now 'n then - lol

As I have said before and still live by:

((Thank you irusoh1 (on 2006.10.30 19:28, 'int x = double y ?') for getting me back onto stable ground, post contents *always* in my mind whenever get to point with MT where loose will to live :))

The dude says it all really, what ya see is what ya get - warts 'n all, just get along with it or use your day job skills to hack DLLs to extend what exists or just move on to another system :)

Personally, I have 'issues' with MT but in the end - as irusoh1 states, their are enough MT tools to allow doing most tasks, it just takes [sometimes] massive amounts of lateral thinking about how can use those MT tools :-))

Cheers

 
I agreed. I just hope for a decent debugger. It is extremely painful using print and trying to debug from journal especially if it involve loops and complex functions.
I also hope MT4 will support recursive function. I tried but often run into stack overload even if I allocate huge memory for the stack to begin with.

:-)
- Zech
 
OK, I buy your arguments. But I'd like to repeat after Zech "I just hope for a decent debugger."
 

Ok, understand this debug need. But... there it is, yes? Personally, I make use of own rolled Trace(), Log() and Assert() function setup. the Trace() and Log() each have own file to dump to. The Assert() dumps via call to Log(), plus caller can tell Assert() to also Print() to Terminal log if desired.

Complex... Well - why not deconstruct complex into 1,2 or more notcomplex functions? So much easier to even just know by inspection that will most likely work... In end is personal, yes?

Loops... may be many iterations, but is needed to o/p every iteration?

OK, just thoughts, how I work not mean any good for others - lol.

But, that's MT so gotta work within the boundaries set by MetaQuotes, yes?

Cheers

 

btw, I am bit paranoic bout any call to well... anything - if truth be told - lol So I play my own game of OOPs type encapsulation whereby most calls to Terminal results in I/F function that has a retry loop and [of course] checks for errors where possible. These I/F functions are mainly type bool and true means a-ok Terminal call. Why go to such lengths? For me it means whenever I for instance want to open,write,read,close a file [which I do all over the place], I absolutely know for a fact that a false return means it's time to shout loud at trader by Alert() and Print() and any other stuff to get user attention. This is real great [imho] cuz calling code not worry about all the gunk normally associated with checking for errors and possible retry loops etc. Also allows calling code to be higher level in look 'n feel - not cluttered with all that error checking gunk which just clouds the main logic of the code... ie, implementation of trading system!

Basically, since am certified paranoid - this massively reduces my code size cuz all that repetitive stuff is hidden from the caller [and by definition, the reader too:]. I've got all the Terminal file I/O calls like mentioned above. Only issue is that type object is not exposed by MQL4 - eg, FileWriteArray() has formal param: object array[] - great for dealing with param actual of type any..., yes? But we cannot [as far as I understand it] use the type object which means I gotta write separate FileWriteArray() I/F function for each valid type of array eg, FileWriteArrayInt(), FileWriteArrayDbl(). Easy enough after design first one but OK... this is MT and that's what we gotta work with - those are the tools available, warts 'n all, yes?

For me, is great having all these functions doing the retry loops and error handling on callers behalf - The more code I write, the faster I can write it cuz not need concern self with anything but the simple idea that need make Terminal call [via I/F function]. Bottom line, all the sweat at start [when developing the I/F's] is soon forgotten and I know that a false return means stop or whatever design can tolerate....

Similarly, to unclutter the code I use error and message handlers. Centralised code - no hassel for main code, no reinventing the wheel every time wanna log/print/... decide what to do, just call the handler - let it take the strain! Once again, keeps main code uncluttered. imho, all possible decluttering of code is benifit simply because I want to see easily just what the heck the code is doing regards financial trading design/system - not give a d*mn about the mechanics of bottom level gunk used to implement the financial trading design/system.

In-a-nutshell, if I can apply KISS principle to my top level code by virtue of absolutely knowing that the bottom level mechanics will function as expected [many calls to Assert() used :], then I can in essence forget about programming and become a financial trader!!!

OK, more ramble - but some may read and think what a weirdo! and maybe some may just think a bit and imho - that's what forum all about!!!

Cheers All

 
phy:
One more thing... You'd have to teach me Java

I would really like to learn to program in MQL4 and it appears that you understand it. May I ask where one can go to get a formal education or something other than getting a piece or two of information here and there on various websites? Are there textbooks or any college level classes available?

Reason: