-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDeals.mqh
57 lines (48 loc) · 2.09 KB
/
Deals.mqh
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
//+------------------------------------------------------------------+
//| Deals.mqh |
//| Copyright 2022, Homma.tech |
//| https://www.homma.tech |
//+------------------------------------------------------------------+
#property copyright "Copyright 2022, Homma.tech"
#property link "https://www.homma.tech"
#property version "1.00"
#include "Operations.mqh"
class CDeals : public COperations {
private:
public:
TRADE_TYPE CDeals :: HistoryDealType(int shift);
double CDeals :: HistoryDealPrice(int shift);
CDeals();
~CDeals();
};
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
CDeals::CDeals() {
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
CDeals::~CDeals() {
}
//+------------------------------------------------------------------+
//| Get deal type function |
//+------------------------------------------------------------------+
TRADE_TYPE CDeals :: HistoryDealType(int shift) {
ulong ticket;
ticket = PastOperationTicket(shift);
if(HistoryDealGetInteger(ticket, DEAL_TYPE) == DEAL_TYPE_BUY)
return BUY;
if(HistoryDealGetInteger(ticket, DEAL_TYPE) == DEAL_TYPE_SELL)
return SELL;
return NOTHING;
}
//+------------------------------------------------------------------+
//| Get deal price function |
//+------------------------------------------------------------------+
double CDeals :: HistoryDealPrice(int shift) {
ulong ticket;
ticket = PastOperationTicket(shift);
return HistoryDealGetDouble(ticket, DEAL_PRICE);
}
//+------------------------------------------------------------------+