-
Notifications
You must be signed in to change notification settings - Fork 1
/
CandleCountdown.mq5
82 lines (70 loc) · 5.71 KB
/
CandleCountdown.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
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
//+------------------------------------------------------------------+
//| SimpleClock.mq5 |
//| Abraão Moreira |
//| abraaol.moreira@outlook.com |
//+------------------------------------------------------------------+
#property copyright "Abraão Moreira"
#property link "abraaol.moreira@outlook.com"
#property version "2.00"
#property indicator_chart_window
#include <CandleClock.mqh>
input color in_color = clrGray; //Cor do relógio
input string in_font = "Arial"; //Fonte
input int in_fontSize = 10; //Tamanho da fonte
input clockStyle swapStyle = comment; //Tipo de exibição
int offsetX = 100;
int offsetY = 10;
CCandleClock *candleCountdown;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//| Create a label object |
//+------------------------------------------------------------------+
int OnInit() {
candleCountdown = new CCandleClock;
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void OnDeinit(const int reason) {
delete candleCountdown;
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
const int prev_calculated,
const datetime &time[],
const double &open[],
const double &high[],
const double &low[],
const double &close[],
const long &tick_volume[],
const long &volume[],
const int &spread[]) {
int x, y;
ArraySetAsSeries(time, true);
ArraySetAsSeries(close, true);
switch(swapStyle) {
case comment:
candleCountdown.CreateComment();
break;
case onPrice:
candleCountdown.CreateOnPrice(10,
10,
in_font,
in_fontSize,
in_color);
break;
case bigNumber:
candleCountdown.CreateBigNumber(10,
2,
in_font,
in_fontSize,
in_color);
break;
}
candleCountdown.CountdownUpdate();
return(rates_total);
}
//+------------------------------------------------------------------+