-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path08_Relational_Operator.mq4
43 lines (35 loc) · 1.18 KB
/
08_Relational_Operator.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
//+------------------------------------------------------------------+
//| Test.mq4 |
//| Copyright 2021, Maulana Aji Wicaksono |
//| https://www.instagram.com/aw.design30 |
//+------------------------------------------------------------------+
#property copyright "Copyright 2021, Maulana Aji Wicaksono"
#property link "https://www.instagram.com/aw.design30"
#property version "1.00"
#property strict
void OnStart(){
// relational operator (perbandingan) dalam bahasa MQL4
// ==, !=, <, >, <=, >=
Alert("");
int a = 2;
int b = 2;
bool hasil;
// Persamaan (==)
hasil = bool(a == 2);
Alert(a, " == ", b, " ", hasil);
// Pertidaksamaan (!=)
hasil = bool(a != 2);
Alert(a, " != ", b, " ", hasil);
// Kurang dari (<)
hasil = bool(a < 2);
Alert(a, " < ", b, " ", hasil);
// Lebih dari (>)
hasil = bool(a > 2);
Alert(a, " > ", b, " ", hasil);
// Kurang dari (<=)
hasil = bool(a <= 2);
Alert(a, " <= ", b, " ", hasil);
// Kurang dari (>=)
hasil = bool(a >= 2);
Alert(a, " >= ", b, " ", hasil);
}