Download MetaTrader 5
To add comments, please log in or register
Do you have a trading signal? Publish it in your blog as well!
Ubzen
Moderator
5394
Ubzen 2013.06.11 12:06 
  • 38%
    (47)
  • 38%
    (47)
  • 25%
    (31)
Total voters: 125
Dua Yong Rew
5133
Dua Yong Rew 2013.06.11 12:14  

I sucks at OOP

maybe my EA are too simple to the extent that did not requires OOP 

Ubzen
Moderator
5394
Ubzen 2013.06.11 12:21  
doshur:I sucks at OOP: maybe my EA are too simple to the extent that did not requires OOP 
Thats understandable. I'm learning oop through java and I'm loving the concepts. I'm wanting to learn it because I want to create a virtual back-tester using mt5 indicator testing. I'm not the fastest learner, but my thinking is that'll be large enough for oop. I would like my project to have broad support from other programmers on this site. I'm hoping oop wouldn't be a big obstacle. The votes thus far, however, is saying otherwise. :)
Alain Verleyen
Moderator
28671
Alain Verleyen 2013.06.11 13:11  

Your poll lacks an option for those that prefers nothing. I mean, this is not only a matter of preference, that makes no sense to use OOP for a little script or even an simple EA. OOP always add work and is only advantageous for complex project and code re-usability (same code used in several projects). Complex is not the same is large, if someone has a large project but relatively simple this does not automatically mean that he must use OOP.

You can see the great potential of OOP with MQL5 Wizard developped by Metaquotes, it would be very difficult to develop such a tool with procedural programming, although it is feasible.

MQL5 Wizard: Creating Expert Advisors without Programming
MQL5 Wizard: Creating Expert Advisors without Programming
  • 2011.01.11
  • MetaQuotes Software Corp.
  • www.mql5.com
Do you want to try out a trading strategy while wasting no time for programming? In MQL5 Wizard you can simply select the type of trading signals, add modules of trailing positions and money management - and your work is done! Create your own implementations of modules or order them via the Jobs service - and combine your new modules with existing ones.
Ubzen
Moderator
5394
Ubzen 2013.06.11 13:21  
angevoyageur: Your poll lacks an option for those that prefers nothing. I mean, this is not only a matter of preference, that makes no sense to use OOP for a little script or even an simple EA. 
Well I taught thats why I included the option to just see the results ;). From what I've read about the subject. Allot of programmers would say "it depends". How am I suppose to pull upon that? :) Any_Hoo its intended to make people think about a preference in general. Ps: from what I understand about java (just example) its all oop; how does someone create a small program in java?
Alain Verleyen
Moderator
28671
Alain Verleyen 2013.06.11 13:29  
Ubzen:
Well I taught thats why I included the option to just see the results ;). From what I've read about the subject. Allot of programmers would say "it depends". How am I suppose to pull upon that? :) Any_Hoo its intended to make people think about a preference in general. Ps: from what I understand about java (just example) its all oop; how does someone create a small program in java?
Effectively Java is all OOP, I thought we was talking about MQL5. However the implementation of OOP is not the same for all languages, with MT5 it's not mandatory, and if we are talking about a learning curve, I think it's not worth to learn OOP with MQL5 if you have only one simple project. For a project like yours on other side it's certainly useful.
Ubzen
Moderator
5394
Ubzen 2013.06.11 13:36  
angevoyageur: Effectively Java is all OOP, I thought we was talking about MQL5. However the implementation of OOP is not the same for all languages, with MT5 it's not mandatory, and if we are talking about a learning curve, I think it's not worth to learn OOP with MQL5 if you have only one simple project. For a project like yours on other side it's certainly useful.
Thanks for the considerations. I think it's fairly obvious that my project isn't simple. I've basically by-passed all the oop stuff for mt5 thus far using your logic above. For me the learning curve is worth_it if Ive got a project which is of real benefit to myself and not just some case-study from a text book.
Stephen Njuki
5147
Stephen Njuki 2013.06.11 20:26  
I think OOP is a necessity for mql. There are always reusable bits of code like that for order processing but in general for most programmers we always start out with the objective to develop this great EA. However the truth is we do not know if this EA will pan out to our expectations which is why it is vital to partition the various parts of your EA whether MM or Signal Management, into separate classes such that in case you learn of say a new MM technique, all you have to do is simply write its class and then call it in your EA instead of your old MM class.

The thing is we are all constantly learning and trying out new stuff so I do not see how we can make headway without OOP.

Having said that a procedural style language like SQL could go someways in improving mql5 especially if we start storing symbol price data in databases... probably in MQL6... :-)... This would not only offer more security to one's trading system but the issue of history price quality and the liability that comes with it, could be resolved.
Celin Smith
18
Celin Smith 2014.11.11 06:08  

I would Prefer Object-oriented programming, or OOP, is an approach to problem-solving where all computations are carried out using objects.

Source:http://en.wikipedia.org/wiki/Object-oriented_programming

Ovo Cz
2954
Ovo Cz 2014.11.11 10:49  
celinsmith:

I would Prefer Object-oriented programming, or OOP, is an approach to problem-solving where all computations are carried out using objects.

Source:http://en.wikipedia.org/wiki/Object-oriented_programming

It depends what experience you have. If you have only the procedural programming experience, then do not start with OOP in MQL5.

If you have been coding JAVA or C++, then you would not like going back, because even simple OOP design cannot be ported to the procedural development.

The trouble with OOP in MQL is that it lacks implementation of system support packages. I mean the very basic patterns, like sets, iterators, comparators, maps, vectors, event listeners etc. So the newcomer with no OOP experience has nothing to start with, and even the advanced programmer has to spend hard times with implementing the very basics. It may take months to have a good basic package, and every one would have it completely different, therefore incompatible.

As the result - you will probably never see a good and complete OOP example for the MQL, as nobody would want to share his/her system framework, and also every one would have it very different and mutually incompatible.

Enrico Lambino
4173
Enrico Lambino 2014.11.11 11:05  
angevoyageur:
Effectively Java is all OOP, I thought we was talking about MQL5. However the implementation of OOP is not the same for all languages, with MT5 it's not mandatory, and if we are talking about a learning curve, I think it's not worth to learn OOP with MQL5 if you have only one simple project. For a project like yours on other side it's certainly useful.
I agree on this. I usually use OOP for larger projects (mostly EAs) and Procedural for less complicated ones (like simple scripts). Procedural helps things done fast. However, for a large project, it is easy to end up with lots of global variables and constants, or have functions pass lots of arguments between each other.
/ /12
To add comments, please log in or register