File tree Expand file tree Collapse file tree 5 files changed +110
-0
lines changed Expand file tree Collapse file tree 5 files changed +110
-0
lines changed Original file line number Diff line number Diff line change 1+ # Metatrader 5 Robots
2+
3+ 4+
5+ ## Bench mark
6+
7+ Este é apenas um exemplo para começar...
8+
9+
10+
Original file line number Diff line number Diff line change 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+
You can’t perform that action at this time.
0 commit comments