Примерно в нем 2/3 нехвотает
На вопрос почему не целый? Потомучто у него есть права!!!!
/*
Generated by EX4-TO-MQ4 decompiler V4.0.224.1 []
Website: _http://purebeam.biz
E-mail :
[email protected]
*/
#property copyright "Copyright © 2010, BARACUDA MULTI 2011"
#property link "http://www.expforex.com"
#include <WinUser32.mqh>
#include <stdlib.mqh>
#import "shell32.dll"
int ShellExecuteA(int a0, string a1, string a2, string a3, string a4, int a5);
#import "wininet.dll"
int InternetAttemptConnect(int a0);
int InternetOpenA(string a0, int a1, string a2, string a3, int a4);
int InternetOpenUrlA(int a0, string a1, string a2, int a3, int a4, int a5);
int InternetReadFile(int a0, int& a1[], int a2, int& a3[]);
int InternetCloseHandle(int a0);
#import
int gi_76 = 20110125;
string gs_unused_80 = "= 1 - профит, 2 -пункты ,3 -%эквити ,4 -%баланс";
int gi_88 = 2;
bool gi_unused_92 = TRUE;
extern double prifitessss = 10.0;
extern double KoefLotNextTrade = 1.0;
extern bool ModifyProfit = TRUE;
extern bool CloseLOss = FALSE;
extern double lossessss = -70.0;
extern bool TrailingStopUSE = TRUE;
extern bool ClosePerDayOut = TRUE;
extern bool ZERO_Trailing = FALSE;
extern string SymbolToWork_ = " Настройки Валютных пар";
extern bool AUTO_SET_SYMBOL_TO_DEPOSIT = FALSE;
extern int AUTO_SET_PERCENT = 50;
extern string SymbolToWork_1 = "";
extern string SymbolToWork_2 = "";
extern string SymbolToWork_3 = "";
extern string SymbolToWork_4 = "";
extern string SymbolToWork_5 = "";
extern string SymbolToWork_6 = "";
extern string SymbolToWork_7 = "";
extern string SymbolToWork_8 = "";
extern bool AUTO_GRID_SET = FALSE;
extern int MAX_GRID_COUNT = 0;
extern int GridSetPips = 0;
extern bool ReverseOpenAfterGrid = FALSE;
extern int GridToTrend = 0;
extern double ReverseKoef = 0.0;
extern string trade_ = "Настройки торговли";
extern int Magic = 777;
extern int StopLoss = 10;
extern int TakeProfit = 0;
extern int Slippage = 0;
extern bool MarketWatch = FALSE;
extern int StopOrderDeltaifUSE = 10;
extern bool ClosePosifChange = FALSE;
extern string autolot_ = "Настройки автолота";
extern double Lots = 0.1;
extern bool DynamicLot = FALSE;
extern double LotBalancePcnt = 0.1;
extern double MaxLot = 5.0;
string gs_unused_320 = "Настройки трейлингстопа";
bool gi_unused_328 = FALSE;
int gi_332 = 0;
int g_spread_336 = 1;
bool gi_340 = TRUE;
string g_symbol_344;
double gd_unused_352 = 0.1;
double gd_unused_360 = 1.0;
int gia_368[8];
double gd_372;
double gd_380;
int gi_388;
string gs_392;
int gi_408 = 1;
bool gi_412 = FALSE;
int gi_416 = 1;
double gd_420 = 0.02;
double gd_428 = 0.2;
int Calculate() {
int li_0;
if (!AUTO_SET_SYMBOL_TO_DEPOSIT) gi_388 = 8;
if (AUTO_SET_SYMBOL_TO_DEPOSIT && !IsTesting()) {
li_0 = MathRound(GetSizeLot(Symbol(), AUTO_SET_PERCENT, 1) / (GetSizeLot(Symbol(), LotBalancePcnt, 1) * (MAX_GRID_COUNT + 1)));
if (li_0 > 8) gi_388 = 8;
else gi_388 = li_0;
}
if (!IsTesting()) {
gs_392 = "\n Количество пар на депозит: " + gi_388
+ "\n Макс лотов на " + gi_388 + " пар: " + DoubleToStr(GetSizeLot(Symbol(), AUTO_SET_PERCENT, 1), 3)
+ "\n Макс лотов на 1 пару: " + DoubleToStr(GetSizeLot(Symbol(), LotBalancePcnt, 1) * (MAX_GRID_COUNT + 1), 3)
+ "\n";
}
if (IsTesting()) gi_388 = 1;
return (0);
}
int start() {
string ls_12;
double ld_20;
double ld_28;
string ls_0 = "\n\n Торгующие пары:";
if (StringFind(WindowExpertName(), "~", 0) != -1) return (0);
if (StringFind(WindowExpertName(), "BARACUDA", 0) == -1) return (0);
ls_0 = ls_0 + gs_392;
for (int li_8 = 1; li_8 <= gi_388; li_8++) {
if (!IsTesting()) {
if (li_8 == 1) g_symbol_344 = SymbolToWork_1;
if (li_8 == 2) g_symbol_344 = SymbolToWork_2;
if (li_8 == 3) g_symbol_344 = SymbolToWork_3;
if (li_8 == 4) g_symbol_344 = SymbolToWork_4;
if (li_8 == 5) g_symbol_344 = SymbolToWork_5;
if (li_8 == 6) g_symbol_344 = SymbolToWork_6;
if (li_8 == 7) g_symbol_344 = SymbolToWork_7;
if (li_8 == 8) g_symbol_344 = SymbolToWork_8;
if (g_symbol_344 == "") continue;
}
if (IsTesting() && li_8 == 1) g_symbol_344 = Symbol();
if (IsTesting() && li_8 != 1) continue;
if (IsTesting())
if (isTradeToDayHISTORY(g_symbol_344, -1, Magic) && !ExO(g_symbol_344, -1, Magic) && !EPs(g_symbol_344, -1, Magic)) break;
ls_12 = "";
if (AUTO_GRID_SET) {
ld_20 = iHigh(g_symbol_344, PERIOD_D1, 1) - iLow(g_symbol_344, PERIOD_D1, 1);
GridSetPips = ld_20 / MAX_GRID_COUNT / MarketInfo(g_symbol_344, MODE_POINT);
ls_12 = " Коридор=" + DoubleToStr(ld_20, 5) + " MAX_GRID_COUNT=" + MAX_GRID_COUNT + " GridSetPips=" + DoubleToStr(GridSetPips, 0);
} else ls_12 = " Коридор=" + DoubleToStr(iHigh(g_symbol_344, PERIOD_D1, 1) - iLow(g_symbol_344, PERIOD_D1, 1), 5);
if (TrailingStopUSE) startTral(g_symbol_344, -1, Magic);
if (ZERO_Trailing) SimpleTrailing_ZERO_LEVEL(g_symbol_344, -1, Magic, start_LEVEL_ZERO(g_symbol_344));
startCloseBlock3(g_symbol_344);
if (isTradeToDayHISTORY(g_symbol_344, -1, Magic)) ls_0 = ls_0 + " \n Символ=" + g_symbol_344 + " YES trade " + " Кол.поз.минус=" + NumberOfLossPosToday(g_symbol_344, -1, Magic) + " Кол.поз.плюс=" + NumberOfProfPosToday(g_symbol_344, -1, Magic) + " Profit=" + DoubleToStr(InfoProfPosToday(g_symbol_344, -1, Magic), 2) + " Lots=" + DoubleToStr(InfoLotsPosToday(g_symbol_344, -1, Magic), 2) + ls_12;
if (!isTradeToDayHISTORY(g_symbol_344, -1, Magic) && MarketInfo(g_symbol_344, MODE_BID) < iHigh(g_symbol_344, PERIOD_D1, 1) && MarketInfo(g_symbol_344, MODE_BID) > iLow(g_symbol_344, PERIOD_D1, 1)) ls_0 = ls_0 + " \n Символ=" + g_symbol_344 + " NO trade " + " Кол.поз.минус=" + NumberOfLossPosToday(g_symbol_344, -1, Magic) + " Кол.поз.плюс=" + NumberOfProfPosToday(g_symbol_344, -1, Magic) + " Profit=" + DoubleToStr(InfoProfPosToday(g_symbol_344, -1, Magic), 2) + " Lots=" + DoubleToStr(InfoLotsPosToday(g_symbol_344, -1, Magic), 2) + ls_12;
if (!isTradeToDay(g_symbol_344, -1, Magic) && MarketInfo(g_symbol_344, MODE_BID) > iHigh(g_symbol_344, PERIOD_D1, 1) || MarketInfo(g_symbol_344, MODE_BID) < iLow(g_symbol_344, PERIOD_D1, 1)) ls_0 = ls_0 + " \n Символ=" + g_symbol_344 + " NO trade Today " + " Кол.поз.минус=" + NumberOfLossPosToday(g_symbol_344, -1, Magic) + " Кол.поз.плюс=" + NumberOfProfPosToday(g_symbol_344, -1, Magic) + " Profit=" + DoubleToStr(InfoProfPosToday(g_symbol_344, -1, Magic), 2) + " Lots=" + DoubleToStr(InfoLotsPosToday(g_symbol_344, -1, Magic), 2) + ls_12;
DxOOnTime(g_symbol_344, -1, Magic);
if (gia_368[li_8] != iTime(g_symbol_344, PERIOD_D1, 0)) {
if (!isTradeToDay(g_symbol_344, -1, Magic) && !ExO(g_symbol_344, -1, Magic) && !EPs(g_symbol_344, -1, Magic) && MarketInfo(g_symbol_344, MODE_BID) < iHigh(g_symbol_344, PERIOD_D1, 1) &&
MarketInfo(g_symbol_344, MODE_BID) > iLow(g_symbol_344, PERIOD_D1, 1) && iHigh(g_symbol_344, PERIOD_D1, 0) < iHigh(g_symbol_344, PERIOD_D1, 1) && iLow(g_symbol_344, PERIOD_D1, 0) > iLow(g_symbol_344, PERIOD_D1, 1)) {
DxO(g_symbol_344, -1, Magic);
ld_28 = iHigh(g_symbol_344, PERIOD_D1, 1);
if (StopLoss != 0) gd_372 = ld_28 + StopOrderDeltaifUSE * MarketInfo(g_symbol_344, MODE_POINT) - StopLoss * MarketInfo(g_symbol_344, MODE_POINT);
else gd_372 = 0;
if (StopLoss == -1) gd_372 = iLow(g_symbol_344, PERIOD_D1, 1) - StopOrderDeltaifUSE * MarketInfo(g_symbol_344, MODE_POINT);
if (TakeProfit != 0) gd_380 = ld_28 + StopOrderDeltaifUSE * MarketInfo(g_symbol_344, MODE_POINT) + TakeProfit * MarketInfo(g_symbol_344, MODE_POINT);
else gd_380 = 0;
if ((gi_340 && !ExO(g_symbol_344, OP_BUYSTOP, Magic) && !EPs(g_symbol_344, -1, Magic)) || !gi_340) {
SetOrder(g_symbol_344, OP_BUYSTOP, GetSizeLot(g_symbol_344, LotBalancePcnt, DynamicLot), ld_28 + StopOrderDeltaifUSE * MarketInfo(g_symbol_344, MODE_POINT), gd_372, gd_380, Magic, "MultiBaracuda 2011");
gia_368[li_8] = iTime(g_symbol_344, PERIOD_D1, 0);
}
ld_28 = iLow(g_symbol_344, PERIOD_D1, 1);
if (StopLoss != 0) gd_372 = ld_28 - StopOrderDeltaifUSE * MarketInfo(g_symbol_344, MODE_POINT) + StopLoss * MarketInfo(g_symbol_344, MODE_POINT);
else gd_372 = 0;
if (StopLoss == -1) gd_372 = iHigh(g_symbol_344, PERIOD_D1, 1) + StopOrderDeltaifUSE * MarketInfo(g_symbol_344, MODE_POINT);
if (TakeProfit != 0) gd_380 = ld_28 - StopOrderDeltaifUSE * MarketInfo(g_symbol_344, MODE_POINT) - TakeProfit * MarketInfo(g_symbol_344, MODE_POINT);
else gd_380 = 0;
if ((gi_340 && !ExO(g_symbol_344, OP_SELLSTOP, Magic) && !EPs(g_symbol_344, -1, Magic)) || !gi_340) {
SetOrder(g_symbol_344, OP_SELLSTOP, GetSizeLot(g_symbol_344, LotBalancePcnt, DynamicLot), ld_28 - StopOrderDeltaifUSE * MarketInfo(g_symbol_344, MODE_POINT), gd_372, gd_380, Magic, "MultiBaracuda 2011");
gia_368[li_8] = iTime(g_symbol_344, PERIOD_D1, 0);
}
}
}
if (EPs(g_symbol_344, OP_BUY, Magic) && ExO(g_symbol_344, -1, Magic)) DxO(g_symbol_344, -1, Magic);
if (EPs(g_symbol_344, OP_SELL, Magic) && ExO(g_symbol_344, -1, Magic)) DxO(g_symbol_344, -1, Magic);
if (EPs(g_symbol_344, OP_BUY, Magic)) {
if (EPs(g_symbol_344, OP_BUY, Magic) && StringFind(OrderComment(), "Reverse") == -1 && EPsCOUNT(g_symbol_344, OP_BUY, Magic) < MAX_GRID_COUNT && EPsCOUNT(g_symbol_344, OP_BUY, Magic) < GridToTrend ||
!ReverseOpenAfterGrid && MarketInfo(g_symbol_344, MODE_BID) < GetMinPriceFromOpenPos(g_symbol_344, OP_BUY, Magic) - GridSetPips * MarketInfo(g_symbol_344, MODE_POINT) - MarketInfo(g_symbol_344, MODE_SPREAD) * MarketInfo(g_symbol_344, MODE_POINT)) {
DxO(g_symbol_344, OP_SELLSTOP, Magic);
EPs(g_symbol_344, OP_BUY, Magic);
Print(g_symbol_344 + " Grid ticket:" + OrderTicket());
if (StopLoss != 0) gd_372 = MarketInfo(g_symbol_344, MODE_BID) - StopLoss * MarketInfo(g_symbol_344, MODE_POINT);
else gd_372 = 0;
if (StopLoss == -1) gd_372 = STOPLOSSLastPos(g_symbol_344, OP_BUY, Magic);
if (TakeProfit != 0) gd_380 = MarketInfo(g_symbol_344, MODE_ASK) + TakeProfit * MarketInfo(g_symbol_344, MODE_POINT);
else gd_380 = 0;
if (ClosePosifChange) {
CPD(g_symbol_344, OP_SELL, Magic);
DxO(g_symbol_344, OP_SELLSTOP, Magic);
}
OPs(g_symbol_344, OP_BUY, GetSizeLot(g_symbol_344, LotBalancePcnt, DynamicLot), gd_372, gd_380, Magic, "MultiBaracuda 2011-Grid");
}
}
if (EPs(g_symbol_344, OP_SELL, Magic)) {
if (EPs(g_symbol_344, OP_SELL, Magic) && StringFind(OrderComment(), "Reverse") == -1 && EPsCOUNT(g_symbol_344, OP_SELL, Magic) < MAX_GRID_COUNT && EPsCOUNT(g_symbol_344, OP_SELL, Magic) < GridToTrend ||
!ReverseOpenAfterGrid && MarketInfo(g_symbol_344, MODE_ASK) > GetMaxPriceFromOpenPos(g_symbol_344, OP_SELL, Magic) + GridSetPips * MarketInfo(g_symbol_344, MODE_POINT) + MarketInfo(g_symbol_344, MODE_SPREAD) * MarketInfo(g_symbol_344, MODE_POINT)) {
DxO(g_symbol_344, OP_BUYSTOP, Magic);
EPs(g_symbol_344, OP_SELL, Magic);
Print(g_symbol_344 + " Grid ticket:" + OrderTicket());
if (StopLoss != 0) gd_372 = MarketInfo(g_symbol_344, MODE_ASK) + StopLoss * MarketInfo(g_symbol_344, MODE_POINT);
else gd_372 = 0;
if (StopLoss == -1) gd_372 = STOPLOSSLastPos(g_symbol_344, OP_SELL, Magic);
if (TakeProfit != 0) gd_380 = MarketInfo(g_symbol_344, MODE_BID) - TakeProfit * MarketInfo(g_symbol_344, MODE_POINT);
else gd_380 = 0;
if (ClosePosifChange) {
CPD(g_symbol_344, OP_BUY, Magic);
DxO(g_symbol_344, OP_BUYSTOP, Magic);
}
OPs(g_symbol_344, OP_SELL, GetSizeLot(g_symbol_344, LotBalancePcnt, DynamicLot), gd_372, gd_380, Magic, "MultiBaracuda 2011-Grid");
}
}
if (EPs(g_symbol_344, OP_BUY, Magic)) {
if (EPs(g_symbol_344, OP_BUY, Magic) && EPsCOUNT(g_symbol_344, OP_BUY, Magic) < MAX_GRID_COUNT && (EPsCOUNT(g_symbol_344, OP_BUY, Magic) == GridToTrend && ReverseOpenAfterGrid) &&
!EPs(g_symbol_344, OP_SELL, Magic) && MarketInfo(g_symbol_344, MODE_BID) < GetMinPriceFromOpenPos(g_symbol_344, OP_BUY, Magic) - GridSetPips * MarketInfo(g_symbol_344, MODE_POINT) - MarketInfo(g_symbol_344, MODE_SPREAD) * MarketInfo(g_symbol_344, MODE_POINT)) {
DxO(g_symbol_344, OP_SELLSTOP, Magic);
EPs(g_symbol_344, OP_BUY, Magic);
Print(g_symbol_344 + " Grid ticket:" + OrderTicket());
gd_372 = MarketInfo(g_symbol_344, MODE_ASK) + GridSetPips * MarketInfo(g_symbol_344, MODE_POINT);
gd_372 = 0;
gd_380 = STOPLOSSLastPos(g_symbol_344, OP_BUY, Magic);
if (ClosePosifChange) {
CPD(g_symbol_344, OP_BUY, Magic);
DxO(g_symbol_344, OP_BUYSTOP, Magic);
}
OPs(g_symbol_344, OP_SELL, GetSizeLotReverse(g_symbol_344), gd_372, gd_380 + MarketInfo(g_symbol_344, MODE_SPREAD) * MarketInfo(g_symbol_344, MODE_POINT), Magic, "MultiBaracuda 2011-Grid Reverse");
}
}
if (EPs(g_symbol_344, OP_SELL, Magic)) {
if (EPs(g_symbol_344, OP_SELL, Magic) && EPsCOUNT(g_symbol_344, OP_SELL, Magic) < MAX_GRID_COUNT && (EPsCOUNT(g_symbol_344, OP_SELL, Magic) == GridToTrend && ReverseOpenAfterGrid) &&
!EPs(g_symbol_344, OP_BUY, Magic) && MarketInfo(g_symbol_344, MODE_ASK) > GetMaxPriceFromOpenPos(g_symbol_344, OP_SELL, Magic) + GridSetPips * MarketInfo(g_symbol_344, MODE_POINT) + MarketInfo(g_symbol_344, MODE_SPREAD) * MarketInfo(g_symbol_344, MODE_POINT)) {
DxO(g_symbol_344, OP_BUYSTOP, Magic);
EPs(g_symbol_344, OP_SELL, Magic);
Print(g_symbol_344 + " Grid ticket:" + OrderTicket());
gd_372 = MarketInfo(g_symbol_344, MODE_ASK) - GridSetPips * MarketInfo(g_symbol_344, MODE_POINT);
gd_372 = 0;
gd_380 = STOPLOSSLastPos(g_symbol_344, OP_SELL, Magic);
if (ClosePosifChange) {
CPD(g_symbol_344, OP_SELL, Magic);
DxO(g_symbol_344, OP_SELLSTOP, Magic);
}
OPs(g_symbol_344, OP_BUY, GetSizeLotReverse(g_symbol_344), gd_372, gd_380 - MarketInfo(g_symbol_344, MODE_SPREAD) * MarketInfo(g_symbol_344, MODE_POINT), Magic, "MultiBaracuda 2011-Grid Reverse");
}
}
if (EPsComment(g_symbol_344, OP_SELL, Magic, "Reverse") && !EPs(g_symbol_344, OP_BUY, Magic)) CPD(g_symbol_344, OP_SELL, Magic);
if (EPsComment(g_symbol_344, OP_BUY, Magic, "Reverse") && !EPs(g_symbol_344, OP_SELL, Magic)) CPD(g_symbol_344, OP_BUY, Magic);
}
ls_0 = ls_0
+ "\n\n Общее: \n Количество убыточных позиций сегодня=" + NumberOfLossPosToday("", -1, Magic);
ls_0 = ls_0
+ "\n Количество прибыльных позиций сегодня=" + NumberOfProfPosToday("", -1, Magic);
ls_0 = ls_0
+ "\n Результат торгов сегодня=" + DoubleToStr(InfoProfPosToday("", -1, Magic), 2);
ls_0 = ls_0
+ "\n Закрыто лотов сегодня=" + DoubleToStr(InfoLotsPosToday("", -1, Magic), 2);
Comment(ls_0);
return (0);
}
int DxO(string as_0 = "", int a_cmd_8 = -1, int a_magic_12 = -1, int ai_16 = 0) {
int l_cmd_28;
int l_ord_total_24 = OrdersTotal();
string ls_unused_32 = " Автор функции для шаблона : www.expforex.at.ua";
if (as_0 == "0") as_0 = Symbol();
for (int l_pos_20 = l_ord_total_24 - 1; l_pos_20 >= 0; l_pos_20--) {
if (OrderSelect(l_pos_20, SELECT_BY_POS, MODE_TRADES)) {
l_cmd_28 = OrderType();
if (l_cmd_28 > OP_SELL && l_cmd_28 < 6) {
if (OrderSymbol() == as_0 || as_0 == "" && a_cmd_8 < OP_BUY || l_cmd_28 == a_cmd_8) {
if (a_magic_12 < 0 || OrderMagicNumber() == a_magic_12)
if (ai_16 <= OrderOpenTime()) OrderDelete(OrderTicket(), Black);
}
}
}
}
return (0);
}
int DxOOnTime(string a_symbol_0 = "", int a_cmd_8 = -1, int a_magic_12 = -1, int ai_unused_16 = 0) {
int l_cmd_28;
int l_ord_total_24 = OrdersTotal();
string ls_unused_32 = " Автор функции для шаблона : www.expforex.at.ua";
if (a_symbol_0 == "0") a_symbol_0 = Symbol();
for (int l_pos_20 = l_ord_total_24 - 1; l_pos_20 >= 0; l_pos_20--) {
if (OrderSelect(l_pos_20, SELECT_BY_POS, MODE_TRADES)) {
l_cmd_28 = OrderType();
if (l_cmd_28 > OP_SELL && l_cmd_28 < 6) {
if (OrderSymbol() == a_symbol_0 || a_symbol_0 == "" && a_cmd_8 < OP_BUY || l_cmd_28 == a_cmd_8) {
if (a_magic_12 < 0 || OrderMagicNumber() == a_magic_12)
if (iTime(a_symbol_0, PERIOD_D1, iBarShift(a_symbol_0, PERIOD_D1, OrderOpenTime())) < iTime(a_symbol_0, PERIOD_D1, 0)) OrderDelete(OrderTicket(), Black);
}
}
}
}
return (0);
}
void ModifyOrder(double a_ord_open_price_0 = -1.0, double a_ord_stoploss_8 = 0.0, double a_ord_takeprofit_16 = 0.0, int a_datetime_24 = 0) {
bool l_bool_28;
double l_ask_40;
double l_bid_48;
int l_error_76;
int l_digits_72 = MarketInfo(OrderSymbol(), MODE_DIGITS);
string ls_unused_84 = " Автор функции для шаблона : www.expforex.at.ua";
if (a_ord_open_price_0 <= 0.0) a_ord_open_price_0 = OrderOpenPrice();
if (a_ord_stoploss_8 < 0.0) a_ord_stoploss_8 = OrderStopLoss();
if (a_ord_takeprofit_16 < 0.0) a_ord_takeprofit_16 = OrderTakeProfit();
a_ord_open_price_0 = NormalizeDouble(a_ord_open_price_0, l_digits_72);
a_ord_stoploss_8 = NormalizeDouble(a_ord_stoploss_8, l_digits_72);
a_ord_takeprofit_16 = NormalizeDouble(a_ord_takeprofit_16, l_digits_72);
double ld_32 = NormalizeDouble(OrderOpenPrice(), l_digits_72);
double ld_56 = NormalizeDouble(OrderStopLoss(), l_digits_72);
double ld_64 = NormalizeDouble(OrderTakeProfit(), l_digits_72);
if (a_ord_open_price_0 != ld_32 || a_ord_stoploss_8 != ld_56 || a_ord_takeprofit_16 != ld_64) {
for (int li_80 = 1; li_80 <= 3; li_80++) {
if (!IsTesting() && !IsExpertEnabled() || IsStopped()) break;
while (!IsTradeAllowed()) Sleep(5000);
RefreshRates();
l_bool_28 = OrderModify(OrderTicket(), a_ord_open_price_0, a_ord_stoploss_8, a_ord_takeprofit_16, a_datetime_24);
if (l_bool_28) break;
l_error_76 = GetLastError();
l_ask_40 = MarketInfo(OrderSymbol(), MODE_ASK);
l_bid_48 = MarketInfo(OrderSymbol(), MODE_BID);
Sleep(10000);
}
}
}
bool ExO(string as_0 = "", int a_cmd_8 = -1, int a_magic_12 = -1, int ai_16 = 0) {
int l_cmd_28;
int l_ord_total_24 = OrdersTotal();
string ls_unused_32 = " Автор функции для шаблона : www.expforex.at.ua";
if (as_0 == "0") as_0 = Symbol();
for (int l_pos_20 = 0; l_pos_20 < l_ord_total_24; l_pos_20++) {
if (OrderSelect(l_pos_20, SELECT_BY_POS, MODE_TRADES)) {
l_cmd_28 = OrderType();
if (l_cmd_28 > OP_SELL && l_cmd_28 < 6) {
if (OrderSymbol() == as_0 || as_0 == "" && a_cmd_8 < OP_BUY || l_cmd_28 == a_cmd_8) {
if (a_magic_12 < 0 || OrderMagicNumber() == a_magic_12) {
if (OrderCloseTime() == 0)
if (ai_16 <= OrderOpenTime()) return (TRUE);
}
}
}
}
}
return (FALSE);
}
int SetOrder(string a_symbol_0, int a_cmd_8, double a_lots_12, double ad_20, double ad_28 = 0.0, double ad_36 = 0.0, int a_magic_44 = 0, string a_comment_48 = "") {
color l_color_56;
int l_datetime_60;
double l_ask_64;
double l_bid_72;
double l_point_80;
int l_error_88;
int l_ticket_96;
if (StringFind(WindowExpertName(), "~", 0) != -1) return (0);
if (StringFind(W