Section 4 - Data Types
In MQL4 have 7 types of data:
1. Integer (int)
= Integer number not use commas, up from -2 billion
+2 billion
code:
int A=1;
2. Boolean (bool)
Boolean values can only be right or wrong (true or false)
code:
bool SpreadProtection=true;
3. Character (int)
Char This content is only 1 letter / symbol only, use
the declaration to int, because the stored number is
an ascii
code:
int char1='A';
only 1 letter, and followed by quotation marks 1
4. String (string)
String = sentence/words
code:
string commentOrder="Order by EA1";
use the words in quotes ( ")
5. Double (double)
with the exact same integer, only to double this number
using commas
code:
double Lot=0.1; 6. Color (color)
Color is a color save information ...
function-function Those parameters have a certain color,
to set the arrow color chart its ....
for example OrderSend
code:
color WarnaBuy=Red;
OrderSend(Symbol(),OP_BUY,1,Ask,3,Ask-25*Point,Ask+25*Point,"My
order #2",16384,0,WarnaBuy);
color is most easily written it (Red, Blue, Green,
etc.), or use of the RGB integer value to its .. but
I like colors are quite common, is not it only charting
a course, not the painting. Color options can be set
in the colors on the Web - MQL4 Documentation
7. Datetime (datetime)
Datetime to save this date and time information to
a variable Eg
code:
datetime expiredEA=D'31.12.2007 00:00:00'; if (TimeCurrent()>expiredEA)
{ Print("maap, EA sudah expired"); } function
above, the time now with the date and time expired EA
stored in a variable ...
besides, usually datetime is used to set the expire
time of the order pending
D'dd format. mm.yy HH: MM: SS '
Hopefully useful to all
of us ..
Click the register when
you are ready!
Section
5 - Plans and expressions: the operator and its expression
in the MQL4 example.
|