JegForex - Solusi Tepat Untuk Investasi
Home Register About Forex Platforms Education Jeg Blog
» Demo Account
» Real Account
» Open Account

» JegForex Basic
» Psychologys Tading
» Indicator Trading
» MetaTrader Platform

» Learn MQL4
 

Section 1
Introduction: the uses and about MQL4.
Section 2
Simple Example of EA: the Expert Advisor, its example
Section 3
The Syntax and Basics: the variable and comments.
Section 4
Data Type: the type of data on MQL4 with examples.
Section 5
Plans and expressions: the operator and its expression in the MQL4 example.
Section 6
Decision and Looping: the use of branching and looping to set the EA program flow.
Section 7
Order and Technical Analysis: EA discusses how to create order and make use technical indicators.
Section 8
Developing EA: discuss how to prepare EA. It is expected that the reader is able to make a simple EA.
Section 9
Use iCustom: discuss how to prepare the EA based on a custom basis entry indicator.

 
JegForex Registration
JegForex Contact
JegForex Education
 

 Back to Learn MQL4

Section 3 - Syntax and Basic Things

Syntax of this MQL4 similar c / c + +.

We go one by one

1. Variable Declaration and Naming

valid:

code:
double aa;
double aaa,bbb;
double aaaa=1;
double bb,cc=2;
double a=0,b=1;
double d=2,
e=3,
f=4;

double data type that it can be replaced int, string, bool, etc.
a-f is the name variablenya.

so essentially (the most simple)

code:
tipe_data nama_variabel = value;

that are used to coding, such as the above combination can also be used

I want to be constrained even though changed by the user, just add extern
so:

code:
extern tipe_data nama_variabel = value

well, the name variable is case sensitive. Nama_Variabel different same nama_variabel

for the array, will be explained in other parts. (usually if beginners rarely use an array)

rules for naming variables:

- Max length 31 characters
- Must start uppercase, lowercase, or _ (not numbers or symbols other than _)
- Can not use the keyword

examples keyword: bool, color, extern, static, Case, Else, If, true, false and others

2. Comment

to write a comment, there are 2 ways
1. add / / at the beginning of the sentence
2. use / * * /

example

code:
stoploss int = 10; / / stoploss of trade

or

code:
/*
Stoploss filled in the point
* /
stoploss int = 10;

sentence after / / on the same line will not be read by any program and followed by / * and * / will not read by the program.

Hopefully useful to all of us ..
Click the register when you are ready!

Section 4 - Data Type: the type of data on MQL4 with examples.

 
 

 

 

 Jadikan homepage Anda | | Risk Disclosure | Contact | Links

Solusi tepat dalam investasi.
© 2010. all rights reserved
 
Sported by Polsend.com