Building EAs and MQL 101

 

Hi

I am interested in learning MQL coding I have read the documentation provided and need clarification.

Can someone go over the essentials of EA and Indicator coding. I am enrolling in a C# class at present.

To get some idea of the structure of a standard Expert Advisor, let us take a look at the description given below:

1. Initializing variables

2. Initial data checks

check the chart, number of bars on the chart

check the values of external variables: Lots, S/L, T/P, T/S

3. Setting the internal variables for quick data access

4. Checking the trading terminal – is it void? If yes, then:

checks: availability of funds on the account etc...

is it possible to take a long position (BUY)?

open a long position and exit

is it possible to take a short position (SELL)?

open a short position and exit

exiting the Expert Advisor...

5. Control of the positions previously opened in the cycle

if it is a long position

should it be closed?

should the trailing stop be reset?

if it is a short position

should it be closed?

should the trailing stop be reset?

It turns out to be quite simple (loloolol ok), only 4 main blocks.

Now let us try to generate pieces of code step by step for each section of the structural scheme:

 

Hmm the problem with this is that full books can be writen on how to code it. I always try to find something similar to what I have and then switch it around a bit. MQL is just like any language, a bunch fo if's and then's you just need to know how to make it flow together

 

Hi, would appreciate if some help as to where I can start learning a simple EA and compile and run testing? I m uing MT4 platform. Thanks.

 

Hello....Hi...

I am looking lazy trading e-book and indicator...please e-mail me at : . Anybody have been tested this system before ?

 

I am new tothe metatrader world am I too am interested in learning how to code indicators myself THX

 

Hi, I been searching for with the zigzag with audio alert but seems fruitless. Can some body help and post this MT4 indicator here if it does exist. Much appreciated.

 

One more book for learning mql4: Table of Contents - MQL4 Tutorial

Reason: