Skip to content

Commit ce107f7

Browse files
committed
Implementacao de benchmark
1 parent f4009aa commit ce107f7

File tree

5 files changed

+110
-0
lines changed

5 files changed

+110
-0
lines changed

Experts/Benchmark/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Metatrader 5 Robots
2+
3+
4+
5+
## Bench mark
6+
7+
Este é apenas um exemplo para começar...
8+
9+
10+
1.88 KB
Binary file not shown.

Experts/Benchmark/benchmark.ico

5.3 KB
Binary file not shown.

Experts/Benchmark/benchmark.mq5

11.8 KB
Binary file not shown.

Include/Robots/Benchmark.mqh

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
//+------------------------------------------------------------------+
2+
//| Copyright 2016, MetaQuotes Software Corp. |
3+
//| https://www.mql5.com |
4+
//+------------------------------------------------------------------+
5+
6+
#property copyright "Copyright 2016, MetaQuotes Software Corp."
7+
#property link "https://www.mql5.com"
8+
#property version "1.00"
9+
10+
#include <Trade\Trade.mqh>
11+
#include <Trade\PositionInfo.mqh>
12+
#include <Framework\Base.mqh>
13+
14+
class Benchmark : public Base
15+
{
16+
private:
17+
//Price
18+
MqlRates _rates[];
19+
ENUM_TIMEFRAMES _period;
20+
21+
//Estrategia
22+
double _maxima;
23+
double _minima;
24+
25+
bool _waitBuy;
26+
bool _waitSell;
27+
int _qtdCopiedRates;
28+
29+
//Grafico
30+
color _corBuy;
31+
color _corSell;
32+
color _cor;
33+
bool _isDesenhar;
34+
bool _isEnviarParaTras;
35+
bool _isPreencher;
36+
37+
public:
38+
39+
void SetColor(color cor) {
40+
_cor = cor;
41+
}
42+
43+
void SetIsDesenhar(bool isDesenhar) {
44+
_isDesenhar = isDesenhar;
45+
}
46+
47+
void SetIsEnviarParaTras(bool isEnviarParaTras) {
48+
_isEnviarParaTras = isEnviarParaTras;
49+
}
50+
51+
void SetIsPreencher(bool isPreencher) {
52+
_isPreencher = isPreencher;
53+
}
54+
55+
void SetColorBuy(color cor) {
56+
_corBuy = cor;
57+
};
58+
59+
void SetColorSell(color cor) {
60+
_corSell = cor;
61+
};
62+
63+
void Load() {
64+
65+
};
66+
67+
void Watch() {
68+
69+
AtualizarLastPrice();
70+
71+
if (HasPositionOpen()) {
72+
GerenciarPosition();
73+
return;
74+
}
75+
76+
if (!Validar()) {
77+
return;
78+
}
79+
80+
if (GetBuffers()) {
81+
82+
ShowInfo();
83+
84+
}
85+
86+
};
87+
88+
void Desenhar(double price, color cor)
89+
{
90+
if (!_isDesenhar) {
91+
return;
92+
}
93+
}
94+
95+
bool GetBuffers() {
96+
return true;
97+
}
98+
99+
};
100+

0 commit comments

Comments
 (0)