النتائج 46 إلى 60 من 60
- 06-07-2010, 12:49 PM #46
- 06-07-2010, 02:37 PM #47
رد: اکسبريت خارق لاكن!! ارجوا المساعده (mr.dollar)
استهدوا بالله يامسلمين
كل سنه وانتم طيبين
- 06-07-2010, 03:27 PM #48
- 07-07-2010, 08:03 AM #49
رد: اکسبريت خارق لاكن!! ارجوا المساعده (mr.dollar)
من الواضح ان الموضوع أغلق بأنسحاب صاحب الموضوع
- 08-07-2010, 01:42 AM #50
رد: اکسبريت خارق لاكن!! ارجوا المساعده (mr.dollar)
تفصلوا
من هنا التحميل
pass word : indoآخر تعديل بواسطة loveh999 ، 08-07-2010 الساعة 01:46 AM
- 08-07-2010, 01:44 AM #51
رد: اکسبريت خارق لاكن!! ارجوا المساعده (mr.dollar)
pass word
indo
- 08-07-2010, 02:14 AM #52
رد: اکسبريت خارق لاكن!! ارجوا المساعده (mr.dollar)
للتأكيد هذا كود
أكسبيرت Supper Avenger(GBPUSD)0
كود PHP:
#property copyright "FX-Persia"
#property link "http://www.FX-Persia.com"
#import "Martin Avenger(GBPUSD).dll"
int Loadsystem(int& a0[]);
int Loadsystem2(int a0);
int Analysis(double a0, double a1, double a2, double a3, double a4, double a5, double a6, int a7);
int Analysis1(double a0, double a1, double a2, double a3, double a4, double a5, double a6, int a7);
string EAComment();
double GetStop(double a0, int a1);
string Comm(string a0);
int coding(int a0);
#import
double g_pips_76 = 500.0;
double gd_84 = 10.0;
double gd_92 = 10.0;
extern double LotExponent = 1.59;
extern bool MoneyManagement = TRUE;
extern int MagicNumber = 1234;
extern double Risk = 0.5;
extern bool Risk_Setting_According_to_Time = FALSE;
extern string Time_Section1 = " Time Section 1";
extern int StartHour1 = 8;
extern int EndHour1 = 18;
extern double Risk1 = 0.5;
extern string Time_Section2 = " Time Section 2";
extern int StartHour2 = 18;
extern int EndHour2 = 8;
extern double Risk2 = 0.5;
extern double Lots = 0.01;
extern int lotdecimal = 2;
extern double Pip_Value = 10.0;
extern double TakeProfit = 10.0;
extern double PipStep = 30.0;
extern double slip = 3.0;
extern bool Retry = TRUE;
extern int Retry_Count = 10;
extern bool Trade_On_Friday = FALSE;
extern int Friday_Close_Hour = 14;
extern string Note = " IF You Are Running This EA More Than 1 Time On Your Account Use Different Track For Each One ";
extern bool Running_EA_More_Than_one_Time = FALSE;
extern int EA_Number = 0;
extern bool Auto_SecureProfit = TRUE;
extern bool SecureProfit_Mode = TRUE;
extern bool AvoidNews = TRUE;
extern bool High_Impact = TRUE;
extern int MinsUntilNextHighNews = 120;
extern int MinsSincePrevHighNews = 420;
extern bool Medium_Impact = TRUE;
extern int MinsUntilNextMediumNews = 90;
extern int MinsSincePrevMediumNews = 240;
extern bool Low_Impact = FALSE;
extern int MinsUntilNextLowNews = 60;
extern int MinsSincePrevLowNews = 60;
int g_period_300 = 40;
int g_period_304 = 80;
int g_period_308 = 21;
int gi_312 = 20;
string gs_316 = "-";
double gd_324;
bool gi_332;
int gi_336 = -2;
int gi_340 = 2;
int gi_344 = 7;
int gi_348 = 11;
int gi_352 = 1;
double gd_356;
bool gi_364 = FALSE;
double gd_368 = 20.0;
bool gi_376 = FALSE;
bool gi_380 = FALSE;
double gd_384 = 48.0;
double g_price_392;
double gd_400;
double gd_unused_408;
double gd_unused_416;
double g_price_424;
double g_bid_432;
double g_ask_440;
double gd_448;
double gd_456;
double gd_464;
bool gi_472;
string gs_476;
int g_time_484 = 0;
int gi_488;
int gi_492 = 0;
double gd_496;
double gd_504;
int g_pos_512 = 0;
int gi_516;
double gd_520 = 0.0;
bool gi_528 = FALSE;
bool gi_532 = FALSE;
bool gi_536 = FALSE;
int gi_540;
bool gi_544 = FALSE;
double gd_548;
double gd_556;
bool g_bool_564;
int gia_568[14];
int gi_unused_572;
int gi_unused_576;
int gi_580;
bool gi_584;
double gd_588;
int gi_596;
double g_icustom_600;
double gd_608 = 0.0;
int g_ticket_616 = 0;
int gi_620 = 0;
double gd_624 = 0.0;
double g_ord_lots_632 = 0.0;
int g_pos_640 = 0;
double gd_644 = 0.0;
int g_ticket_652 = 0;
int gi_656 = 0;
double gd_660 = 0.0;
double g_ord_lots_668 = 0.0;
int g_pos_676 = 0;
string gs_680;
bool gi_688;
int gi_unused_692;
int gi_696 = 123;
int gi_700 = 152;
double gd_704;
int g_count_712;
bool gi_716;
int gi_720;
bool gi_724 = FALSE;
int g_minute_728 = -1;
string function16(int ai_unused_0) {
return (AccountNumber());
}
int function17(string as_unused_0) {
return (AccountNumber());
}
int init() {
gd_464 = MarketInfo(Symbol(), MODE_SPREAD) * Point;
Cook(gia_568);
gi_unused_572 = GetStop(0, gia_568[5]);
if (Auto_SecureProfit) SecureProfit_Mode = FALSE;
return (0);
}
int deinit() {
return (0);
}
int start() {
double l_iclose_0;
double l_iclose_8;
double ld_16;
int li_24;
int li_28;
double ld_32;
int l_count_40;
g_icustom_600 = iCustom(Symbol(), 0, "ADX%20Crossing", 0, 1);
gi_516 = CountTrades();
if (gi_516 == 0 && gd_588 != AccountBalance()) gi_584 = FALSE;
if (gi_584 == FALSE) {
gd_588 = AccountBalance();
gi_584 = TRUE;
MagicNumber = Magic();
}
if (Trade_On_Friday == FALSE && DayOfWeek() == 5 && Hour() >= Friday_Close_Hour && gi_516 == 0) {
Comment("Not Trading Hour");
return (0);
}
if (DayOfWeek() == 1) gi_unused_692 = gi_700;
else gi_unused_692 = gi_696;
if (!IsDllsAllowed()) {
Alert("Warning: Wrong EA Settings => Please check \" AllowDLL Imports\" under Tools -> Options -> ExpertAdvisors.");
Print("Warning: Wrong EA Settings => Please check \" AllowDLL Imports\" under Tools -> Options -> ExpertAdvisors.");
return;
}
if (Cook2(Loadsystem(gia_568)) && gi_580) {
mycomment();
if (gi_376) TrailingAlls(gd_84, gd_92, g_price_424);
if (gi_380) {
if (TimeCurrent() >= gi_488) {
CloseThisSymbolAll();
Print("Closed All due to TimeOut");
}
}
gi_516 = CountTrades();
if (SecureProfit_Mode && gi_516 != 0) {
gd_644 = 0;
g_ticket_652 = 0;
gi_656 = FALSE;
gd_660 = 0;
g_ord_lots_668 = 0;
for (g_pos_676 = 0; g_pos_676 < OrdersTotal(); g_pos_676++) {
OrderSelect(g_pos_676, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber) {
g_ticket_652 = OrderTicket();
if (OrderType() == OP_BUY) gi_656 = FALSE;
if (OrderType() == OP_SELL) gi_656 = TRUE;
gd_660 = OrderClosePrice();
g_ord_lots_668 = OrderLots();
if (gi_656 == FALSE) {
if (OrderClosePrice() < OrderOpenPrice()) gd_644 -= (OrderOpenPrice() - OrderClosePrice()) * OrderLots() / Point;
if (OrderClosePrice() > OrderOpenPrice()) gd_644 += (OrderClosePrice() - OrderOpenPrice()) * OrderLots() / Point;
}
if (gi_656 == TRUE) {
if (OrderClosePrice() > OrderOpenPrice()) gd_644 -= (OrderClosePrice() - OrderOpenPrice()) * OrderLots() / Point;
if (OrderClosePrice() < OrderOpenPrice()) gd_644 += (OrderOpenPrice() - OrderClosePrice()) * OrderLots() / Point;
}
}
}
gd_644 *= Pip_Value;
if (gd_644 >= gd_608 - gd_704) {
CloseThisSymbolAll();
return (0);
}
}
if (CalculateProfit() > 20.0 * (gd_356 * TakeProfit)) CloseLastOrder();
if (g_time_484 == Time[0] && gi_516 > 0 && AllowTrading()) return (0);
g_time_484 = Time[0];
ld_16 = CalculateProfit();
if (gi_364) {
if (ld_16 < 0.0 && MathAbs(ld_16) > gd_368 / 100.0 * AccountEquityHigh()) {
CloseThisSymbolAll();
Print("Closed All due to Stop Out");
gi_544 = FALSE;
}
}
gi_516 = CountTrades();
if (gi_516 == 0) gi_472 = FALSE;
for (g_pos_512 = OrdersTotal() - 1; g_pos_512 >= 0; g_pos_512--) {
OrderSelect(g_pos_512, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() != Symbol() || OrderMagicNumber() != MagicNumber) continue;
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber) {
if (OrderType() == OP_BUY) {
gi_532 = TRUE;
gi_536 = FALSE;
break;
}
}
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber) {
if (OrderType() == OP_SELL) {
gi_532 = FALSE;
gi_536 = TRUE;
break;
}
}
}
if (gi_516 > 0 && gi_516 <= gi_312) {
RefreshRates();
gd_448 = FindLastBuyPrice();
gd_456 = FindLastSellPrice();
if (gi_532 && gd_448 - Ask >= PipStep * Point) gi_528 = TRUE;
if (gi_536 && Bid - gd_456 >= PipStep * Point) gi_528 = TRUE;
}
if (gi_516 < 1) {
gi_536 = FALSE;
gi_532 = FALSE;
gi_528 = TRUE;
gd_400 = AccountEquity();
if (lotdecimal == 1) gd_504 = 10;
else gd_504 = 100;
if (MoneyManagement == TRUE && gi_516 < 1) {
if (Risk_Setting_According_to_Time == TRUE) {
if (StartHour1 < EndHour2 || EndHour1 > StartHour2 || EndHour2 != StartHour1 || EndHour1 != StartHour2) {
gs_316 = "Please Check Your Time Sections Adjustments";
return (0);
}
gs_316 = "_";
if (StartHour1 > EndHour1 && gi_516 < 1)
if (Hour() <= EndHour1 || Hour() >= StartHour1) gd_324 = Risk1;
if (StartHour1 < EndHour1 && gi_516 < 1)
if (Hour() >= StartHour1 && Hour() <= EndHour1) gd_324 = Risk1;
if (StartHour2 > EndHour2 && gi_516 < 1)
if (Hour() <= EndHour2 - 1 || Hour() >= StartHour2) gd_324 = Risk2;
if (StartHour2 < EndHour2 && gi_516 < 1)
if (Hour() >= StartHour2 && Hour() <= EndHour2 - 1) gd_324 = Risk2;
} else {
gd_324 = Risk;
gs_316 = "_";
}
Lots = (MathCeil((AccountFreeMargin() + 1.0) / (1000 / gd_324)) - 1.0) / gd_504;
if (Lots < 1 / gd_504) Lots = 1 / gd_504;
}
}
if (gi_528) {
gd_704 = 0;
gd_448 = FindLastBuyPrice();
gd_456 = FindLastSellPrice();
if (gi_536) {
gi_492 = gi_516;
gd_496 = NormalizeDouble(Lots * MathPow(LotExponent, gi_492), lotdecimal);
if (gd_496 > MarketInfo(Symbol(), MODE_MAXLOT)) {
gi_332 = TRUE;
g_count_712++;
for (int li_44 = 2; li_44 <= 10; li_44++) {
gd_496 = NormalizeDouble(Lots * MathPow(LotExponent, gi_492), lotdecimal);
gd_496 /= li_44;
li_24 = li_44;
if (gd_496 <= MarketInfo(Symbol(), MODE_MAXLOT)) li_44 = 11;
}
if (g_count_712 != 0 && gi_716 != g_count_712) {
gi_716 = g_count_712;
gi_720 = gi_720 + li_24 - 1;
}
} else {
gi_332 = FALSE;
g_count_712 = 0;
gi_716 = FALSE;
}
RefreshRates();
if (gi_332 == FALSE) gi_540 = OpenPendingOrder(1, gd_496, Bid, slip, Ask, 0, 0, EAComment() + gi_492, MagicNumber, 0, HotPink);
if (gi_332 == TRUE) for (int li_48 = 1; li_48 <= li_24; li_48++) gi_540 = OpenPendingOrder(1, gd_496, Bid, slip, Ask, 0, 0, EAComment() + gi_492, MagicNumber, 0, HotPink);
if (gi_540 < 0) {
Print("Error: ", GetLastError());
return (0);
}
gd_456 = FindLastSellPrice();
gi_528 = FALSE;
gi_544 = TRUE;
} else {
if (gi_532) {
gi_492 = gi_516;
gd_496 = NormalizeDouble(Lots * MathPow(LotExponent, gi_492), lotdecimal);
if (gd_496 > MarketInfo(Symbol(), MODE_MAXLOT)) {
gi_332 = TRUE;
g_count_712++;
for (int li_52 = 2; li_52 <= 10; li_52++) {
gd_496 = NormalizeDouble(Lots * MathPow(LotExponent, gi_492), lotdecimal);
gd_496 /= li_52;
li_28 = li_52;
if (gd_496 <= MarketInfo(Symbol(), MODE_MAXLOT)) li_52 = 11;
}
if (g_count_712 != 0 && gi_716 != g_count_712) {
gi_716 = g_count_712;
gi_720 = gi_720 + li_28 - 1;
}
} else {
gi_332 = FALSE;
g_count_712 = 0;
gi_716 = FALSE;
}
if (gi_332 == FALSE) gi_540 = OpenPendingOrder(0, gd_496, Ask, slip, Bid, 0, 0, EAComment() + gi_492, MagicNumber, 0, Lime);
if (gi_332 == TRUE) for (int li_56 = 1; li_56 <= li_28; li_56++) gi_540 = OpenPendingOrder(0, gd_496, Ask, slip, Bid, 0, 0, EAComment() + gi_492, MagicNumber, 0, Lime);
if (gi_540 < 0) {
Print("Error: ", GetLastError());
return (0);
}
gd_448 = FindLastBuyPrice();
gi_528 = FALSE;
gi_544 = TRUE;
}
}
}
if (gi_528 && gi_516 < 1) {
l_iclose_0 = iClose(Symbol(), 0, 2);
l_iclose_8 = iClose(Symbol(), 0, 1);
gd_704 = 0;
if (IsNormalTradeTime(gi_352)) gi_596 = GetSignal();
if (!IsNormalTradeTime(gi_352)) gi_596 = GetSignal1();
Print(GetSignal1());
g_bid_432 = Bid;
g_ask_440 = Ask;
if (!gi_536 && !gi_532) {
gi_492 = gi_516;
gd_496 = NormalizeDouble(Lots * MathPow(LotExponent, gi_492), lotdecimal);
gd_356 = gd_496;
if (gi_596 == 1) {
gi_540 = OpenPendingOrder(1, gd_496, g_bid_432, slip, g_bid_432, 0, 0, EAComment() + gi_492, MagicNumber, 0, HotPink);
if (gi_540 < 0) {
Print("Error: ", GetLastError());
return (0);
}
gd_448 = FindLastBuyPrice();
gi_544 = TRUE;
} else {
if (gi_596 == 2) {
gi_540 = OpenPendingOrder(0, gd_496, g_ask_440, slip, g_ask_440, 0, 0, EAComment() + gi_492, MagicNumber, 0, Lime);
if (gi_540 < 0) {
Print("Error: ", GetLastError());
return (0);
}
gd_456 = FindLastSellPrice();
gi_544 = TRUE;
}
}
if (gi_540 > 0) gi_488 = TimeCurrent() + 60.0 * (60.0 * gd_384);
gi_528 = FALSE;
}
}
gi_516 = CountTrades();
g_price_424 = 0;
ld_32 = 0;
for (g_pos_512 = OrdersTotal() - 1; g_pos_512 >= 0; g_pos_512--) {
OrderSelect(g_pos_512, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() != Symbol() || OrderMagicNumber() != MagicNumber) continue;
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber) {
if (OrderType() == OP_BUY || OrderType() == OP_SELL) {
g_price_424 += OrderOpenPrice() * OrderLots();
ld_32 += OrderLots();
}
}
}
if (gi_516 > 0) g_price_424 = NormalizeDouble(g_price_424 / ld_32, Digits);
if (gi_544) {
for (g_pos_512 = OrdersTotal() - 1; g_pos_512 >= 0; g_pos_512--) {
OrderSelect(g_pos_512, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() != Symbol() || OrderMagicNumber() != MagicNumber) continue;
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber) {
if (OrderType() == OP_BUY) {
g_price_392 = g_price_424 + TakeProfit * Point;
if (gi_516 > 4) g_price_392 = g_price_424 + (TakeProfit - 1.0) * Point;
if (gi_516 > 13) g_price_392 = g_price_424 + (TakeProfit - 3.0) * Point;
gd_unused_408 = g_price_392;
gd_520 = g_price_424 - g_pips_76 * Point;
gi_472 = TRUE;
}
}
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber) {
if (OrderType() == OP_SELL) {
g_price_392 = g_price_424 - TakeProfit * Point;
if (gi_516 > 4) g_price_392 = g_price_424 - (TakeProfit - 1.0) * Point;
if (gi_516 > 13) g_price_392 = g_price_424 - (TakeProfit - 3.0) * Point;
gd_unused_416 = g_price_392;
gd_520 = g_price_424 + g_pips_76 * Point;
gi_472 = TRUE;
}
}
}
}
if (!Auto_SecureProfit)
if (MarketInfo(Symbol(), MODE_STOPLEVEL) > TakeProfit && SecureProfit_Mode == FALSE) gs_680 = "IT Is Stronglly Recommended to Turn On The SecureProfit_Mode ON";
if (Auto_SecureProfit) {
if (MarketInfo(Symbol(), MODE_STOPLEVEL) > TakeProfit) SecureProfit_Mode = TRUE;
else SecureProfit_Mode = FALSE;
if (SecureProfit_Mode == TRUE) {
gs_680 = " The Broker have changed the StopLevel of the pair. The EA Turned ON the SecureProfit_Mode"
+ "\n"
+ " So Do Not Change Any Setting.The EA Will Manage It";
gi_688 = TRUE;
}
if (SecureProfit_Mode == FALSE && gi_688 == FALSE) gs_680 = "";
if (SecureProfit_Mode == FALSE && gi_688 == TRUE) gs_680 = " The Stop Level Chaned To Normal Agian. So The EA Turned Off the SecureProfit_Mode";
}
if (gi_544 && !SecureProfit_Mode) {
if (gi_472 == TRUE) {
for (g_pos_512 = OrdersTotal() - 1; g_pos_512 >= 0; g_pos_512--) {
OrderSelect(g_pos_512, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() != Symbol() || OrderMagicNumber() != MagicNumber) continue;
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber) g_bool_564 = OrderModify(OrderTicket(), g_price_424, OrderStopLoss(), g_price_392, 0, Yellow);
if (!g_bool_564) {
Alert("ORDER MODIFY DID NOT EFFECTED.THE EA WILL RETRY TO MODIFY THE ORDER");
if (Retry == TRUE && Retry_Count > 0) {
l_count_40 = 0;
while (l_count_40 < Retry_Count || Retry_Count <= 0) {
g_bool_564 = OrderModify(OrderTicket(), g_price_424, OrderStopLoss(), g_price_392, 0, Yellow);
l_count_40++;
if (g_bool_564) l_count_40 = Retry_Count;
}
}
}
gi_544 = FALSE;
}
}
}
if (gi_544 && SecureProfit_Mode) {
gd_608 = 0;
g_ticket_616 = 0;
gi_620 = FALSE;
gd_624 = 0;
g_ord_lots_632 = 0;
for (g_pos_640 = 0; g_pos_640 < OrdersTotal(); g_pos_640++) {
OrderSelect(g_pos_640, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber) {
g_ticket_616 = OrderTicket();
if (OrderType() == OP_BUY) gi_620 = FALSE;
if (OrderType() == OP_SELL) gi_620 = TRUE;
gd_624 = OrderClosePrice();
g_ord_lots_632 = OrderLots();
if (gi_620 == FALSE) gd_608 += (g_price_392 - OrderOpenPrice()) * OrderLots() / Point;
if (gi_620 == TRUE) gd_608 += (OrderOpenPrice() - g_price_392) * OrderLots() / Point;
}
}
gd_608 *= Pip_Value;
gi_544 = FALSE;
}
if (SecureProfit_Mode) {
gd_644 = 0;
g_ticket_652 = 0;
gi_656 = FALSE;
gd_660 = 0;
g_ord_lots_668 = 0;
for (g_pos_676 = 0; g_pos_676 < OrdersTotal(); g_pos_676++) {
OrderSelect(g_pos_676, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber) {
g_ticket_652 = OrderTicket();
if (OrderType() == OP_BUY) gi_656 = FALSE;
if (OrderType() == OP_SELL) gi_656 = TRUE;
gd_660 = OrderClosePrice();
g_ord_lots_668 = OrderLots();
if (gi_656 == FALSE) {
if (OrderClosePrice() < OrderOpenPrice()) gd_644 -= (OrderOpenPrice() - OrderClosePrice()) * OrderLots() / Point;
if (OrderClosePrice() > OrderOpenPrice()) gd_644 += (OrderClosePrice() - OrderOpenPrice()) * OrderLots() / Point;
}
if (gi_656 == TRUE) {
if (OrderClosePrice() > OrderOpenPrice()) gd_644 -= (OrderClosePrice() - OrderOpenPrice()) * OrderLots() / Point;
if (OrderClosePrice() < OrderOpenPrice()) gd_644 += (OrderOpenPrice() - OrderClosePrice()) * OrderLots() / Point;
}
}
}
gd_644 *= Pip_Value;
if (gd_644 >= gd_608 - gd_704) {
CloseThisSymbolAll();
return (0);
}
}
} else {
Comment(Comm(""));
return (coding(gia_568[1]));
}
return (0);
}
int CountTrades() {
int l_count_0 = 0;
for (int l_pos_4 = OrdersTotal() - 1; l_pos_4 >= 0; l_pos_4--) {
OrderSelect(l_pos_4, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() != Symbol() || OrderMagicNumber() != MagicNumber) continue;
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber)
if (OrderType() == OP_SELL || OrderType() == OP_BUY) l_count_0++;
}
if (g_count_712 == 0) gi_720 = 0;
if (g_count_712 != 0) l_count_0 -= gi_720;
return (l_count_0);
}
void CloseThisSymbolAll() {
for (int l_pos_0 = OrdersTotal() - 1; l_pos_0 >= 0; l_pos_0--) {
OrderSelect(l_pos_0, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() == Symbol()) {
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber) {
if (OrderType() == OP_BUY) OrderClose(OrderTicket(), OrderLots(), Bid, slip, Blue);
if (OrderType() == OP_SELL) OrderClose(OrderTicket(), OrderLots(), Ask, slip, Red);
}
Sleep(1000);
}
}
}
void CloseLastOrder() {
for (int l_pos_0 = OrdersTotal() - 1; l_pos_0 >= 0; l_pos_0--) {
OrderSelect(l_pos_0, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() == Symbol()) {
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber) {
if (OrderType() == OP_BUY) OrderClose(OrderTicket(), OrderLots(), Bid, slip, Blue);
if (OrderType() == OP_SELL) OrderClose(OrderTicket(), OrderLots(), Ask, slip, Red);
}
Sleep(1000);
l_pos_0 = 0;
if (OrderType() == OP_BUY) gd_704 = (g_price_392 - OrderOpenPrice()) * OrderLots() / Point * Pip_Value;
if (OrderType() == OP_SELL) gd_704 = (OrderOpenPrice() - g_price_392) * OrderLots() / Point * Pip_Value;
}
}
}
int OpenPendingOrder(int ai_0, double a_lots_4, double a_price_12, int a_slippage_20, double ad_24, int ai_32, int ai_36, string a_comment_40, int a_magic_48, int a_datetime_52, color a_color_56) {
int l_ticket_60 = 0;
int l_error_64 = 0;
int l_count_68 = 0;
int li_72 = 100;
switch (ai_0) {
case 2:
for (l_count_68 = 0; l_count_68 < li_72; l_count_68++) {
l_ticket_60 = OrderSend(Symbol(), OP_BUYLIMIT, a_lots_4, a_price_12, a_slippage_20, StopLong(ad_24, ai_32), TakeLong(a_price_12, ai_36), a_comment_40, a_magic_48, a_datetime_52, a_color_56);
l_error_64 = GetLastError();
if (l_error_64 == 0/* NO_ERROR */) break;
if (!((l_error_64 == 4/* SERVER_BUSY */ || l_error_64 == 137/* BROKER_BUSY */ || l_error_64 == 146/* TRADE_CONTEXT_BUSY */ || l_error_64 == 136/* OFF_QUOTES */))) break;
Sleep(1000);
}
break;
case 4:
for (l_count_68 = 0; l_count_68 < li_72; l_count_68++) {
l_ticket_60 = OrderSend(Symbol(), OP_BUYSTOP, a_lots_4, a_price_12, a_slippage_20, StopLong(ad_24, ai_32), TakeLong(a_price_12, ai_36), a_comment_40, a_magic_48, a_datetime_52, a_color_56);
l_error_64 = GetLastError();
if (l_error_64 == 0/* NO_ERROR */) break;
if (!((l_error_64 == 4/* SERVER_BUSY */ || l_error_64 == 137/* BROKER_BUSY */ || l_error_64 == 146/* TRADE_CONTEXT_BUSY */ || l_error_64 == 136/* OFF_QUOTES */))) break;
Sleep(5000);
}
break;
case 0:
for (l_count_68 = 0; l_count_68 < li_72; l_count_68++) {
RefreshRates();
l_ticket_60 = OrderSend(Symbol(), OP_BUY, a_lots_4, Ask, a_slippage_20, StopLong(Bid, ai_32), TakeLong(Ask, ai_36), a_comment_40, a_magic_48, a_datetime_52, a_color_56);
l_error_64 = GetLastError();
if (l_error_64 == 0/* NO_ERROR */) break;
if (!((l_error_64 == 4/* SERVER_BUSY */ || l_error_64 == 137/* BROKER_BUSY */ || l_error_64 == 146/* TRADE_CONTEXT_BUSY */ || l_error_64 == 136/* OFF_QUOTES */))) break;
Sleep(5000);
}
break;
case 3:
for (l_count_68 = 0; l_count_68 < li_72; l_count_68++) {
l_ticket_60 = OrderSend(Symbol(), OP_SELLLIMIT, a_lots_4, a_price_12, a_slippage_20, StopShort(ad_24, ai_32), TakeShort(a_price_12, ai_36), a_comment_40, a_magic_48, a_datetime_52, a_color_56);
l_error_64 = GetLastError();
if (l_error_64 == 0/* NO_ERROR */) break;
if (!((l_error_64 == 4/* SERVER_BUSY */ || l_error_64 == 137/* BROKER_BUSY */ || l_error_64 == 146/* TRADE_CONTEXT_BUSY */ || l_error_64 == 136/* OFF_QUOTES */))) break;
Sleep(5000);
}
break;
case 5:
for (l_count_68 = 0; l_count_68 < li_72; l_count_68++) {
l_ticket_60 = OrderSend(Symbol(), OP_SELLSTOP, a_lots_4, a_price_12, a_slippage_20, StopShort(ad_24, ai_32), TakeShort(a_price_12, ai_36), a_comment_40, a_magic_48, a_datetime_52, a_color_56);
l_error_64 = GetLastError();
if (l_error_64 == 0/* NO_ERROR */) break;
if (!((l_error_64 == 4/* SERVER_BUSY */ || l_error_64 == 137/* BROKER_BUSY */ || l_error_64 == 146/* TRADE_CONTEXT_BUSY */ || l_error_64 == 136/* OFF_QUOTES */))) break;
Sleep(5000);
}
break;
case 1:
for (l_count_68 = 0; l_count_68 < li_72; l_count_68++) {
l_ticket_60 = OrderSend(Symbol(), OP_SELL, a_lots_4, Bid, a_slippage_20, StopShort(Ask, ai_32), TakeShort(Bid, ai_36), a_comment_40, a_magic_48, a_datetime_52, a_color_56);
l_error_64 = GetLastError();
if (l_error_64 == 0/* NO_ERROR */) break;
if (!((l_error_64 == 4/* SERVER_BUSY */ || l_error_64 == 137/* BROKER_BUSY */ || l_error_64 == 146/* TRADE_CONTEXT_BUSY */ || l_error_64 == 136/* OFF_QUOTES */))) break;
Sleep(5000);
}
}
return (l_ticket_60);
}
double StopLong(double ad_0, int ai_8) {
if (ai_8 == 0) return (0);
return (ad_0 - ai_8 * Point);
}
double StopShort(double ad_0, int ai_8) {
if (ai_8 == 0) return (0);
return (ad_0 + ai_8 * Point);
}
double TakeLong(double ad_0, int ai_8) {
if (ai_8 == 0) return (0);
return (ad_0 + ai_8 * Point);
}
double TakeShort(double ad_0, int ai_8) {
if (ai_8 == 0) return (0);
return (ad_0 - ai_8 * Point);
}
double CalculateProfit() {
double ld_ret_0 = 0;
for (g_pos_512 = OrdersTotal() - 1; g_pos_512 >= 0; g_pos_512--) {
OrderSelect(g_pos_512, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() != Symbol() || OrderMagicNumber() != MagicNumber) continue;
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber)
if (OrderType() == OP_BUY || OrderType() == OP_SELL) ld_ret_0 += OrderProfit();
}
return (ld_ret_0);
}
void TrailingAlls(int ai_0, int ai_4, double a_price_8) {
int li_16;
double l_ord_stoploss_20;
double l_price_28;
if (ai_4 != 0) {
for (int l_pos_36 = OrdersTotal() - 1; l_pos_36 >= 0; l_pos_36--) {
if (OrderSelect(l_pos_36, SELECT_BY_POS, MODE_TRADES)) {
if (OrderSymbol() != Symbol() || OrderMagicNumber() != MagicNumber) continue;
if (OrderSymbol() == Symbol() || OrderMagicNumber() == MagicNumber) {
if (OrderType() == OP_BUY) {
li_16 = NormalizeDouble((Bid - a_price_8) / Point, 0);
if (li_16 < ai_0) continue;
l_ord_stoploss_20 = OrderStopLoss();
l_price_28 = Bid - ai_4 * Point;
if (l_ord_stoploss_20 == 0.0 || (l_ord_stoploss_20 != 0.0 && l_price_28 > l_ord_stoploss_20)) OrderModify(OrderTicket(), a_price_8, l_price_28, OrderTakeProfit(), 0, Aqua);
}
if (OrderType() == OP_SELL) {
li_16 = NormalizeDouble((a_price_8 - Ask) / Point, 0);
if (li_16 < ai_0) continue;
l_ord_stoploss_20 = OrderStopLoss();
l_price_28 = Ask + ai_4 * Point;
if (l_ord_stoploss_20 == 0.0 || (l_ord_stoploss_20 != 0.0 && l_price_28 < l_ord_stoploss_20)) OrderModify(OrderTicket(), a_price_8, l_price_28, OrderTakeProfit(), 0, Red);
}
}
Sleep(1000);
}
}
}
}
double AccountEquityHigh() {
if (CountTrades() == 0) gd_548 = AccountEquity();
if (gd_548 < gd_556) gd_548 = gd_556;
else gd_548 = AccountEquity();
gd_556 = AccountEquity();
return (gd_548);
}
double FindLastBuyPrice() {
double l_ord_open_price_0;
int l_ticket_8;
double ld_unused_12 = 0;
int l_ticket_20 = 0;
for (int l_pos_24 = OrdersTotal() - 1; l_pos_24 >= 0; l_pos_24--) {
OrderSelect(l_pos_24, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() != Symbol() || OrderMagicNumber() != MagicNumber) continue;
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber && OrderType() == OP_BUY) {
l_ticket_8 = OrderTicket();
if (l_ticket_8 > l_ticket_20) {
l_ord_open_price_0 = OrderOpenPrice();
ld_unused_12 = l_ord_open_price_0;
l_ticket_20 = l_ticket_8;
}
}
}
return (l_ord_open_price_0);
}
int GetSignal() {
double ld_0;
double l_ima_8 = iMA(Symbol(), 0, g_period_300, 0, MODE_EMA, PRICE_CLOSE, 0);
double l_ima_16 = iMA(Symbol(), 0, g_period_304, 0, MODE_EMA, PRICE_CLOSE, 0);
double l_iwpr_24 = iWPR(Symbol(), 0, g_period_308, 1);
double l_iwpr_32 = iWPR(Symbol(), 0, g_period_308, 2);
double l_ihigh_40 = iHigh(Symbol(), 0, 1);
double l_ilow_48 = iLow(Symbol(), 0, 1);
if (IsCriticalTime(gi_352)) ld_0 = l_ihigh_40;
else ld_0 = l_ilow_48;
return (Analysis(l_ima_8, l_ima_16, l_iwpr_24, l_iwpr_32, ld_0, iClose(Symbol(), 0, 0), iHigh(Symbol(), 0, 1), gia_568[5]));
}
int GetSignal1() {
double ld_0;
double l_ima_8 = iMA(Symbol(), 0, g_period_300, 0, MODE_EMA, PRICE_CLOSE, 0);
double l_ima_16 = iMA(Symbol(), 0, g_period_304, 0, MODE_EMA, PRICE_CLOSE, 0);
double l_iwpr_24 = iWPR(Symbol(), 0, g_period_308, 1);
double l_iwpr_32 = iWPR(Symbol(), 0, g_period_308, 2);
double l_ihigh_40 = iHigh(Symbol(), 0, 1);
double l_ilow_48 = iLow(Symbol(), 0, 1);
if (IsCriticalTime(gi_352)) ld_0 = l_ihigh_40;
else ld_0 = l_ilow_48;
return (Analysis1(l_ima_8, l_ima_16, l_iwpr_24, l_iwpr_32, ld_0, iClose(Symbol(), 0, 0), iHigh(Symbol(), 0, 1), gia_568[5]));
}
bool IsNormalTradeTime(int ai_0) {
int li_4 = gi_336 + ai_0;
int li_8 = gi_340 + ai_0;
if (li_4 < 0) li_4 += 24;
if (li_8 < 0) li_8 += 24;
if (li_4 >= 24) li_4 -= 24;
if (li_8 >= 24) li_8 -= 24;
if (li_4 < li_8)
if (DayOfWeek() == 1 && TimeHour(TimeCurrent()) >= li_4 && TimeHour(TimeCurrent()) < li_8) return (FALSE);
if (li_4 > li_8)
if (DayOfWeek() == 1 && TimeHour(TimeCurrent()) >= li_4 || TimeHour(TimeCurrent()) < li_8) return (FALSE);
return (TRUE);
}
bool IsCriticalTime(int ai_0) {
int li_4 = gi_344 + ai_0;
int li_8 = gi_348 + ai_0;
if (li_4 < 0) li_4 += 24;
if (li_8 < 0) li_8 += 24;
if (li_4 >= 24) li_4 -= 24;
if (li_8 >= 24) li_8 -= 24;
if (li_4 < li_8)
if (TimeHour(TimeCurrent()) >= li_4 && TimeHour(TimeCurrent()) < li_8) return (TRUE);
if (li_4 > li_8)
if (TimeHour(TimeCurrent()) >= li_4 || TimeHour(TimeCurrent()) < li_8) return (TRUE);
return (FALSE);
}
double FindLastSellPrice() {
double l_ord_open_price_0;
int l_ticket_8;
double ld_unused_12 = 0;
int l_ticket_20 = 0;
for (int l_pos_24 = OrdersTotal() - 1; l_pos_24 >= 0; l_pos_24--) {
OrderSelect(l_pos_24, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() != Symbol() || OrderMagicNumber() != MagicNumber) continue;
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber && OrderType() == OP_SELL) {
l_ticket_8 = OrderTicket();
if (l_ticket_8 > l_ticket_20) {
l_ord_open_price_0 = OrderOpenPrice();
ld_unused_12 = l_ord_open_price_0;
l_ticket_20 = l_ticket_8;
}
}
}
return (l_ord_open_price_0);
}
int Magic() {
int li_0;
int li_4;
if (Running_EA_More_Than_one_Time == TRUE) li_4 = EA_Number;
else li_4 = 0;
MathSrand(Ask / Point);
for (int l_count_8 = 0; l_count_8 < 10; l_count_8++) li_0 = MathRand() + AccountNumber() + li_4;
gi_unused_576 = li_0;
return (MagicNumber);
}
void mycomment() {
string ls_0;
if (gs_316 != "_") ls_0 = gs_316;
else {
if (Risk_Setting_According_to_Time == TRUE) {
ls_0 = "\n"
+ " " + gs_476 + " \n" + " \n" + " -------------------" + " \n" + " Current Time: " + CountTrades() + " \n" + " \n" + " Time Section #1:" + " Start: " + StartHour1 + " \n" + " " + " End: " + EndHour1 + " \n" + " " + " Risk: " + DoubleToStr(Risk1, 2) + " \n" + " Time Section #2:" + " Start: " + StartHour2 + " \n" + " " + " End: " + EndHour2 + " \n" + " " + " Risk: " + DoubleToStr(Risk2, 2) + " \n" + " \n" + " -------------------" + " \n" + " Balance: " + DoubleToStr(AccountBalance(), 2) + " \n" + " Equity: " + DoubleToStr(AccountEquity(), 2) + " \n" + " -------------------" + " \n" + gs_680;
}
if (Risk_Setting_According_to_Time == FALSE) {
ls_0 = "\n"
+ " " + gs_476 + " \n" + " \n" + " -------------------" + " \n" + " Current Time: " + TimeCurrent() + " \n" + " \n" + " Martin EA Is Woriking With Fixed Risk Value:" + " \n" + " \n" + " -------------------" + " \n" + " Balance: " + DoubleToStr(AccountBalance(), 2) + " \n" + " Equity: " + DoubleToStr(AccountEquity(), 2);
}
}
Comment(ls_0);
}
void Cook(int &aia_0[14]) {
aia_0[0] = AccountCredit();
aia_0[1] = AccountEquity();
aia_0[2] = StrToInteger(function16(AccountNumber()));
aia_0[3] = StrToInteger(WindowExpertName());
aia_0[4] = StrToInteger(AccountServer());
aia_0[5] = function17(AccountName());
aia_0[6] = StrToInteger(TerminalCompany());
aia_0[7] = StrToInteger(TerminalName());
aia_0[8] = StrToInteger(TerminalPath());
aia_0[9] = StrToInteger(TimeToStr(TimeCurrent(), TIME_DATE));
aia_0[10] = 1;
aia_0[11] = StrToInteger(Symbol());
aia_0[12] = 12345;
aia_0[13] = StrToInteger(DoubleToStr(IsTesting(), 0));
aia_0[14] = StringLen(DoubleToStr(aia_0[5], 0));
}
int Cook2(int ai_0) {
if (ai_0 == Loadsystem2(Loadsystem(gia_568))) return (1);
return (0);
}
int AllowTrading() {
int l_icustom_0;
int l_icustom_4;
int l_icustom_8;
int l_icustom_12;
int l_icustom_16;
int l_icustom_20;
if (AvoidNews == FALSE) return (0);
if (AvoidNews) {
l_icustom_0 = iCustom(NULL, 0, "FFCal", 1, 0, 0, 1, 1, 1, 0);
l_icustom_4 = iCustom(NULL, 0, "FFCal", 1, 0, 0, 1, 1, 1, 1);
l_icustom_8 = iCustom(NULL, 0, "FFCal", 0, 1, 0, 1, 1, 1, 0);
l_icustom_12 = iCustom(NULL, 0, "FFCal", 0, 1, 0, 1, 1, 1, 1);
l_icustom_16 = iCustom(NULL, 0, "FFCal", 0, 0, 1, 1, 1, 1, 0);
l_icustom_20 = iCustom(NULL, 0, "FFCal", 0, 0, 1, 1, 1, 1, 1);
if (Minute() != g_minute_728) {
gi_724 = FALSE;
g_minute_728 = Minute();
if (High_Impact)
if (l_icustom_4 <= MinsUntilNextHighNews || l_icustom_0 <= MinsSincePrevHighNews) gi_724 = TRUE;
if (Medium_Impact)
if (l_icustom_12 <= MinsUntilNextMediumNews || l_icustom_8 <= MinsSincePrevMediumNews) gi_724 = TRUE;
if (Low_Impact)
if (l_icustom_20 <= MinsUntilNextLowNews || l_icustom_16 <= MinsSincePrevLowNews) gi_724 = TRUE;
}
}
return (gi_724);
}
كود PHP:
#property copyright "BETSAFE"
#property link "http://beam.to/betsafe"
#import "Martin.dll"
int Loadsystem(int& a0[]);
int Loadsystem2(int a0);
string Comm(string a0);
int coding(int a0);
#import
double g_pips_76 = 500.0;
double gd_84 = 10.0;
double gd_92 = 10.0;
extern double LotExponent = 1.59;
extern bool MoneyManagement = TRUE;
extern double Risk = 0.5;
extern bool Risk_Setting_According_to_Time = FALSE;
extern string Time_Section1 = " Time Section 1";
extern int StartHour1 = 8;
extern int EndHour1 = 18;
extern double Risk1 = 0.5;
extern string Time_Section2 = " Time Section 2";
extern int StartHour2 = 18;
extern int EndHour2 = 8;
extern double Risk2 = 0.5;
extern double Lots = 0.01;
extern int lotdecimal = 2;
extern double TakeProfit = 10.0;
extern double PipStep = 30.0;
extern int MagicNumber = 12324;
extern double slip = 3.0;
int gi_212 = 10;
string gs_216 = "-";
double gd_224;
bool gi_232 = FALSE;
double gd_236 = 20.0;
bool gi_244 = FALSE;
bool gi_248 = FALSE;
double gd_252 = 48.0;
double g_price_260;
double gd_268;
double gd_unused_276;
double gd_unused_284;
double g_price_292;
double g_bid_300;
double g_ask_308;
double gd_316;
double gd_324;
double gd_332;
bool gi_340;
string gs_344 = "Martin(FX-Persia.com)";
int g_time_352 = 0;
int gi_356;
int gi_360 = 0;
double gd_364;
double gd_372;
int g_pos_380 = 0;
int gi_384;
double gd_388 = 0.0;
bool gi_396 = FALSE;
bool gi_400 = FALSE;
bool gi_404 = FALSE;
int gi_408;
bool gi_412 = FALSE;
double gd_416;
double gd_424;
int gia_432[14];
string function16(int ai_unused_0) {
return (AccountNumber());
}
int function17(string as_unused_0) {
return (AccountNumber());
}
int init() {
gd_332 = MarketInfo(Symbol(), MODE_SPREAD) * Point;
return (0);
}
int deinit() {
return (0);
}
int start() {
double l_iclose_32;
double l_iclose_40;
double ld_48;
double ld_56;
double l_icustom_0 = iCustom(NULL, 0, "COG", 1, 0);
double l_icustom_8 = iCustom(NULL, 0, "COG", 2, 0);
double l_icustom_16 = iCustom(NULL, 0, "COG", 1, 1);
double l_icustom_24 = iCustom(NULL, 0, "COG", 0, 0);
if (!IsDllsAllowed()) {
Alert("Warning: Wrong EA Settings => Please check \" AllowDLL Imports\" under Tools -> Options -> ExpertAdvisors.");
Print("Warning: Wrong EA Settings => Please check \" AllowDLL Imports\" under Tools -> Options -> ExpertAdvisors.");
return;
}
//Cook(gia_432);
// if (Cook2(Loadsystem(gia_432))) {
{
mycomment();
if (gi_244) TrailingAlls(gd_84, gd_92, g_price_292);
if (gi_248) {
if (TimeCurrent() >= gi_356) {
CloseThisSymbolAll();
Print("Closed All due to TimeOut");
}
}
if (g_time_352 == Time[0]) return (0);
g_time_352 = Time[0];
ld_48 = CalculateProfit();
if (gi_232) {
if (ld_48 < 0.0 && MathAbs(ld_48) > gd_236 / 100.0 * AccountEquityHigh()) {
CloseThisSymbolAll();
Print("Closed All due to Stop Out");
gi_412 = FALSE;
}
}
gi_384 = CountTrades();
if (gi_384 == 0) gi_340 = FALSE;
for (g_pos_380 = OrdersTotal() - 1; g_pos_380 >= 0; g_pos_380--) {
OrderSelect(g_pos_380, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() != Symbol() || OrderMagicNumber() != MagicNumber) continue;
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber) {
if (OrderType() == OP_BUY) {
gi_400 = TRUE;
gi_404 = FALSE;
break;
}
}
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber) {
if (OrderType() == OP_SELL) {
gi_400 = FALSE;
gi_404 = TRUE;
break;
}
}
}
if (gi_384 > 0 && gi_384 <= gi_212) {
RefreshRates();
gd_316 = FindLastBuyPrice();
gd_324 = FindLastSellPrice();
if (gi_400 && gd_316 - Ask >= PipStep * Point) gi_396 = TRUE;
if (gi_404 && Bid - gd_324 >= PipStep * Point) gi_396 = TRUE;
}
if (gi_384 < 1) {
gi_404 = FALSE;
gi_400 = FALSE;
gi_396 = TRUE;
gd_268 = AccountEquity();
if (lotdecimal == 1) gd_372 = 10;
else gd_372 = 100;
if (MoneyManagement == TRUE && gi_384 < 1) {
if (Risk_Setting_According_to_Time == TRUE) {
if (StartHour1 < EndHour2 || EndHour1 > StartHour2 || EndHour2 != StartHour1 || EndHour1 != StartHour2) {
gs_216 = "Please Check Your Time Sections Adjustments";
return (0);
}
gs_216 = "_";
if (StartHour1 > EndHour1 && gi_384 < 1)
if (Hour() <= EndHour1 || Hour() >= StartHour1) gd_224 = Risk1;
if (StartHour1 < EndHour1 && gi_384 < 1)
if (Hour() >= StartHour1 && Hour() <= EndHour1) gd_224 = Risk1;
if (StartHour2 > EndHour2 && gi_384 < 1)
if (Hour() <= EndHour2 - 1 || Hour() >= StartHour2) gd_224 = Risk2;
if (StartHour2 < EndHour2 && gi_384 < 1)
if (Hour() >= StartHour2 && Hour() <= EndHour2 - 1) gd_224 = Risk2;
} else {
gd_224 = Risk;
gs_216 = "_";
}
Lots = (MathCeil((AccountFreeMargin() + 1.0) / (1000 / gd_224)) - 1.0) / gd_372;
if (Lots < 1 / gd_372) Lots = 1 / gd_372;
}
}
if (gi_396) {
gd_316 = FindLastBuyPrice();
gd_324 = FindLastSellPrice();
if (gi_404) {
gi_360 = gi_384;
gd_364 = NormalizeDouble(Lots * MathPow(LotExponent, gi_360), lotdecimal);
RefreshRates();
gi_408 = OpenPendingOrder(1, gd_364, Bid, slip, Ask, 0, 0, gs_344 + "-" + gi_360, MagicNumber, 0, HotPink);
if (gi_408 < 0) {
Print("Error: ", GetLastError());
return (0);
}
gd_324 = FindLastSellPrice();
gi_396 = FALSE;
gi_412 = TRUE;
} else {
if (gi_400) {
gi_360 = gi_384;
gd_364 = NormalizeDouble(Lots * MathPow(LotExponent, gi_360), lotdecimal);
gi_408 = OpenPendingOrder(0, gd_364, Ask, slip, Bid, 0, 0, gs_344 + "-" + gi_360, MagicNumber, 0, Lime);
if (gi_408 < 0) {
Print("Error: ", GetLastError());
return (0);
}
gd_316 = FindLastBuyPrice();
gi_396 = FALSE;
gi_412 = TRUE;
}
}
}
if (gi_396 && gi_384 < 1) {
l_iclose_32 = iClose(Symbol(), 0, 2);
l_iclose_40 = iClose(Symbol(), 0, 1);
g_bid_300 = Bid;
g_ask_308 = Ask;
if (!gi_404 && !gi_400) {
gi_360 = gi_384;
gd_364 = NormalizeDouble(Lots * MathPow(LotExponent, gi_360), lotdecimal);
if (iClose(NULL, 0, 0) < l_icustom_8 && l_icustom_0 >= l_icustom_16) {
gi_408 = OpenPendingOrder(1, gd_364, g_bid_300, slip, g_bid_300, 0, 0, gs_344 + "-" + gi_360, MagicNumber, 0, HotPink);
if (gi_408 < 0) {
Print("Error: ", GetLastError());
return (0);
}
gd_316 = FindLastBuyPrice();
gi_412 = TRUE;
} else {
if (iClose(NULL, 0, 0) > l_icustom_0 && l_icustom_0 <= l_icustom_16) {
gi_408 = OpenPendingOrder(0, gd_364, g_ask_308, slip, g_ask_308, 0, 0, gs_344 + "-" + gi_360, MagicNumber, 0, Lime);
if (gi_408 < 0) {
Print("Error: ", GetLastError());
return (0);
}
gd_324 = FindLastSellPrice();
gi_412 = TRUE;
}
}
if (gi_408 > 0) gi_356 = TimeCurrent() + 60.0 * (60.0 * gd_252);
gi_396 = FALSE;
}
}
gi_384 = CountTrades();
g_price_292 = 0;
ld_56 = 0;
for (g_pos_380 = OrdersTotal() - 1; g_pos_380 >= 0; g_pos_380--) {
OrderSelect(g_pos_380, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() != Symbol() || OrderMagicNumber() != MagicNumber) continue;
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber) {
if (OrderType() == OP_BUY || OrderType() == OP_SELL) {
g_price_292 += OrderOpenPrice() * OrderLots();
ld_56 += OrderLots();
}
}
}
if (gi_384 > 0) g_price_292 = NormalizeDouble(g_price_292 / ld_56, Digits);
if (gi_412) {
for (g_pos_380 = OrdersTotal() - 1; g_pos_380 >= 0; g_pos_380--) {
OrderSelect(g_pos_380, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() != Symbol() || OrderMagicNumber() != MagicNumber) continue;
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber) {
if (OrderType() == OP_BUY) {
g_price_260 = g_price_292 + TakeProfit * Point;
gd_unused_276 = g_price_260;
gd_388 = g_price_292 - g_pips_76 * Point;
gi_340 = TRUE;
}
}
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber) {
if (OrderType() == OP_SELL) {
g_price_260 = g_price_292 - TakeProfit * Point;
gd_unused_284 = g_price_260;
gd_388 = g_price_292 + g_pips_76 * Point;
gi_340 = TRUE;
}
}
}
}
if (gi_412) {
if (gi_340 == TRUE) {
for (g_pos_380 = OrdersTotal() - 1; g_pos_380 >= 0; g_pos_380--) {
OrderSelect(g_pos_380, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() != Symbol() || OrderMagicNumber() != MagicNumber) continue;
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber) OrderModify(OrderTicket(), g_price_292, OrderStopLoss(), g_price_260, 0, Yellow);
gi_412 = FALSE;
}
}
}
}
/*else {
Comment(Comm(""));
return (coding(gia_432[1]));
}*/
return (0);
}
int CountTrades() {
int l_count_0 = 0;
for (int l_pos_4 = OrdersTotal() - 1; l_pos_4 >= 0; l_pos_4--) {
OrderSelect(l_pos_4, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() != Symbol() || OrderMagicNumber() != MagicNumber) continue;
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber)
if (OrderType() == OP_SELL || OrderType() == OP_BUY) l_count_0++;
}
return (l_count_0);
}
void CloseThisSymbolAll() {
for (int l_pos_0 = OrdersTotal() - 1; l_pos_0 >= 0; l_pos_0--) {
OrderSelect(l_pos_0, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() == Symbol()) {
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber) {
if (OrderType() == OP_BUY) OrderClose(OrderTicket(), OrderLots(), Bid, slip, Blue);
if (OrderType() == OP_SELL) OrderClose(OrderTicket(), OrderLots(), Ask, slip, Red);
}
Sleep(1000);
}
}
}
int OpenPendingOrder(int ai_0, double a_lots_4, double a_price_12, int a_slippage_20, double ad_24, int ai_32, int ai_36, string a_comment_40, int a_magic_48, int a_datetime_52, color a_color_56) {
int l_ticket_60 = 0;
int l_error_64 = 0;
int l_count_68 = 0;
int li_72 = 100;
switch (ai_0) {
case 2:
for (l_count_68 = 0; l_count_68 < li_72; l_count_68++) {
l_ticket_60 = OrderSend(Symbol(), OP_BUYLIMIT, a_lots_4, a_price_12, a_slippage_20, StopLong(ad_24, ai_32), TakeLong(a_price_12, ai_36), a_comment_40, a_magic_48, a_datetime_52, a_color_56);
l_error_64 = GetLastError();
if (l_error_64 == 0/* NO_ERROR */) break;
if (!((l_error_64 == 4/* SERVER_BUSY */ || l_error_64 == 137/* BROKER_BUSY */ || l_error_64 == 146/* TRADE_CONTEXT_BUSY */ || l_error_64 == 136/* OFF_QUOTES */))) break;
Sleep(1000);
}
break;
case 4:
for (l_count_68 = 0; l_count_68 < li_72; l_count_68++) {
l_ticket_60 = OrderSend(Symbol(), OP_BUYSTOP, a_lots_4, a_price_12, a_slippage_20, StopLong(ad_24, ai_32), TakeLong(a_price_12, ai_36), a_comment_40, a_magic_48, a_datetime_52, a_color_56);
l_error_64 = GetLastError();
if (l_error_64 == 0/* NO_ERROR */) break;
if (!((l_error_64 == 4/* SERVER_BUSY */ || l_error_64 == 137/* BROKER_BUSY */ || l_error_64 == 146/* TRADE_CONTEXT_BUSY */ || l_error_64 == 136/* OFF_QUOTES */))) break;
Sleep(5000);
}
break;
case 0:
for (l_count_68 = 0; l_count_68 < li_72; l_count_68++) {
RefreshRates();
l_ticket_60 = OrderSend(Symbol(), OP_BUY, a_lots_4, Ask, a_slippage_20, StopLong(Bid, ai_32), TakeLong(Ask, ai_36), a_comment_40, a_magic_48, a_datetime_52, a_color_56);
l_error_64 = GetLastError();
if (l_error_64 == 0/* NO_ERROR */) break;
if (!((l_error_64 == 4/* SERVER_BUSY */ || l_error_64 == 137/* BROKER_BUSY */ || l_error_64 == 146/* TRADE_CONTEXT_BUSY */ || l_error_64 == 136/* OFF_QUOTES */))) break;
Sleep(5000);
}
break;
case 3:
for (l_count_68 = 0; l_count_68 < li_72; l_count_68++) {
l_ticket_60 = OrderSend(Symbol(), OP_SELLLIMIT, a_lots_4, a_price_12, a_slippage_20, StopShort(ad_24, ai_32), TakeShort(a_price_12, ai_36), a_comment_40, a_magic_48, a_datetime_52, a_color_56);
l_error_64 = GetLastError();
if (l_error_64 == 0/* NO_ERROR */) break;
if (!((l_error_64 == 4/* SERVER_BUSY */ || l_error_64 == 137/* BROKER_BUSY */ || l_error_64 == 146/* TRADE_CONTEXT_BUSY */ || l_error_64 == 136/* OFF_QUOTES */))) break;
Sleep(5000);
}
break;
case 5:
for (l_count_68 = 0; l_count_68 < li_72; l_count_68++) {
l_ticket_60 = OrderSend(Symbol(), OP_SELLSTOP, a_lots_4, a_price_12, a_slippage_20, StopShort(ad_24, ai_32), TakeShort(a_price_12, ai_36), a_comment_40, a_magic_48, a_datetime_52, a_color_56);
l_error_64 = GetLastError();
if (l_error_64 == 0/* NO_ERROR */) break;
if (!((l_error_64 == 4/* SERVER_BUSY */ || l_error_64 == 137/* BROKER_BUSY */ || l_error_64 == 146/* TRADE_CONTEXT_BUSY */ || l_error_64 == 136/* OFF_QUOTES */))) break;
Sleep(5000);
}
break;
case 1:
for (l_count_68 = 0; l_count_68 < li_72; l_count_68++) {
l_ticket_60 = OrderSend(Symbol(), OP_SELL, a_lots_4, Bid, a_slippage_20, StopShort(Ask, ai_32), TakeShort(Bid, ai_36), a_comment_40, a_magic_48, a_datetime_52, a_color_56);
l_error_64 = GetLastError();
if (l_error_64 == 0/* NO_ERROR */) break;
if (!((l_error_64 == 4/* SERVER_BUSY */ || l_error_64 == 137/* BROKER_BUSY */ || l_error_64 == 146/* TRADE_CONTEXT_BUSY */ || l_error_64 == 136/* OFF_QUOTES */))) break;
Sleep(5000);
}
}
return (l_ticket_60);
}
double StopLong(double ad_0, int ai_8) {
if (ai_8 == 0) return (0);
return (ad_0 - ai_8 * Point);
}
double StopShort(double ad_0, int ai_8) {
if (ai_8 == 0) return (0);
return (ad_0 + ai_8 * Point);
}
double TakeLong(double ad_0, int ai_8) {
if (ai_8 == 0) return (0);
return (ad_0 + ai_8 * Point);
}
double TakeShort(double ad_0, int ai_8) {
if (ai_8 == 0) return (0);
return (ad_0 - ai_8 * Point);
}
double CalculateProfit() {
double ld_ret_0 = 0;
for (g_pos_380 = OrdersTotal() - 1; g_pos_380 >= 0; g_pos_380--) {
OrderSelect(g_pos_380, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() != Symbol() || OrderMagicNumber() != MagicNumber) continue;
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber)
if (OrderType() == OP_BUY || OrderType() == OP_SELL) ld_ret_0 += OrderProfit();
}
return (ld_ret_0);
}
void TrailingAlls(int ai_0, int ai_4, double a_price_8) {
int li_16;
double l_ord_stoploss_20;
double l_price_28;
if (ai_4 != 0) {
for (int l_pos_36 = OrdersTotal() - 1; l_pos_36 >= 0; l_pos_36--) {
if (OrderSelect(l_pos_36, SELECT_BY_POS, MODE_TRADES)) {
if (OrderSymbol() != Symbol() || OrderMagicNumber() != MagicNumber) continue;
if (OrderSymbol() == Symbol() || OrderMagicNumber() == MagicNumber) {
if (OrderType() == OP_BUY) {
li_16 = NormalizeDouble((Bid - a_price_8) / Point, 0);
if (li_16 < ai_0) continue;
l_ord_stoploss_20 = OrderStopLoss();
l_price_28 = Bid - ai_4 * Point;
if (l_ord_stoploss_20 == 0.0 || (l_ord_stoploss_20 != 0.0 && l_price_28 > l_ord_stoploss_20)) OrderModify(OrderTicket(), a_price_8, l_price_28, OrderTakeProfit(), 0, Aqua);
}
if (OrderType() == OP_SELL) {
li_16 = NormalizeDouble((a_price_8 - Ask) / Point, 0);
if (li_16 < ai_0) continue;
l_ord_stoploss_20 = OrderStopLoss();
l_price_28 = Ask + ai_4 * Point;
if (l_ord_stoploss_20 == 0.0 || (l_ord_stoploss_20 != 0.0 && l_price_28 < l_ord_stoploss_20)) OrderModify(OrderTicket(), a_price_8, l_price_28, OrderTakeProfit(), 0, Red);
}
}
Sleep(1000);
}
}
}
}
double AccountEquityHigh() {
if (CountTrades() == 0) gd_416 = AccountEquity();
if (gd_416 < gd_424) gd_416 = gd_424;
else gd_416 = AccountEquity();
gd_424 = AccountEquity();
return (gd_416);
}
double FindLastBuyPrice() {
double l_ord_open_price_0;
int l_ticket_8;
double ld_unused_12 = 0;
int l_ticket_20 = 0;
for (int l_pos_24 = OrdersTotal() - 1; l_pos_24 >= 0; l_pos_24--) {
OrderSelect(l_pos_24, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() != Symbol() || OrderMagicNumber() != MagicNumber) continue;
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber && OrderType() == OP_BUY) {
l_ticket_8 = OrderTicket();
if (l_ticket_8 > l_ticket_20) {
l_ord_open_price_0 = OrderOpenPrice();
ld_unused_12 = l_ord_open_price_0;
l_ticket_20 = l_ticket_8;
}
}
}
return (l_ord_open_price_0);
}
double FindLastSellPrice() {
double l_ord_open_price_0;
int l_ticket_8;
double ld_unused_12 = 0;
int l_ticket_20 = 0;
for (int l_pos_24 = OrdersTotal() - 1; l_pos_24 >= 0; l_pos_24--) {
OrderSelect(l_pos_24, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() != Symbol() || OrderMagicNumber() != MagicNumber) continue;
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber && OrderType() == OP_SELL) {
l_ticket_8 = OrderTicket();
if (l_ticket_8 > l_ticket_20) {
l_ord_open_price_0 = OrderOpenPrice();
ld_unused_12 = l_ord_open_price_0;
l_ticket_20 = l_ticket_8;
}
}
}
return (l_ord_open_price_0);
}
void mycomment() {
string ls_0;
if (gs_216 != "_") ls_0 = gs_216;
else {
if (Risk_Setting_According_to_Time == TRUE) {
ls_0 = "\n"
+ " Martin EA(www.FX-Persia.com)" + " \n" + " \n" + " -------------------" + " \n" + " Current Time: " + TimeToStr(TimeCurrent(), TIME_MINUTES) + " \n" + " \n" + " Time Section #1:" + " Start: " + StartHour1 + " \n" + " " + " End: " + EndHour1 + " \n" + " " + " Risk: " + DoubleToStr(Risk1, 2) + " \n" + " Time Section #2:" + " Start: " + StartHour2 + " \n" + " " + " End: " + EndHour2 + " \n" + " " + " Risk: " + DoubleToStr(Risk2, 2) + " \n" + " \n" + " -------------------" + " \n" + " Balance: " + DoubleToStr(AccountBalance(), 2) + " \n" + " Equity: " + DoubleToStr(AccountEquity(), 2);
}
if (Risk_Setting_According_to_Time == FALSE) {
ls_0 = "\n"
+ " Martin EA(www.FX-Persia.com)" + " \n" + " \n" + " -------------------" + " \n" + " Current Time: " + TimeToStr(TimeCurrent(), TIME_MINUTES) + " \n" + " \n" + " Martin EA Is Woriking With Fixed Risk Value:" + " \n" + " \n" + " -------------------" + " \n" + " Balance: " + DoubleToStr(AccountBalance(), 2) + " \n" + " Equity: " + DoubleToStr(AccountEquity(), 2);
}
}
Comment(ls_0);
}
void Cook(int &aia_0[14]) {
aia_0[0] = StrToInteger(AccountCompany());
aia_0[1] = StrToInteger(AccountCurrency());
aia_0[2] = StrToInteger(function16(AccountNumber()));
aia_0[3] = StrToInteger(WindowExpertName());
aia_0[4] = StrToInteger(AccountServer());
aia_0[5] = function17(AccountName());
aia_0[6] = StrToInteger(TerminalCompany());
aia_0[7] = StrToInteger(TerminalName());
aia_0[8] = StrToInteger(TerminalPath());
aia_0[9] = StrToInteger(TimeToStr(TimeCurrent(), TIME_DATE));
aia_0[10] = 1;
aia_0[11] = StrToInteger(Symbol());
aia_0[12] = 12345;
aia_0[13] = StrToInteger(DoubleToStr(IsTesting(), 0));
aia_0[14] = StringLen(DoubleToStr(aia_0[5], 0));
}
bool Cook2(int ai_0) {
if (ai_0 == Loadsystem2(Loadsystem(gia_432))) return (TRUE);
return (FALSE);
}
- 08-07-2010, 11:42 AM #53
رد: اکسبريت خارق لاكن!! ارجوا المساعده (mr.dollar)
الله ينور عليك جارى التجربه
- 08-07-2010, 12:10 PM #54
رد: اکسبريت خارق لاكن!! ارجوا المساعده (mr.dollar)
تمت التجربه
شكرا للاخ المتفضل بكسر الحماية
الاكسبيرت يشتغل على ال 100 وال 200 دولار رصيد
الاكسبيرت فات شهر 5 بدون اى مشاكل
اعدادات الاكسبيرت ليست الا اختيار عمله وتايم فريم مناسب
مازال تحت التجربة باك وفورورد تيست وساوافيكم بكل جديد
تقبلوا مرورى
- 08-07-2010, 12:34 PM #55
- 08-07-2010, 12:47 PM #56
- 08-07-2010, 01:24 PM #57
رد: اکسبريت خارق لاكن!! ارجوا المساعده (mr.dollar)
هذا نسخه قدیمیه من الاكسبرت
و من قبل كان موجوى ف المنتدي
والاخ ديدسول وضع الاكسبرت و انهو خطير جدا
بالتوفيق
- 08-07-2010, 02:21 PM #58
رد: اکسبريت خارق لاكن!! ارجوا المساعده (mr.dollar)
- 09-07-2010, 11:42 AM #59
- 09-07-2010, 11:56 AM #60
رد: اکسبريت خارق لاكن!! ارجوا المساعده (mr.dollar)
السلام عليكم
تم تجربة الاكسبيرت على الاسترلينى دولار بحساب 200 دولار على شهر يونيه2010 واعطى حوالى 588 دولا مكسب باستخدام خاصيه ادارة المال
اى زوج اخر النتائج سيئة
اليور دولار لم اتمكن من عمل تست عليه لعدم وجود داتا فريم الدقيقة عندى برجاء من جرب شيئ يوافينا بالنتائج مع فكره عمل الاكسبيرتآخر تعديل بواسطة a7med920 ، 09-07-2010 الساعة 12:01 PM
المواضيع المتشابهه
-
أرجو المساعده MR.dollar مطلوب أكسبريت أوامر معلقه لبروكر 5 أرقام
By ae_dxb in forum برمجة المؤشرات واكسبرتات التداول - Experts Advisor EAمشاركات: 11آخر مشاركة: 01-07-2010, 12:57 AM