← К каталогу
Исходный код · ID 695

trio_4.2.mq4

Похожие материалы по тегам

ares_indicator.pineTradingView · 1 общих теговgold_trend_revers.mq5MQL5 / MetaTrader 5 · 1 общих тегов!!!-mt4 x-xardg-rsi.mq5MQL5 / MetaTrader 5 · 1 общих тегов! cycle-identifier.mq5MQL5 / MetaTrader 5 · 1 общих тегов!!! rsi ma simple+arrows 1.2 (mtf).mq5MQL5 / MetaTrader 5 · 1 общих теговprecisionflowea.mq5MQL5 / MetaTrader 5 · 1 общих тегов
Вы автор или правообладатель?

Сообщите нам, если считаете, что материал размещён без разрешения.

Краткий обзор

О программе

Trio — торговый советник для MetaTrader 4, объединяющий три независимых торговых модуля: Jaipong, Keroncong и Tortor. Каждый модуль работает автономно, имеет собственные параметры объёма, лимиты убытков, максимальное количество сделок и шаги открытия позиций. Модули используют индикатор RSI для генерации сигналов на покупку и продажу.

Советник поддерживает прогрессивное увеличение объёма сделок с экспонентой, функцию трейлинг-стоп, защиту по эквити и ограничение по времени торговли (закрытие в пятницу, открытие в понедельник). Встроена возможность автоматической генерации магических чисел для разных символов.

Доступен режим отчётности в CSV-файлах с фиксацией шагов и результатов по каждому модулю. На графике отображаются информационные метки с данными о количестве открытых позиций, прибыли и максимальном убытке для каждого из трёх модулей.

Настройки программы

НастройкаОписание
Jaipong Включает или отключает торговый модуль Jaipong.
Keroncong Включает или отключает торговый модуль Keroncong.
Tortor Включает или отключает торговый модуль Tortor.
Lots Начальный размер лота для открытия первой позиции.
LotExponent Экспонента для прогрессивного увеличения размера лота при каждом последующем шаге открытия позиции.
next_step_after Таймфрейм, после завершения которого проверяется возможность открытия следующей позиции.
Filter_MA Переключатель фильтра скользящей средней. При выключении фильтр не применяется при открытии позиций.
PERIOD_MA Таймфрейм для расчёта скользящей средней, используемой в фильтре.
close_next_Jaipong Автоматически закрывает все позиции модуля Jaipong при активации следующего модуля.
close_next_Keroncong Автоматически закрывает все позиции модуля Keroncong при активации следующего модуля.
close_next_Tortor Автоматически закрывает все позиции модуля Tortor при активации следующего модуля.
report Включает или отключает запись отчёта в CSV-файл с информацией о шагах и результатах по каждому модулю.
Jaipong_Loss_Limit Максимальный допустимый убыток по модулю Jaipong. При превышении все позиции модуля закрываются.
Keroncong_Loss_Limit Максимальный допустимый убыток по модулю Keroncong. При превышении все позиции модуля закрываются.
Tortor_Loss_Limit Максимальный допустимый убыток по модулю Tortor. При превышении все позиции модуля закрываются.
MaxTrades_Hilo Максимальное количество одновременно открытых позиций по модулю Jaipong.
MaxTrades_15 Максимальное количество одновременно открытых позиций по модулю Keroncong.
MaxTrades_16 Максимальное количество одновременно открытых позиций по модулю Tortor.
max_J_steps Максимальное количество шагов открытия позиций для модуля Jaipong.
max_K_steps Максимальное количество шагов открытия позиций для модуля Keroncong.
max_T_steps Максимальное количество шагов открытия позиций для модуля Tortor.
Auto_MagicNumber Включает или отключает автоматическое назначение магических чисел для ордеров в зависимости от торгового символа (EURUSD, USDJPY, EURJPY, AUDUSD).
MagicNumber_Hilo Магическое число, используемое для идентификации ордеров модуля Jaipong.
G_magic_176_15 Магическое число, используемое для идентификации ордеров модуля Keroncong.
G_magic_176_16 Магическое число, используемое для идентификации ордеров модуля Tortor.
MaxLots Максимально допустимый размер лота при торговле.
MM Включает или отключает систему управления денежными средствами с автоматическим расчётом размера лота на основе баланса счёта.
TakeProfit Тейк-профит в пунктах для фиксации прибыли по открытым позициям.
UseEquityStop Включает или отключает защиту по эквити, закрывающую все позиции при превышении убытка заданного процента.
TotalEquityRisk Процент риска от общего капитала, используемый при расчёте защиты по эквити.
t2 Текстовый параметр, используемый как заголовок раздела настроек времени.
CloseFriday Включает автоматическое закрытие всех позиций в пятницу в указанном часе.
CloseFridayHour Час в пятницу для автоматического закрытия всех открытых позиций.
OpenMondey Включает автоматическое закрытие всех позиций в понедельник до указанного часа.
OpenMondeyHour Час в понедельник для автоматического закрытия всех открытых позиций.
t3 Текстовый параметр, используемый как заголовок раздела настроек модуля Jaipong.
UseTrailingStop_Hilo Включает или отключает трейлинг-стоп для модуля Jaipong.
TrailStart_Hilo Прибыль в пунктах, при достижении которой активируется трейлинг-стоп для модуля Jaipong.
TrailStop_Hilo Расстояние стоп-лосса в пунктах от цены для трейлинг-стопа модуля Jaipong.
PipStep_Hilo Шаг в пунктах для модуля Jaipong, определяющий условие открытия следующей позиции.
slip_Hilo Допустимое проскальзывание в пунктах для модуля Jaipong.
t4 Текстовый параметр, используемый как заголовок раздела настроек модуля Keroncong.
PipStep_15 Шаг в пунктах для модуля Keroncong, определяющий условие открытия следующей позиции.
UseTrailingStop_15 Включает или отключает трейлинг-стоп для модуля Keroncong.
TrailStart_15 Прибыль в пунктах, при достижении которой активируется трейлинг-стоп для модуля Keroncong.
TrailStop_15 Расстояние стоп-лосса в пунктах от цены для трейлинг-стопа модуля Keroncong.
slip_15 Допустимое проскальзывание в пунктах для модулей Keroncong.
t5 Текстовый параметр, используемый как заголовок раздела настроек модуля Tortor.
UseTrailingStop_16 Включает или отключает трейлинг-стоп для модуля Tortor.
TrailStart_16 Прибыль в пунктах, при достижении которой активируется трейлинг-стоп для модуля Tortor.
TrailStop_16 Расстояние стоп-лосса в пунктах от цены для трейлинг-стопа модуля Tortor.
PipStep_16 Шаг в пунктах для модуля Tortor, определяющий условие открытия следующей позиции.
slip_16 Допустимое проскальзывание в пунктах для модуля Tortor.
Получить полный код

