-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathExpert_Conta_Ticks.mq5
45 lines (36 loc) · 2.68 KB
/
Expert_Conta_Ticks.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
//+------------------------------------------------------------------+
//| |
//| CONTADOR DE TICKS |
//| |
//+------------------------------------------------------------------+
// VARIAVEIS DO CONTADOR
int BidCounter;
int AskCounter;
// VARIAVEIS DE CONTROLE
double BidControl;
double AskControl;
// VARIAVEIS QUE RECEBEM OS TICKS
double Ask;
double Bid;
//+------------------------------------------------------------------+
//| ON-TICKS |
//+------------------------------------------------------------------+
void OnTick()
{
// ASK - PEGA O VALOR DO ASK DO SIMBOLO CORRENTE
Ask = NormalizeDouble(SymbolInfoDouble(_Symbol, SYMBOL_ASK), _Digits);
// BID - PEGA O VALOR DO BID DO SIMBOLO CORRENTE
Bid = NormalizeDouble(SymbolInfoDouble(_Symbol, SYMBOL_BID), _Digits);
// BID - CONTADOR
if(BidControl!=Bid)
{
BidCounter++;
Print(" Numero do Tick = ", BidCounter," Tick Bid = ", Bid);
}
// ASK - CONTADOR
if(AskControl!=Ask)
{
AskCounter++;
Print(" Numero do Tick = ", AskCounter," Tick Ask = ", Ask);
}
} // FECHA ONTICK