Learn to code in MT4

omfx

Well-Known Member
Hi Everyone,

I only had some basic coding experience during college time eon years ago. So you can say that I am a total beginner in coding. I want to learn how to code in MT4. I went to the MT4 website but it is not easy to follow and understand. Can anyone please suggest the how, where, what and which resource(s)/material(s) that are easy to understand in learning how to code in MT4? Thank you in advance!
 

rod178

Well-Known Member
omfx said:
Hi Everyone,

I only had some basic coding experience during college time eon years ago. So you can say that I am a total beginner in coding. I want to learn how to code in MT4. I went to the MT4 website but it is not easy to follow and understand. Can anyone please suggest the how, where, what and which resource(s)/material(s) that are easy to understand in learning how to code in MT4? Thank you in advance!
Start on the MQL4 forum http://forum.mql4.com/
from there you can download the book. Start at the beginning. After you understand the material in the book start to study and understand other people's code.

There are no shortcuts
 

omfx

Well-Known Member
rod178 said:
Start on the MQL4 forum http://forum.mql4.com/
from there you can download the book. Start at the beginning. After you understand the material in the book start to study and understand other people's code.

There are no shortcuts
Hi @rod178,

Thanks for the MQL4 forum reference. Is this the only source to learn MT4 coding? I tried that before but most of the materials there are too technical, not easily understood. I am not requesting for shortcuts. I am looking for materials/resources that can explain in layman/simple terms to teach a total beginner how to code in MT4. I am willing to put in the effort to learn it. I thought may be some members in this forum would be able to share and direct me to another way of learning how to code MT4 (other than the MQL4 forum).
 

jack

Administrator
Staff member
http://book.mql4.com/

I learned from this above.. same resource that rod pointed out.

If you're finding the resources provided by MetaQuotes too complicated.. I really think starting with an introduction to programming that focuses on JavaScript (or some other scripting language) might be a better place to start. It will make approaching MQL4 a lot easier afterward.
 

rod178

Well-Known Member
Jack said:
http://book.mql4.com/

I learned from this above.. same resource that rod pointed out.

If you're finding the resources provided by MetaQuotes too complicated.. I really think starting with an introduction to programming that focuses on JavaScript (or some other scripting language) might be a better place to start. It will make approaching MQL4 a lot easier.
Not exactly a shortcut though!!

Actually I found the MetaQuotes documentation quite good. If an additional foundation in the basics is required then I'd suggest a good intro to C++, as that is what MQL4 is based upon. eg C++ Primer Plus - Lippman. Actually, I'd just start with the MQL4 book. It is not complicated at all. Use other Language resources to fill in any gaps in understanding eg Objects, Arrays etc. Forget supposed shortcuts.

A specific third part book on MT4 programming, which I have not read, is:
"Expert Advisor Programming: Creating Automated Trading Systems in MQL for MetaTrader 4"

http://www.scribd.com/doc/97653631/Expert-Advisor-Programming-Creating-Automated-Trading-System-in-MQL-for-Metatrader-4
 

jack

Administrator
Staff member
rod178 said:
Not exactly a shortcut though!!
Never said it was. :p To study some intro to programming type material before going back to MQL4 would be a longer, but less steep, road.. not a shortcut.

And yeah, you're right, MQL4 is loosely based on C/C++... but I mentioned JavaScript since its syntax is close enough while being on a high enough level to focus on programming theory (and really, that was the point, get someone started off on programming logic to start... learning new languages after that becomes easier. Heck, I would have suggested Python for a starter programming language, but JavaScript's syntax is much closer to MQL4 than python...)

I hope that 3rd party book link helps omfx out.. I haven't read the book myself.. but sometimes it just takes a different author saying the same things but in their own words to help a concept 'click'.
 

rod178

Well-Known Member
Jack said:
Never said it was. :p To study some intro to programming type material before going back to MQL4 would be a longer, but less steep, road.. not a shortcut.
My meaning was that the omfx stated he/she was looking for a Shortcut. imho, that would be counterproductive. Think we both agree on that.
 

omfx

Well-Known Member
Hi @rod and @Jack,

