Skip to content

Commit 14f79ef

Browse files
authored
Merge pull request #6 from erlonfs/develop
Renames and replaces
2 parents e2d9868 + 9b0923c commit 14f79ef

File tree

10 files changed

+183
-183
lines changed

10 files changed

+183
-183
lines changed

Experts/Benchmark/benchmark.mq5

400 Bytes
Binary file not shown.
410 Bytes
Binary file not shown.
402 Bytes
Binary file not shown.
346 Bytes
Binary file not shown.

Include/Framework/Base.mqh

-54 Bytes
Binary file not shown.

Include/Framework/Enum.mqh

-56 Bytes
Binary file not shown.

Include/Robots/Benchmark.mqh

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//| https://github.com/erlonfs |
44
//+------------------------------------------------------------------+
55

6-
#property copyright "Copyright 2016, Erlon F. Souza"
6+
#property copyright "Copyright 2017, Erlon F. Souza"
77
#property link "https://github.com/erlonfs"
88
#property version "1.00"
99

@@ -29,6 +29,23 @@ private:
2929
bool _isDesenhar;
3030
bool _isEnviarParaTras;
3131
bool _isPreencher;
32+
33+
void Draw()
34+
{
35+
if (!_isDesenhar) {
36+
return;
37+
}
38+
39+
//Drawn something
40+
41+
}
42+
43+
bool GetBuffers() {
44+
45+
//Get Buffers
46+
47+
return true;
48+
}
3249

3350
public:
3451

@@ -60,9 +77,9 @@ public:
6077

6178
};
6279

63-
void Watch() {
80+
void Execute() {
6481

65-
AtualizarLastPrice();
82+
RefreshLastPrice();
6683

6784
if (HasPositionOpen()) {
6885
ManagePosition();
@@ -81,22 +98,5 @@ public:
8198

8299
};
83100

84-
void Desenhar()
85-
{
86-
if (!_isDesenhar) {
87-
return;
88-
}
89-
90-
//Drawn something
91-
92-
}
93-
94-
bool GetBuffers() {
95-
96-
//Get Buffers
97-
98-
return true;
99-
}
100-
101101
};
102102

-50 Bytes
Binary file not shown.

Include/Robots/FirstCandle.mqh

Lines changed: 66 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -33,70 +33,7 @@ private:
3333
bool _isDesenhar;
3434
bool _isEnviarParaTras;
3535
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-
ManagePosition();
73-
return;
74-
}
75-
76-
if (!Validate()) {
77-
return;
78-
}
79-
80-
if (GetBuffers()) {
81-
82-
ExcluirDesenho(_maxima);
83-
ExcluirDesenho(_minima);
84-
85-
if (FindCondition()) {
86-
Desenhar(_minima, _corSell);
87-
Desenhar(_maxima, _corBuy);
88-
89-
VerifyStrategy(ORDER_TYPE_BUY);
90-
VerifyStrategy(ORDER_TYPE_SELL);
91-
}
92-
93-
SetInfo("COMPRA " + (string)_maxima + " VENDA " + (string)_minima);
94-
ShowInfo();
95-
96-
}
97-
98-
};
99-
36+
10037
void VerifyStrategy(int order) {
10138

10239
if (order == ORDER_TYPE_BUY) {
@@ -170,7 +107,7 @@ public:
170107

171108
}
172109

173-
void Desenhar(double price, color cor)
110+
void Draw(double price, color cor)
174111
{
175112

176113
if (!_isDesenhar) {
@@ -198,7 +135,7 @@ public:
198135
ObjectSetString(0, objName, OBJPROP_TEXT, "ENTRADA EM " + (string)price);
199136
}
200137

201-
void ExcluirDesenho(double price) {
138+
void ClearDraw(double price) {
202139

203140
if (!_isDesenhar) {
204141
return;
@@ -234,5 +171,68 @@ public:
234171

235172
}
236173

174+
public:
175+
176+
void SetColor(color cor) {
177+
_cor = cor;
178+
}
179+
180+
void SetIsDesenhar(bool isDesenhar) {
181+
_isDesenhar = isDesenhar;
182+
}
183+
184+
void SetIsEnviarParaTras(bool isEnviarParaTras) {
185+
_isEnviarParaTras = isEnviarParaTras;
186+
}
187+
188+
void SetIsPreencher(bool isPreencher) {
189+
_isPreencher = isPreencher;
190+
}
191+
192+
void SetColorBuy(color cor) {
193+
_corBuy = cor;
194+
};
195+
196+
void SetColorSell(color cor) {
197+
_corSell = cor;
198+
};
199+
200+
void Load() {
201+
202+
};
203+
204+
void Execute() {
205+
206+
RefreshLastPrice();
207+
208+
if (HasPositionOpen()) {
209+
ManagePosition();
210+
return;
211+
}
212+
213+
if (!Validate()) {
214+
return;
215+
}
216+
217+
if (GetBuffers()) {
218+
219+
ClearDraw(_maxima);
220+
ClearDraw(_minima);
221+
222+
if (FindCondition()) {
223+
Draw(_minima, _corSell);
224+
Draw(_maxima, _corBuy);
225+
226+
VerifyStrategy(ORDER_TYPE_BUY);
227+
VerifyStrategy(ORDER_TYPE_SELL);
228+
}
229+
230+
SetInfo("COMPRA " + (string)_maxima + " VENDA " + (string)_minima);
231+
ShowInfo();
232+
233+
}
234+
235+
};
236+
237237
};
238238

0 commit comments

Comments
 (0)