ส่วนของโค๊ดนะครับพอดีติดต่อผู้เขียนแล้วแต่ไม่รับการตอบกลับแต่อย่างใด เลยอยากให้แก้ไขโค๊ดให้ทำงานได้ในบัญชีจริงด้วยครับ
ท่านผลการทดสอบแบคเทสผ่าน โรโบฟอเรก นั้น 5 จุด ทำกำไรได้น่าตกใจในหลายๆ คู่เงินครับ ดีที่สุด EU ,Uj เพราะสเปรดน้อย ปิดเปิดไว
รบกวนผู้เชี่ยวชาญทุกท่านช่วยแก้โค๊ดให้หน่อยนะครับ ขอบคุณมากครับ และลองทดสอบฟอวาร์ดเทสดูนะครับ ผลการทำงานดีน่าใจหาย เอาไปใช้ได้เลย
/*
G e n e r a t e d by ex4-to-mq4 decompiler FREEWARE 4.0.509.5
Website: h t T P: / /W w w.m e ta qU O te S .N E t
E-mail : s uppO rT @ m et a q U Ot e s .NeT
*/
#property copyright "Kinga Kovacs"
#property link "kingask2013@gmail.com"
extern string Note = "Free to use on REAL accounts. Contact us!";
extern string Contact = "kingask2013@gmail.com or Skype: xperya";
extern string Web = "
http://mt4robots.blogspot.com";
extern string Important1 = "Use default setting with leverage 1:500!";
extern string Important2 = "Use on any time frame. But do NOT move between time frames.";
extern string Currency = "Any currency pair. Attach this EA to any numbers of chart.";
int G_acc_number_124 = 1111;
extern string EA_Setting = "------ EA Setting ------";
extern int MaxSpreads_Points = 1000;
int G_magic_140 = 99999;
int G_magic_144;
extern bool AutomaticCalculateMagic = TRUE;
extern bool Enabel_ECN_Broker = TRUE;
extern bool Enable_5Digit_Broker = TRUE;
extern bool KeepTrading = TRUE;
extern string Hidden_Pending_Setting = "------ Hidden Pending Setting ------";
extern int Hidden_Pending_Distane_Pips = 10;
bool Gi_176 = TRUE;
int Gi_180 = 1;
string Gs_unused_184 = " ----- News Setting -----";
int Gi_unused_192 = 2;
bool Gi_196 = FALSE;
bool Gi_200 = TRUE;
int Gi_204 = 3;
int Gi_208 = 5;
int Gi_212 = 0;
bool Gi_216 = TRUE;
bool Gi_220 = TRUE;
bool Gi_224 = FALSE;
bool Gi_228 = FALSE;
bool Gi_232 = FALSE;
bool Gi_236 = FALSE;
bool Gi_240 = FALSE;
bool Gi_244 = FALSE;
bool Gi_248 = FALSE;
int Gi_252 = 1;
int Gi_256 = 1;
bool Gi_260 = TRUE;
bool Gi_264 = FALSE;
bool Gi_268 = TRUE;
int Gi_272 = 1;
int Gi_276 = 20;
int Gi_280 = 20;
string Gs_unused_284 = " ----- Trarget Profit and Steps Setting -----";
double Gd_292 = 0.05;
double Gd_300 = 0.05;
int Gi_308 = 0;
extern string Lot_Settings = " ----- Lots size & Auto Lots Setting -----";
extern double LotSize = 0.1;
extern double MaxLot = 30.0;
extern bool AutoLot = TRUE;
extern double Amount_Per_baseLot = 100.0;
int G_slippage_348 = 3;
string Gs_buyline_352 = "buyline";
string Gs_sellline_360 = "sellline";
int G_datetime_368;
double Gd_372;
double Gd_380;
double Gd_388;
double Gd_396;
int G_count_404 = 0;
int Gi_408;
string Gsa_412[];
bool Gi_416 = TRUE;
double Gd_428;
double Gd_436;
bool Gi_444 = FALSE;
bool Gi_448 = TRUE;
bool Gi_452 = FALSE;
// E37F0136AA3FFAF149B351F6A4C948E9
int init() {
if (Enable_5Digit_Broker) {
Hidden_Pending_Distane_Pips = 10 * Hidden_Pending_Distane_Pips;
G_slippage_348 = 10 * G_slippage_348;
}
Gi_408 = TimeCurrent() - 5;
f0_6();
if (AutomaticCalculateMagic) G_magic_144 = f0_11();
else G_magic_144 = G_magic_140;
if ((!IsDemo()) && AccountCompany() != "FxPro Financial Services Ltd") {
Alert("If you want use this EA for free please contact kingask2013@gmail.com or Skype: xperya");
Gi_416 = FALSE;
}
if ((!IsDemo()) && AccountCompany() == "FxPro Financial Services Ltd" && AccountNumber() != G_acc_number_124) {
Alert("If you want use this EA for free please contact kingask2013@gmail.com or Skype: xperya");
Gi_416 = FALSE;
}
if (ObjectFind(Gs_buyline_352) != -1) ObjectDelete(Gs_buyline_352);
if (ObjectFind(Gs_sellline_360) != -1) ObjectDelete(Gs_sellline_360);
return (0);
}
// 52D46093050F38C27267BCE42543EF60
int deinit() {
if (ObjectFind(Gs_buyline_352) != -1) ObjectDelete(Gs_buyline_352);
if (ObjectFind(Gs_sellline_360) != -1) ObjectDelete(Gs_sellline_360);
return (0);
}
// EA2B2676C28C0DB26D39331A336C6B92
int start() {
int icustom_0;
int Li_4;
int Li_8;
int Li_12;
double Ld_16;
double Ld_24;
if (Gi_416) {
if (Gi_196 && Gi_448) {
if (Gi_200) {
icustom_0 = iCustom(NULL, 0, "FFCal_04", Gi_252, Gi_256, Gi_260, Gi_264, 1, Gi_216, Gi_220, Gi_236, Gi_240, Gi_232, Gi_224, Gi_244, Gi_228, Gi_248, Gi_268, Gi_272,
Gi_276, Gi_280, 1, 0);
if (icustom_0 >= Gi_204 && icustom_0 <= Gi_208 && (!Gi_444)) {
Print("make set");
Gd_428 = Ask + Hidden_Pending_Distane_Pips * Point;
Gd_436 = Bid - Hidden_Pending_Distane_Pips * Point;
f0_13(Gs_buyline_352, Gd_428);
f0_13(Gs_sellline_360, Gd_436);
G_datetime_368 = TimeCurrent();
Gi_444 = TRUE;
}
} else {
icustom_0 = iCustom(NULL, 0, "FFCal_04", Gi_252, Gi_256, Gi_260, Gi_264, 1, Gi_216, Gi_220, Gi_236, Gi_240, Gi_232, Gi_224, Gi_244, Gi_228, Gi_248, Gi_268, Gi_272,
Gi_276, Gi_280, 1, 1);
if (icustom_0 <= Gi_212 && (!Gi_444)) {
Print("make set");
Gd_428 = Ask + Hidden_Pending_Distane_Pips * Point;
Gd_436 = Bid - Hidden_Pending_Distane_Pips * Point;
f0_13(Gs_buyline_352, Gd_428);
f0_13(Gs_sellline_360, Gd_436);
G_datetime_368 = TimeCurrent();
Gi_444 = TRUE;
}
}
} else {
if (!Gi_444) {
Print("make set");
Gd_428 = Ask + Hidden_Pending_Distane_Pips * Point;
Gd_436 = Bid - Hidden_Pending_Distane_Pips * Point;
f0_13(Gs_buyline_352, Gd_428);
f0_13(Gs_sellline_360, Gd_436);
G_datetime_368 = TimeCurrent();
Gi_444 = TRUE;
}
}
if (!(Gi_444)) return (0);
Li_4 = f0_12();
Li_8 = f0_0();
Li_12 = f0_3();
if (Li_4 == 0 && Li_8 == 0) {
if (NormalizeDouble(Ask - Bid, Digits) < NormalizeDouble(MaxSpreads_Points * Point, Digits))
if (Ask >= Gd_428) f0_8();
if (Bid <= Gd_436) f0_9();
}
if (Li_4 == 1 && Li_8 == 0) f0_1();
if (Gi_176) {
if (TimeCurrent() >= G_datetime_368 + 60 * Gi_180) {
if (Li_12 == 0) {
Print("1");
if (ObjectFind(Gs_buyline_352) != -1) ObjectDelete(Gs_buyline_352);
if (ObjectFind(Gs_sellline_360) != -1) ObjectDelete(Gs_sellline_360);
Gi_444 = FALSE;
if (Li_8 > 0) {
if (KeepTrading) Gi_448 = TRUE;
else Gi_448 = FALSE;
}
}
}
}
if (Li_12 == 0) {
if (Li_8 > 0) {
Print("2");
if (ObjectFind(Gs_buyline_352) != -1) ObjectDelete(Gs_buyline_352);
if (ObjectFind(Gs_sellline_360) != -1) ObjectDelete(Gs_sellline_360);
Gi_444 = FALSE;
if (KeepTrading) Gi_448 = TRUE;
else Gi_448 = FALSE;
}
} else {
Ld_16 = f0_5();
if (f0_7()) {
Ld_24 = f0_10();
if (!Gi_452) {
Gd_372 = Gd_292 * Ld_16;
Gd_388 = Gd_372;
Gd_396 = Gd_300 * Ld_16;
Gi_452 = TRUE;
}
if (Ld_24 > Gd_372) {
Gd_372 = Ld_24;
Print("trade profit ", Gd_372);
if (G_count_404 > 0) Gd_380 = Gd_372 - Gd_396;
}
if (G_count_404 == 0 && Gd_372 - Gd_388 >= Gd_396) {
Gd_380 = Gd_372 - Gd_396;
Print("profit for close ", Gd_380);
Print("add step ");
G_count_404++;
}
if (G_count_404 > 0 && Ld_24 <= Gd_380) {
f0_2();
Print("close with profit", Gd_380);
G_count_404 = 0;
Gi_452 = FALSE;
}
}
}
return (0);
}
}
// FFCAA643B493573EC6A0A6AFE59C37B8
void f0_13(string A_name_0, double Ad_8) {
string name_16 = A_name_0;
if (ObjectFind(name_16) != -1) {
ObjectMove(name_16, 0, Time[0], Ad_8);
return;
}
ObjectCreate(name_16, OBJ_HLINE, 0, 0, Ad_8);
ObjectSet(name_16, OBJPROP_COLOR, Blue);
ObjectSet(name_16, OBJPROP_STYLE, STYLE_SOLID);
ObjectSet(name_16, OBJPROP_WIDTH, 1);
ObjectSet(name_16, OBJPROP_BACK, TRUE);
}
// 2208AB04CCD91A8303FE0D7679EA198F
void f0_2() {
while (f0_3() > 0) {
for (int pos_0 = 0; pos_0 < OrdersTotal(); pos_0++) {
if (OrderSelect(pos_0, SELECT_BY_POS, MODE_TRADES)) {
if (OrderSymbol() == Symbol() && OrderType() <= OP_SELL && OrderMagicNumber() == G_magic_144) {
if (OrderType() == OP_BUY) OrderClose(OrderTicket(), OrderLots(), Bid, G_slippage_348, Black);
if (OrderType() == OP_SELL) OrderClose(OrderTicket(), OrderLots(), Ask, G_slippage_348, Black);
}
}
}
}
}
// 5E6381046EEFD4FF2270BD9B9CB2DF3A
int f0_5() {
int Li_ret_0 = NormalizeDouble(f0_4() / MarketInfo(Symbol(), MODE_MINLOT), 0);
return (Li_ret_0);
}
// 00B85795831A6FEF4DF6C8A164D0D548
int f0_0() {
int count_0 = 0;
for (int pos_4 = 0; pos_4 < OrdersHistoryTotal(); pos_4++) {
if (OrderSelect(pos_4, SELECT_BY_POS, MODE_HISTORY)) {
if (OrderSymbol() == Symbol() && OrderType() <= OP_SELL)
if (OrderMagicNumber() == G_magic_144 && OrderOpenTime() >= G_datetime_368) count_0++;
}
}
return (count_0);
}
// 17D772DE8C0915B0BB0EBDD567883DF7
void f0_1() {
for (int pos_0 = 0; pos_0 < OrdersTotal(); pos_0++) {
if (OrderSelect(pos_0, SELECT_BY_POS, MODE_TRADES)) {
if (OrderSymbol() == Symbol() && OrderType() <= OP_SELL && OrderMagicNumber() == G_magic_144) {
if (OrderType() == OP_BUY) {
if (Bid <= Gd_436)
if (OrderClose(OrderTicket(), OrderLots(), Bid, G_slippage_348, Black)) break;
}
if (OrderType() == OP_SELL) {
if (Ask >= Gd_428)
if (OrderClose(OrderTicket(), OrderLots(), Ask, G_slippage_348, Black)) break;
}
}
}
}
}
// 33206DE718A258471B12F91D380A844C
int f0_3() {
int count_0 = 0;
for (int pos_4 = 0; pos_4 < OrdersTotal(); pos_4++) {
if (OrderSelect(pos_4, SELECT_BY_POS, MODE_TRADES)) {
if (OrderSymbol() == Symbol() && OrderType() <= OP_SELL)
if (OrderMagicNumber() == G_magic_144) count_0++;
}
}
return (count_0);
}
// EBF10DC6D0336C6D28DD08CBCA76C625
int f0_12() {
int count_0 = 0;
for (int pos_4 = 0; pos_4 < OrdersTotal(); pos_4++) {
if (OrderSelect(pos_4, SELECT_BY_POS, MODE_TRADES)) {
if (OrderSymbol() == Symbol() && OrderType() <= OP_SELL)
if (OrderMagicNumber() == G_magic_144 && OrderOpenTime() >= G_datetime_368) count_0++;
}
}
return (count_0);
}
// A5475BEEA729819A4699A3F14CBC7B39
void f0_8() {
int error_4;
int ticket_0 = 0;
bool Li_8 = TRUE;
while (Li_8) {
RefreshRates();
ticket_0 = OrderSend(Symbol(), OP_BUY, f0_4(), NormalizeDouble(Ask, Digits), G_slippage_348, 0, 0, "", G_magic_144, 16711680);
Sleep(200);
if (ticket_0 > 0) Li_8 = FALSE;
else {
error_4 = GetLastError();
if (error_4 == 129/* INVALID_PRICE */ || error_4 == 138/* REQUOTE */) {
Sleep(200);
RefreshRates();
continue;
}
Li_8 = FALSE;
}
}
if (ticket_0 <= 0) Print(GetLastError());
}
// B6832796D33422B67F3123C913057ADB
void f0_9() {
int error_4;
int ticket_0 = 0;
bool Li_8 = TRUE;
while (Li_8) {
RefreshRates();
ticket_0 = OrderSend(Symbol(), OP_SELL, f0_4(), NormalizeDouble(Bid, Digits), G_slippage_348, 0, 0, "", G_magic_144, 255);
Sleep(200);
if (ticket_0 > 0) Li_8 = FALSE;
else {
error_4 = GetLastError();
if (error_4 == 129/* INVALID_PRICE */ || error_4 == 138/* REQUOTE */) {
Sleep(200);
RefreshRates();
continue;
}
Li_8 = FALSE;
}
}
if (ticket_0 <= 0) Print(GetLastError());
}
// 4CA46AAB119D6115222154B9DE991BEE
double f0_4() {
double Ld_ret_0;
if (!AutoLot) Ld_ret_0 = LotSize;
else Ld_ret_0 = MathFloor(AccountEquity() / Amount_Per_baseLot) * MarketInfo(Symbol(), MODE_MINLOT);
if (Ld_ret_0 < MarketInfo(Symbol(), MODE_MINLOT)) Ld_ret_0 = MarketInfo(Symbol(), MODE_MINLOT);
if (Ld_ret_0 > MarketInfo(Symbol(), MODE_MAXLOT)) Ld_ret_0 = MarketInfo(Symbol(), MODE_MAXLOT);
if (Ld_ret_0 > MaxLot) Ld_ret_0 = MaxLot;
if (MarketInfo(Symbol(), MODE_MINLOT) == 0.1) Ld_ret_0 = NormalizeDouble(Ld_ret_0, 1);
if (MarketInfo(Symbol(), MODE_MINLOT) == 0.01) Ld_ret_0 = NormalizeDouble(Ld_ret_0, 2);
return (Ld_ret_0);
}
// 7AA1EC0A310DF29C6D98B0354710655D
int f0_7() {
int datetime_0 = 0;
for (int pos_4 = 0; pos_4 < OrdersTotal(); pos_4++) {
if (OrderSelect(pos_4, SELECT_BY_POS, MODE_TRADES)) {
if (OrderSymbol() == Symbol() && OrderMagicNumber() == G_magic_144 && OrderType() <= OP_SELL)
if (OrderOpenTime() > datetime_0 && OrderOpenTime() > Gi_408) datetime_0 = OrderOpenTime();
}
}
if (datetime_0 != 0) {
if (TimeCurrent() - datetime_0 > Gi_308) return (1);
return (0);
}
return (0);
}
// C9E339AC8E524CA7C6F5AA6D3A63450F
double f0_10() {
double Ld_ret_0 = 0;
for (int pos_8 = 0; pos_8 < OrdersTotal(); pos_8++) {
if (OrderSelect(pos_8, SELECT_BY_POS, MODE_TRADES))
if (OrderSymbol() == Symbol() && OrderMagicNumber() == G_magic_144 && OrderType() <= OP_SELL) Ld_ret_0 = Ld_ret_0 + OrderProfit() + OrderSwap() + OrderCommission();
}
return (Ld_ret_0);
}
// CC280CABE49899B45BCA03607341629A
int f0_11() {
int Li_ret_0 = 0;
int arr_size_4 = ArraySize(Gsa_412);
for (int index_8 = 0; index_8 < arr_size_4; index_8++)
if (Gsa_412[index_8] == Symbol()) Li_ret_0 = G_magic_140 + index_8;
return (Li_ret_0);
}
// 7A1A5F3E79FDC91EDF2F5EAD9D66ABB4
void f0_6() {
int Li_4;
int file_0 = FileOpenHistory("symbols.raw", FILE_BIN|FILE_READ);
if (file_0 >= 0) {
Li_4 = FileSize(file_0) / 1936;
ArrayResize(Gsa_412, Li_4);
for (int index_8 = 0; index_8 < Li_4; index_8++) {
Gsa_412[index_8] = FileReadString(file_0, 12);
FileSeek(file_0, 1924, SEEK_CUR);
}
}
}