Поиск по коду файла

extern bool Jaipong = FALSE;
extern bool Keroncong = TRUE;
extern bool Tortor = FALSE;

extern double Lots = 0.01;
extern double LotExponent = 1.5;

extern int next_step_after = PERIOD_H1;
extern bool Filter_MA = TRUE;
extern int PERIOD_MA = PERIOD_H1;

extern bool close_next_Jaipong = FALSE;
extern bool close_next_Keroncong = FALSE;
extern bool close_next_Tortor = FALSE;

int PERIOD = 60;

extern bool report = FALSE;

extern double Jaipong_Loss_Limit = -3000.0;
extern double Keroncong_Loss_Limit = -3000.0;
extern double Tortor_Loss_Limit = -3000.0;

extern int MaxTrades_Hilo = 10;
extern int MaxTrades_15 = 10;
extern int MaxTrades_16 = 10;

extern int max_J_steps = 50000;
extern int max_K_steps = 50000;
extern int max_T_steps = 50000;

extern bool Auto_MagicNumber = TRUE;
extern int MagicNumber_Hilo = 11111;
extern int G_magic_176_15 = 22222;
extern int G_magic_176_16 = 33333;

double Jai_lot, Jai;
double Ker_lot, Ker;
double Tor_lot, Tor; 

double max_loss_J=0;
double max_loss_K=0;
double max_loss_T=0;

int J, K, T;

int MagicJ;
int MagicK;
int MagicT;

string a, b, c;
string posJ, posK, posT;

int step_J = 0; 
int step_K = 0;
int step_T = 0;

int J_r = 0; 
int K_r = 0;
int T_r = 0;

double Jai_r=0;
double Ker_r=0;
double Tor_r=0;

int last_step_J=0;
int last_step_K=0;
int last_step_T=0;

int Gi_108 = 2;
extern double MaxLots = 5.0;
extern bool MM = FALSE;
extern double TakeProfit = 30.0;
extern bool UseEquityStop = FALSE;
extern double TotalEquityRisk = 20.0;
extern string t2 = "Time Setting";
extern bool CloseFriday = FALSE;
extern int CloseFridayHour = 17;
extern bool OpenMondey = FALSE;
extern int OpenMondeyHour = 0;
extern string t3 = "Setting for Dancing Jaipong";
bool Gi_220 = FALSE;
double Gd_224 = 48.0;
extern bool UseTrailingStop_Hilo = FALSE;
double G_pips_236 = 500.0;
extern double TrailStart_Hilo = 10.0;
extern double TrailStop_Hilo = 5.0;
extern double PipStep_Hilo = 30.0;
extern double slip_Hilo = 3.0;
double G_price_280;
double Gd_288;
double Gd_unused_296;
double Gd_unused_304;
double G_price_312;
double G_bid_320;
double G_ask_328;
double Gd_336;
double Gd_344;
bool Gi_360;
string Gs_364 = "Dancing Jaipong";
int Gi_372 = 0;
int Gi_376;
int Gi_380 = 0;
double Gd_384;
int G_pos_392 = 0;
int Gi_396;
double Gd_400 = 0.0;
bool Gi_408 = FALSE;
bool Gi_412 = FALSE;
bool Gi_416 = FALSE;
int Gi_420;
bool Gi_424 = FALSE;
double Gd_428;
double Gd_436;
extern string t4 = "Setting for Dancing Keroncong";
extern double PipStep_15 = 30.0;