Thank you for the guidance. I will start off with the ideas Jack suggested and refer to the MQL4 book occasionally. @rod, like I said before I am NOT looking for a shortcut but another way(s) to learn MT4 coding that I can understand hence helping me to learn better. As the saying goes, there are many ways to skin a cat. Another example, I have been following ICT's teachings on and off for about two years now. One of the major improvements I noticed ICT has made is the way that he teaches now as compared to two years ago. Now it's much easier to understand, at least for me. May be it's the result of him trying to teach his kids how to trade. :)
 

jack

Administrator
Staff member
:thumbsup:

Don't be afraid to post here should you get stuck writing your first indicators and EAs. :)

Can't promise to know everything about MQL4 off the top of my head, or be able to fix any bug, but if it's something I can spot easily I'll help where I can. Others here might be able to help as well.
 

rod178

Well-Known Member
Another option is Video Tutorials. Personally I'd rather refer to a book, although that s just me. Here is a link that seems to start from the beginning.

http://forexscalping101.blogspot.com.au/2013/08/free-mql4-programing-and-editing.html
 

jaywalker

Active Member
Sorry, this post is not exactly to topic, but relates to MT4:

Please can someone tell me how to create an historical chart in MT4, for example if I want to display only candles from, say, 1/10/2010 - 30/06/2011. I have hunted everywhere for a start and end date option on the chart, but for the life of me cannot find one.

Many thanks
Mike
 

jaywalker

Active Member
Hi Rod

Thanks for the reply.

Basically what I am trying to do is show a chart that has the last daily candle at 5/4/2010. I am not too concerned about the exact start date as long as there is2 - 3yrs history. I tried CTRL+R and put in my date range. This limited the data range for EA to that range but still displayed all candles up to present date. I also plugged that date (5/4/2010) into the visual mode but this did not limit candles. Maybe I'm doing something wrong?

Your help is greatly appreciated

Regards
Mike
 

AusDoc

Well-Known Member
rod178 said:
A specific third part book on MT4 programming, which I have not read, is:
"Expert Advisor Programming: Creating Automated Trading Systems in MQL for MetaTrader 4"

http://www.scribd.com/doc/97653631/Expert-Advisor-Programming-Creating-Automated-Trading-System-in-MQL-for-Metatrader-4
I have read this. It's very clear and quite good. I recommend it. It does contain several errors though so be sure to visit the book's website to download the errata files. Even though it is targeted, as the title indicates, on EA development it will definitely help you to acquire an understanding of MQL and an ability to program in it. Add to that the study of other widely available code, as was suggested earlier, and you should be right.

omfx said:
Another example, I have been following ICT's teachings on and off for about two years now. One of the major improvements I noticed ICT has made is the way that he teaches now as compared to two years ago. Now it's much easier to understand, at least for me. May be it's the result of him trying to teach his kids how to trade. :)
Yes, and hopefully over those two years you developed enough to be able to more easily make sense of it. :)

Good luck with your coding ambition. Just remember that most people who fail when they try do so because they lacked self-belief. With some prior experience, that book mentioned above, some reference to examples from working code, if you add some focus and a little hard work it should be quite manageable. Just believe you can do it.
 

rod178

Well-Known Member
jaywalker said:
Hi Rod

Thanks for the reply.

Basically what I am trying to do is show a chart that has the last daily candle at 5/4/2010. I am not too concerned about the exact start date as long as there is2 - 3yrs history. I tried CTRL+R and put in my date range. This limited the data range for EA to that range but still displayed all candles up to present date. I also plugged that date (5/4/2010) into the visual mode but this did not limit candles. Maybe I'm doing something wrong?

Your help is greatly appreciated

Regards
Mike
Use LFH-Trading Simulator (maybe something else available now?) and restrict the date range. Start by reading this -

http://urbanforex.com/profiles/blogs/using-a-trading-simulator-to-test-your-strategies
 

TopFroxx

Well-Known Member
does the LFH trading simulator still work for you? mine stopped working, probably since the last mt4 update. if i click to open an order, it just doesnt place it anymore.
 

Top