-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBar.mqh
More file actions
43 lines (42 loc) · 3.48 KB
/
Copy pathBar.mqh
File metadata and controls
43 lines (42 loc) · 3.48 KB
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
//+------------------------------------------------------------------+
//| Bar.mqh |
//| Copyright 2022, André Hoogendoorn |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2022, André Hoogendoorn"
#property link "https://www.mql5.com"
#property version "1.00"
class CBar
{
private:
ENUM_TIMEFRAMES m_tf;
string m_sym;
datetime m_p;
public:
CBar(ENUM_TIMEFRAMES timeframe = PERIOD_CURRENT, string symbol = NULL);
~CBar();
bool New();
};
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
CBar::CBar(ENUM_TIMEFRAMES timeframe = PERIOD_CURRENT, string symbol = NULL)
{
m_tf = timeframe;
m_sym = symbol == NULL ? _Symbol : symbol;
m_p = iTime(m_sym, m_tf, 0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
CBar::~CBar()
{
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
bool CBar::New()
{
return m_p != (m_p = iTime(m_sym, m_tf, 0));
}
//+------------------------------------------------------------------+