extern bool UseTrailingStop_15 = FALSE;
double G_pips_508 = 500.0;
extern double TrailStart_15 = 10.0;
extern double TrailStop_15 = 5.0;
bool Gi_532 = FALSE;
double Gd_536 = 48.0;
extern double slip_15 = 3.0;
double G_price_564;
double Gd_572;
double G_price_596;
double G_bid_604;
double G_ask_612;
double Gd_620;
double Gd_628;
double Gd_636;
bool Gi_644;
string Gs_648 = "Dancing Keroncong";
int Gi_656 = 0;
int Gi_660;
int Gi_664 = 0;
double Gd_668;
int G_pos_676 = 0;
int Gi_680;
double Gd_684 = 0.0;
bool Gi_692 = FALSE;
bool Gi_696 = FALSE;
bool Gi_700 = FALSE;
int Gi_704;
bool Gi_708 = FALSE;
double Gd_712;
double Gd_720;
int G_datetime_728 = 1;
extern string t5 = "Setting for Dancing Tortor";
int G_timeframe_784 = PERIOD_M1;
extern bool UseTrailingStop_16 = FALSE;
double G_pips_792 = 500.0;
extern double TrailStart_16 = 10.0;
extern double TrailStop_16 = 5.0;
bool Gi_816 = FALSE;
double Gd_820 = 48.0;
extern double PipStep_16 = 30.0;
extern double slip_16 = 3.0;
double G_price_848;
double Gd_856;
double Gd_unused_864;
double Gd_unused_872;
double G_price_880;
double G_bid_888;
double G_ask_896;
double Gd_904;
double Gd_912;
double Gd_920;
bool Gi_928;
string Gs_932 = "Dancing Tortor";
int Gi_940 = 0;
int Gi_944;
int Gi_948 = 0;
double Gd_952;
int G_pos_960 = 0;
int Gi_964;
double Gd_968 = 0.0;
bool Gi_976 = FALSE;
bool Gi_980 = FALSE;
bool Gi_984 = FALSE;
int Gi_988;
bool Gi_992 = FALSE;
double Gd_996;
double Gd_1004;
int G_datetime_1012 = 1;
bool G_corner_1052 = TRUE;
int Gi_1056 = 0;
int Gi_1060 = 10;
int G_window_1064 = 0;
bool Gi_1068 = TRUE;
bool Gi_unused_1072 = TRUE;
bool Gi_1076 = FALSE;
int G_color_1080 = Gray;
int G_color_1084 = Gray;
int G_color_1088 = Gray;
int G_color_1092 = DarkOrange;
int Gi_unused_1096 = 36095;
int G_color_1100 = Lime;
int G_color_1104 = OrangeRed;
int Gi_1108 = 65280;
int Gi_1112 = 17919;
int G_color_1116 = Lime;
int G_color_1120 = Red;
int G_color_1124 = Orange;
int G_period_1128 = 8;
int G_period_1132 = 17;
int G_period_1136 = 9;
int G_applied_price_1140 = PRICE_CLOSE;
int G_color_1144 = Lime;
int G_color_1148 = Tomato;
int G_color_1152 = Green;
int G_color_1156 = Red;
int G_period_1176 = 9;
int G_applied_price_1180 = PRICE_CLOSE;
int G_period_1192 = 13;
int G_applied_price_1196 = PRICE_CLOSE;
int G_period_1208 = 5;
int G_period_1212 = 3;
int G_slowing_1216 = 3;
int G_ma_method_1220 = MODE_EMA;
int G_color_1232 = Lime;
int G_color_1236 = Red;
int G_color_1240 = Orange;
int G_period_1252 = 5;
int G_period_1256 = 9;
int G_ma_method_1260 = MODE_EMA;
int G_applied_price_1264 = PRICE_CLOSE;
int G_color_1276 = Lime;
int G_color_1280 = Red;
string Gs_dummy_1292;
string G_text_1464;
string G_text_1472;
bool Gi_1480 = FALSE;//TRUE;
extern string KEY = "";
int Gi_1492;
int G_str2int_1496;
int G_str2int_1500;
int G_str2int_1504;
bool MA;

int init()                                      
   {
      // код доступен только после оплаты
   } 

