Comparaison des fichiers tst1.txt et TST2.TXT
***** tst1.txt
_Bull_str,t4_Bull_str,i_Cht_str,t_ATS_str,p_Ver_str;
int prevMinute=0,prevMinut2=0,tmfr_,tmfr_b,t3,test0,test1,test2,HOp,Rect_Ks[50];          long Chart_M5;          string rect_s
tr, Rect_Ns[50][2], EA_cht_str,EA_Ch2_str,EA_Ch3_str;
datetime tim_Chart_M5, tim_Chart_M5b, tim_Alt_M5, last_rect, last_rct_=0, i_Cht_M5, curr_time, ATS_Time, tst_5c, tim_M15, tim_f
***** TST2.TXT
_Bull_str,t4_Bull_str,i_Cht_str,t_ATS_str,p_Ver_str;
int prevMinute=0,prevMinut2=0,tmfr_,tmfr_b,t3,test0=-1,test1=-1,test2=-1,HOp,Rect_Ks[50];       long Chart_M5;          string 
rect_str, Rect_Ns[50][2], EA_cht_str,EA_Ch2_str,EA_Ch3_str;
datetime tim_Chart_M5, tim_Chart_M5b, tim_Alt_M5, last_rect, last_rct_=0, i_Cht_M5, curr_time, ATS_Time, tst_5c, tim_M15, tim_f
*****

