-
Notifications
You must be signed in to change notification settings - Fork 1
/
EA_HGNR_V.2.1_GU.mq4
90 lines (84 loc) · 3.31 KB
/
EA_HGNR_V.2.1_GU.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
/*
Generated by EX4-TO-MQ4 decompiler V4.0.224.1 []
Website: http://purebeam.biz
E-mail : [email protected]
*/
#property copyright "Copyright © 2009, High Gain No Risk"
#property link "http://www.highgainnorisk.com"
int gi_76 = 12;
int gi_80 = 8;
int g_slippage_84 = 2;
int g_magic_88 = 11111;
int gi_92 = 200;
int gi_unused_96 = 6;
int gi_unused_100 = 11;
double gd_104 = 0.01;
double gd_unused_112 = 0.03;
double gd_unused_120 = -0.01;
double gd_unused_128 = 20.0;
double gd_unused_136 = 203.0;
double g_ord_open_price_152;
double g_ord_open_price_160;
double g_lots_168;
string gs_200 = "EU";
string g_comment_208 = "GU";
string gs_unused_216 = "UJ";
string g_comment_224 = "EA_Off";
int g_count_232;
int g_count_236;
int gi_244;
int gi_unused_256 = 0;
int gi_unused_260 = 0;
int gi_unused_264 = 0;
int gi_unused_268 = 0;
bool gi_276;
bool gi_280;
int gi_284 = 000000;
int init() {
OrderSend(Symbol(), OP_BUYSTOP, 0.01, Ask + 500.0 * Point, 5, 0, 0, g_comment_208, g_magic_88, 0, Blue);
return (0);
}
int deinit() {
OrderSend(Symbol(), OP_BUYSTOP, 0.01, Ask + 500.0 * Point, 5, 0, 0, g_comment_224, g_magic_88, 0, Blue);
return (0);
}
int start() {
int li_unused_12;
int li_0 = AccountEquity();
double ld_4 = li_0 % gi_92;
gi_244 = (li_0 - ld_4) / gi_92;
g_lots_168 = NormalizeDouble(gd_104 * gi_244, Digits);
if (g_lots_168 < gd_104) g_lots_168 = gd_104;
g_lots_168 = gd_104;
if (myComment()) li_unused_12 = 0;
g_count_232 = 0;
g_count_236 = 0;
gi_276 = FALSE;
gi_280 = FALSE;
for (int l_pos_16 = 0; l_pos_16 <= OrdersTotal() - 1; l_pos_16++) {
OrderSelect(l_pos_16, SELECT_BY_POS, MODE_TRADES);
if (OrderType() == OP_BUY && OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_88 && OrderComment() == g_comment_208) {
g_count_232++;
g_ord_open_price_152 = OrderOpenPrice();
}
if (OrderType() == OP_SELL && OrderSymbol() == Symbol() && OrderMagicNumber() == g_magic_88 && OrderComment() == g_comment_208) {
g_count_236++;
g_ord_open_price_160 = OrderOpenPrice();
}
if (OrderMagicNumber() == g_magic_88 && OrderComment() == gs_200) gi_276 = TRUE;
if (OrderType() == OP_BUYSTOP && OrderMagicNumber() == g_magic_88 && OrderComment() == g_comment_208) gi_280 = TRUE;
}
if (gi_276 == FALSE) Alert("EA pada pair EUR/USD belum siap!");
if (OrdersTotal() == 0 || (gi_280 != TRUE && g_count_232 + g_count_236 < 1)) OrderSend(Symbol(), OP_BUYSTOP, 0.01, Ask + 500.0 * Point, 5, 0, 0, g_comment_208, g_magic_88, 0, Blue);
if (IzinTrade() && g_count_232 == 0 || (g_count_232 > 0 && Bid <= g_ord_open_price_152 - gi_80 * Point)) OrderSend(Symbol(), OP_BUY, g_lots_168, Ask, g_slippage_84, 0, Ask + gi_76 * Point, g_comment_208, g_magic_88, 0, Blue);
if (IzinTrade() && g_count_236 == 0 || (g_count_236 > 0 && Ask >= g_ord_open_price_160 + gi_80 * Point)) OrderSend(Symbol(), OP_SELL, g_lots_168, Bid, g_slippage_84, 0, Bid - gi_76 * Point, g_comment_208, g_magic_88, 0, Red);
return (0);
}
int IzinTrade() {
//if ((Day() > 26 && Month() >= 12 && Year() >= 2009) || IsDemo() || AccountNumber() != gi_284 || IsTesting() || gi_276 != TRUE) return (0);
return (1);
}
bool myComment() {
Comment("EA_HGNR_V.2");
return (FALSE);
}