-
Notifications
You must be signed in to change notification settings - Fork 0
/
07_Assignment_Operator.mq4
29 lines (24 loc) · 1.02 KB
/
07_Assignment_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
//+------------------------------------------------------------------+
//| 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(){
// assignment operator dalam bahasa MQL4
// =, +=, -=, *=, /=, %=
Alert("");
// Penggunaan assignment operator untuk menghitung profit
double totalProfit = 1000.00;
double tradeProfit = 20.0;
totalProfit += tradeProfit;
Alert("Profit yang anda peroleh: $", totalProfit);
// Penggunaan assignment operator untuk menghitung loss
totalProfit = 1000.00;
double tradeLoss = -20.0;
totalProfit += tradeLoss;
Alert("Loss! Saldo tersisa: $", totalProfit);
}