#property description "***THEONE***"
#property description "Recommended Pair EURUSD,GBPUSD,GBPCAD,GBPCAD,EURCAD,CADCHF,AUDNZD,GBPCHF"
#property description "TF H1"
#import "stdlib.ex4"
string ErrorDescription(int a0); // DA69CBAFF4D38B87377667EEC549DE5A
#import
extern double default_lot = 0.01;
extern int risk = 1.0;
extern double MaxSpread = 30.0;
extern bool mm = TRUE;
extern double Loto = 0.1;
extern double LotM = 10.0;
extern double StopLoss = 20;
extern double TakeProfit = 80;
int slippage = 3;
int Gi_352 = -1;
int Gi_356 = 0;
int Gi_360 = 0;
int G_datetime_364;
int G_leverage_368;
int Gi_372;
int Gi_376;
int Gi_380;
int Gi_384;
int Gi_388;
int Gi_392;
int Gi_396;
int Gi_400;
int Gi_404;
int Gi_408;
int Gi_412;
int Gi_416;
int Gi_420;
int Gi_424;
int G_count_428 = 0;
int Gi_432 = 0;
double Gda_436[30];
double G_lots_440;
double Gd_448;
double Gd_456;
double Gd_464;
extern double MinimumUseStopLevel = 10.0;
extern string VolatilitySettings = "23";
extern bool UseDynamicVolatilityLimit = TRUE;
extern double VolatilityMultiplier = 125.0;
extern double VolatilityLimit = 180.0;
extern bool UseVolatilityPercentage = TRUE;
double Gd_472;
double G_lotstep_480;
double G_marginrequired_488;
double Gd_496 = 0.0;
int Gi_504;
int Gi_508 = -1;
int Gi_512 = 3000000;
int Gi_516 = 0;
string Configuration = "23";
int Magic = -1;
string OrderCmt = "TheOne";
extern bool ECN_Mode = TRUE;
extern string TradingSettings = "0012";
extern int MaxExecution = 0;
extern int MaxExecutionMinutes = 5;
extern double AddPriceGap = 0.0;
extern double TrailingStart = 1.0;
extern double Commission = 0.0;
extern double VolatilityPercentageLimit = 0.0;
extern string UseIndicatorSet = "134";
extern int UseIndicatorSwitch = 3;
extern double BBDeviation = 1.5;
extern double EnvelopesDeviation = 0.07;
extern int OrderExpireSeconds = 3600;
string Money_Management = "MM";
string Screen_Shooter = "42";
bool TakeShots = FALSE;
int DelayTicks = 1;
bool Debug = FALSE;
bool Verbose = FALSE;
int ShotsPerBar = 1;
string Gs_320 = "TheOne";
int G_period_328 = 3;
int G_digits_332 = 0;
int Gi_336 = 0;
datetime G_time_340 = 0;
int G_count_344 = 0;
int Gi_348 = 0;
int init() {
// код доступен только после оплаты
}
int deinit() {
string Ls_0 = "";
if (IsTesting() && MaxExecution > 0) {
Ls_0 = Ls_0 + "During backtesting " + G_count_428 + " number of ticks was ";
Ls_0 = Ls_0 + "skipped to simulate latency of up to " + MaxExecution + " ms";
f0_3(Ls_0);
}
f0_5();
Print(Gs_320, " has been deinitialized!");
return (0);
}
int start() {
// код доступен только после оплаты
}
void f0_9() {
string Ls_unused_8;
bool bool_24;
int Li_32;
int Li_36;
int Li_40;
int ticket_52;
int Li_88;
int Li_92;
double Ld_128;
double price_144;
double order_stoploss_152;
double order_takeprofit_160;
double Ld_184;
double Ld_192;
double Ld_200;
double Ld_208;
double Ld_216;
double Ld_224;
double Ld_232;
double Ld_240;
double Ld_248;
double price_312;
double Ld_344;
if (G_time_340 < Time[0]) {
if (Gi_432 < 10) Gi_432++;
Gd_496 += (G_count_344 - Gd_496) / Gi_432;
G_time_340 = Time[0];
G_count_344 = 0;
} else G_count_344++;
if (IsTesting() && MaxExecution != 0 && Gi_352 != -1) {
Ld_344 = MathRound(Gd_496 * MaxExecution / 60000.0);
if (G_count_428 >= Ld_344) {
Gi_352 = -1;
G_count_428 = 0;
} else {
G_count_428++;
return;
}
}
double ask_96 = MarketInfo(Symbol(), MODE_ASK);
double bid_104 = MarketInfo(Symbol(), MODE_BID);
double ihigh_168 = iHigh(Symbol(), PERIOD_M1, 0);
double ilow_176 = iLow(Symbol(), PERIOD_M1, 0);
double Ld_280 = ihigh_168 - ilow_176;
string Ls_16 = "";
if (UseIndicatorSwitch == 1 || UseIndicatorSwitch == 4) {
Ld_184 = iMA(Symbol(), PERIOD_M1, G_period_328, 0, MODE_LWMA, PRICE_LOW, 0);
Ld_192 = iMA(Symbol(), PERIOD_M1, G_period_328, 0, MODE_LWMA, PRICE_HIGH, 0);
Ld_200 = Ld_192 - Ld_184;
Li_32 = bid_104 >= Ld_184 + Ld_200 / 2.0;
Ls_16 = "iMA_low: " + f0_6(Ld_184) + ", iMA_high: " + f0_6(Ld_192) + ", iMA_diff: " + f0_6(Ld_200);
}
if (UseIndicatorSwitch == 2) {
Ld_208 = iBands(Symbol(), PERIOD_M1, G_period_328, BBDeviation, 0, PRICE_OPEN, MODE_UPPER, 0);
Ld_216 = iBands(Symbol(), PERIOD_M1, G_period_328, BBDeviation, 0, PRICE_OPEN, MODE_LOWER, 0);
Ld_224 = Ld_208 - Ld_216;
Li_36 = bid_104 >= Ld_216 + Ld_224 / 2.0;
Ls_16 = "iBands_upper: " + f0_6(Ld_216) + ", iBands_lower: " + f0_6(Ld_216) + ", iBands_diff: " + f0_6(Ld_224);
}
if (UseIndicatorSwitch == 3) {
Ld_232 = iEnvelopes(Symbol(), PERIOD_M1, G_period_328, MODE_LWMA, 0, PRICE_OPEN, EnvelopesDeviation, MODE_UPPER, 0);
Ld_240 = iEnvelopes(Symbol(), PERIOD_M1, G_period_328, MODE_LWMA, 0, PRICE_OPEN, EnvelopesDeviation, MODE_LOWER, 0);
Ld_248 = Ld_232 - Ld_240;
Li_40 = bid_104 >= Ld_240 + Ld_248 / 2.0;
Ls_16 = "iEnvelopes_upper: " + f0_6(Ld_232) + ", iEnvelopes_lower: " + f0_6(Ld_240) + ", iEnvelopes_diff: " + f0_6(Ld_248);
}
bool Li_48 = FALSE;
int Li_72 = 0;
if (UseIndicatorSwitch == 1 && Li_32 == 1) {
Li_48 = TRUE;
Gd_448 = Ld_192;
Gd_456 = Ld_184;
} else {
if (UseIndicatorSwitch == 2 && Li_36 == 1) {
Li_48 = TRUE;
Gd_448 = Ld_208;
Gd_456 = Ld_216;
} else {
if (UseIndicatorSwitch == 3 && Li_40 == 1) {
Li_48 = TRUE;
Gd_448 = Ld_232;
Gd_456 = Ld_240;
}
}
}
double Ld_288 = ask_96 - bid_104;
int datetime_56 = TimeCurrent() + OrderExpireSeconds;
G_lots_440 = f0_11();
ArrayCopy(Gda_436, Gda_436, 0, 1, 29);
Gda_436[29] = Ld_288;
if (Gi_348 < 30) Gi_348++;
double Ld_320 = 0;
int pos_64 = 29;
for (int count_68 = 0; count_68 < Gi_348; count_68++) {
Ld_320 += Gda_436[pos_64];
pos_64--;
}
double Ld_296 = Ld_320 / Gi_348;
double Ld_328 = f0_12(ask_96 + Commission);
double Ld_336 = f0_12(bid_104 - Commission);
double Ld_304 = Ld_296 + Commission;
if (UseDynamicVolatilityLimit == TRUE) VolatilityLimit = Ld_304 * VolatilityMultiplier;
if (Ld_280 && VolatilityLimit && Gd_456 && Gd_448 && UseIndicatorSwitch != 4) {
if (Ld_280 > VolatilityLimit) {
Ld_128 = Ld_280 / VolatilityLimit;
if (UseVolatilityPercentage == FALSE || (UseVolatilityPercentage == TRUE && Ld_128 > VolatilityPercentageLimit)) {
if (bid_104 < Gd_456) Li_72 = -1;
else
if (bid_104 > Gd_448) Li_72 = 1;
}
} else Ld_128 = 0;
}
if (AccountBalance() <= 0.0) {
Comment("ERROR -- Account Balance is " + DoubleToStr(MathRound(AccountBalance()), 0));
return;
}
Gi_352 = -1;
int count_76 = 0;
int count_80 = 0;
for (pos_64 = 0; pos_64 < OrdersTotal(); pos_64++) {
OrderSelect(pos_64, SELECT_BY_POS, MODE_TRADES);
if (OrderMagicNumber() == Magic && OrderCloseTime() == 0) {
if (OrderSymbol() != Symbol()) {
count_80++;
continue;
}
switch (OrderType()) {
case OP_BUY:
RefreshRates();
order_stoploss_152 = OrderStopLoss();
order_takeprofit_160 = OrderTakeProfit();
if (order_takeprofit_160 < f0_12(Ld_328 + TakeProfit * Point + AddPriceGap) && Ld_328 + TakeProfit * Point + AddPriceGap - order_takeprofit_160 > TrailingStart) {
order_stoploss_152 = f0_12(bid_104 - StopLoss * Point - AddPriceGap);
order_takeprofit_160 = f0_12(Ld_328 + TakeProfit * Point + AddPriceGap);
if (order_stoploss_152 != OrderStopLoss() && order_takeprofit_160 != OrderTakeProfit()) {
Gi_352 = GetTickCount();
bool_24 = OrderModify(OrderTicket(), 0, order_stoploss_152, order_takeprofit_160, datetime_56, Lime);
}
if (bool_24 == TRUE) {
Gi_352 = GetTickCount() - Gi_352;
if (TakeShots && (!IsTesting())) f0_8();
} else {
Gi_352 = -1;
f0_0();
if (Debug || Verbose) Print("Order could not be modified because of ", ErrorDescription(GetLastError()));
if (order_stoploss_152 == 0.0) bool_24 = OrderModify(OrderTicket(), 0, NormalizeDouble(Bid - 30.0, G_digits_332), 0, 0, Red);
}
}
count_76++;
break;
case OP_SELL:
RefreshRates();
order_stoploss_152 = OrderStopLoss();
order_takeprofit_160 = OrderTakeProfit();
if (order_takeprofit_160 > f0_12(Ld_336 - TakeProfit * Point - AddPriceGap) && order_takeprofit_160 - Ld_336 + TakeProfit * Point - AddPriceGap > TrailingStart) {
order_stoploss_152 = f0_12(ask_96 + StopLoss * Point + AddPriceGap);
order_takeprofit_160 = f0_12(Ld_336 - TakeProfit * Point - AddPriceGap);
if (order_stoploss_152 != OrderStopLoss() && order_takeprofit_160 != OrderTakeProfit()) {
Gi_352 = GetTickCount();
bool_24 = OrderModify(OrderTicket(), 0, order_stoploss_152, order_takeprofit_160, datetime_56, Orange);
}
if (bool_24 == TRUE) {
Gi_352 = GetTickCount() - Gi_352;
if (TakeShots && (!IsTesting())) f0_8();
} else {
Gi_352 = -1;
f0_0();
if (Debug || Verbose) Print("Order could not be modified because of ", ErrorDescription(GetLastError()));
Sleep(1000);
if (order_stoploss_152 == 0.0) bool_24 = OrderModify(OrderTicket(), 0, NormalizeDouble(Ask + 30.0, G_digits_332), 0, 0, Red);
}
}
count_76++;
break;
case OP_BUYSTOP:
if (Li_48 == FALSE) {
price_144 = f0_12(ask_96 + Gd_464 + AddPriceGap);
order_stoploss_152 = f0_12(price_144 - Ld_288 - StopLoss * Point - AddPriceGap);
order_takeprofit_160 = f0_12(price_144 + Commission + TakeProfit * Point + AddPriceGap);
if (price_144 < OrderOpenPrice() && OrderOpenPrice() - price_144 > TrailingStart) {
if (order_stoploss_152 != OrderStopLoss() && order_takeprofit_160 != OrderTakeProfit()) {
RefreshRates();
Gi_352 = GetTickCount();
bool_24 = OrderModify(OrderTicket(), price_144, order_stoploss_152, order_takeprofit_160, 0, Lime);
}
if (bool_24 == TRUE) {
Gi_352 = GetTickCount() - Gi_352;
if (Debug || Verbose) Print("Order executed in " + Gi_352 + " ms");
} else {
Gi_352 = -1;
f0_0();
}
}
count_76++;
} else OrderDelete(OrderTicket());
break;
case OP_SELLSTOP:
if (Li_48 == TRUE) {
price_144 = f0_12(bid_104 - Gd_464 - AddPriceGap);
order_stoploss_152 = f0_12(price_144 + Ld_288 + StopLoss * Point + AddPriceGap);
order_takeprofit_160 = f0_12(price_144 - Commission - TakeProfit * Point - AddPriceGap);
if (price_144 > OrderOpenPrice() && price_144 - OrderOpenPrice() > TrailingStart) {
if (order_stoploss_152 != OrderStopLoss() && order_takeprofit_160 != OrderTakeProfit()) {
RefreshRates();
Gi_352 = GetTickCount();
bool_24 = OrderModify(OrderTicket(), price_144, order_stoploss_152, order_takeprofit_160, 0, Orange);
}
if (bool_24 == TRUE) {
Gi_352 = GetTickCount() - Gi_352;
if (Debug || Verbose) Print("Order executed in " + Gi_352 + " ms");
} else {
Gi_352 = -1;
f0_0();
}
}
count_76++;
} else OrderDelete(OrderTicket());
}
}
}
if (Gi_336 >= 0 || Gi_336 == -2) {
Li_92 = NormalizeDouble(bid_104 / Point, 0);
Li_88 = NormalizeDouble(ask_96 / Point, 0);
if (Li_92 % 10 != 0 || Li_88 % 10 != 0) Gi_336 = -1;
else {
if (Gi_336 >= 0 && Gi_336 < 10) Gi_336++;
else Gi_336 = -2;
}
}
int Li_unused_28 = 0;
if (Li_72 != 0 && MaxExecution > 0 && Gi_356 > MaxExecution) {
Li_72 = 0;
if (Debug || Verbose) Print("Server is too Slow. Average Execution: " + Gi_356);
}
double Ld_112 = ask_96 + Gd_464;
double Ld_120 = bid_104 - Gd_464;
if (count_76 == 0 && Li_72 != 0 && f0_12(Ld_304) <= f0_12(MaxSpread * Point) && Gi_336 == -1) {
if (Li_72 == -1 || Li_72 == 2 ) {
price_144 = ask_96 + Gd_464;
if (ECN_Mode == TRUE) {
price_144 = Ld_112;
order_stoploss_152 = 0;
order_takeprofit_160 = 0;
Gi_352 = GetTickCount();
ticket_52 = OrderSend(Symbol(), OP_BUYSTOP, G_lots_440, price_144, slippage, order_stoploss_152, order_takeprofit_160, OrderCmt, Magic, 0, Lime);
if (ticket_52 > 0) {
Gi_352 = GetTickCount() - Gi_352;
if (Debug || Verbose) Print("Order executed in " + Gi_352 + " ms");
if (TakeShots && (!IsTesting())) f0_8();
} else {
Li_unused_28 = 1;
Gi_352 = -1;
f0_0();
}
if (OrderSelect(ticket_52, SELECT_BY_TICKET)) {
RefreshRates();
price_144 = OrderOpenPrice();
order_stoploss_15Показано первые 50% кода (символов: 22015)
Введите ваш email и нажмите кнопку, чтобы перейти к оплате.