int start() {
      // код доступен только после оплаты
   }

   string Ls_unused_100;
   color color_108;
   int Li_unused_112;
   double ihigh_1128;
   double ilow_1136;
   double iclose_1144;
   double iclose_1152;
   double Ld_1192;
   double Ld_1248;
   double Ld_1256;
   int Li_1264;
   int count_1268;
   double Ld_1316;
   double Ld_1324;
   int Li_1332;
   int count_1336;

      color ColorJ=Yellow;
      color ColorK=Yellow;
      color ColorT=Yellow;   

      Jai_lot=0; Jai=0; J=0;
      Ker_lot=0; Ker=0; K=0;
      Tor_lot=0; Tor=0; T=0;

    if (close_next_Jaipong == TRUE && f0_4()==0 )  Jaipong = FALSE;
    if (close_next_Keroncong == TRUE && f0_5()==0) Keroncong = FALSE;
    if (close_next_Tortor == TRUE && f0_12()==0) Tortor = FALSE;

   double ww=iMA(NULL,PERIOD_MA,29,0,MODE_LWMA,PRICE_CLOSE,1);

   if (Jaipong == TRUE) 
   {

   double Ld_1160 = LotExponent;
   int Li_1168 = Gi_108;
   double Ld_1172 = TakeProfit;
   bool bool_1180 = UseEquityStop;
   double Ld_1184 = TotalEquityRisk;
         if (MM == TRUE) 
           {
               if (MathCeil(AccountBalance()) < 2000.0) Ld_1192 = Lots;
               else Ld_1192 = 0.00001 * MathCeil(AccountBalance());
           }   else Ld_1192 = Lots;
         if ((CloseFriday == TRUE && DayOfWeek() == 5 && TimeCurrent() >= StrToTime(CloseFridayHour + ":00")) || (OpenMondey == TRUE && DayOfWeek() == 1 && TimeCurrent() <= StrToTime(OpenMondeyHour + ":00")))
             return (0);
         if (UseTrailingStop_Hilo) f0_35(TrailStart_Hilo, TrailStop_Hilo, G_price_312);
         if (Gi_220)
            {
            if (TimeCurrent() >= Gi_376) {
               f0_24();
               Print("Closed All due_Hilo to TimeOut"); }
            }
         if (Gi_372 == Time[0]) return (0);
         Gi_372 = Time[0];
         double Ld_1200 = f0_31();
         if (bool_1180) {
            if (Ld_1200 < 0.0 && MathAbs(Ld_1200) > Ld_1184 / 100.0 * f0_7()) {
               f0_24();
               Print("Closed All due_Hilo to Stop Out");
               Gi_424 = FALSE;
            }
         }

   Gi_396 = f0_4();
   if (Gi_396 == 0) Gi_360 = FALSE;
   for (G_pos_392 = OrdersTotal() - 1; G_pos_392 >= 0; G_pos_392--)
    {
      OrderSelect(G_pos_392, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() != Symbol() || OrderMagicNumber() != MagicNumber_Hilo) continue;
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber_Hilo) {
         if (OrderType() == OP_BUY) {
            Gi_412 = TRUE;
            Gi_416 = FALSE;
            break;
         }
      }
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber_Hilo) {
         if (OrderType() == OP_SELL) {
            Gi_412 = FALSE;
            Gi_416 = TRUE;
            break;
         }
      }
    }

   if (Gi_396 > 0 && Gi_396 <= MaxTrades_Hilo) {
      RefreshRates();
      Gd_336 = f0_32();
      Gd_344 = f0_20();
      if (Gi_412 && Gd_336 - Ask >= PipStep_Hilo * Point) Gi_408 = TRUE;
      if (Gi_416 && Bid - Gd_344 >= PipStep_Hilo * Point) Gi_408 = TRUE;
   }
   if (Gi_396 < 1) {
      Gi_416 = FALSE;
      Gi_412 = FALSE;
      Gi_408 = TRUE;
      Gd_288 = AccountEquity();
   }
   if (Gi_408) {
      Gd_336 = f0_32();
      Gd_344 = f0_20();
      if (Gi_416) {
         Gi_380 = Gi_396;
         Gd_384 = NormalizeDouble(Ld_1192 * MathPow(Ld_1160, Gi_380), Li_1168);  // ??????????? ??????????? ???? (x 1.5)
         RefreshRates();
         Gi_420 = f0_3(1, Gd_384, Bid, slip_Hilo, Ask, 0, 0, Gs_364 + "-" + Gi_380, MagicNumber_Hilo, 0, HotPink);
         if (Gi_420 < 0) {
            Print("Error: ", GetLastError());
            return (0);
         }
         Gd_344 = f0_20();
         Gi_408 = FALSE;
         Gi_424 = TRUE;
      } else {
         if (Gi_412) {
            Gi_380 = Gi_396;
            Gd_384 = NormalizeDouble(Ld_1192 * MathPow(Ld_1160, Gi_380), Li_1168); // ??????????? ??????????? ???? (x 1.5)
            Gi_420 = f0_3(0, Gd_384, Ask, slip_Hilo, Bid, 0, 0, Gs_364 + "-" + Gi_380, MagicNumber_Hilo, 0, HotPink );
            if (Gi_420 < 0) {
               Print("Error: ", GetLastError());
               return (0);
            }
            Gd_336 = f0_32();
            Gi_408 = FALSE;
            Gi_424 = TRUE;
         }
      }
   }
   if (Gi_408 && Gi_396 < 1 )           // -------   / ?????? ????????? Jaipong
    {                   
      ihigh_1128 = iHigh(Symbol(), 0, 1);
      ilow_1136 = iLow(Symbol(), 0, 2);
      G_bid_320 = Bid;
      G_ask_328 = Ask;
      if ((!Gi_416) && !Gi_412 && step_J < max_J_steps) {
         Gi_380 = Gi_396;
         Gd_384 = NormalizeDouble(Ld_1192 * MathPow(Ld_1160, Gi_380), Li_1168);
         if (ihigh_1128 > ilow_1136) {
            if (iRSI(NULL, PERIOD, 14, PRICE_CLOSE, 1) > 30.0)
             {
               Gi_420 = f0_3(1, Gd_384, G_bid_320, slip_Hilo, G_bid_320, 0, 0, Gs_364 + "-" + Gi_380, MagicNumber_Hilo, 0, HotPink );
               if (Gi_420 < 0) {
                  Print("Error: ", GetLastError());
                  return (0);
               }
               Gd_336 = f0_32();
               Gi_424 = TRUE;
               step_J = step_J+1; last_step_J=1;

            }
         } else {
            if (iRSI(NULL, PERIOD, 14, PRICE_CLOSE, 1) < 70.0) {
               Gi_420 = f0_3(0, Gd_384, G_ask_328, slip_Hilo, G_ask_328, 0, 0, Gs_364 + "-" + Gi_380, MagicNumber_Hilo, 0, HotPink );
               if (Gi_420 < 0) {
                  Print("Error: ", GetLastError());
                  return (0);
               }
               Gd_344 = f0_20();
               Gi_424 = TRUE;
               step_J = step_J+1; last_step_J=1;
            }
         }
         if (Gi_420 > 0) Gi_376 = TimeCurrent() + 60.0 * (60.0 * Gd_224);
         Gi_408 = FALSE;
      }

   }
   Gi_396 = f0_4();
   G_price_312 = 0;
   double Ld_1208 = 0;
   for (G_pos_392 = OrdersTotal() - 1; G_pos_392 >= 0; G_pos_392--) {
      OrderSelect(G_pos_392, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() != Symbol() || OrderMagicNumber() != MagicNumber_Hilo) continue;
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber_Hilo) {
         if (OrderType() == OP_BUY || OrderType() == OP_SELL) {
            G_price_312 += OrderOpenPrice() * OrderLots();
            Ld_1208 += OrderLots();
         }
      }
   }
   if (Gi_396 > 0) G_price_312 = NormalizeDouble(G_price_312 / Ld_1208, Digits);
   if (Gi_424) {
      for (G_pos_392 = OrdersTotal() - 1; G_pos_392 >= 0; G_pos_392--) {
         OrderSelect(G_pos_392, SELECT_BY_POS, MODE_TRADES);
         if (OrderSymbol() != Symbol() || OrderMagicNumber() != MagicNumber_Hilo) continue;
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber_Hilo) {
            if (OrderType() == OP_BUY) {
               G_price_280 = G_price_312 + Ld_1172 * Point;
               Gd_unused_296 = G_price_280;
               Gd_400 = G_price_312 - G_pips_236 * Point;
               Gi_360 = TRUE;
            }
         }
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber_Hilo) {
            if (OrderType() == OP_SELL) {
               G_price_280 = G_price_312 - Ld_1172 * Point;
               Gd_unused_304 = G_price_280;
               Gd_400 = G_price_312 + G_pips_236 * Point;
               Gi_360 = TRUE;
            }
         }
      }

   }
   if (Gi_424) {
      if (Gi_360 == TRUE) {
         for (G_pos_392 = OrdersTotal() - 1; G_pos_392 >= 0; G_pos_392--) {
            OrderSelect(G_pos_392, SELECT_BY_POS, MODE_TRADES);
            if (OrderSymbol() != Symbol() || OrderMagicNumber() != MagicNumber_Hilo) continue;
            if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber_Hilo) OrderModify(OrderTicket(), G_price_312, OrderStopLoss(), G_price_280, 0, Yellow);
            Gi_424 = FALSE;
         }
      }
   }
   }

   if (Keroncong == TRUE) {

   double Ld_1216 = LotExponent;
   int Li_1224 = Gi_108;
   double Ld_1228 = TakeProfit;
   bool bool_1236 = UseEquityStop;
   double Ld_1240 = TotalEquityRisk;
   if (MM == TRUE) {
      if (MathCeil(AccountBalance()) < 2000.0) Ld_1248 = Lots;
      else Ld_1248 = 0.00001 * MathCeil(AccountBalance());
   } else Ld_1248 = Lots;
   if ((CloseFriday == TRUE && DayOfWeek() == 5 && TimeCurrent() >= StrToTime(CloseFridayHour + ":00")) || (OpenMondey == TRUE && DayOfWeek() == 1 && TimeCurrent() <= StrToTime(OpenMondeyHour +
      ":00"))) return (0);
   if (UseTrailingStop_15) f0_21(TrailStart_15, TrailStop_15, G_price_596);

   if (Gi_656 != Time[0]) {    /// Gi_656 = 0;
      Gi_656 = Time[0];
      Ld_1256 = f0_29();     /// f0_29() ????????? ?????? ???? ???????
      if (bool_1236) {
         if (Ld_1256 < 0.0 && MathAbs(Ld_1256) > Ld_1240 / 100.0 * f0_16()) {
            f0_18();
            Print("Closed All due to Stop Out");
            Gi_708 = FALSE;
         }
      }

      Gi_680 = f0_5();  /// ???-?? ???????? ???.
      if (Gi_680 == 0) Gi_644 = FALSE;
      for (G_pos_676 = OrdersTotal() - 1; G_pos_676 >= 0; G_pos_676--) {
         OrderSelect(G_pos_676, SELECT_BY_POS, MODE_TRADES);
         if (OrderSymbol() != Symbol() || OrderMagicNumber() != G_magic_176_15) continue;
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == G_magic_176_15) {
            if (OrderType() == OP_BUY) {
               Gi_696 = TRUE;  ///////  BUY
               Gi_700 = FALSE;
               break;
            }
         }
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == G_magic_176_15) {
            if (OrderType() == OP_SELL) {
               Gi_696 = FALSE; 
               Gi_700 = TRUE;  ////////// SELL
               break;
            }
         }
      }
      if (Gi_680 > 0 && Gi_680 <= MaxTrades_15) {
         RefreshRates();
         Gd_620 = f0_36();
         Gd_628 = f0_28();
         if (Gi_696 && Gd_620 - Ask >= PipStep_15 * Point) Gi_692 = TRUE;
         if (Gi_700 && Bid - Gd_628 >= PipStep_15 * Point) Gi_692 = TRUE;
      }
      if (Gi_680 < 1) {   // ???-?? ???????? ???.
         Gi_700 = FALSE;
         Gi_696 = FALSE;
         Gi_692 = TRUE;
         Gd_572 = AccountEquity();
      }
      if (Gi_692) {          ///???? ??, ?? ?????????? ????? ?????
         Gd_620 = f0_36();
         Gd_628 = f0_28();
         if (Gi_700) {   /// ???? ???? SELL
            Gi_664 = Gi_680;/// ???-?? ???????? ???.
            Gd_668 = NormalizeDouble(Ld_1248 * MathPow(Ld_1216, Gi_664), Li_1224);
            RefreshRates();
            Gi_704 = f0_2(1, Gd_668, Bid, slip_15, Ask, 0, 0, Gs_648 + "-" + Gi_664, G_magic_176_15, 0, Lime);
            if (Gi_704 < 0) {
               Print("Error: ", GetLastError());
               return (0);
            }
            Gd_628 = f0_28();
            Gi_692 = FALSE;
            Gi_708 = TRUE;
         } else {
            if (Gi_696) {        /// ???? ???? BUY
               Gi_664 = Gi_680; /// ???-?? ???????? ???.
               Gd_668 = NormalizeDouble(Ld_1248 * MathPow(Ld_1216, Gi_664), Li_1224);
               Gi_704 = f0_2(0, Gd_668, Ask, slip_15, Bid, 0, 0, Gs_648 + "-" + Gi_664, G_magic_176_15, 0, Lime);
               if (Gi_704 < 0) {
                  Print("Error: ", GetLastError());
                  return (0);
               }
               Gd_620 = f0_36();
               Gi_692 = FALSE;
               Gi_708 = TRUE;
            }
         }
      }
   }

   if (G_datetime_728 != iTime(NULL, next_step_after, 0)) {
      Li_1264 = OrdersTotal();
      count_1268 = 0;
      for (int Li_1272 = Li_1264; Li_1272 >= 1; Li_1272--) {
         OrderSelect(Li_1272 - 1, SELECT_BY_POS, MODE_TRADES);
         if (OrderSymbol() != Symbol() || OrderMagicNumber() != G_magic_176_15) continue;
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == G_magic_176_15) count_1268++;
      }
      if (Li_1264 == 0 || count_1268 < 1)
       if (step_K < max_K_steps) {
         iclose_1144 = iClose(Symbol(), 0, 2);
         iclose_1152 = iClose(Symbol(), 0, 1);
         G_bid_604 = Bid;
         G_ask_612 = Ask;
         Gi_664 = Gi_680;
         Gd_668 = Ld_1248;
         if (iclose_1144 > iclose_1152 ) {  //sell
            if(MA || iclose_1152 < ww){
            Gi_704 = f0_2(1, Gd_668, G_bid_604, slip_15, G_bid_604, 0, 0, Gs_648 + "-" + Gi_664, G_magic_176_15, 0, Lime);
            if (Gi_704 < 0) {
               Print("Error: ", GetLastError());
               return (0);
            }
            Gd_620 = f0_36();
            Gi_708 = TRUE; step_K = step_K + 1; last_step_K=1; }}
        else {  //buy
            if(MA || iclose_1152 > ww){
            Gi_704 = f0_2(0, Gd_668, G_ask_612, slip_15, G_ask_612, 0, 0, Gs_648 + "-" + Gi_664, G_magic_176_15, 0, Lime);
            if (Gi_704 < 0) {
               Print("Error: ", GetLastError());
               return (0);
            }
            Gd_628 = f0_28();
            Gi_708 = TRUE;  step_K = step_K + 1;  last_step_K=1;
         }}
         if (Gi_704 > 0) Gi_660 = TimeCurrent() + 60.0 * (60.0 * Gd_536);
         Gi_692 = FALSE;

       }
      }
      G_datetime_728 = iTime(NULL, next_step_after, 0);

   Gi_680 = f0_5();
   G_price_596 = 0;
   double Ld_1276 = 0;
   for (G_pos_676 = OrdersTotal() - 1; G_pos_676 >= 0; G_pos_676--) {
      OrderSelect(G_pos_676, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() != Symbol() || OrderMagicNumber() != G_magic_176_15) continue;
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == G_magic_176_15) {
         if (OrderType() == OP_BUY || OrderType() == OP_SELL) {
            G_price_596 += OrderOpenPrice() * OrderLots();
            Ld_1276 += OrderLots();
         }
      }
   }

   if (Gi_680 > 0) G_price_596 = NormalizeDouble(G_price_596 / Ld_1276, Digits);
   if (Gi_708) {
      for (G_pos_676 = OrdersTotal() - 1; G_pos_676 >= 0; G_pos_676--) {
         OrderSelect(G_pos_676, SELECT_BY_POS, MODE_TRADES);
         if (OrderSymbol() != Symbol() || OrderMagicNumber() != G_magic_176_15) continue;
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == G_magic_176_15) {
            if (OrderType() == OP_BUY) {
               G_price_564 = G_price_596 + Ld_1228 * Point;   ////   Ld_1228 = TakeProfit;
               Gd_684 = G_price_596 - G_pips_508 * Point;
               Gi_644 = TRUE;
            }
         }
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == G_magic_176_15) {
            if (OrderType() == OP_SELL) {
               G_price_564 = G_price_596 - Ld_1228 * Point;
               Gd_684 = G_price_596 + G_pips_508 * Point;
               Gi_644 = TRUE;
            }
         }
      }
   }
   if (Gi_708) {
      if (Gi_644 == TRUE) {
         for (G_pos_676 = OrdersTotal() - 1; G_pos_676 >= 0; G_pos_676--) {
            OrderSelect(G_pos_676, SELECT_BY_POS, MODE_TRADES);
            if (OrderSymbol() != Symbol() || OrderMagicNumber() != G_magic_176_15) continue;
            if (OrderSymbol() == Symbol() && OrderMagicNumber() == G_magic_176_15) OrderModify(OrderTicket(), G_price_596, OrderStopLoss(), G_price_564, 0, Yellow);
            Gi_708 = FALSE;
         }
      }
   }
  } 

   if (Tortor == TRUE) {

   double Ld_1284 = LotExponent;
   int Li_1292 = Gi_108;
   double Ld_1296 = TakeProfit;
   bool bool_1304 = UseEquityStop;
   double Ld_1308 = TotalEquityRisk;
   if (MM == TRUE) {
      if (MathCeil(AccountBalance()) < 2000.0) Ld_1316 = Lots;
      else Ld_1316 = 0.00001 * MathCeil(AccountBalance());
   } else Ld_1316 = Lots;
   if ((CloseFriday == TRUE && DayOfWeek() == 5 && TimeCurrent() >= StrToTime(CloseFridayHour + ":00")) || (OpenMondey == TRUE && DayOfWeek() == 1 && TimeCurrent() <= StrToTime(OpenMondeyHour +
      ":00"))) return (0);
   if (UseTrailingStop_16) f0_34(TrailStart_16, TrailStop_16, G_price_880);
   if (Gi_816) {
      if (TimeCurrent() >= Gi_944) {
         f0_0();
         Print("Closed All due to TimeOut");
      }
   }
   if (Gi_940 != Time[0]) {
      Gi_940 = Time[0];
      Ld_1324 = f0_8();
      if (bool_1304)
       {
         if (Ld_1324 < 0.0 && MathAbs(Ld_1324) > Ld_1308 / 100.0 * f0_30())
          {
            f0_0();
            Print("Closed All due to Stop Out");
            Gi_992 = FALSE;
          }
       }
      Gi_964 = f0_12();
      if (Gi_964 == 0) Gi_928 = FALSE;
      for (G_pos_960 = OrdersTotal() - 1; G_pos_960 >= 0; G_pos_960--) {
         OrderSelect(G_pos_960, SELECT_BY_POS, MODE_TRADES);
         if (OrderSymbol() != Symbol() || OrderMagicNumber() != G_magic_176_16) continue;
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == G_magic_176_16) {
            if (OrderType() == OP_BUY) {
               Gi_980 = TRUE;
               Gi_984 = FALSE;
               break;
            }
         }
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == G_magic_176_16) {
            if (OrderType() == OP_SELL) {
               Gi_980 = FALSE;
               Gi_984 = TRUE;
               break;
            }
         }
      }
      if (Gi_964 > 0 && Gi_964 <= MaxTrades_16) {
         RefreshRates();
         Gd_904 = f0_17();
         Gd_912 = f0_27();
         if (Gi_980 && Gd_904 - Ask >= PipStep_16 * Point) Gi_976 = TRUE;
         if (Gi_984 && Bid - Gd_912 >= PipStep_16 * Point) Gi_976 = TRUE;
      }
      if (Gi_964 < 1) {
         Gi_984 = FALSE;
         Gi_980 = FALSE;
         Gd_856 = AccountEquity();
      }
      if (Gi_976) {
         Gd_904 = f0_17();
         Gd_912 = f0_27();
         if (Gi_984) {
            Gi_948 = Gi_964;
            Gd_952 = NormalizeDouble(Ld_1316 * MathPow(Ld_1284, Gi_948), Li_1292);
            RefreshRates();
            Gi_988 = f0_6(1, Gd_952, Bid, slip_16, Ask, 0, 0, Gs_932 + "-" + Gi_948, G_magic_176_16, 0, Black);
            if (Gi_988 < 0) {
               Print("Error: ", GetLastError());
               return (0);
            }
            Gd_912 = f0_27();
            Gi_976 = FALSE;
            Gi_992 = TRUE;
         } else {
            if (Gi_980) {
               Gi_948 = Gi_964;
               Gd_952 = NormalizeDouble(Ld_1316 * MathPow(Ld_1284, Gi_948), Li_1292);
               Gi_988 = f0_6(0, Gd_952, Ask, slip_16, Bid, 0, 0, Gs_932 + "-" + Gi_948, G_magic_176_16, 0, Black);
               if (Gi_988 < 0) {
                  Print("Error: ", GetLastError());
                  return (0);
               }
               Gd_904 = f0_17();
               Gi_976 = FALSE;
               Gi_992 = TRUE;
            }
         }
      }
   }
   if (G_datetime_1012 != iTime(NULL, G_timeframe_784, 0)) {
      Li_1332 = OrdersTotal();
      count_1336 = 0;
      for (int Li_1340 = Li_1332; Li_1340 >= 1; Li_1340--) {
         OrderSelect(Li_1340 - 1, SELECT_BY_POS, MODE_TRADES);
         if (OrderSymbol() != Symbol() || OrderMagicNumber() != G_magic_176_16) continue;
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == G_magic_176_16) count_1336++;
      }
      if (Li_1332 == 0 || count_1336 < 1) 
       if (step_T < max_T_steps)
         {
         iclose_1144 = iClose(Symbol(), 0, 2);
         iclose_1152 = iClose(Symbol(), 0, 1);
         G_bid_888 = Bid;
         G_ask_896 = Ask;
         Gi_948 = Gi_964;
         Gd_952 = Ld_1316;

         if (iclose_1144 > iclose_1152) {
            if (iRSI(NULL, PERIOD, 14, PRICE_CLOSE, 1) > 30.0) {
               Gi_988 = f0_6(1, Gd_952, G_bid_888, slip_16, G_bid_888, 0, 0, Gs_932 + "-" + Gi_948, G_magic_176_16, 0, Black);
               if (Gi_988 < 0) {
                  Print("Error: ", GetLastError());
                  return (0);
               }
               Gd_904 = f0_17();
               Gi_992 = TRUE;  step_T = step_T + 1;  last_step_T=1;
            }
         } else {
            if (iRSI(NULL, PERIOD, 14, PRICE_CLOSE, 1) < 70.0) {
               Gi_988 = f0_6(0, Gd_952, G_ask_896, slip_16, G_ask_896, 0, 0, Gs_932 + "-" + Gi_948, G_magic_176_16, 0, Black);
               if (Gi_988 < 0) {
                  Print("Error: ", GetLastError());
                  return (0);
               }
               Gd_912 = f0_27();
               Gi_992 = TRUE;  step_T = step_T + 1; last_step_T=1;
            }
         }
         if (Gi_988 > 0) Gi_944 = TimeCurrent() + 60.0 * (60.0 * Gd_820);
         Gi_976 = FALSE;

      }
      G_datetime_1012 = iTime(NULL, G_timeframe_784, 0);
   }
   Gi_964 = f0_12();
   G_price_880 = 0;
   double Ld_1344 = 0;
   for (G_pos_960 = OrdersTotal() - 1; G_pos_960 >= 0; G_pos_960--) {
      OrderSelect(G_pos_960, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() != Symbol() || OrderMagicNumber() != G_magic_176_16) continue;
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == G_magic_176_16) {
         if (OrderType() == OP_BUY || OrderType() == OP_SELL) {
            G_price_880 += OrderOpenPrice() * OrderLots();
            Ld_1344 += OrderLots();
         }
      }
   }
   if (Gi_964 > 0) G_price_880 = NormalizeDouble(G_price_880 / Ld_1344, Digits);
   if (Gi_992) {
      for (G_pos_960 = OrdersTotal() - 1; G_pos_960 >= 0; G_pos_960--) {
         OrderSelect(G_pos_960, SELECT_BY_POS, MODE_TRADES);
         if (OrderSymbol() != Symbol() || OrderMagicNumber() != G_magic_176_16) continue;
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == G_magic_176_16) {
            if (OrderType() == OP_BUY) {
               G_price_848 = G_price_880 + Ld_1296 * Point;
               Gd_unused_864 = G_price_848;
               Gd_968 = G_price_880 - G_pips_792 * Point;
               Gi_928 = TRUE;
            }
         }
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == G_magic_176_16) {
            if (OrderType() == OP_SELL) {
               G_price_848 = G_price_880 - Ld_1296 * Point;
               Gd_unused_872 = G_price_848;
               Gd_968 = G_price_880 + G_pips_792 * Point;
               Gi_928 = TRUE;
            }
         }
      }
   }
   if (Gi_992) {
      if (Gi_928 == TRUE) {
         for (G_pos_960 = OrdersTotal() - 1; G_pos_960 >= 0; G_pos_960--) {
            OrderSelect(G_pos_960, SELECT_BY_POS, MODE_TRADES);
            if (OrderSymbol() != Symbol() || OrderMagicNumber() != G_magic_176_16) continue;
            if (OrderSymbol() == Symbol() && OrderMagicNumber() == G_magic_176_16) OrderModify(OrderTicket(), G_price_880, OrderStopLoss(), G_price_848, 0, Yellow);
            Gi_992 = FALSE;
         }
      }
   }
   }

  if (OrdersTotal()>0)
     {

      for(int i=OrdersTotal()-1; i>=0; i--)

                {
                OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
                  if(OrderSymbol()==Symbol()&& OrderMagicNumber()==MagicNumber_Hilo)
                    { 
                      if (OrderType()==0) posJ="Buy";
                      else posJ="Sell";
                      a = StringSubstr(OrderComment(),8,1);
                      Jai_lot=Jai_lot + OrderLots();
                      Jai=Jai + OrderProfit();      Jai_r=Jai;    if (Jai<max_loss_J) max_loss_J=Jai;
                      J=J+1;                        J_r=J;

                    }
                  else if(OrderSymbol()==Symbol()&& OrderMagicNumber()==G_magic_176_15)
                    {
                      if (OrderType()==0) posK="Buy";
                      else posK="Sell";
                      b = StringSubstr(OrderComment(),8,1);
                      Ker_lot=Ker_lot + OrderLots();
                      Ker=Ker + OrderProfit();          if (Ker<max_loss_K) max_loss_K=Ker;
                      K=K+1;   K_r=K; Ker_r=Ker;
                    } 
                  else if(OrderSymbol()==Symbol()&& OrderMagicNumber()==G_magic_176_16)
                    { 
                      if (OrderType()==0) posT="Buy";
                      else posT="Sell";
                      c = StringSubstr(OrderComment(),8,1);
                      Tor_lot=Tor_lot + OrderLots();
                      Tor=Tor + OrderProfit();         if (Tor<max_loss_T) max_loss_T=Tor;
                      T=T+1;   T_r=T; Tor_r=Tor;
                    }         
                }

       ObjectDelete("Total Jaipon");
       ObjectDelete("Total Keronc");
       ObjectDelete("Total Tortor");

       if (Jaipong == TRUE){  if(J>7) ColorJ=Red;
          ObjectCreate("Total Jaipon", OBJ_LABEL,0, 0, 0); 
                       Obj

Показано первые 50% кода (символов: 42652)

Открыть по тарифу

Купите тариф с пакетом открытий или войдите, если тариф уже есть. Открытый файл останется в вашем кабинете навсегда.

Разовая покупка файла

На этой странице откроется полный исходный код файла вместо ознакомительного фрагмента.

Чтобы оформить заказ, введите email и перейдите к оплате.

Стоимость полного кода
4 265,20₽ ≈ $52.13