-
Notifications
You must be signed in to change notification settings - Fork 1
/
!XPS v7 PROFIT.mq4
210 lines (177 loc) · 10.9 KB
/
!XPS v7 PROFIT.mq4
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
// +----------------------------------------------------------------------------------------+ //
// | .-._______ XARD777 _______.-. | //
// |---( )_)______) Knowledge of the ancients (______(_( )---| //
// | ( ()___) \¦/ (___() ) | //
// | ()__) (o o) (__() | //
// |--(___()_)__________________________oOOo___(_)___oOOo_________________________(_()___)--| //
// |_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|____|_____| //
// | 2011 | //
// |----------------------------------------------------------------------------------------| //
// | File: !XPS v7 PROFIT.mq4 | //
// | Programming language: MQL4 | //
// | Development platform: MetaTrader 4 | //
// | End product: THIS SOFTWARE IS FOR USE ONLY BY XARD777 | //
// | | //
// | [Xard777 Proprietory Software] | //
// +----------------------------------------------------------------------------------------+ //
#property indicator_chart_window
// ------------------------------------------------------------------------------------------ //
// E X T E R N A L V A R I A B L E S //
// ------------------------------------------------------------------------------------------ //
int Corner=1;
int Window=0;
color Warna_Text = Snow;
color Warna_Order_Sell = Orange;
color Warna_Order_Buy = DeepSkyBlue;
color Warna_Rugi = Orange;
color Warna_Laba = DeepSkyBlue;
string NamaFont = "Arial Black";
int UkuranFont = 10;
double posX = 38;
double posY = -14;
// ------------------------------------------------------------------------------------------ //
// I N T E R N A L V A R I A B L E S //
// ------------------------------------------------------------------------------------------ //
int Font=9;
int x = NULL;
// ------------------------------------------------------------------------------------------ //
// I N I T I A L I S A T I O N //
// ------------------------------------------------------------------------------------------ //
int init()
{
//---- indicators
//----
return(0);
}
// ------------------------------------------------------------------------------------------ //
// D E - I N I T I A L I S A T I O N //
// ------------------------------------------------------------------------------------------ //
int deinit()
{
//----
int idx;
if(x != NULL) {
for(idx = 0; idx<x; idx++) {
ObjectDelete("Panel242"+idx);
ObjectDelete("PL"+idx);
}
ObjectDelete("Panel241");
ObjectDelete("Panel243");
ObjectDelete("h");
ObjectDelete("Total1");
ObjectDelete("Total2");
}
ObjectsDeleteAll(0,OBJ_HLINE);
ObjectsDeleteAll(0,OBJ_TEXT);
ObjectsDeleteAll(0,OBJ_LABEL);
//----
return(0);
}
void DisplayText(string objname, string text, int fontsize, color clr, double C, double X, double Y, string font)
{
ObjectDelete(objname);
ObjectCreate(objname, OBJ_LABEL, Window, 0, 0);
ObjectSetText(objname, text, fontsize, font, clr);
ObjectSet(objname, OBJPROP_CORNER, Corner);
ObjectSet(objname, OBJPROP_XDISTANCE, X+posX);
ObjectSet(objname, OBJPROP_YDISTANCE, Y+posY);
}
// ------------------------------------------------------------------------------------------ //
// M A I N P R O C E D U R E //
// ------------------------------------------------------------------------------------------ //
int start()
{
int counted_bars=IndicatorCounted();
int j;
int idx;
string text;
double PL;
double total;
//----
if(x != NULL) {
for(idx = 0; idx<x; idx++) {
ObjectDelete("Panel242"+idx);
ObjectDelete("Panel243"+idx);
}
ObjectDelete("Total1");
ObjectDelete("Total2");
}
text = "";
j=0;
total = 0;
DisplayText("Panel241", "Trades", 12, Warna_Text, 0, -6, 20 , "Arial Black");
for (int i = OrdersTotal()-1 ; i >= 0; i--)
{
if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES) == true)
{
if(OrderType() == OP_BUY) {
DisplayText("Panel242"+j, OrderSymbol(), 12, Warna_Order_Buy, 0, 10, Font+28 + j * 18, "Arial Black");
PL = (OrderClosePrice()-OrderOpenPrice())/MarketInfo(OrderSymbol(),MODE_POINT)/10;
total = total + PL;
if(PL<0) DisplayText("Panel243"+j, DoubleToStr(PL, 0), 12, Warna_Rugi, 0, -30, Font+28 + j * 18, "Arial Black");
else if(PL>0) DisplayText("Panel243"+j, "+"+DoubleToStr(PL, 0), 12, Warna_Laba, 0, -30, Font+28 + j * 18, "Arial Black");
else DisplayText("Panel243"+j, DoubleToStr(PL, 0), 12, Warna_Text, 0, -30, Font+28 + j * 18, "Arial Black");
}
else if(OrderType() == OP_SELL) {
DisplayText("Panel242"+j, OrderSymbol(), 12, Warna_Order_Sell, 0, 10, Font+28 + j * 18, "Arial Black");
PL = (OrderOpenPrice()-OrderClosePrice())/MarketInfo(OrderSymbol(),MODE_POINT)/10;
total = total + PL;
if(PL<0) DisplayText("Panel243"+j, DoubleToStr(PL, 0), 12, Warna_Rugi, 0, -30, Font+28 + j * 18, "Arial Black");
else if(PL>0) DisplayText("Panel243"+j,"+"+DoubleToStr(PL, 0), 12, Warna_Laba, 0, -30, Font+28 + j * 18, "Arial Black");
else DisplayText("Panel243"+j,DoubleToStr(PL, 0), 12, Warna_Text, 0, -30, Font+28 + j * 18, "Arial Black");
}
j=j+1;
}
}
DisplayText("Total1","Total", 12, Warna_Text, 0, 25, Font+28 + j * 18, "Arial Black");
if(total<0) DisplayText("Total2", DoubleToStr(total, 0), 12, Warna_Rugi, 0, -30, Font+28 + j * 18, "Arial Black");
else if (total>0) DisplayText("Total2","+" + DoubleToStr(total, 0), 12, Warna_Laba, 0, -30, Font+28 + j * 18, "Arial Black");
else DisplayText("Total2", DoubleToStr(total, 0), 12, White, 0, -30, Font+28 + j * 18, "Arial Black");
x=j;
return(0);
}
// ------------------------------------------------------------------------------------------ //
// E N D P R O G R A M //
// ------------------------------------------------------------------------------------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