***** tst1.txt
  if (GlobalVariableCheck(tck_vstr)) ticket = GlobalVariableGet(tck_vstr);
  if (GlobalVariableCheck(bull_str)) bull_ = GlobalVariableGet(bull_str);           bool t_tick=(ticket > 7);
  if ((GlobalVariableCheck(tck_vstr) && (tr_allow || t_tick)) || (GlobalVariableCheck("Ticket0") && !tr_allow)) {
***** TST2.TXT
  if (GlobalVariableCheck(tck_vstr)) ticket = GlobalVariableGet(tck_vstr);
  if (GlobalVariableCheck(bull_str)) bull_ = GlobalVariableGet(bull_str);           bool t_tick=(ticket > 7 || (ticket && MQLIn
foInteger(MQL_TESTER)));
  if ((GlobalVariableCheck(tck_vstr) && (tr_allow || t_tick)) || (GlobalVariableCheck("Ticket0") && !tr_allow)) {
*****

***** tst1.txt
      if (! t_tick) ticket = tr_allow ? GlobalVariableGet(tck_vstr) : GlobalVariableGet("Ticket0");
      if (tr_allow || t_tick) { if (ticket <= 7) {
#else
***** TST2.TXT
      if (! t_tick) ticket = tr_allow ? GlobalVariableGet(tck_vstr) : GlobalVariableGet("Ticket0");
      if (tr_allow || t_tick) { if ((ticket <= 7 && ! MQLInfoInteger(MQL_TESTER)) || ! ticket) {
#else
*****

***** tst1.txt
  if (TimeCurrent() % PERIOD_H1*60 < 3 && Period()==PERIOD_H1 && DCC_Check()) { tmfr = PERIOD_M30;
      ChartSetSymbolPeriod(0, NULL, PERIOD_M30);         GlobalVariableSet(tmfr0_str, tmfr);
      copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES)+" "+Symbol()+": ***** PASSAGE EN M30 ! ("+str_DCC+") *****"
***** TST2.TXT
  if (TimeCurrent() % PERIOD_H1*60 < 3 && Period()==PERIOD_H1 && DCC_Check()) { tmfr = PERIOD_M30;
      ChartSetSymbolPeriod(0, NULL, PERIOD_M30);         GlobalVariableSet("tmfr_0_bk-tst", tmfr);
      copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES)+" "+Symbol()+": ***** PASSAGE EN M30 ! ("+str_DCC+") *****"
*****

***** tst1.txt
  bool tst, tst2, t_night_, tr_allow_;          int t=0, t1=0, t2=0, err;            // 6
  if (Hour() < H1 && (H1 < H3 || Hour() > H3) && t_h6) { t_h6 = false;  t_ngt0 = false;   GlobalVariableSet("t_ngt_1", 0);    H
3 = H3_; }
  else if (Hour() == H1 && (H1 < H3 || DayOfWeek() < 5)) { if (! time_allow) { time_allow = true;   nb_ticks = 0;  nb_tcks_N = 
***** TST2.TXT
  bool tst, tst2, t_night_, tr_allow_;          int t=0, t1=0, t2=0, err;            // 6
  if (Hour() < H1 && (H1 < H3 || Hour() > H3) && t_h6) { t_h6 = false;  t_ngt0 = false;   GlobalVariableSet("t_ngt_1", 0); }   
     // H3 = H3_;
  else if (Hour() == H1 && (H1 < H3 || DayOfWeek() < 5)) { if (! time_allow) { time_allow = true;   nb_ticks = 0;  nb_tcks_N = 
*****

***** tst1.txt
      (H1 > H3 && (Minute() < 40 || (Minute() == 40 && Seconds() < 17)))))) && (H1 < H3 || DayOfWeek()));         // 6
  if (H1 > H3 && t_night != t_night_) Print("** Suivi de t_night et tr_allow (1) : "+Symbol()+" / "+IntegerToString(Period())+"
***** TST2.TXT
      (H1 > H3 && (Minute() < 40 || (Minute() == 40 && Seconds() < 17)))))) && (H1 < H3 || DayOfWeek()));         // 6
/* Print("***** ",t_night," ",t_ngt0," ",((! Hour() || (Hour() < H1 && (H1 < H3 || Hour() >= H3)) || (!t_h6 && !t_ngt0 && Hour(
) == H1 && ((H1 < H3 && ! Minute() && Seconds() < 17) ||
      (H1 > H3 && (Minute() < 40 || (Minute() == 40 && Seconds() < 17)))))) && (H1 < H3 || DayOfWeek()))," ",
      (! Hour() || (Hour() < H1 && (H1 < H3 || Hour() >= H3)) || (!t_h6 && !t_ngt0 && Hour() == H1 && ((H1 < H3 && ! Minute() &
& Seconds() < 17) ||
      (H1 > H3 && (Minute() < 40 || (Minute() == 40 && Seconds() < 17))))))," ",
      (! Hour())," ",(Hour() < H1 && (H1 < H3 || Hour() >= H3))," ",(!t_h6 && !t_ngt0 && Hour() == H1 && ((H1 < H3 && ! Minute(
) && Seconds() < 17) ||
      (H1 > H3 && (Minute() < 40 || (Minute() == 40 && Seconds() < 17)))))," ",t_h6," ",t_ngt0," ",
      ((H1 < H3 && ! Minute() && Seconds() < 17) || (H1 > H3 && (Minute() < 40 || (Minute() == 40 && Seconds() < 17))))," ",
      (H1 < H3 && ! Minute() && Seconds() < 17)," ",(H1 > H3 && (Minute() < 40 || (Minute() == 40 && Seconds() < 17)))," "," **
***");     f_End_EA(); //*/
  if (H1 > H3 && t_night != t_night_) Print("** Suivi de t_night et tr_allow (1) : "+Symbol()+" / "+IntegerToString(Period())+"
*****

***** tst1.txt
         GlobalVariableSet("t1_Bullish", t5a_Bullish);   GlobalVariableSet("t2_Bullish", t5b_Bullish);
         GlobalVariableSet(tmfr1_str, tmfr_);            GlobalVariableSet(tmfr0_str, tmfr); }
      if (tst) { temp = "** Passage en "+(str=="-HKG"?"M1":"M5")+" à "+IntegerToString(fmax(H1,H3))+" H ! (Period()="+IntegerTo
***** TST2.TXT
         GlobalVariableSet("t1_Bullish", t5a_Bullish);   GlobalVariableSet("t2_Bullish", t5b_Bullish);
         GlobalVariableSet(tmfr1_str, tmfr_);            GlobalVariableSet("tmfr_0_bk-tst", tmfr); }
      if (tst) { temp = "** Passage en "+(str=="-HKG"?"M1":"M5")+" à "+IntegerToString(fmax(H1,H3))+" H ! (Period()="+IntegerTo
*****

***** tst1.txt
  if (str == "-HKG" && Hour() == HOp && Minute() > 30 && Period() == PERIOD_M1) { t1 = 0;
      GlobalVariableSet(tmfr0_str, PERIOD_M5);     while(! (tst=ChartSetSymbolPeriod(0, NULL, PERIOD_M5)) && t1 < 17) { t1 ++; 
     Sleep(100); }
      if (tst) { temp = "** Passage en M5 à "+IntegerToString(HOp)+" H ! (Period()="+IntegerToString(Period())+", t1="+IntegerT
***** TST2.TXT
  if (str == "-HKG" && Hour() == HOp && Minute() > 30 && Period() == PERIOD_M1) { t1 = 0;
      GlobalVariableSet("tmfr_0_bk-tst", PERIOD_M5);     while(! (tst=ChartSetSymbolPeriod(0, NULL, PERIOD_M5)) && t1 < 17) { t
1 ++;      Sleep(100); }
      if (tst) { temp = "** Passage en M5 à "+IntegerToString(HOp)+" H ! (Period()="+IntegerToString(Period())+", t1="+IntegerT
*****

***** tst1.txt
 t1 ++;  Sleep(100); }
         if (Hour() == HOp && ! Minute()) GlobalVariableSet(tmfr0_str, PERIOD_H1);
         err = GetLastError();      if (tst && tmfr_ > 0) { Sleep(50);        ChartSetInteger(0, CHART_SCALE, 0, 5);
***** TST2.TXT
 t1 ++;  Sleep(100); }
         if (Hour() == HOp && ! Minute()) GlobalVariableSet("tmfr_0_bk-tst", PERIOD_H1);
         err = GetLastError();      if (tst && tmfr_ > 0) { Sleep(50);        ChartSetInteger(0, CHART_SCALE, 0, 5);
*****

***** tst1.txt
            tim_Chart_M5 = 0;       GlobalVariableSet(t1_Chart_str, tim_Chart_M5);
            tmfr = tmfr_;           GlobalVariableSet(tmfr0_str, tmfr); }
         else { temp = "*** ERREUR - REPASSAGE EN M30 / H1 ! ("+Symbol()+" - " +(tmfr_?"":"*")+IntegerToString(tmfr_)+(tmfr_?""
***** TST2.TXT
            tim_Chart_M5 = 0;       GlobalVariableSet(t1_Chart_str, tim_Chart_M5);
            tmfr = tmfr_;           GlobalVariableSet("tmfr_0_bk-tst", tmfr); }
         else { temp = "*** ERREUR - REPASSAGE EN M30 / H1 ! ("+Symbol()+" - " +(tmfr_?"":"*")+IntegerToString(tmfr_)+(tmfr_?""
*****

***** tst1.txt
            tim_Chart_M5b = 0;      GlobalVariableSet(t2_Chart_str, tim_Chart_M5b);
            tmfr = tmfr_b;          GlobalVariableSet(tmfr0_str, tmfr); }
         else { temp = "*** ERREUR - REPASSAGE EN M5 ! ("+Symbol()+" - " +(tmfr_b?"":"*")+IntegerToString(tmfr_b)+(tmfr_b?"":"*
***** TST2.TXT
            tim_Chart_M5b = 0;      GlobalVariableSet(t2_Chart_str, tim_Chart_M5b);
            tmfr = tmfr_b;          GlobalVariableSet("tmfr_0_bk-tst", tmfr); }
         else { temp = "*** ERREUR - REPASSAGE EN M5 ! ("+Symbol()+" - " +(tmfr_b?"":"*")+IntegerToString(tmfr_b)+(tmfr_b?"":"*
*****

***** tst1.txt
#ifdef v_opfx_0
  if (GlobalVariableCheck(tck_vstr)) ticket = GlobalVariableGet(tck_vstr);      bool t_tick=(ticket > 7);
  if ((ticket <= 7 && (mOrdersTotal(magic_nb)==1 || mOrdersTotal(magic_nb)==3) && tr_allow) ||
  (! tr_allow && ! t_tick && GlobalVariableCheck("Ticket0") && (ticket=GlobalVariableGet("Ticket0")) > 0)) {
***** TST2.TXT
#ifdef v_opfx_0
  if (GlobalVariableCheck(tck_vstr)) ticket = GlobalVariableGet(tck_vstr);      bool t_tick=(ticket > 7 || (ticket && MQLInfoIn
teger(MQL_TESTER)));
  if ((((ticket <= 7 && ! MQLInfoInteger(MQL_TESTER)) || ! ticket) && (mOrdersTotal(magic_nb)==1 || mOrdersTotal(magic_nb)==3) 
&& tr_allow) ||
  (! tr_allow && ! t_tick && GlobalVariableCheck("Ticket0") && (ticket=GlobalVariableGet("Ticket0")) > 0)) {
*****

***** tst1.txt
      if (! t_tick) ticket = tr_allow ? GlobalVariableGet(tck_vstr) : ticket;
      if (tr_allow || t_tick) { if (ticket <= 7) {
#else
***** TST2.TXT
      if (! t_tick) ticket = tr_allow ? GlobalVariableGet(tck_vstr) : ticket;
      if (tr_allow || t_tick) { if ((ticket <= 7 && ! MQLInfoInteger(MQL_TESTER)) || ! ticket) {
#else
*****

***** tst1.txt
#endif
         if (mOrderSelect(mOrdersTotal(magic_nb)==1?0:2,SELECT_BY_POS)) ticket = OrderTicket();
         Print("*** -> (2) Ticket LOADED! ",ticket," - ... ***");#ifdef v_opfx_0    GlobalVariableSet(tck_vstr, ticket);#endif 
}
       if (OrderSelect(floor(ticket), SELECT_BY_TICKET) && !OrderCloseTime()) {
***** TST2.TXT
#endif
         if (mOrderSelect(mOrdersTotal(magic_nb)==1?0:2,SELECT_BY_POS)) ticket = OrderTicket();#ifdef v_opfx_0    if (prevMinut
e != Time[0]) {#endif
            Print("*** -> (2) Ticket LOADED! ",ticket," - ... ***");#ifdef v_opfx_0    GlobalVariableSet(tck_vstr, ticket); }#e
ndif }
       if (OrderSelect(floor(ticket), SELECT_BY_TICKET) && !OrderCloseTime()) {
*****

***** tst1.txt
      (Period() > PERIOD_M15 || DayOfWeek() == 5) && ! time_allow) return;    // 23
   if (Hour() >= 3 && ! (Minute() % PERIOD_M5 * 60) && Seconds() < 7 && test1 < Seconds()) { test1 = Seconds();
      Print("** -> TEST(1) DrawArrow_OS n ",bull_," ",bull," ",ticket," ",t_night," ",TimeToStr(Time[0],TIME_MINUTES)," / ",(!(
***** TST2.TXT
      (Period() > PERIOD_M15 || DayOfWeek() == 5) && ! time_allow) return;    // 23
   if (Hour() >= H1 && ! (Minute() % PERIOD_M5 * 60) && Seconds() < 7 && test1 < Seconds()) { test1 = Seconds();
      Print("** -> TEST(1) DrawArrow_OS n ",bull_," ",bull," ",ticket," ",t_night," ",TimeToStr(Time[0],TIME_MINUTES)," / ",(!(
*****

***** tst1.txt
     #ifdef v_opfx_0 if (iCustom(NULL,0,"RSI.ex4",0,0)>40 && iCustom(NULL,0,"RSI.ex4",0,0)<60 && Period()==PERIOD_M5 && (H1<H3 
|| Hour()>H2+2)) { t1 = 0;  GlobalVariableSet(tmfr0_str, PERIOD_M15);
         while(! (tst=ChartSetSymbolPeriod(0, NULL, PERIOD_M15)) && t1 < 17) { t1 ++;     Sleep(100);      tim_M15 = Time[0]; }
***** TST2.TXT
     #ifdef v_opfx_0 if (iCustom(NULL,0,"RSI.ex4",0,0)>40 && iCustom(NULL,0,"RSI.ex4",0,0)<60 && Period()==PERIOD_M5 && (H1<H3 
|| Hour()>H2+2)) { t1 = 0;  GlobalVariableSet("tmfr_0_bk-tst", PERIOD_M15);
         while(! (tst=ChartSetSymbolPeriod(0, NULL, PERIOD_M15)) && t1 < 17) { t1 ++;     Sleep(100);      tim_M15 = Time[0]; }
*****

***** tst1.txt
 0, 0) < 65 && Period() == PERIOD_M5 &&
         (H1 < H3 || Hour() > H2)) { t1 = 0;             GlobalVariableSet(tmfr0_str, PERIOD_M15);
            while(! (tst=ChartSetSymbolPeriod(0, NULL, PERIOD_M15)) && t1 < 17) { t1 ++;     Sleep(100);       tim_M15 = Time[0
***** TST2.TXT
 0, 0) < 65 && Period() == PERIOD_M5 &&
         (H1 < H3 || Hour() > H2)) { t1 = 0;             GlobalVariableSet("tmfr_0_bk-tst", PERIOD_M15);
            while(! (tst=ChartSetSymbolPeriod(0, NULL, PERIOD_M15)) && t1 < 17) { t1 ++;     Sleep(100);       tim_M15 = Time[0
*****

***** tst1.txt
      if (tim_M15 > 0 && (Time[0] - tim_M15 > Period() * 60*8 || ! fl_Trade) && Period() == PERIOD_M15) { t1 = 0;    GlobalVari
ableSet(tmfr0_str, PERIOD_M5);
         while(! (tst=ChartSetSymbolPeriod(0, NULL, PERIOD_M5)) && t1 < 17) { t1 ++;      Sleep(100); }
***** TST2.TXT
      if (tim_M15 > 0 && (Time[0] - tim_M15 > Period() * 60*8 || ! fl_Trade) && Period() == PERIOD_M15) { t1 = 0;    GlobalVari
ableSet("tmfr_0_bk-tst", PERIOD_M5);
         while(! (tst=ChartSetSymbolPeriod(0, NULL, PERIOD_M5)) && t1 < 17) { t1 ++;      Sleep(100); }
*****

***** tst1.txt
 && Period() == PERIOD_M5 &&
  (H1 < H3 || Hour() > H2 + 2)) { t1 = 0;             GlobalVariableSet(tmfr0_str, PERIOD_M15);
      while(! (tst=ChartSetSymbolPeriod(0, NULL, PERIOD_M15)) && t1 < 17) { t1 ++;     Sleep(100);       tim_M15 = Time[0]; }
***** TST2.TXT
 && Period() == PERIOD_M5 &&
  (H1 < H3 || Hour() > H2 + 2)) { t1 = 0;             GlobalVariableSet("tmfr_0_bk-tst", PERIOD_M15);
      while(! (tst=ChartSetSymbolPeriod(0, NULL, PERIOD_M15)) && t1 < 17) { t1 ++;     Sleep(100);       tim_M15 = Time[0]; }
*****

***** tst1.txt
) > H2 &&      // H1 > H3
   int (StringSubstr(TimeToStr(ATS_Time, TIME_DATE), 8, 2)) == Day() && ticket > 7) { t_night = true;       if (str=="-CHN") t_
ngt0 = true;
      Print("** -> DrawArrow_OS 11 ",bull_," ",bull," ",ticket," ",t_night," ",TimeToStr(Time[0],TIME_MINUTES)," **");
***** TST2.TXT
) > H2 &&      // H1 > H3
   int (StringSubstr(TimeToStr(ATS_Time, TIME_DATE), 8, 2)) == Day() && (ticket > 7 || (ticket && MQLInfoInteger(MQL_TESTER))))
 { t_night = true;  //if (str=="-CHN") t_ngt0 = true;
      Print("** -> DrawArrow_OS 11 ",bull_," ",bull," ",ticket," ",t_night," ",TimeToStr(Time[0],TIME_MINUTES)," **");
*****

***** tst1.txt
//  if ((DayOfWeek() < 5 || H1 < H3) && t_night && Hour() == H1 && (str != "-CHN" || Seconds() > 4) && ticket <= 7) {
  if ((DayOfWeek() < 5 || H1 < H3) && t_night && Hour() == H1 && ((str!="-CHN" && str!="-HKG") || Minute() >= 40) && (str!="-CH
N" || (Seconds() > 4 &&
   ((bull && FileIsExist("ATS-Ind_On-Off\\ATS-Ind5"+str+"_Buy.txt", 0)) || (! bull && FileIsExist("ATS-Ind_On-Off\\ATS-Ind5"+st
***** TST2.TXT
//  if ((DayOfWeek() < 5 || H1 < H3) && t_night && Hour() == H1 && (str != "-CHN" || Seconds() > 4) && ticket <= 7) {
  int ind_total = ChartIndicatorsTotal(0,0);    temp = NULL;      for (int ind = 0; ind < ind_total && temp==NULL; ind ++)
      if (StringFind((name=ChartIndicatorName(0,0,ind)), "ATS") > 0) temp = StringSubstr(name, StringFind(name, "(")+1, 3);
  if (temp != NULL && (DayOfWeek() < 5 || H1 < H3) && t_night && Hour() == H1 && ((str!="-CHN" && str!="-HKG") || Minute() >= 4
0) && (str!="-CHN" || (Seconds() > 4 &&
   ((bull && FileIsExist("ATS-Ind_On-Off\\ATS-Ind5"+str+"_Buy.txt", 0)) || (! bull && FileIsExist("ATS-Ind_On-Off\\ATS-Ind5"+st
*****

***** tst1.txt
r+"_Sell.txt", 0))) &&
   (iCustom(NULL, PERIOD_H1, "RSI.ex4", 0, 0) < 38 || iCustom(NULL, PERIOD_H1, "RSI.ex4", 0, 0) > 62))) && ticket <= 7) {
      Print("** -> DrawArrow_OS 7 ",bull_," ",bull," ",ticket," ",t_night," ",(str=="-CHN"? IntegerToString(Seconds())+" ": "")
***** TST2.TXT
r+"_Sell.txt", 0))) &&
   (iCustom(NULL, PERIOD_H1, "RSI.ex4", 0, 0) < 38 || iCustom(NULL, PERIOD_H1, "RSI.ex4", 0, 0) > 62))) && ((ticket <= 7 && ! M
QLInfoInteger(MQL_TESTER)) || ! ticket)) {
      Print("** -> DrawArrow_OS 7 ",bull_," ",bull," ",ticket," ",t_night," ",(str=="-CHN"? IntegerToString(Seconds())+" ": "")
*****

***** tst1.txt
stom(NULL, 0, "RSI.ex4", 0, 0) < 65) ||
   Hour() == 23)) || t_night) && ticket > 7) { t_night = true;       Print("** -> DrawArrow_OS 8 ",bull_," ",bull," ",ticket," 
",t_night," ",TimeToStr(Time[0],TIME_MINUTES)," **");
      DrawArrow_OS(8, obj_prClots[pos]+(bull? 150*vScale*Point: 625*vScale*Point), 0, 0, bull, ticket); }
***** TST2.TXT
stom(NULL, 0, "RSI.ex4", 0, 0) < 65) ||
   Hour() == 23)) || t_night) && (ticket > 7 || (ticket && MQLInfoInteger(MQL_TESTER)))) { t_night = true;
      Print("** -> DrawArrow_OS 8 ",bull_," ",bull," ",ticket," ",t_night," ",TimeToStr(Time[0],TIME_MINUTES)," **");
      DrawArrow_OS(8, obj_prClots[pos]+(bull? 150*vScale*Point: 625*vScale*Point), 0, 0, bull, ticket); }
*****

***** tst1.txt

  if (Hour() != 8 && Hour() != 15 && Hour() != 23 && tmp_saved) tmp_saved = false;
  else if (! tmp_saved && (Hour()==8 || Hour()==15 || Hour()==23)) { tmp_saved = true;    ChartSaveTemplate(0, "template_saved_
"+Symbol()); }
#endif
***** TST2.TXT

/*  if (Hour() != 8 && Hour() != 15 && Hour() != 23 && tmp_saved) tmp_saved = false;
  else if (! tmp_saved && (Hour()==8 || Hour()==15 || Hour()==23)) { tmp_saved = true;    ChartSaveTemplate(0, "template_saved_
"+Symbol()); } */
#endif
*****

***** tst1.txt
#else
  int ticket_=GlobalVariableGet(tck_vstr);         bool t_tick=(ticket_ > 7);
  GlobalVariableSet(tr_allow || t_tick ? tck_vstr : "Ticket0", ticket);
  Print("*** -> Ticket SAVED! ",IntegerToString(ticket)," - ",IntegerToString(bull_)," - ",DoubleToStr(OrderLots(),2)," ***");
  ObjectDelete(LabelNameEnd);                   GlobalVariableSet(bull_str, bull_);
***** TST2.TXT
#else
  int ticket_=GlobalVariableGet(tck_vstr);         bool t_tick=(ticket_ > 7 || (ticket_ && MQLInfoInteger(MQL_TESTER)));
  GlobalVariableSet(tr_allow || t_tick ? tck_vstr : "Ticket0", MQLInfoInteger(MQL_TESTER)? 0: ticket);
  Print("*** -> Ticket SAVED! ",IntegerToString(MQLInfoInteger(MQL_TESTER)? 0: ticket)," - ",IntegerToString(bull_)," - ",Doubl
eToStr(OrderLots(),2)," ***");
  ObjectDelete(LabelNameEnd);                   GlobalVariableSet(bull_str, bull_);
*****

***** tst1.txt
#endif
   ObjectSet(ArrowName, OBJPROP_COLOR, I==1||I>=4? I==1&&ticket>7? clrGold: clrSilver: clrSkyBlue);
   ObjectSet(ArrowName, OBJPROP_SELECTABLE, 0);
***** TST2.TXT
#endif
   ObjectSet(ArrowName, OBJPROP_COLOR, I==1||I>=4? I==1&&(ticket>7||(ticket&&MQLInfoInteger(MQL_TESTER)))? clrGold: clrSilver: 
clrSkyBlue);
   ObjectSet(ArrowName, OBJPROP_SELECTABLE, 0);
*****

***** tst1.txt
   tr_Allow = (tr_allow || Typ == 7);                    t_Night = ! (! t_night || Typ == 7);
   if (ticket <= 7 && tr_Allow) { ticket = 0;            GlobalVariableSet(tck_vstr, ticket); }
#endif
***** TST2.TXT
   tr_Allow = (tr_allow || Typ == 7);                    t_Night = ! (! t_night || Typ == 7);
   if (((ticket <= 7 && ! MQLInfoInteger(MQL_TESTER)) || ! ticket) && tr_Allow) { ticket = 0;      GlobalVariableSet(tck_vstr, 
ticket); }
#endif
*****

***** tst1.txt
   if (AccBalance != AccountBalance()) AccBalance = AccountBalance();         p_Coef = 100.0;   // revoir avec pips2dbl et lot
//Alert("TEST ALLOWED! (1) " + tr_allow + " " + ticket + " " + Clot + " " + t_close + " " + Bullish);
#ifndef v_opfx_0
***** TST2.TXT
   if (AccBalance != AccountBalance()) AccBalance = AccountBalance();         p_Coef = 100.0;   // revoir avec pips2dbl et lot
Alert("***** TEST ALLOWED! (1) " + vtst + " " + cpt2 + " " + tr_allow + " " + ticket + " " + Clot + " " + t_close + " " + Bulli
sh + " *****");
#ifndef v_opfx_0
*****

***** tst1.txt
#else
   while ((Clot || ticket > 7) && ! t_close && cpt2 < 4) { if ((((vtst && mOrderSelect(mOrdersTotal(magic_nb)==1?0:2,SELECT_BY_
POS)) ||
         OrderSelect(floor(Clot? Clot: ticket), SELECT_BY_TICKET)) && ! OrderCloseTime()) || ! tr_Allow)
***** TST2.TXT
#else
   while ((Clot || (ticket > 7 || (ticket && MQLInfoInteger(MQL_TESTER)))) && ! t_close && cpt2 < 4) {
      if ((((vtst && mOrderSelect(mOrdersTotal(magic_nb)==1?0:2,SELECT_BY_POS)) ||
         OrderSelect(floor(Clot? Clot: ticket), SELECT_BY_TICKET)) && ! OrderCloseTime()) || ! tr_Allow)
*****

***** tst1.txt
      while (! t_close && cpt2 < 4) { t_close = OrderClose(floor(Clot? Clot: ticket), lot, Bullish? Bid: Ask, slip, clrNONE);
//Alert("TEST ALLOWED! (2) " + tr_allow + " " + ticket + " " + Clot + " " + t_close + " " + Bullish);
         if (t_close || ! tr_Allow) { ticket = 0;           total3_ = total3;          if (! tr_Allow) t_close = true;
***** TST2.TXT
      while (! t_close && cpt2 < 4) { t_close = OrderClose(floor(Clot? Clot: ticket), lot, Bullish? Bid: Ask, slip, clrNONE);
if (t_close) Alert("***** TEST CLOSED! (2) " + vtst + " " + tr_allow + " " + ticket + " " + Clot + " " + t_close + " " + Bullis
h + " *****");
else  Alert("***** TEST NOT CLOSED! (2) " + vtst + " " + tr_allow + " " + ticket + " " + Clot + " " + t_close + " " + Bullish +
 " " +  GetLastError() + " *****");
         if (t_close || ! tr_Allow) { ticket = 0;           total3_ = total3;          if (! tr_Allow) t_close = true;
*****

***** tst1.txt
#else
      if (ticket <= 7 || cpt > 2) { if (! vtst) ticket = 0;     cpt = 1; }       else { cpt ++;      //Clot && 
         if (infoMarket && !t_Night) Sleep(100);         if (mOrderSelect(mOrdersTotal(magic_nb)==1?0:2,SELECT_BY_POS)) {
***** TST2.TXT
#else
      if (((ticket <= 7 && ! MQLInfoInteger(MQL_TESTER)) || ! ticket) || cpt > 2) { if (! vtst) ticket = 0;    cpt = 1; }     e
lse { cpt ++;      //Clot && 
         if (infoMarket && !t_Night) Sleep(100);         if (mOrderSelect(mOrdersTotal(magic_nb)==1?0:2,SELECT_BY_POS)) {
*****

***** tst1.txt
               GlobalVariableSet(t1_Bull_str, t5a_Bullish);    GlobalVariableSet(t2_Bull_str, t5b_Bullish);
               GlobalVariableSet(tmfr1_str, tmfr_);            GlobalVariableSet(tmfr0_str, tmfr); } }
/*         else if (Period() == PERIOD_M5 && ! t_night) { tmfr_b = Period();
***** TST2.TXT
               GlobalVariableSet(t1_Bull_str, t5a_Bullish);    GlobalVariableSet(t2_Bull_str, t5b_Bullish);
               GlobalVariableSet(tmfr1_str, tmfr_);            GlobalVariableSet("tmfr_0_bk-tst", tmfr); } }
/*         else if (Period() == PERIOD_M5 && ! t_night) { tmfr_b = Period();
*****

***** tst1.txt
               GlobalVariableSet(t3_Bull_str, t5a_Bull_b);     GlobalVariableSet(t4_Bull_str, t5b_Bull_b);
               GlobalVariableSet(tmfr2_str, tmfr_b);           GlobalVariableSet(tmfr0_str, tmfr); } } */       else t = 17;
         if (tmfr_n==Period()) { temp = "** Passage SANS effet en M"+IntegerToString(tmfr_n)+" avec OrderSend "+(tst_5? "OK": "
***** TST2.TXT
               GlobalVariableSet(t3_Bull_str, t5a_Bull_b);     GlobalVariableSet(t4_Bull_str, t5b_Bull_b);
               GlobalVariableSet(tmfr2_str, tmfr_b);           GlobalVariableSet("tmfr_0_bk-tst", tmfr); } } */       else t = 
17;
         if (tmfr_n==Period()) { temp = "** Passage SANS effet en M"+IntegerToString(tmfr_n)+" avec OrderSend "+(tst_5? "OK": "
*****

***** tst1.txt
//Alert("TEST ALLOWED! (4) " + tr_allow + " " + ticket + " " + Clot + " " + t_close + " " + Bullish);
      if (ticket > 7) Print("** -> OrderSend ", ticket, " - ", OrderProfit(), " - ", OrderSwap(), " - ", OrderCommission(), " -
 ",
            DoubleToStr(OrderOpenPrice(),Digits()), " - ", DoubleToStr(SL, Digits()), " **"); } //*/
***** TST2.TXT
//Alert("TEST ALLOWED! (4) " + tr_allow + " " + ticket + " " + Clot + " " + t_close + " " + Bullish);
      if ((ticket > 7 || (ticket && MQLInfoInteger(MQL_TESTER)))) Print("** -> OrderSend ", ticket, " - ", OrderProfit(), " - "
, OrderSwap(), " - ", OrderCommission(), " - ",
            DoubleToStr(OrderOpenPrice(),Digits()), " - ", DoubleToStr(SL, Digits()), " **"); } //*/
*****

***** tst1.txt
#ifdef v_opfx_0
   if (GlobalVariableCheck(tck_vstr)) ticket_ = GlobalVariableGet(tck_vstr);           t_tick = (ticket_ > 7);
   if (nb_ticks && OrderSelect(ticket_, SELECT_BY_TICKET) && t_tick) if (OrderProfit() < 0.0) nb_tcks_N ++;    else { nb_ticks 
***** TST2.TXT
#ifdef v_opfx_0
   if (GlobalVariableCheck(tck_vstr)) ticket_ = GlobalVariableGet(tck_vstr);           t_tick = (ticket_ > 7 || (ticket_ && MQL
InfoInteger(MQL_TESTER)));
   if (nb_ticks && OrderSelect(ticket_, SELECT_BY_TICKET) && t_tick) if (OrderProfit() < 0.0) nb_tcks_N ++;    else { nb_ticks 
*****

***** tst1.txt

bool chk_chartm5(int i) { int t=0;
   while((! Chart_M5 || (!int(ChartPeriod(Chart_M5)) && !int(ChartPeriod(Chart_M5+t)) && !int(ChartPeriod(Chart_M5-t)))) && t <
***** TST2.TXT

bool chk_chartm5(int i) { int t=0;     return(true);
   while((! Chart_M5 || (!int(ChartPeriod(Chart_M5)) && !int(ChartPeriod(Chart_M5+t)) && !int(ChartPeriod(Chart_M5-t)))) && t <
*****

***** tst1.txt
void Liqu_x2_tf(string str) { int t1=0, t2=0, err;       bool tst;     string temp;
   if (Period() == PERIOD_M15) { GlobalVariableSet(tmfr0_str, PERIOD_M5);
      while(! (tst=ChartSetSymbolPeriod(0, NULL, PERIOD_M5)) && t1 < 17) { t1 ++;      Sleep(100);       tim_M15 = Time[0]; }  
***** TST2.TXT
void Liqu_x2_tf(string str) { int t1=0, t2=0, err;       bool tst;     string temp;
   if (Period() == PERIOD_M15) { GlobalVariableSet("tmfr_0_bk-tst", PERIOD_M5);
      while(! (tst=ChartSetSymbolPeriod(0, NULL, PERIOD_M5)) && t1 < 17) { t1 ++;      Sleep(100);       tim_M15 = Time[0]; }  
*****

***** tst1.txt
            GlobalVariableSet(t3_Bull_str, t5a_Bull_b);     GlobalVariableSet(t4_Bull_str, t5b_Bull_b);
            GlobalVariableSet(tmfr2_str, tmfr_b);           GlobalVariableSet(tmfr0_str, tmfr); }
/*         else { tim_Chart_M5 = TimeCurrent();       GlobalVariableSet("t_Chart_M5", tim_Chart_M5);
***** TST2.TXT
            GlobalVariableSet(t3_Bull_str, t5a_Bull_b);     GlobalVariableSet(t4_Bull_str, t5b_Bull_b);
            GlobalVariableSet(tmfr2_str, tmfr_b);           GlobalVariableSet("tmfr_0_bk-tst", tmfr); }
/*         else { tim_Chart_M5 = TimeCurrent();       GlobalVariableSet("t_Chart_M5", tim_Chart_M5);
*****

***** tst1.txt
            GlobalVariableSet("t1_Bullish", t5a_Bullish);   GlobalVariableSet("t2_Bullish", t5b_Bullish);
            GlobalVariableSet(tmfr1_str, tmfr_);            GlobalVariableSet(tmfr0_str, tmfr); }*/ }
      if (tst) { temp = "** Passage en " + (Period()==PERIOD_M5? "M1": "M5") + " à " + TimeToStr(TimeCurrent(),TIME_MINUTES) + 
***** TST2.TXT
            GlobalVariableSet("t1_Bullish", t5a_Bullish);   GlobalVariableSet("t2_Bullish", t5b_Bullish);
            GlobalVariableSet(tmfr1_str, tmfr_);            GlobalVariableSet("tmfr_0_bk-tst", tmfr); }*/ }
      if (tst) { temp = "** Passage en " + (Period()==PERIOD_M5? "M1": "M5") + " à " + TimeToStr(TimeCurrent(),TIME_MINUTES) + 
*****

***** tst1.txt
int f_Params(int mode) { int new_set=4;   // <- changer à chaque élément nouveau
  if (mode) {
   GlobalVariableSet("EURUSD_Comm", 13);         GlobalVariableSet("EURUSD_Sprd", 20);
/*   GlobalVariableSet("USDZAR_Comm", 706);        GlobalVariableSet("USDZAR_Sprd", 1600);
   GlobalVariableSet("EURZAR_Comm", 706);        GlobalVariableSet("EURZAR_Sprd", 1600);
   GlobalVariableSet("USDMXN_Comm", 606);        GlobalVariableSet("USDMXN_Sprd", 1500); */

   GlobalVariableSet("BTCUSD_Comm", 3506);       GlobalVariableSet("BTCUSD_Sprd", 5000);
/*   GlobalVariableSet("ETHUSD_Comm", 506);        GlobalVariableSet("ETHUSD_Sprd", 715);
   GlobalVariableSet("LTCUSD_Comm", 66););       GlobalVariableSet("LTCUSD_Sprd", 85);
   GlobalVariableSet("XRPUSD_Comm", 56);         GlobalVariableSet("XRPUSD_Sprd", 50); */

//   GlobalVariableSet("USTECH_Comm", 136);      GlobalVariableSet("USTECH_Sprd", 200);
   GlobalVariableSet("CHINAA_Comm", 13500);      GlobalVariableSet("CHINAA_Sprd", 42000);
   GlobalVariableSet("HKG50_Comm", 22000);       GlobalVariableSet("HKG50_Sprd", 65000);
   GlobalVariableSet("SPX500_Comm", 55);         GlobalVariableSet("SPX500_Sprd", 170);
   GlobalVariableSet("FRA40_Comm", 130);         GlobalVariableSet("FRA40_Sprd", 380);
   GlobalVariableSet("AUS200_Comm", 485);        GlobalVariableSet("AUS200_Sprd", 1500);
   GlobalVariableSet("UK100_Comm", 105);         GlobalVariableSet("UK100_Sprd", 320);
   GlobalVariableSet("US30_Comm", 170);          GlobalVariableSet("US30_Sprd", 520);
   GlobalVariableSet("GER30_Comm", 170);         GlobalVariableSet("GER30_Sprd", 520);
   GlobalVariableSet("JPN225_Comm", 1105);       GlobalVariableSet("JPN225_Sprd", 3320);
   GlobalVariableSet("NAS100_Comm", 300);        GlobalVariableSet("NAS100_Sprd", 930);
   GlobalVariableSet("ESTX50_Comm", 160);        GlobalVariableSet("ESTX50_Sprd", 500);
   GlobalVariableSet("ITA40_Comm", 120);         GlobalVariableSet("ITA40_Sprd", 380);
   GlobalVariableSet("SUI20_Comm", 45);         GlobalVariableSet("SUI20_Sprd", 150);

   GlobalVariableSet("XAUUSD_Comm", 13);         GlobalVariableSet("XAUUSD_Sprd", 20);
   GlobalVariableSet("BRENT_Comm", 56);          GlobalVariableSet("BRENT_Sprd", 100);

   GlobalVariableSet("EURUSD_H1", 6);    GlobalVariableSet("EURUSD_H2", 8);    GlobalVariableSet("EURUSD_H3", 23);    GlobalVar
iableSet("EURUSD_Diff", 0);
/*   GlobalVariableSet("USDZAR_H1", 6);    GlobalVariableSet("USDZAR_H2", 8);    GlobalVariableSet("USDZAR_H3", 23);    GlobalV
ariableSet("USDZAR_Diff", 0);
   GlobalVariableSet("EURZAR_H1", 6);    GlobalVariableSet("EURZAR_H2", 8);    GlobalVariableSet("EURZAR_H3", 23);    GlobalVar
iableSet("EURZAR_Diff", 0);
   GlobalVariableSet("USDMXN_H1", 6);    GlobalVariableSet("USDMXN_H2", 8);    GlobalVariableSet("USDMXN_H3", 23);    GlobalVar
iableSet("USDMXN_Diff", 0); */

   GlobalVariableSet("BTCUSD_H1", 1);    GlobalVariableSet("BTCUSD_H2", 1);    GlobalVariableSet("BTCUSD_H3", 23);     GlobalVa
***** TST2.TXT
int f_Params(int mode) { int new_set=4;   // <- changer à chaque élément nouveau
/*  if (mode) {
   GlobalVariableSet("BTCUSD_Comm", 3506);       GlobalVariableSet("BTCUSD_Sprd", 5000);
   GlobalVariableSet("BTCUSD_H1", 1);    GlobalVariableSet("BTCUSD_H2", 1);    GlobalVariableSet("BTCUSD_H3", 23);     GlobalVa
*****

***** tst1.txt
riableSet("BTCUSD_Diff", 0);
/*   GlobalVariableSet("ETHUSD_H1", 1);    GlobalVariableSet("ETHUSD_H2", 1);    GlobalVariableSet("ETHUSD_H3", 0);     GlobalV
ariableSet("ETHUSD_Diff", 0);
   GlobalVariableSet("LTCUSD_H1", 1);    GlobalVariableSet("LTCUSD_H2", 1);    GlobalVariableSet("LTCUSD_H3", 0);     GlobalVar
iableSet("LTCUSD_Diff", 0);
   GlobalVariableSet("XRPUSD_H1", 1);    GlobalVariableSet("XRPUSD_H2", 1);    GlobalVariableSet("XRPUSD_H3", 0);     GlobalVar
iableSet("XRPUSD_Diff", 0); */

// fin de journée : 22 h 45 - reprise lundi matin : 04 h 00 - reprise matin semaine : 03 h 45 
   GlobalVariableSet("CHINAA_H1", 22);   GlobalVariableSet("CHINAA_H2", 4);   GlobalVariableSet("CHINAA_H3", 14);    GlobalVari
ableSet("CHINAA_Diff", 0);
// fin de journée : 21 h 00 - reprise lundi matin : 04 h 15 - reprise matin semaine : 03 h 45 
   GlobalVariableSet("HKG50_H1", 20);    GlobalVariableSet("HKG50_H2", 4);    GlobalVariableSet("HKG50_H3", 14);     GlobalVari
ableSet("HKG50_Diff", 0);
   GlobalVariableSet("SPX500_H1", 3);    GlobalVariableSet("SPX500_H2", 6);   GlobalVariableSet("SPX500_H3", 23);    GlobalVari
ableSet("SPX500_Diff", 0);
   GlobalVariableSet("FRA40_H1", 8);     GlobalVariableSet("FRA40_H2", 8);    GlobalVariableSet("FRA40_H3", 20);     GlobalVari
ableSet("FRA40_Diff", 0);
// fin de journée : 23 h 00 - reprise lundi matin : 02 h 50 - reprise matin semaine : 02 h 50 
   GlobalVariableSet("AUS200_H1", 22);   GlobalVariableSet("AUS200_H2", 4);   GlobalVariableSet("AUS200_H3", 19);    GlobalVari
ableSet("AUS200_Diff", 0);
   GlobalVariableSet("UK100_H1", 6);     GlobalVariableSet("UK100_H2", 8);    GlobalVariableSet("UK100_H3", 23);     GlobalVari
ableSet("UK100_Diff", 0);
   GlobalVariableSet("US30_H1", 3);      GlobalVariableSet("US30_H2", 6);     GlobalVariableSet("US30_H3", 23);      GlobalVari
ableSet("US30_Diff", 0);
   GlobalVariableSet("GER30_H1", 8);     GlobalVariableSet("GER30_H2", 8);    GlobalVariableSet("GER30_H3", 20);     GlobalVari
ableSet("GER30_Diff", 0);
// fin de journée : 00 h 00 - reprise lundi matin : 01 h 50 - reprise matin semaine : 01 h 50 
   GlobalVariableSet("JPN225_H1", 23);   GlobalVariableSet("JPN225_H2", 1);   GlobalVariableSet("JPN225_H3", 19);    GlobalVari
ableSet("JPN225_Diff", 0);
   GlobalVariableSet("NAS100_H1", 3);    GlobalVariableSet("NAS100_H2", 6);   GlobalVariableSet("NAS100_H3", 23);    GlobalVari
ableSet("NAS100_Diff", 0);
   GlobalVariableSet("ESTX50_H1", 6);    GlobalVariableSet("ESTX50_H2", 8);   GlobalVariableSet("ESTX50_H3", 23);    GlobalVari
ableSet("ESTX50_Diff", 0);
   GlobalVariableSet("ITA40_H1", 8);     GlobalVariableSet("ITA40_H2", 8);    GlobalVariableSet("ITA40_H3", 20);     GlobalVari
ableSet("ITA40_Diff", 0);
   GlobalVariableSet("SUI20_H1", 8);     GlobalVariableSet("SUI20_H2", 8);    GlobalVariableSet("SUI20_H3", 20);     GlobalVari
ableSet("SUI20_Diff", 0);

   GlobalVariableSet("XAUUSD_H1", 1);    GlobalVariableSet("XAUUSD_H2", 3);   GlobalVariableSet("XAUUSD_H3", 23);     GlobalVar
iableSet("XAUUSD_Diff", 0);
   GlobalVariableSet("BRENT_H1", 6);     GlobalVariableSet("BRENT_H2", 6);    GlobalVariableSet("BRENT_H3", 23);     GlobalVari
ableSet("BRENT_Diff", 0);

   GlobalVariableSet("All_SL", 25); }    // / 1000

  comm = GlobalVariableGet(StringSubstr(Symbol(), 0, 6) + "_Comm");
  sprd = GlobalVariableGet(StringSubstr(Symbol(), 0, 6) + "_Sprd");
  H1 =   GlobalVariableGet(StringSubstr(Symbol(), 0, 6) + "_H1");
  H2 =   GlobalVariableGet(StringSubstr(Symbol(), 0, 6) + "_H2");    HOp = H2;
  H3 =   GlobalVariableGet(StringSubstr(Symbol(), 0, 6) + "_H3");    H3_ = H3;
  diff = GlobalVariableGet(StringSubstr(Symbol(), 0, 6) + "_Diff");
  SL =   GlobalVariableGet("All_SL") / 1000.0 * (Ask > 1000 ? round((Bid+Ask) / 2000.0) * 1000 :
      Ask > 100? round((Bid+Ask)/200.0) * 100.0: Ask > 10? round((Bid+Ask)/20.0) * 10.0: Ask > 1? round((Bid+Ask) / 2.0): 1.0);


***** TST2.TXT
riableSet("BTCUSD_Diff", 0);

   GlobalVariableSet("All_SL", 25); }    // / 1000 */

  comm = 3506;    sprd = 5000;      H1 = 1;     H2 = 1;    HOp = H2;    H3 = 23;    diff = 0;
  SL = 25 / 1000.0 * (Ask > 1000 ? round((Bid+Ask) / 2000.0) * 1000 : Ask > 100? round((Bid+Ask)/200.0) * 100.0: Ask > 10? roun
d((Bid+Ask)/20.0) * 10.0: Ask > 1? round((Bid+Ask) / 2.0): 1.0);

*****

***** tst1.txt
  t_ngt0 = true;        GlobalVariableSet("t_ngt_3", 1.0);        Sleep(100);          ExpertRemove(); }
#endif
***** TST2.TXT
  t_ngt0 = true;        GlobalVariableSet("t_ngt_3", 1.0);        Sleep(100);          ExpertRemove(); }

int f_End_EA() { int zero=0;    return(1/zero); }
#endif
*****

