-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path05_Menghitung_Pips.mq4
27 lines (22 loc) · 1.07 KB
/
05_Menghitung_Pips.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
//+------------------------------------------------------------------+
//| 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(){
// Membuat contoh program menghitung pips
// harga tertinggi - harga terendah
double entryPrice = 1.75241;
double exitPrice = 1.75741;
// nilai pip = 0.0001
double pipValue = 0.0001;
// selisih harga tertinggi - harga terendah / nilai pip
//double pipGenerated = (exitPrice - entryPrice) / pipValue; // Hasilnya 49.9999
// Menggunakan fungsi MathRound() untuk membulatkan hasilnya menjadi 50
double pipGenerated = MathRound((exitPrice - entryPrice) / pipValue);
Alert("Nilai pip adalah ", pipGenerated);
}