View Single Post
Building EAs and MQL 101
  #1 (permalink)  
Old 10-10-2006, 10:07 PM
mforexx mforexx is offline
Freshman
 
Join Date: Oct 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
mforexx is on a distinguished road
Lightbulb 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:
Reply With Quote

Registered members have access to special online forex currency trading tools, software, mt4 expert advisors and indicators. Register now

Main Menu

Economic Forecast