forked from Lucas170/Chapter-2-All-Files
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MyPracticeScript_Syntax.mq4
69 lines (48 loc) · 1.63 KB
/
MyPracticeScript_Syntax.mq4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//+------------------------------------------------------------------+
//| MyPracticeScript_Syntax.mq4 |
//| Copyright 2014, MetaQuotes Software Corp. |
//| http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2014, MetaQuotes Software Corp."
#property link "http://www.mql5.com"
#property version "1.00"
#property strict
// Created by Lucas Liew
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
void OnStart()
{
//---
// ---------- Comments ----------
// This is a comment
/*
int x = 5;
Print(x); // This is a comment
*/
// ------------- Format -----------
int x = 5;
Print(x); // This is a comment
// ----------- Identifiers -------------
/*
Identifiers: Names we give to variables, constants or function.
*/
int hello = 10;
int hello1 = 100;
Print(hello1);
/*
Rules to naming:
1) 31 char max
2) Can only contain digits 0-9, letters, and underscore
3) Cannot start with a digit
4) Case sensitive
5) Cannot use a Reserved Word
*/
int _hello = 10;
int _HELLO = 100;
int _HELLO_ALL_I_COME_FROM_EARTH_IN_PEACE_HAHA_NO_NOT_REALLY_WAIT_WHAT;
int What!isThis = 2;
int Print;
int if;
}
//+------------------------------------------------------------------+