-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathChartFullSet.mq5
32 lines (31 loc) · 1.24 KB
/
ChartFullSet.mq5
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
//+------------------------------------------------------------------+
//| ChartFullSet.mq5 |
//| Copyright 2021, MetaQuotes Ltd. |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#include <MQL5Book/ChartModeMonitor.mqh>
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
void OnStart()
{
int flags[1000];
// prepare array with values covering all properties
for(int i = 0; i < ArraySize(flags); ++i)
{
flags[i] = i;
}
// only existing properies will be attached to the monitor
ChartModeMonitor m(flags);
// make a backup and show total number of properties
PrintFormat("Total number of properties: %d", m.backup());
// monitor changes utill the script is stopped
while(!IsStopped())
{
m.snapshot();
Sleep(500);
}
// restore properties from backup
m.restore();
}
//+------------------------------------------------------------------+