How does VBA compare with MQL4?

 
This question is aimed at the more experienced programmers around here - but feel free to reply if you have a point of view on this question.

I am demo trading with MT4 and became interested in programming some indicators, scripts etc. Thing is, I had no programming experience whatsoever. So I came here and looked around on the internet in the hope of understanding enough to pull something together. Well that didn't work for me...anyway, I have also been putting a trade journal together in Excel and have begun to pick up some VBA coding. Thanks to the huge amount of information available on this, I have found it much easier (relative to MQL) to work with. Now I am wandering - and this is why I am asking experienced programmers - are the two languages similar enough to make a transition from one to the other relatively easy?

Thanks in advance for any responses.

Oneday
 
Hello and welcome! start here https://book.mql4.com// and use https://docs.mql4.com// and the forum search as references. You'll be writing your own programs in no time!
 
farhang:
Hello and welcome! start here https://book.mql4.com// and use https://docs.mql4.com// and the forum search as references. You'll be writing your own programs in no time!


Thanks - that is where I looked first and it didn't make much sense to me. Put me off in fact! VBA appealed because there are lots more reference books, tutorials and help sources available. I hoped that if I could get my head around that, then MQL might be a little more comprehensible to me.

Regards
 
Nobody has ever become a programmer over night. But if you are willing to put enough dedication into it then you will succeed.

You should also consider looking at other languages too. In terms of static typing and syntax Java (NOT JavaScript) is quite similar to mql4 and there is also tons of literature available. I don't suggest C# and .NET in general because of moral scruples (dark side of the force) and also i think VBA is not the language one should recommend as a first language. Although it might be possible to learn some basic concepts of programming with VBA too it is not considered a serious programming language and clearly not a language to learn clean and proper programming and you WANT to learn clean and proper programming!

And just in case somebody comes here to suggest C or C++, I say don't do it! Don't even think about it! If you want to learn fencing you shouldn't start with a light saber (especially not with a half broken one) as a complete beginner, only a Jedi Knight or Master is allowed to use this. In this analogy VBA would compare to a sword made of rubber (not really good for learning) and Java would compare to complete standard foil fencing equipment with protective armor and everything, including trainer and and sparring partners and a complete sports arena built in.
 
My 2 cents: if u want to learn MQL4 then learn MQL4. Forget ALL other languages (no matter what kind of metaphoric 'sword' they may be...).
 

There are three structures in programming. Assignment, if something then this else that, and loop. There is one other structure and that is the function call or in old basic gosub.
BASIC - stood for Beginers All Purpose Symbolic Instruction Code. There have been many versions of BASIC ceated over the years.
These structures, perhaps it might be better to call them concepts, are the same in all programming languages.
After you have learned how to get these concepts to give you results you want it is just a question of learning how to write the syntax of the language your working in.
-
There are supplied with each language functions that make the purpose of the language easier to handle. Mastering those functions and concepts is the time consuming bit of learning
a language.
-

 

Thank you all for your opinions and advice - much appreciated and food for thought.

I have had an irrational fear of programming for years for whatever reason, so when I started looking at MQL, it didn't take long for the grey mist to descend and convince me that I was not a programmer. With a little experience in VBA though, I am starting to realise that I can programme albeit at a rudimentary level and that it requires thinking about things in a particular way - organising, structuring and understanding the concepts as you said Ickyrus.

7bit - I hadn't considered Java, so I will look at that as well.

Gordon - What you are saying makes sense, however, one of the reasons that I started with VBA is because it will be useful for me outside of trading, as might Java. I am thinking that as a proprietary language, MQL will be of limited use to me....

Thank you all once again

Regards

 

If you learn any programming language you will find the transisition between it and another language a lot easier than it was to learn the first one.

 
Rule 1) If you have a specific objective of writing indicators and scripts and EAs, learn MQL4.

Rule 2) Unless you already have a clear idea of what you are going to use other languages for "outside of trading", stick to Rule 1.
Reason: