Comparaison des fichiers tst1.txt et TST2.TXT
***** tst1.txt
   EUS_60=10100600, BTC_60=20100600, GLD_60=30100600, BRT_60=30300600, 
   NAS_60=50900600, FRA_60=51000600, EST_60=51100600, ITA_60=51200600, SUI_60=51300600, 
***** TST2.TXT
   EUS_60=10100600, BTC_60=20100600, GLD_60=30100600, BRT_60=30300600, 
   CJP_60=10200600, EGB_60=10300600, EJP_60=10400600, GJP_60=10500600, UTR_60=10600600, 
   NAS_60=50900600, FRA_60=51000600, EST_60=51100600, ITA_60=51200600, SUI_60=51300600, 
*****

***** tst1.txt
   EUS_60_lm=10100601, BTC_60_lm=20100601, GLD_60_lm=30100601, BRT_60_lm=30300601, 
   NAS_60_lm=50900601, FRA_60_lm=51000601, EST_60_lm=51100601, ITA_60_lm=51200601, SUI_60_lm=51300601};
***** TST2.TXT
   EUS_60_lm=10100601, BTC_60_lm=20100601, GLD_60_lm=30100601, BRT_60_lm=30300601, 
   CJP_60_lm=10200601, EGB_60_lm=10300601, EJP_60_lm=10400601, GJP_60_lm=10500601, UTR_60_lm=10600601, 
   NAS_60_lm=50900601, FRA_60_lm=51000601, EST_60_lm=51100601, ITA_60_lm=51200601, SUI_60_lm=51300601};
*****

***** tst1.txt
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
lt;
bool t5a_Bullish, t5b_Bullish, t5a_Bull_b, t5b_Bull_b, pass1b, t_night, t_h6, tst_5b, t_ngt0, ha_Shw=false, tmp_saved, t_TST1, 
t_TST2, Liqu_x2, t_M15_H1=false,
   OS1_tick=true, OS2_tick=true, OS3_tick=true, OS4_tick=true, OS5_tick=true, OS6_tick=true, OS9_tick=true, bull2, trd_on;     
  // comm=13  (6+7)   spr2=20
int sprd, comm, H1, H2, H3, H3_, diff, nb_ticks, nb_tcks_N, NR, rect_HG, haCoef=1, liqu_x2_n;      double SL, Rect_Hs[50][2], A
ccBalance_day;
#endif
***** TST2.TXT
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, next_vert, last_rct_=0, i_Cht_M5, curr_time, ATS_Time, tst_5c, tim
_M15, tim_flt;
bool t5a_Bullish, t5b_Bullish, t5a_Bull_b, t5b_Bull_b, pass1b, t_night, t_h6, tst_5b, t_ngt0, ha_Shw=false, tmp_saved, t_TST1, 
t_TST2, Liqu_x2, t_M15_H1=false, t_M5_M15=false,
   OS1_tick=true, OS2_tick=true, OS3_tick=true, OS4_tick=true, OS5_tick=true, OS6_tick=true, OS9_tick=true, bull2, trd_on, t_rs
i51_, t_rsi515, tmf_Diff;    // comm=13  (6+7)   spr2=20
int sprd, comm, H1, H2, H3, H3_, diff, Mg_N, nb_ticks, nb_tcks_N, NR, rect_HG, haCoef=1, liqu_x2_n;      double SL, Rect_Hs[50]
[2], AccBalance_day;
#endif
*****

***** tst1.txt
#include <Liste dObjets EA.mqh>
#else
***** TST2.TXT
#include <Liste dObjets EA.mqh>
#ifdef v_opfx_0
#include <Enable current EA.mqh>
#endif
#else
*****

***** tst1.txt
);
      Alert("***** PASSAGE EN M30 ! ("+str_DCC+") *****"); }

***** TST2.TXT
);
      Alert("***** PASSAGE EN M30 ! ("+str_DCC+") *****");        tmf_Diff = true; }

*****

***** tst1.txt
  if (prevMinut2 != Minute() && Seconds() > 2 && GlobalVariableCheck(EA_cht_str)) {
      EA_cht_W = GlobalVariableGet(EA_cht_str);
      if (EA_cht_W) { GlobalVariableSet(EA_Ch2_str, ChartID());      GlobalVariableSet(EA_cht_str, 0);
         GlobalVariableSet(EA_Ch3_str, TimeCurrent());               prevMinut2 = Minute(); }
      if (GlobalVariableCheck("t_ngt_3")) t_ngt0 = GlobalVariableGet("t_ngt_3"); }

***** TST2.TXT
  if (prevMinut2 != Minute() && Seconds() > 2 && GlobalVariableCheck(EA_cht_str)) {
      GlobalVariableSet(EA_Ch2_str, ChartID());
      if (! MQLInfoInteger(MQL_DLLS_ALLOWED)) GlobalVariableSet(EA_cht_str, 20);
      else { EA_cht_W = GlobalVariableGet(EA_cht_str);
         if (EA_cht_W) { GlobalVariableSet(EA_cht_str, 0);
            GlobalVariableSet(EA_Ch3_str, TimeCurrent());      prevMinut2 = Minute(); }
         if (GlobalVariableCheck("t_ngt_3")) t_ngt0 = GlobalVariableGet("t_ngt_3"); } }

  string str, temp;
  if (pass1b && GlobalVariableCheck("Enable_EA") && GlobalVariableGet("Enable_EA")) GlobalVariableSet("Enable_EA", 0.0);
  if (! MQLInfoInteger(MQL_DLLS_ALLOWED) && (! GlobalVariableCheck("Enable_DLL") || GlobalVariableGet("Enable_DLL") == 0.0)) {
      str = TimeToStr(Time[0], TIME_MINUTES);         Sleep(100);                // ResetLastError();
      GlobalVariableSet(EA_cht_str, 20);        GlobalVariableSet("Enable_DLL", 1.0);        GlobalVariableSet("Enable_DLL_mgn"
, Mg_N);
//      Enable_EA("", 0, 1);             FileMove("EA_Enabled.txt", FILE_COMMON, "EA_Not_Enabled.txt", FILE_COMMON);
      StringReplace(str, ":", "");     ChartSaveTemplate(0,"templates saved EA\\template_saved_"+StringSubstr(Symbol(),0,6)+" -
 "+str); }
/*      if (ChartApplyTemplate(0, "template_saved_"+StringSubstr(Symbol(), 0, 6))) { //GlobalVariableSet(EA_cht_str, 15.0);
         temp = "** EA -> ChartApplyTemplate OK: -> template_saved_" + StringSubstr(Symbol(), 0, 6) + " **";         Sleep(1000
); }
      else temp = "***** EA -> ChartApplyTemplate failed error: "+GetLastError()+" - "+Symbol()+" - "+IntegerToString(ChartID()
)+" *****";
      Alert(temp);      copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) +" "+Symbol()+","+stmfr+": " + temp); } *
/
  if (! MQLInfoInteger(MQL_DLLS_ALLOWED) || (! MQLInfoInteger(MQL_TRADE_ALLOWED) && TerminalInfoInteger(TERMINAL_TRADE_ALLOWED)
)) {
      if (Enable_EA("temp EA "+Symbol()+".set", 1, 0)) temp = "***** "+Symbol()+" - Toggle Expert Advisor button ON *****";
      else     temp = "***** "+Symbol()+" - Toggle Expert Advisor button OFF *****";
      Alert(temp);      copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) +" "+Symbol()+","+stmfr+": " + temp);
      if (MQLInfoInteger(MQL_DLLS_ALLOWED)) return; }
  else if (Mg_N != round(magic_nb / 100000)) { if (Enable_EA("temp EA "+Symbol()+".set", 0, 0))
         temp = "***** "+Symbol()+" - Mg_N != round(magic_nb / 100000) -> OK *****";
      else     temp = "***** "+Symbol()+" - Error: Mg_N != round(magic_nb / 100000) *****";
      Alert(temp);      copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) +" "+Symbol()+","+stmfr+": " + temp);
      if (MQLInfoInteger(MQL_DLLS_ALLOWED)) return; }
  else if (GlobalVariableGet("Enable_DLL_mgn") == Mg_N && GlobalVariableGet("Enable_DLL") == 1.0) {
      GlobalVariableSet("Enable_DLL", 0.0);           GlobalVariableSet("Enable_DLL_mgn", 0.0); }
  if (MQLInfoInteger(MQL_DLLS_ALLOWED) && FileIsExist("EA_Not_Enabled.txt", 0)) FileMove("EA_Not_Enabled.txt", 0, "EA_Enabled.t
xt", 0);

*****

***** tst1.txt

  string str="-"+StringSubstr(EnumToString(magic_nb), 0, 3), temp;
  if (!FileIsExist("ATS-Ind_On-Off\\ATS-Ind5"+str+"_Buy.txt", 0) && !FileIsExist("ATS-Ind_On-Off\\ATS-Ind5"+str+"_Sell.txt", 0)
***** TST2.TXT

  str = "-" + StringSubstr(EnumToString(magic_nb), 0, 3);
  if (!FileIsExist("ATS-Ind_On-Off\\ATS-Ind5"+str+"_Buy.txt", 0) && !FileIsExist("ATS-Ind_On-Off\\ATS-Ind5"+str+"_Sell.txt", 0)
*****

***** tst1.txt
3 = H3_; }
  else if (Hour() == H1 && (H1 < H3 || DayOfWeek() < 5)) { if (! time_allow) { time_allow = true;   nb_ticks = 0;  nb_tcks_N = 
0;   t_M15_H1 = false; }
         if (H1 > H3 && GlobalVariableCheck("t_ngt_2") && str == "-CHN") t_ngt0 = GlobalVariableGet("t_ngt_2"); }
  if (H1 > H3 && (t_night_ != t_night || tr_allow_ != tr_allow)) { t_night_ = t_night;       tr_allow_ = tr_allow; }
  t_night = t_ngt0 || ((! Hour() || (Hour() < H1 && (H1 < H3 || Hour() >= H3)) || (!t_h6 && !t_ngt0 && Hour() == H1 && ((H1 < H
3 && ! Minute() && Seconds() < 17) ||
      (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
3 = H3_; }
  else if (Hour() == H1 && (H1 < H3 || DayOfWeek() < 5)) { if (! time_allow) { time_allow = true;     nb_ticks = 0;     nb_tcks
_N = 0; }
      t_M5_M15 = false;    t_M15_H1 = false;    if (H1 > H3 && GlobalVariableCheck("t_ngt_2") && str == "-CHN") t_ngt0 = Global
VariableGet("t_ngt_2"); }
  if (H1 > H3 && (t_night_ != t_night || tr_allow_ != tr_allow)) { t_night_ = t_night;       tr_allow_ = tr_allow; }
  t_night = t_ngt0 || (((H1 < H3 && diff && Hour() == H3 && Minute() > diff) || ! Hour() || (DayOfWeek() == 5 && ((Hour() == 16
 && 
      Minute() > 39) || Hour() > 16)) || (Hour() < H1 && (H1 < H3 || Hour() >= H3)) || (!t_h6 && !t_ngt0 && Hour() == H1 && ((H
1 < H3 && ! Minute() && 
      Seconds() < 17) || (H1 > H3 && Hour() == H1 && (Minute() < 40 || (Minute() == 40 && Seconds() < 17)))))) && (H1 < H3 || D
ayOfWeek()));    // 6
  if (H1 > H3 && t_night != t_night_) Print("** Suivi de t_night et tr_allow (1) : "+Symbol()+" / "+IntegerToString(Period())+"
*****

***** tst1.txt
 - t_night = "+t_night+" - tr_allow = "+tr_allow+" **");
  if (((! Hour() && H1 < H3) || Hour() < HOp || (Hour() >= H1 && H1 > H3 && (str != "-CHN" || Seconds() > 4)) ||
   last_rct_ == Time[0]) && ((Period() == PERIOD_H1 || Period() == PERIOD_M30) && ! t_M15_H1)) { tmfr_ = Period();
      while(! (tst=ChartSetSymbolPeriod(0, NULL, str=="-HKG"?PERIOD_M1:PERIOD_M5)) && t1 < 17) { t1 ++;   Sleep(100); }     err
***** TST2.TXT
 - t_night = "+t_night+" - tr_allow = "+tr_allow+" **");
  if (((! Hour() && H1 < H3) || Hour() < HOp || (Hour() >= H1 && H1 > H3 && (str != "-CHN" || Seconds() > 4)) || (last_rct_==Ti
me[0] && Period()>=PERIOD_M30)) &&
   ((Period() >= PERIOD_M15 || (str == "-HKG" && Period() >= PERIOD_M5)) && ! t_M5_M15 && ! t_M15_H1)) { tmfr_ = Period()==PERI
OD_M30? Period(): PERIOD_H1;
      while(! (tst=ChartSetSymbolPeriod(0, NULL, str=="-HKG"?PERIOD_M1:PERIOD_M5)) && t1 < 17) { t1 ++;   Sleep(100); }     err
*****

***** tst1.txt
Chart_M5)+" ***";
            Alert(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) + " " + Symbol() + ": " + temp);
 }
         Sleep(50);      ChartSetInteger(0, CHART_SCALE, 0, 4);             tmfr = str == "-HKG"? PERIOD_M1: PERIOD_M5;
***** TST2.TXT
Chart_M5)+" ***";
            Alert(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) +" "+Symbol()+","+stmfr+": " + t
emp); }
         Sleep(50);      ChartSetInteger(0, CHART_SCALE, 0, 4);             tmfr = str == "-HKG"? PERIOD_M1: PERIOD_M5;
*****

***** tst1.txt
         Sleep(50);           ChartSetInteger(Chart_M5, CHART_SCALE, 0, 5);         int err2 = GetLastError();
         tim_Chart_M5 = TimeCurrent();       GlobalVariableSet("t_Chart_M5", tim_Chart_M5);
         t5a_Bullish = bull_;                t5b_Bullish = FileIsExist("ATS-Ind_On-Off\\ATS-Ind5_Buy.txt", 0);
         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
         Sleep(50);           ChartSetInteger(Chart_M5, CHART_SCALE, 0, 5);         int err2 = GetLastError();
         tim_Chart_M5 = TimeCurrent();       GlobalVariableSet(t1_Chart_str, tim_Chart_M5);
         t5a_Bullish = bull_;                t5b_Bullish = FileIsExist("ATS-Ind_On-Off\\ATS-Ind5"+str+"_Buy.txt", 0);
         GlobalVariableSet(t1_Bull_str, t5a_Bullish);    GlobalVariableSet(t2_Bull_str, t5b_Bullish);
         GlobalVariableSet(tmfr1_str, tmfr_);            GlobalVariableSet(tmfr0_str, tmfr); }     if (last_rct_ < Time[0] && H
1 > H3) t_night = true;
      if (tst) { temp = "** Passage en "+(str=="-HKG"?"M1":"M5")+" à "+IntegerToString(fmax(H1,H3))+" H ! (Period()="+IntegerTo
*****

***** tst1.txt
            IntegerToString(t1) + ", t2=" + IntegerToString(t2) + (t2==17 ? ", err2=" + IntegerToString(err2) : "") + ") **";
         Print(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) + " " + Symbol() + ": " + temp); }
      else { if (Period()>PERIOD_M1) Print("*** Erreur - Passage en M5 à "+IntegerToString(fmax(H1,H3))+" H ! (Period()=" + Int
***** TST2.TXT
            IntegerToString(t1) + ", t2=" + IntegerToString(t2) + (t2==17 ? ", err2=" + IntegerToString(err2) : "") + ") **";
         Print(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) +" "+Symbol()+","+stmfr+": " + temp
); }
      else { if (Period()>PERIOD_M1) Print("*** Erreur - Passage en M5 à "+IntegerToString(fmax(H1,H3))+" H ! (Period()=" + Int
*****

***** tst1.txt
;
            Print(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) + " " + Symbol() + ": " + temp);
 } }
  if (str == "-HKG" && Hour() == HOp && Minute() > 30 && Period() == PERIOD_M1) { t1 = 0;
***** TST2.TXT
;
            Print(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) +" "+Symbol()+","+stmfr+": " + t
emp); } }
  if (str == "-HKG" && Hour() == HOp && Minute() > 30 && Period() == PERIOD_M1) { t1 = 0;
*****

***** tst1.txt
oString(t1)+") **";
         Print(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) + " " + Symbol() + ": " + temp); } 
}

***** TST2.TXT
oString(t1)+") **";
         Print(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) +" "+Symbol()+","+stmfr+": " + temp
); } }

*****

***** tst1.txt
 
   TimeCurrent()-tim_Chart_M5 > tmfr_*60*8 && iCustom(NULL, 0, "RSI.ex4", 0, 0) > 35 && iCustom(NULL, 0, "RSI.ex4", 0, 0) < 65)
 ||
   (tst2 = (Period() == PERIOD_M15 && iCustom(NULL, 0, "RSI.ex4", 0, 0) > 40 && iCustom(NULL, 0, "RSI.ex4", 0, 0) < 60 &&
   nb_ticks > 2 && nb_ticks == nb_tcks_N + 1))) {     // ou tester la présence d'un rectangle ATS
      if (! chk_chartm5(4)) Alert("*** ERROR Chart_M5 (4) "+IntegerToString(ChartPeriod(Chart_M5))+" - "+IntegerToString(Chart_
M5)+" ***");
      if ((StringTrimLeft(ChartSymbol(Chart_M5)) != "" && ((t5b_Bullish == FileIsExist("ATS-Ind_On-Off\\ATS-Ind5"+str+"_Buy.txt
***** TST2.TXT
 
   TimeCurrent()-tim_Chart_M5 > tmfr_*60*8 && m3_RSI(PERIOD_M5, 2) > 40 && m3_RSI(PERIOD_M5, 2) < 60) ||
   (tst2 = (Period() == PERIOD_M15 && m3_RSI(0, 2) > 35 && m3_RSI(0, 2) < 65 &&
   nb_ticks > 2 && nb_ticks == nb_tcks_N + 1))) {     // ou tester la présence d'un rectangle ATS
      if (! chk_chartm5(4)) { temp = "*** ERROR Chart_M5 (4) "+IntegerToString(ChartPeriod(Chart_M5))+" - "+IntegerToString(Cha
rt_M5)+" ***";
         Alert(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) +" "+Symbol()+","+stmfr+": " + temp
); }
      if ((StringTrimLeft(ChartSymbol(Chart_M5)) != "" && ((t5b_Bullish == FileIsExist("ATS-Ind_On-Off\\ATS-Ind5"+str+"_Buy.txt
*****

***** tst1.txt
ng(Chart_M5)+" ***";
               Alert(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) + " " + Symbol() + ": " + tem
p); }
            t2 = 0;     while(! ChartSetSymbolPeriod(Chart_M5, NULL, PERIOD_M5) && t2 < 17) { t2 ++;      Sleep(100); }
***** TST2.TXT
ng(Chart_M5)+" ***";
               Alert(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) +" "+Symbol()+","+stmfr+": " 
+ temp); }
            t2 = 0;     while(! ChartSetSymbolPeriod(Chart_M5, NULL, PERIOD_M5) && t2 < 17) { t2 ++;      Sleep(100); }
*****

***** tst1.txt
egerToString(GetLastError()): "")+") **";
            Alert(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) + " " + Symbol() + ": " + temp);

            tim_Chart_M5 = 0;       GlobalVariableSet(t1_Chart_str, tim_Chart_M5);
***** TST2.TXT
egerToString(GetLastError()): "")+") **";
            Alert(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) +" "+Symbol()+","+stmfr+": " + t
emp);
            tim_Chart_M5 = 0;       GlobalVariableSet(t1_Chart_str, tim_Chart_M5);
*****

***** tst1.txt
               IntegerToString(t1) + ", t = " + IntegerToString(t) + ", err1 = " + IntegerToString(err) + ") ***";
            Alert(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) + " " + Symbol() + ": " + temp);
 } } }
   else if (Period()==PERIOD_M1 && TimeCurrent() % PERIOD_M1*60 < 3 && tim_Chart_M5b > 0 && TimeCurrent()-tim_Chart_M5b > tmfr_
***** TST2.TXT
               IntegerToString(t1) + ", t = " + IntegerToString(t) + ", err1 = " + IntegerToString(err) + ") ***";
            Alert(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) +" "+Symbol()+","+stmfr+": " + t
emp); } } }
   else if (Period()==PERIOD_M1 && TimeCurrent() % PERIOD_M1*60 < 3 && tim_Chart_M5b > 0 && TimeCurrent()-tim_Chart_M5b > tmfr_
*****

***** tst1.txt
rt_M5)+" ***";
         Alert(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) + " " + Symbol() + ": " + temp); }
      if (StringTrimLeft(ChartSymbol(Chart_M5)) != "" && ((t5b_Bull_b == FileIsExist("ATS-Ind_On-Off\\ATS-Ind5"+str+"_Buy.txt",
***** TST2.TXT
rt_M5)+" ***";
         Alert(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) +" "+Symbol()+","+stmfr+": " + temp
); }
      if (StringTrimLeft(ChartSymbol(Chart_M5)) != "" && ((t5b_Bull_b == FileIsExist("ATS-Ind_On-Off\\ATS-Ind5"+str+"_Buy.txt",
*****

***** tst1.txt
ng(Chart_M5)+" ***";
               Alert(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) + " " + Symbol() + ": " + tem
p); }
            t2 = 0;     while(! ChartSetSymbolPeriod(Chart_M5, NULL, ENUM_TIMEFRAMES(tmfr_)) && t2 < 17) { t2 ++;       Sleep(1
***** TST2.TXT
ng(Chart_M5)+" ***";
               Alert(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) +" "+Symbol()+","+stmfr+": " 
+ temp); }
            t2 = 0;     while(! ChartSetSymbolPeriod(Chart_M5, NULL, ENUM_TIMEFRAMES(tmfr_)) && t2 < 17) { t2 ++;       Sleep(1
*****

***** tst1.txt
rror()) : "") + ") **";
            Alert(temp);            copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) + " " + Symbol() + ": " + tem
p);
            tim_Chart_M5b = 0;      GlobalVariableSet(t2_Chart_str, tim_Chart_M5b);
***** TST2.TXT
rror()) : "") + ") **";
            Alert(temp);            copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) +" "+Symbol()+","+stmfr+": " 
+ temp);
            tim_Chart_M5b = 0;      GlobalVariableSet(t2_Chart_str, tim_Chart_M5b);
*****

***** tst1.txt
               IntegerToString(t1) + ", t = " + IntegerToString(t) + ", err1 = " + IntegerToString(err) + ") ***";
            Alert(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) + " " + Symbol() + ": " + temp);
 } } }
   else   tst = true;    if (! tst) Sleep(100);    t ++; }
***** TST2.TXT
               IntegerToString(t1) + ", t = " + IntegerToString(t) + ", err1 = " + IntegerToString(err) + ") ***";
            Alert(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) +" "+Symbol()+","+stmfr+": " + t
emp); } } }
   else   tst = true;    if (! tst) Sleep(100);    t ++; }
*****

***** tst1.txt
false;
      Alert(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) + " " + Symbol() + ": " + temp); }

***** TST2.TXT
false;
      Alert(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) +" "+Symbol()+","+stmfr+": " + temp); 
}

*****

***** tst1.txt
//  if (! OrdersTotal() && ticket) { Print("** --> Ticket CHANGED! (OnTick) ",ticket," -> 0 ***");      ticket = 0; }      ***
  for (int pos = 0; pos < obj_total; pos ++) {
     OTim2 = 0;     name = ObjectName(pos);     //type = ObjectType(name);
     t_neutral0 = t_neutral;   t_liquid_b0 = t_liquid_b;   t_liquid_s0 = t_liquid_s;   //iTime(NULL,0,0)
     if (StringFind(name, "rect") > 0) { if (ObjectGet(name, OBJPROP_TIME2) == Time[0]) {  // ATS V2.0 Userrect1612950600
***** TST2.TXT
//  if (! OrdersTotal() && ticket) { Print("** --> Ticket CHANGED! (OnTick) ",ticket," -> 0 ***");      ticket = 0; }      ***
  next_vert = 0;     for (int pos = 0; pos < obj_total; pos ++) {
     OTim2 = 0;      name = ObjectName(pos);       //type = ObjectType(name);
     t_neutral0 = t_neutral;   t_liquid_b0 = t_liquid_b;   t_liquid_s0 = t_liquid_s;   //iTime(NULL,0,0)
#ifdef v_opfx_0
     if (StringFind(name, "ertical") > 0 && ObjectGet(name, OBJPROP_TIME1) > Time[0] && ObjectGet(name, OBJPROP_COLOR) == clrRe
d && 
         (! int(next_vert) || ObjectGet(name, OBJPROP_TIME1) < next_vert)) next_vert = ObjectGet(name, OBJPROP_TIME1);
     if (StringFind(name, "rect") > 0) { if (ObjectGet(name, OBJPROP_TIME2) == Time[0]) {  // ATS V2.0 Userrect1612950600
*****

***** tst1.txt
         if (ObjectGet(name_, OBJPROP_TIME2) < Time[1]) cpt_wav = 0; }   //*/
#ifdef v_opfx_0
     if (StringFind(name, "rect") > 0) { last_rect = ObjectGet(name, OBJPROP_TIME2);      rect_str = name; }
***** TST2.TXT
         if (ObjectGet(name_, OBJPROP_TIME2) < Time[1]) cpt_wav = 0; }   //*/
     if (StringFind(name, "rect") > 0) { last_rect = ObjectGet(name, OBJPROP_TIME2);      rect_str = name; }
*****

***** tst1.txt
  if ((last_liq_pr==0 || last_liq_t2==0) && StringSubstr(temp, 0, 3) != "ATS")
      Print("*** Erreur sur last_liq_pr ou last_liq_t2. " + DoubleToStr(last_liq_pr,Digits()) + " " + DoubleToStr(last_ntr_pr,D
igits()) +
         " " + TimeToStr(last_liq_t1, TIME_DATE|TIME_SECONDS) + " " + TimeToStr(last_liq_t2, TIME_DATE|TIME_SECONDS) + " \"" +
***** TST2.TXT
  if ((last_liq_pr==0 || last_liq_t2==0) && StringSubstr(temp, 0, 3) != "ATS")
      Print("*** Erreur sur last_liq_pr ou last_liq_t2. " + DoubleToStr(last_liq_pr,Digits()) + " " + DoubleToStr(ObjectGet(tem
p,OBJPROP_PRICE1),Digits()) +
         " " + TimeToStr(last_liq_t1, TIME_DATE|TIME_SECONDS) + " " + TimeToStr(last_liq_t2, TIME_DATE|TIME_SECONDS) + " \"" +
*****

***** tst1.txt
 ",((Period() > PERIOD_M15 ||
         DayOfWeek() == 5) && ! time_allow)," ",(Period() > PERIOD_M15 || DayOfWeek() == 5)," ",OS5_tick," ",Hour()," ",TimeToS
tr(tim_Chart_M5,TIME_MINUTES)," **"); }
#endif
***** TST2.TXT
 ",((Period() > PERIOD_M15 ||
         DayOfWeek() == 5) && ! time_allow)," ",(Period() > PERIOD_M15 || DayOfWeek() == 5)," ",t_rsi515," ",OS5_tick," ",Hour(
)," ",TimeToStr(tim_Chart_M5,TIME_MINUTES)," **"); }
#endif
*****

***** tst1.txt
s)+" *",0,0,0);  // && Op_HiLo
   t_clo = false;    j = 0;   while(! Time[j]) j ++;     bool op_case0;    // op_case0 juste provisoire **
   for (i=obj_bars[obj_pos[p-1]]+1; i <= Bars && ! t_clo; i ++) { obj_prClots[pos] = iClose(NULL,0,Bars-i);
***** TST2.TXT
s)+" *",0,0,0);  // && Op_HiLo
   t_clo = false;    j = 0;   while(! Time[j]) j ++;     //bool op_case0;    // op_case0 juste provisoire, à revoir *
   for (i=obj_bars[obj_pos[p-1]]+1; i <= Bars && ! t_clo; i ++) { obj_prClots[pos] = iClose(NULL,0,Bars-i);
*****

***** tst1.txt
#ifndef v_opfx
         t_clo =#ifdef v_opfx_0 Period() != PERIOD_M5 && 
                #endif f_mqh_code(3, pos, prv_pos, i, obj_liqTypes[prv_pos], obj_prClots[pos], 0, 0); }                        
***** TST2.TXT
#ifndef v_opfx
         t_clo =#ifdef v_opfx_0 Period() > PERIOD_M5 && 
                #endif f_mqh_code(3, pos, prv_pos, i, obj_liqTypes[prv_pos], obj_prClots[pos], 0, 0); }                        
*****

***** tst1.txt
l3_ = ",total3_,", ticket = ",ticket," **");
         if (obj_bars[obj_pos[p-1]] >= Bars-1 && (! ticket || FileIsExist("ATS-Int_On.txt", FILE_COMMON))#ifdef v_opfx_0 && OS2
_tick && time_allow) { OS2_tick = false;#else) {#endif total2_ = total2;
            DrawArrow_pf(bull? Ask: Bid, Bars-obj_bars[obj_pos[p-1]], 2, bull, 0);     DrawArrow_pf(bull? Ask: Bid, Bars-obj_ba
***** TST2.TXT
l3_ = ",total3_,", ticket = ",ticket," **");
#ifndef v_opfx_0
         if (obj_bars[obj_pos[p-1]] >= Bars-1 && (! ticket || FileIsExist("ATS-Int_On.txt", FILE_COMMON))) { total2_ = total2;
#else
         if ((Hour() != H1 || H1 < H3 || Minute() >= 2) && obj_bars[obj_pos[p-1]] >= Bars-1 && (! ticket || FileIsExist("ATS-In
t_On.txt", FILE_COMMON)) &&
            OS2_tick && time_allow) { OS2_tick = false;           total2_ = total2;
#endif
            DrawArrow_pf(bull? Ask: Bid, Bars-obj_bars[obj_pos[p-1]], 2, bull, 0);     DrawArrow_pf(bull? Ask: Bid, Bars-obj_ba
*****

***** tst1.txt
  if (obj_bars[prv_pos] >= Bars-1 && OS5_tick && time_allow && (!ticket || (bull_==NULL && bull_!=false) || ((bull && ! bull_) 
|| (! bull && bull_)))) {
#endif
***** TST2.TXT
  if (obj_bars[prv_pos] >= Bars-1 && OS5_tick && time_allow && (!ticket || (bull_==NULL && bull_!=false) || ((bull && ! bull_) 
|| (! bull && bull_)) ||
   (tmf_Diff && ((! OrderType() && obj_liqTypes[prv_pos] == "Sell") || (OrderType() && obj_liqTypes[prv_pos] == "Buy")))) && (!
 t_rsi515 || H1 > H3 || 
   (Hour() > 9 && Time[0] - OrderOpenTime() > 7200)) && ((last_ntr_pr > Ask && ! bull) || (last_ntr_pr < Bid && bull)) && last_
ntr_pr) {
                                                                     // du à un faux signal sur XAUUSD le 04-06-2021 à 14h45 mk
-time, la Liquid_Sell a disparu après
#endif
*****

***** tst1.txt
row_chk Error (2): ",GetLastError()," ***");   //iClose(NULL,0,0)
     #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]; }
     liqu_x2_n = 0;    if (tst) 
            temp = "** Passage en M15 (1) à "+TimeToStr(TimeCurrent(),TIME_MINUTES)+" ! (Period()="+IntegerToString(Period())+"
***** TST2.TXT
row_chk Error (2): ",GetLastError()," ***");   //iClose(NULL,0,0)
     #ifdef v_opfx_0 if (Hour() > H2 - 2 && m3_RSI(0, 2) > 40 && m3_RSI(0, 2) < 60 && Period() == PERIOD_M5 && (H1 < H3 || Hour
() > H2 + 2)) { t1 = 0;         // Hour() != H1
         while(! (tst=ChartSetSymbolPeriod(0, NULL, PERIOD_M15)) && t1 < 17) { t1 ++;        Sleep(100); }
         if (tst) { t_M5_M15 = true;           GlobalVariableSet(tmfr0_str, PERIOD_M15);     tim_M15 = Time[0];         liqu_x2
_n = 0;       tmf_Diff = true;
            temp = "** Passage en M15 (1) à "+TimeToStr(TimeCurrent(),TIME_MINUTES)+" ! (Period()="+IntegerToString(Period())+"
*****

***** tst1.txt
, t1="+IntegerToString(t1)+") **";
            Print(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) + " " + Symbol() + ": " + temp);
 }         else { OS5_tick = false;
     #endif if (Bars != obj_bars[obj_pos[p-1]]) tmp = obj_Prices[prv_pos];    else tmp = (iOpen(NULL,0,Bars-obj_bars[obj_pos[p-
***** TST2.TXT
, t1="+IntegerToString(t1)+") **";
            Print(temp);      copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) +" "+Symbol()+","+stmfr+": " + temp
); } }        else { OS5_tick = false;
     #endif if (Bars != obj_bars[obj_pos[p-1]]) tmp = obj_Prices[prv_pos];    else tmp = (iOpen(NULL,0,Bars-obj_bars[obj_pos[p-
*****

***** tst1.txt
[prv_pos]],
         TIME_MINUTES)," | ",pos," ",iClose(NULL,0,Bars-i+1)," ",vScale," | ",(tmp2=AccountBalance())," **"); //*/
      if (! DrawArrow_OS(5, obj_Levels[prv_pos]+(bull? 400*vScale*Point: 300*vScale*Point), Bars-obj_bars[prv_pos], 0, bull, 0)
)    //250*vScale*Point: 250*vScale
            Print("*** DrawArrow_OS 5 Error: ",GetLastError()," ***");
***** TST2.TXT
[prv_pos]],
         TIME_MINUTES)," | ",pos," ",iClose(NULL,0,Bars-i+1)," ",vScale," | ",(tmp2=AccountBalance())," **");  // v Bars-obj_ba
rs[prv_pos] */
      if (! DrawArrow_OS(5, obj_Levels[prv_pos]+(bull? 400*vScale*Point: 300*vScale*Point), 0, 0, bull, 0))    //250*vScale*Poi
nt: 250*vScale
            Print("*** DrawArrow_OS 5 Error: ",GetLastError()," ***");
*****

***** tst1.txt
  else if (obj_bars[prv_pos] >= Bars-1 && so_cpt < 2) { so_cpt ++;
      Print("*** DrawArrow_OS (*)5 "+(!ticket || (bull_==NULL && bull_!=false) || ((bull && ! bull_) || (! bull && bull_)))+" "
+(bull_==NULL && bull_!=false)+" "+
         (bull && ! bull_)+" "+(! bull && bull_)+" "+IntegerToString(ticket)+" "+bull_+" "+bull+" "+OS5_tick+" "+time_allow+" *
**"); }
  else if (obj_bars[prv_pos] < Bars-1) so_cpt = 0;
***** TST2.TXT
  else if (obj_bars[prv_pos] >= Bars-1 && so_cpt < 2) { so_cpt ++;
      Print("*** DrawArrow_OS (*)5 "+(!ticket || (bull_==NULL && bull_!=false) || ((bull && ! bull_) || (! bull && bull_))) + "
 " + (bull_==NULL && bull_!=false) + " " +
         (bull && ! bull_)+" "+(! bull && bull_) + " " + IntegerToString(ticket) + " " + bull_ + " " + bull + " " + t_rsi515 + 
" " + OS5_tick + " " + time_allow + " " +
         DoubleToStr(last_ntr_pr, Digits()) + " " + DoubleToStr(bull? Bid: Ask, Digits()) + " ***"); }
  else if (obj_bars[prv_pos] < Bars-1) so_cpt = 0;
*****

***** tst1.txt
#ifdef v_opfx_0
  int dgts=Digits() > 3 ? Digits() : Bid > 10000 ? 2 : 3;      double douHiLo, rect_H;       bool t_ngt1;
  bull = ! bull;    // car inversé sur < DrawArrow(((bull=(obj_liqTypes[prv_pos]=="Sell")) ?... >, 45 lignes plus haut
***** TST2.TXT
#ifdef v_opfx_0
  int dgts=Digits() > 3 ? Digits() : Bid > 10000 ? 2 : 3, K;      double douHiLo, rect_H;
  bool t_ngt1, t_Ntcks=(str=="-HKG" || str=="-CHN" || str=="-GLD");
  bull = ! bull;    // car inversé sur < DrawArrow(((bull=(obj_liqTypes[prv_pos]=="Sell")) ?... >, 45 lignes plus haut
*****

***** tst1.txt
  if (AccountEquity() > 0 && AccBalance_day - AccountEquity() > 0.2 * AccBalance_day) Close_All_Trades();
  if (curr_time < Time[0] && ((H1 > H3 && Hour() == H2) || (H1 < H3 && Hour() == H1)) && ! Minute()) {
      AccBalance_day = AccountBalance();           if (GlobalVariableCheck("t_ngt_3")) GlobalVariableDel("t_ngt_3"); }
***** TST2.TXT
  if (AccountEquity() > 0 && AccBalance_day - AccountEquity() > 0.2 * AccBalance_day) Close_All_Trades();
  if (curr_time < Time[0] && ((((H1 > H3 && Hour() == H2) || (H1 < H3 && Hour() == H1)) && ! Minute()) || ! AccBalance_day)) {
      AccBalance_day = AccountBalance();           if (GlobalVariableCheck("t_ngt_3")) GlobalVariableDel("t_ngt_3"); }
*****

***** tst1.txt
 H3 = 10;
      if ((str=="-HKG" || str=="-CHN") && Hour() < 6 && nb_ticks > 2 && nb_ticks == nb_tcks_N + 1) Print("** -> (2) nb_ticks > 
2 && nb_ticks == nb_tcks_N + 1 : ",
         IntegerToString(nb_ticks) , " " , IntegerToString(nb_tcks_N) , " " , ticket , " " , t_night , " " , t_ngt1 , " " , Tim
***** TST2.TXT
 H3 = 10;
      if (t_Ntcks && Hour() < 6 && nb_ticks > 2 && nb_ticks == nb_tcks_N + 1) Print("** -> (2) nb_ticks > 2 && nb_ticks == nb_t
cks_N + 1 : ",
         IntegerToString(nb_ticks) , " " , IntegerToString(nb_tcks_N) , " " , ticket , " " , t_night , " " , t_ngt1 , " " , Tim
*****

***** tst1.txt
j][1]; }
         Line_N = LineCreate(bull_? rLow - rect_H / 4: rHigh + rect_H / 4);
         Print("** -> Valeurs de Line_N : "+IntegerToString(rect_HG)+" "+DoubleToStr(rect_H, Digits())+" "+DoubleToStr(rLow, Di
***** TST2.TXT
j][1]; }
         Line_N = LineCreate(bull_? rLow - rect_H / 4: rHigh + rect_H / 4);         K = ArrayMinimum(Rect_Ks, WHOLE_ARRAY, 0);
         Print("** -> Valeurs de Line_N : "+IntegerToString(rect_HG)+" "+DoubleToStr(rect_H, Digits())+" "+DoubleToStr(rLow, Di
*****

***** tst1.txt
gits())+" "+Line_N+" **");
         if ((bull_ && Ask > 0.0 && Ask < rLow - rect_H / 4 && (iHigh(NULL, 0, 0) > rLow || iHigh(NULL, 0, 1) > rLow)) || (! bu
ll_ && Bid > rHigh + rect_H / 4 &&
            ((iLow(NULL, 0, 0) > 0.0 && iLow(NULL, 0, 0) < rHigh) || (iLow(NULL, 0, 1) > 0.0 && iLow(NULL, 0, 1) < rHigh)))) { 
fl_Trade = true;    haCoef = 5;
            if (OrderSelect(ticket, SELECT_BY_TICKET) && OrderModify(ticket, OrderOpenPrice(), bull_ ? Bid - (Bid - fmin(iMA(NU
***** TST2.TXT
gits())+" "+Line_N+" **");
         if (((bull_ && Ask > 0.0 && Ask < rLow - rect_H / 4 && (iHigh(NULL, 0, 0) > rLow || iHigh(NULL, 0, K) > rLow)) || (! b
ull_ && Bid > rHigh + rect_H / 4 &&
         ((iLow(NULL, 0, 0) > 0.0 && iLow(NULL, 0, 0) < rHigh) || (iLow(NULL, 0, K) > 0.0 && iLow(NULL, 0, K) < rHigh)))) && K 
< 3) { 
            Print("** -> DrawArrow_OS 12 ",bull_," ",bull," ",ticket," ",t_night," ",TimeToStr(Time[0],TIME_MINUTES)," **");
            DrawArrow_OS(12, bull? Ask + 150*vScale*Point: Bid + 625*vScale*Point, 0, 0, bull, ticket); }
         if (((! bull_ && Ask > 0.0 && Ask < rLow - rect_H / 4 && (iHigh(NULL, 0, 0) > rLow || iHigh(NULL, 0, K) > rLow)) || (b
ull_ && Bid > rHigh + rect_H / 4 &&
         ((iLow(NULL, 0, 0) > 0.0 && iLow(NULL, 0, 0) < rHigh) || (iLow(NULL, 0, K) > 0.0 && iLow(NULL, 0, K) < rHigh)))) && K 
< 3) { fl_Trade = true;    haCoef = 5;
            Print("** -> Suivi de fl_Trade (1) : "+IntegerToString(K)+" "+IntegerToString(rect_HG)+" "+DoubleToStr(rect_H, Digi
ts())+" "+DoubleToStr(rLow, Digits())+" "+
               IntegerToString(Time[0]) + " " + fl_Trade + " **");
            if (OrderSelect(ticket, SELECT_BY_TICKET) && OrderModify(ticket, OrderOpenPrice(), bull_ ? Bid - (Bid - fmin(iMA(NU
*****

***** tst1.txt
               ObjectSetInteger(0, Line_N, OBJPROP_COLOR, clrAqua);        else  ObjectSetInteger(0, Line_N, OBJPROP_COLOR, clr
Cornsilk);    tim_flt = Time[0]; }
         if (nb_ticks > 2 && nb_ticks == nb_tcks_N + 1 && iCustom(NULL, 0, "RSI.ex4", 0, 0) > 35 && iCustom(NULL, 0, "RSI.ex4",
 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
]; }
            if (tst) { temp = "** Passage en M15 (2) à "+TimeToStr(TimeCurrent(),TIME_MINUTES)+" ! (Period()="+IntegerToString(
Period())+", t1="+IntegerToString(t1)+") **";
               Print(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) + " " + Symbol() + ": " + tem
p); } } }
      else if (tim_flt > 0 && Time[0] - tim_flt > 7200) { objRects_del(1, Line_N);     fl_Trade = false;    haCoef = 1;    tim_
flt = 0; }       // ObjectDelete(Line_N);
      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);       tim_M15 = 0; }
         if (tst) { temp = "** Passage en M5 (3) à "+TimeToStr(TimeCurrent(),TIME_MINUTES)+" ! (Period()="+IntegerToString(Peri
od())+", t1="+IntegerToString(t1)+") **";
            Print(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) + " " + Symbol() + ": " + temp);
 } }
     if (! trd_on && mOrderSelect(mOrdersTotal(magic_nb)==1?0:2,SELECT_BY_POS)) { ticket = OrderTicket();         bull2 = ! Ord
erType(); }
     else { bull2 = bull_;          if (! trd_on) ticket = 0; }            trd_on = false; }
  if (! iBarShift(NULL,0,last_liq_t1,false) && 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]; }
      if (tst) { temp = "** Passage en M15 (3) à "+TimeToStr(TimeCurrent(),TIME_MINUTES)+" ! (Period()="+IntegerToString(Period
())+", t1="+IntegerToString(t1)+") **";
         Print(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) + " " + Symbol() + ": " + temp); } 
}
  bool d_HiLo=((douHiLo > (Point() != 0.00001 && Point() != 0.001? str=="-HKG" || str=="-CHN"? 0.001: 0.0005: 0.00017) * Bid) &
***** TST2.TXT
               ObjectSetInteger(0, Line_N, OBJPROP_COLOR, clrAqua);        else  ObjectSetInteger(0, Line_N, OBJPROP_COLOR, clr
Cornsilk);    tim_flt = Time[0]; } }
      else if (tim_flt > 0 && Time[0] - tim_flt > 7200) { objRects_del(1, Line_N);     if (str != "-CHN") { fl_Trade = false;  
  haCoef = 1;    tim_flt = 0; }
         Print("** -> Suivi de fl_Trade (2) : "+IntegerToString(K)+" "+IntegerToString(rect_HG)+" "+DoubleToStr(rect_H, Digits(
))+" "+DoubleToStr(rLow, Digits())+" "+
            IntegerToString(Time[0]) + " " + fl_Trade + " **"); }          // ObjectDelete(Line_N);
      if (nb_ticks > 2 && nb_ticks == nb_tcks_N + 1 && m3_RSI(0, 2) > 35 && m3_RSI(0, 2) < 65 && ((t_M5_M15 = (Period() == PERI
OD_M5)) ||
      Period() == PERIOD_M15) && Hour() > H2 - 2) { t1 = 0;    GlobalVariableSet(tmfr0_str, PERIOD_M5? PERIOD_M15: PERIOD_M5); 
     nb_ticks = 0;    nb_tcks_N = 0;  // (H1 < H3 || 
         while(! (tst=ChartSetSymbolPeriod(0, NULL, PERIOD_M5? PERIOD_M15: PERIOD_M5)) && t1 < 17) { t1 ++;       Sleep(100); }
     if (tst) { tim_M15 = Time[0];    tmf_Diff = true;
            temp = "** Passage en M15 (2) à "+TimeToStr(TimeCurrent(),TIME_MINUTES)+" ! (Period()="+IntegerToString(Period())+"
, t1="+IntegerToString(t1)+") **";
            Print(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) +" "+Symbol()+","+stmfr+": " + t
emp); } }
      t_rsi51_ = t_rsi515;       t_rsi515 = (m3_RSI(PERIOD_M5, 3) > 38 && m3_RSI(PERIOD_M5, 3) < 62 && m3_RSI(PERIOD_M15, 3) > 
38 && 
         m3_RSI(PERIOD_M15, 3) < 62 && (Period() == PERIOD_M5 || Period() == PERIOD_M15));                  if (t_rsi51_ && ! t
_rsi515) tmf_Diff = true;
      if (tim_M15 > 0 && (Time[0] - tim_M15 > Period() * 60*8) && Period() == PERIOD_M15) { t1 = 0;    GlobalVariableSet(tmfr0_
str, PERIOD_M5);    // || ! fl_Trade
         while(! (tst=ChartSetSymbolPeriod(0, NULL, PERIOD_M5)) && t1 < 17) { t1 ++;      Sleep(100); }     if (tst) { tim_M15 
= 0;    t_M5_M15 = false;    tmf_Diff = true;
            temp = "** Passage en M5 (1) à "+TimeToStr(TimeCurrent(),TIME_MINUTES)+" ! (Period()="+IntegerToString(Period())+",
 t1="+IntegerToString(t1)+") **";
            Print(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) +" "+Symbol()+","+stmfr+": " + t
emp); } }
      if (! trd_on && mOrderSelect(mOrdersTotal(magic_nb)==1?0:2,SELECT_BY_POS) && OrderSymbol() == Symbol()) { ticket = OrderT
icket();      bull2 = ! OrderType();
         if (OrderProfit() + OrderSwap() + OrderCommission() < -0.05 * AccBalance_day && OrderClose(ticket, lot, bull2? Bid: As
k, slip, clrMagenta)) {
           temp = "***** Trade STOP LOSS Reached. This Trade Has Been Closed. ("+DoubleToStr(OrderProfit(),Digits())+" - "+Hour
()+" - "+DoubleToStr(AccBalance_day,2)+") *****";
           Alert(temp);          copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) +" "+Symbol()+","+stmfr+": " + t
emp); } }
      else { bull2 = bull_;         if (! trd_on) { ticket = 0;     GlobalVariableSet(tck_vstr, 0); } }           trd_on = fals
e; }
  if (tim_M15 < Time[0] && (! iBarShift(NULL,0,last_liq_t1,false) && m3_RSI(0, 2) > 40 && m3_RSI(0, 2) < 60 && Period() == PERI
OD_M5 &&
   ((H1 < H3 && Hour() > H2 - 2) || Hour() > H2 + 2))) { t1 = 0;           GlobalVariableSet(tmfr0_str, PERIOD_M15);
      while(! (tst=ChartSetSymbolPeriod(0, NULL, PERIOD_M15)) && t1 < 17) { t1 ++;     Sleep(100); }     if (tst) { tim_M15 = T
ime[0];   t_M5_M15 = true;   tmf_Diff = true;
         temp = "** Passage en M15 (3) à "+TimeToStr(TimeCurrent(),TIME_MINUTES)+" ! (Period()="+IntegerToString(Period())+", t
1="+IntegerToString(t1)+") **";
         Print(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) +" "+Symbol()+","+stmfr+": " + temp
); } }
  if ((m3_RSI(PERIOD_M5, 2) < 32 || m3_RSI(PERIOD_M5, 2) > 68) && m3_RSI(PERIOD_H1, 2) > 28 &&
   m3_RSI(PERIOD_H1, 2) < 72 && Period() == PERIOD_M15) { t1 = 0;       GlobalVariableSet(tmfr0_str, PERIOD_M5);     // revoir 
si RSI H1 nécessaire
      while(! (tst=ChartSetSymbolPeriod(0, NULL, PERIOD_M5)) && t1 < 17) { t1 ++;         Sleep(100); }        if (tst) { tim_M
15 = 0;       tmf_Diff = true;
         temp = "** Passage en M5 (2) à "+TimeToStr(TimeCurrent(),TIME_MINUTES)+" ! (Period()="+IntegerToString(Period())+", t1
="+IntegerToString(t1)+") **";
         Print(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) +" "+Symbol()+","+stmfr+": " + temp
); } }
  bool d_HiLo=((douHiLo > (Point() != 0.00001 && Point() != 0.001? str=="-HKG" || str=="-CHN"? 0.001: 0.0005: 0.00017) * Bid) &
*****

***** tst1.txt
            DoubleToStr(0.0002*Bid, Digits()) + " **";
         Print(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) + " " + Symbol() + ": " + temp);
         DrawArrow_OS(9, (bull_? Ask: Bid)+(bull_? 150*vScale*Point: 625*vScale*Point), 0, 0, bull_, 0);    OS9_tick = false; }
***** TST2.TXT
            DoubleToStr(0.0002*Bid, Digits()) + " **";
         Print(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) +" "+Symbol()+","+stmfr+": " + temp
);
         DrawArrow_OS(9, (bull_? Ask: Bid)+(bull_? 150*vScale*Point: 625*vScale*Point), 0, 0, bull_, 0);    OS9_tick = false; }
*****

***** tst1.txt
            DoubleToStr(0.0002*Bid, Digits()) + " **";
         Print(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) + " " + Symbol() + ": " + temp);
         DrawArrow_OS(10, obj_prClots[pos]+(bull2? 150*vScale*Point: 625*vScale*Point), 0, 0, bull2, ticket); }
***** TST2.TXT
            DoubleToStr(0.0002*Bid, Digits()) + " **";
         Print(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) +" "+Symbol()+","+stmfr+": " + temp
);
         DrawArrow_OS(10, obj_prClots[pos]+(bull2? 150*vScale*Point: 625*vScale*Point), 0, 0, bull2, ticket); }
*****

***** tst1.txt
Str(0.0002*Bid, Digits()) + " **";
      Alert(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) + " " + Symbol() + ": " + temp);      
  t_TST1 = false; } }
else if (t_TST2) { temp = "** -> DrawArrow_OS 10(b) TEST " + bull_ + " " + bull + " " + bull2 + " " + ticket + " " + t_night + 
***** TST2.TXT
Str(0.0002*Bid, Digits()) + " **";
      Alert(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) +" "+Symbol()+","+stmfr+": " + temp); 
        t_TST1 = false; } }
else if (t_TST2) { temp = "** -> DrawArrow_OS 10(b) TEST " + bull_ + " " + bull + " " + bull2 + " " + ticket + " " + t_night + 
*****

***** tst1.txt
;
      Print(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) + " " + Symbol() + ": " + temp);      
  t_TST2 = false; }
  if ((str=="-HKG" || str=="-CHN") && nb_ticks > 2 && nb_ticks == nb_tcks_N + 1 && Hour() < 6) { t_ngt0 = true;         GlobalV
ariableSet("t_ngt_1", 1.0);
   Print("** -> (3) nb_ticks > 2 && nb_ticks == nb_tcks_N + 1 : ",IntegerToString(nb_ticks)," ",IntegerToString(nb_tcks_N)," ",
***** TST2.TXT
;
      Print(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) +" "+Symbol()+","+stmfr+": " + temp); 
        t_TST2 = false; }
  if (t_Ntcks && nb_ticks > 2 && nb_ticks == nb_tcks_N + 1 && Hour() < 6) { if (str=="-HKG" || str=="-CHN") { t_ngt0 = true;   
     GlobalVariableSet("t_ngt_1", 1.0); }
   Print("** -> (3) nb_ticks > 2 && nb_ticks == nb_tcks_N + 1 : ",IntegerToString(nb_ticks)," ",IntegerToString(nb_tcks_N)," ",
*****

***** tst1.txt
;
      Print(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) + " " + Symbol() + ": " + temp);
      DrawArrow_OS(6, (bull_? Ask: Bid)+(bull_? 150*vScale*Point: 625*vScale*Point), 0, 0, bull_, 0);       GlobalVariableSet(b
***** TST2.TXT
;
      Print(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) +" "+Symbol()+","+stmfr+": " + temp);
      DrawArrow_OS(6, (bull_? Ask: Bid)+(bull_? 150*vScale*Point: 625*vScale*Point), 0, 0, bull_, 0);       GlobalVariableSet(b
*****

***** 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))) &&
   (m3_RSI(PERIOD_H1, 2) < 38 || m3_RSI(PERIOD_H1, 2) > 62))) && ticket <= 7) { if (str == "-CHN") fl_Trade = true;
      Print("** -> DrawArrow_OS 7 ",bull_," ",bull," ",ticket," ",t_night," ",(str=="-CHN"? IntegerToString(Seconds())+" ": "")
*****

***** tst1.txt
true; }    // 6
   if (t_night && Hour() == H1 && str == "-CHN") GlobalVariableSet("t_ngt_2", (t_ngt0 = ! (((bull && FileIsExist("ATS-Ind_On-Of
f\\ATS-Ind5"+str+"_Buy.txt", 0)) || 
   (! bull && FileIsExist("ATS-Ind_On-Off\\ATS-Ind5"+str+"_Sell.txt", 0))) && (iCustom(NULL, PERIOD_H1, "RSI.ex4", 0, 0) < 38 |
| iCustom(NULL, PERIOD_H1, "RSI.ex4", 0, 0) > 62))));
  if (DayOfWeek() < 5 && !t_h6 && t_night && Hour() == H1 && Minute() >= 40 && (str == "-CHN" || str == "-HKG"))
***** TST2.TXT
true; }    // 6
  if (Hour()==H1 && str=="-CHN" && Minute()>40 && t_ngt0!=!(((bull && FileIsExist("ATS-Ind_On-Off\\ATS-Ind5"+str+"_Buy.txt", 0)
) || (!bull && FileIsExist("ATS-Ind_On-Off\\ATS-Ind5"+
      str + "_Sell.txt", 0))) && (m3_RSI(PERIOD_H1, 2) < 38 || m3_RSI(PERIOD_H1, 2) > 62))) GlobalVariableSet("t_ngt_2", ! t_ng
t0);
  if (DayOfWeek() < 5 && !t_h6 && t_night && Hour() == H1 && Minute() >= 40 && (str == "-CHN" || str == "-HKG"))
*****

***** tst1.txt
ff\\ATS-Ind5"+str+"_Buy.txt", 0)+" "+
         DoubleToStr(iCustom(NULL, PERIOD_H1, "RSI.ex4", 0, 0), 2) + " " + IntegerToString(Seconds()) + " ": ""), TimeToStr(Tim
e[0],TIME_MINUTES), " **"); //*/
  if (H1 > H3 && t_night != t_night_) Print("** Suivi de t_night et tr_allow (3) : "+Symbol()+" / "+IntegerToString(Period())+"
***** TST2.TXT
ff\\ATS-Ind5"+str+"_Buy.txt", 0)+" "+
         DoubleToStr(m3_RSI(PERIOD_H1, 2), 2) + " " + IntegerToString(Seconds()) + " ": ""), TimeToStr(Time[0],TIME_MINUTES), "
 **"); //*/
  if (H1 > H3 && t_night != t_night_) Print("** Suivi de t_night et tr_allow (3) : "+Symbol()+" / "+IntegerToString(Period())+"
*****

***** tst1.txt
 - t_night = "+t_night+" - tr_allow = "+tr_allow+" **");
  if (((DayOfWeek() == 5 && ((Hour() == 16 && Minute() > 39) || Hour() > 16)) || 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); }
//if (str=="-CHN" || str=="-HKG") Print("** -> DrawArrow_OS 8 ATTENTE ",bull_," ",bull," ",ticket," ",t_night," ",TimeToStr(Tim
***** TST2.TXT
 - t_night = "+t_night+" - tr_allow = "+tr_allow+" **");
  if (((DayOfWeek() == 5 && ((Hour() == 16 && Minute() > 39) || Hour() > 16)) || (t_night && (H1 < H3 || Hour() != H1))) && tic
ket > 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); }
  if ((DayOfWeek() == 5 && ((Hour() == 16 && Minute() > 39) || Hour() > 16)) || (H1 > H3 && DayOfWeek() == 1 && Hour() == H2 &&
 ! Minute() && Seconds() < 7)) {
      GlobalVariableSet("t_ngt_2", 0.0);              if (str == "-CHN") fl_Trade = true; }
//if (str=="-CHN" || str=="-HKG") Print("** -> DrawArrow_OS 8 ATTENTE ",bull_," ",bull," ",ticket," ",t_night," ",TimeToStr(Tim
*****

***** 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) && MQLInfoInteger(MQL_DLLS_ALLOWED)) { tmp_saved = true
;
      ChartSaveTemplate(0, "template_saved_"+Symbol());     ChartSaveTemplate(0, "template_saved_"+StringSubstr(Symbol(), 0, 6)
); }
#endif
*****

***** tst1.txt
LLOWED)), tst_5, tst_6, tr_Allow, t_Night;
   tst_5b = Clot || tst_5c < Time[0] || (((tmfr == PERIOD_H1 || tmfr == PERIOD_M30) && ((FileIsExist("ATS-Ind_On-Off\\ATS-Ind5_
Buy.txt", 0) &&  // || tmfr == PERIOD_M5
      Bullish) || (FileIsExist("ATS-Ind_On-Off\\ATS-Ind5_Sell.txt", 0) && ! Bullish))) || Typ < 5 || tmfr == PERIOD_M1 || tmfr 
== PERIOD_M5);
// ** ou utiliser tr_allow_ = tr_allow au début et tr_allow = tr_allow_ à la fin, à la place de tr_Allow **
***** TST2.TXT
LLOWED)), tst_5, tst_6, tr_Allow, t_Night;
   tst_5b = Clot || tst_5c < Time[0] || (((tmfr == PERIOD_H1 || tmfr == PERIOD_M30) && ((FileIsExist("ATS-Ind_On-Off\\ATS-Ind5"
+str+"_Buy.txt", 0) &&  // || tmfr == PERIOD_M5
      Bullish) || (FileIsExist("ATS-Ind_On-Off\\ATS-Ind5"+str+"_Sell.txt", 0) && ! Bullish))) || Typ < 5 || tmfr == PERIOD_M1 |
| tmfr == PERIOD_M5);
// ** ou utiliser tr_allow_ = tr_allow au début et tr_allow = tr_allow_ à la fin, à la place de tr_Allow **
*****

***** tst1.txt
 + (Bullish? "BUY": "SELL"));*/ }
      else#ifdef v_opfx_0 { if ((tst_5=(((tmfr == PERIOD_H1 || tmfr == PERIOD_M30) && ((FileIsExist("ATS-Ind_On-Off\\ATS-Ind5_B
uy.txt", 0) &&     // || tmfr == PERIOD_M5
      Bullish) || (FileIsExist("ATS-Ind_On-Off\\ATS-Ind5_Sell.txt", 0) && ! Bullish))) || Typ < 5 || (tmfr <= PERIOD_M15 && (st
r != "-CHN" || (tst_6 =
      (OrderProfit() / lot < 100 || iCustom(NULL, 0, "RSI.ex4", 0, 0) < 38 || iCustom(NULL, 0, "RSI.ex4", 0, 0) > 62))))))) {  
   // && (str=="-GLD" || t_night))
        #endif ticket = OrderSend(Symbol(), Bullish? ORDER_TYPE_BUY: ORDER_TYPE_SELL, lot, Bullish? Ask: Bid, slip,#ifndef v_op
fx_0 0.0, 0.0, NULL#else str == "-HKG" ? 
         round(Bullish ? Ask - SL : Bid + SL) : str == "-GER" && Typ == 9 ? Bullish ? iLowest(NULL, 0, MODE_CLOSE, 5, 0) : iHig
hest(NULL, 0, MODE_CLOSE, 5, 0) : Bullish ? 
         Ask - SL : Bid + SL, 0.0, (Bullish? "buy": "sell") + " - " + stmfr#endif, magic_nb);
#ifdef v_opfx
***** TST2.TXT
 + (Bullish? "BUY": "SELL"));*/ }
      else#ifdef v_opfx_0 { if ((tst_5=(((tmfr == PERIOD_H1 || tmfr == PERIOD_M30) && ((FileIsExist("ATS-Ind_On-Off\\ATS-Ind5"+
str+"_Buy.txt", 0) &&     // || tmfr == PERIOD_M5
      Bullish) || (FileIsExist("ATS-Ind_On-Off\\ATS-Ind5"+str+"_Sell.txt", 0) && ! Bullish))) || Typ < 5 || (tmfr <= PERIOD_M15
 && (str != "-CHN" || (tst_6 =
      (OrderProfit() / lot < 100 || m3_RSI(0, 2) < 38 || m3_RSI(0, 2) > 62))))))) {     // && (str=="-GLD" || t_night))
        #endif ticket = OrderSend(Symbol(), Bullish? ORDER_TYPE_BUY: ORDER_TYPE_SELL, lot, Bullish? Ask: Bid, slip,#ifndef v_op
fx_0 0.0, 0.0, NULL#else StringSubstr(str, 1, 3)=="HKG" ?
         round(Bullish ? Ask - SL : Bid + SL) : Bullish ? Ask - SL : Bid + SL, 0.0, (Bullish? "buy": "sell") + " - " + stmfr#en
dif, magic_nb);
#ifdef v_opfx
*****

***** tst1.txt
tring(Chart_M5)+" ***";
                  Alert(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) + " " + Symbol() + ": " + 
temp); }
               t2 = 0;     while(! ChartSetSymbolPeriod(Chart_M5, NULL, ENUM_TIMEFRAMES(tmfr_)) && t2 < 17) { t2 ++;    Sleep(1
***** TST2.TXT
tring(Chart_M5)+" ***";
                  Alert(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) +" "+Symbol()+","+stmfr+":
 " + temp); }
               t2 = 0;     while(! ChartSetSymbolPeriod(Chart_M5, NULL, ENUM_TIMEFRAMES(tmfr_)) && t2 < 17) { t2 ++;    Sleep(1
*****

***** tst1.txt
               ", Period()=" + IntegerToString(Period()) + ", Bullish=" + (Bullish) + ") **";
            Print(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) + " " + Symbol() + ": " + temp);
 }
         else if (tst) { temp = "** Passage en M"+IntegerToString(tmfr_n)+" avec OrderSend "+(tst_5? "OK": "ANNULE")+" ! (Typ="
***** TST2.TXT
               ", Period()=" + IntegerToString(Period()) + ", Bullish=" + (Bullish) + ") **";
            Print(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) +" "+Symbol()+","+stmfr+": " + t
emp); }
         else if (tst) { temp = "** Passage en M"+IntegerToString(tmfr_n)+" avec OrderSend "+(tst_5? "OK": "ANNULE")+" ! (Typ="
*****

***** tst1.txt
               (t2==17 ? ", err2=" + IntegerToString(err2) : "") + ") **";
            Print(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) + " " + Symbol() + ": " + temp);
 }
         else { if (Period()>PERIOD_M1) { temp = "*** Erreur - Passage en M5 (ou M1) avec OrderSend "+(tst_5? "OK": "ANNULE")+"
***** TST2.TXT
               (t2==17 ? ", err2=" + IntegerToString(err2) : "") + ") **";
            Print(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) +" "+Symbol()+","+stmfr+": " + t
emp);
            ObjectSet(ArrowName, OBJPROP_ARROWCODE, tr_Allow? tmf_Diff? 215: 216: tmf_Diff? 223: 224);         ObjectSet(ArrowN
ame, OBJPROP_WIDTH, 4); }
         else { if (Period()>PERIOD_M1) { temp = "*** Erreur - Passage en M5 (ou M1) avec OrderSend "+(tst_5? "OK": "ANNULE")+"
*****

***** tst1.txt
               ", err1=" + IntegerToString(err1) + ") ***";
            Print(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) + " " + Symbol() + ": " + temp);
 }    tst_5b = tst_5;      if (! tst_5) { tst_5c = Time[0];
               ObjectSet(ArrowName, OBJPROP_WIDTH, 2); }       Sleep(100); }        t ++; }        if (! tst_5) return true; }
#endif
***** TST2.TXT
               ", err1=" + IntegerToString(err1) + ") ***";
            Print(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) +" "+Symbol()+","+stmfr+": " + t
emp); }       tst_5b = tst_5;
            if (! tst_5) { tst_5c = Time[0];       ObjectSet(ArrowName, OBJPROP_WIDTH, 2); }       Sleep(100); }     t ++; }
         tmf_Diff = false;          if (! tst_5) return true; }
#endif
*****

***** tst1.txt
   nb_ticks ++;      if (t_tick && OrderProfit() == 0.0) Alert("***** ATTENTION : OrderProfit() NON RENSEIGNE ! *****");
   if ((str=="-HKG" || str=="-CHN") && Hour() < 6 && nb_ticks > 2 && nb_ticks == nb_tcks_N + 1) 
      Print("** -> (1) nb_ticks > 2 && nb_ticks == nb_tcks_N + 1 : ",IntegerToString(nb_ticks)," ",IntegerToString(nb_tcks_N),"
***** TST2.TXT
   nb_ticks ++;      if (t_tick && OrderProfit() == 0.0) Alert("***** ATTENTION : OrderProfit() NON RENSEIGNE ! *****");
   bool t_Ntcks=(str=="-HKG" || str=="-CHN" || str=="-GLD");
   if (t_Ntcks && Hour() < 6 && nb_ticks > 2 && nb_ticks == nb_tcks_N + 1) 
      Print("** -> (1) nb_ticks > 2 && nb_ticks == nb_tcks_N + 1 : ",IntegerToString(nb_ticks)," ",IntegerToString(nb_tcks_N),"
*****

***** tst1.txt

void ObjectsDelete(int P, string str#ifdef v_opfx_0, bool chk, bool old#endif) {
***** TST2.TXT

bool op_case0;
void ObjectsDelete(int P, string str#ifdef v_opfx_0, bool chk, bool old#endif) {
*****

***** tst1.txt
     if (pos && ((str!="" && StringSubstr(name,0,StringLen(str)+4)=="EA_"+str+"-") || 
     (str=="" && ((old && Period() == PERIOD_H1 && (ObjectGet(name, OBJPROP_TIME2) > 0 ?
        ObjectGet(name, OBJPROP_TIME2) : ObjectGet(name, OBJPROP_TIME1)) < Time[500]) ||
     (chk && (StringSubstr(name,0,9)=="EA_Chck2-" || StringSubstr(name,0,9)=="EA_Chck3-")) || 
     (! chk && (StringSubstr(name,0,8) == "EA_Test_" ||        //StringSubstr(name,0,6) == "EA_pf_" ||
     (P==2 && StringSubstr(name,0,8) != "EA_Check"))))))) { j ++;     if (ObjectDelete(name)) { i ++;  pos --; } } }
***** TST2.TXT
     if (pos && ((str!="" && StringSubstr(name,0,StringLen(str)+4)=="EA_"+str+"-") || 
     (str=="" && ((old && Period() >= PERIOD_M5 && (ObjectGet(name, OBJPROP_TIME2) > 0 ?
        ObjectGet(name, OBJPROP_TIME2) : ObjectGet(name, OBJPROP_TIME1)) < Time[H1 < H3? 500: 300]) ||
     (chk && (StringSubstr(name,0,9)=="EA_Chck2-" || StringSubstr(name,0,9)=="EA_Chck3-")) || 
     (! chk && (StringSubstr(name,0,8) == "EA_Test_" || (op_case0 && StringSubstr(name,0,6) == "EA_pf_" && 
     ! iBarShift(NULL,0,fmax(ObjectGetInteger(0,name,OBJPROP_TIME1),ObjectGetInteger(0,name,OBJPROP_TIME)),false)) ||
     (P==2 && StringSubstr(name,0,8) != "EA_Check"))))))) { j ++;     if (ObjectDelete(name)) { i ++;  pos --; } } }
*****

***** tst1.txt
     if (tst) 
         temp = "** Passage en M5 (1) à "+TimeToStr(TimeCurrent(),TIME_MINUTES)+" ! (Period()="+IntegerToString(Period())+", t1
="+IntegerToString(t1)+") **";
         Print(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) + " " + Symbol() + ": " + temp);
      return; }
***** TST2.TXT
     if (tst) 
         temp = "** Passage en M5 (x2) à "+TimeToStr(TimeCurrent(),TIME_MINUTES)+" ! (Period()="+IntegerToString(Period())+", t
1="+IntegerToString(t1)+") **";
         Print(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) +" "+Symbol()+","+stmfr+": " + temp
);
      return; }
*****

***** tst1.txt
            t5a_Bullish = bull_;                t5b_Bullish = FileIsExist("ATS-Ind_On-Off\\ATS-Ind5_Buy.txt", 0);
            GlobalVariableSet("t1_Bullish", t5a_Bullish);   GlobalVariableSet("t2_Bullish", t5b_Bullish);
            GlobalVariableSet(tmfr1_str, tmfr_);            GlobalVariableSet(tmfr0_str, tmfr); }*/ }
***** TST2.TXT
            t5a_Bullish = bull_;                t5b_Bullish = FileIsExist("ATS-Ind_On-Off\\ATS-Ind5_Buy.txt", 0);
            GlobalVariableSet(t1_Bull_str, t5a_Bullish);    GlobalVariableSet(t2_Bull_str, t5b_Bullish);
            GlobalVariableSet(tmfr1_str, tmfr_);            GlobalVariableSet(tmfr0_str, tmfr); }*/ }
*****

***** tst1.txt
 **";
         Print(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) + " " + Symbol() + ": " + temp); }
      else { temp = "*** Erreur - Passage en " + (Period()==PERIOD_M5?"M1":"M5") + " à " + TimeToStr(TimeCurrent(),TIME_MINUTES
***** TST2.TXT
 **";
         Print(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) +" "+Symbol()+","+stmfr+": " + temp
); }
      else { temp = "*** Erreur - Passage en " + (Period()==PERIOD_M5?"M1":"M5") + " à " + TimeToStr(TimeCurrent(),TIME_MINUTES
*****

***** tst1.txt
            ", t1=" + IntegerToString(t1) + ", err1=" + IntegerToString(err) + ") ***";
         Alert(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) + " " + Symbol() + ": " + temp);   
      Sleep(100); } } } }

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);
***** TST2.TXT
            ", t1=" + IntegerToString(t1) + ", err1=" + IntegerToString(err) + ") ***";
         Alert(temp);         copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) +" "+Symbol()+","+stmfr+": " + temp
);         Sleep(100); } } } }

int f_Params(int mode) { int new_set=5;   // <- changer à chaque élément nouveau
  if (mode) {
   GlobalVariableSet("EURUSD_Comm", 13);         GlobalVariableSet("EURUSD_Sprd", 20);          GlobalVariableSet("EURUSD_Mag_N
", 101);
/*   GlobalVariableSet("USDZAR_Comm", 706);        GlobalVariableSet("USDZAR_Sprd", 1600);
*****

***** tst1.txt
   GlobalVariableSet("USDMXN_Comm", 606);        GlobalVariableSet("USDMXN_Sprd", 1500); */

   GlobalVariableSet("BTCUSD_Comm", 3506);       GlobalVariableSet("BTCUSD_Sprd", 5000);
/*   GlobalVariableSet("ETHUSD_Comm", 506);        GlobalVariableSet("ETHUSD_Sprd", 715);
***** TST2.TXT
   GlobalVariableSet("USDMXN_Comm", 606);        GlobalVariableSet("USDMXN_Sprd", 1500); */
   GlobalVariableSet("CADJPY_Comm", 13);         GlobalVariableSet("CADJPY_Sprd", 20);          GlobalVariableSet("CADJPY_Mag_N
", 102);
   GlobalVariableSet("EURGBP_Comm", 13);         GlobalVariableSet("EURGBP_Sprd", 20);          GlobalVariableSet("EURGBP_Mag_N
", 103);
   GlobalVariableSet("EURJPY_Comm", 13);         GlobalVariableSet("EURJPY_Sprd", 20);          GlobalVariableSet("EURJPY_Mag_N
", 104);
   GlobalVariableSet("GBPJPY_Comm", 13);         GlobalVariableSet("GBPJPY_Sprd", 20);          GlobalVariableSet("GBPJPY_Mag_N
", 105);
   GlobalVariableSet("USDTRY_Comm", 13);         GlobalVariableSet("USDTRY_Sprd", 20);          GlobalVariableSet("USDTRY_Mag_N
", 106);

   GlobalVariableSet("BTCUSD_Comm", 3506);       GlobalVariableSet("BTCUSD_Sprd", 5000);        GlobalVariableSet("BTCUSD_Mag_N
", 201);
/*   GlobalVariableSet("ETHUSD_Comm", 506);        GlobalVariableSet("ETHUSD_Sprd", 715);
*****

***** tst1.txt
//   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);

***** TST2.TXT
//   GlobalVariableSet("USTECH_Comm", 136);      GlobalVariableSet("USTECH_Sprd", 200);
   GlobalVariableSet("CHINAA_Comm", 13500);      GlobalVariableSet("CHINAA_Sprd", 42000);       GlobalVariableSet("CHINAA_Mag_N
", 501);
   GlobalVariableSet("HKG50_Comm", 22000);       GlobalVariableSet("HKG50_Sprd", 65000);        GlobalVariableSet("HKG50_Mag_N"
, 502);
   GlobalVariableSet("SPX500_Comm", 55);         GlobalVariableSet("SPX500_Sprd", 170);         GlobalVariableSet("SPX500_Mag_N
", 503);
   GlobalVariableSet("AUS200_Comm", 485);        GlobalVariableSet("AUS200_Sprd", 1500);        GlobalVariableSet("AUS200_Mag_N
", 504);
   GlobalVariableSet("UK100_Comm", 105);         GlobalVariableSet("UK100_Sprd", 320);          GlobalVariableSet("UK100_Mag_N"
, 505);
   GlobalVariableSet("US30_Comm", 170);          GlobalVariableSet("US30_Sprd", 520);           GlobalVariableSet("US30_Mag_N",
 506);
   GlobalVariableSet("GER30_Comm", 170);         GlobalVariableSet("GER30_Sprd", 520);          GlobalVariableSet("GER30_Mag_N"
, 507);
   GlobalVariableSet("JPN225_Comm", 1105);       GlobalVariableSet("JPN225_Sprd", 3320);        GlobalVariableSet("JPN225_Mag_N
", 508);
   GlobalVariableSet("NAS100_Comm", 300);        GlobalVariableSet("NAS100_Sprd", 930);         GlobalVariableSet("NAS100_Mag_N
", 509);
   GlobalVariableSet("FRA40_Comm", 130);         GlobalVariableSet("FRA40_Sprd", 380);          GlobalVariableSet("FRA40_Mag_N"
, 510);
   GlobalVariableSet("ESTX50_Comm", 160);        GlobalVariableSet("ESTX50_Sprd", 500);         GlobalVariableSet("ESTX50_Mag_N
", 511);
   GlobalVariableSet("ITA40_Comm", 120);         GlobalVariableSet("ITA40_Sprd", 380);          GlobalVariableSet("ITA40_Mag_N"
, 512);
   GlobalVariableSet("SUI20_Comm", 45);         GlobalVariableSet("SUI20_Sprd", 150);           GlobalVariableSet("SUI20_Mag_N"
, 513);

   GlobalVariableSet("XAUUSD_Comm", 13);         GlobalVariableSet("XAUUSD_Sprd", 20);          GlobalVariableSet("XAUUSD_Mag_N
", 301);
   GlobalVariableSet("BRENT_Comm", 56);          GlobalVariableSet("BRENT_Sprd", 100);          GlobalVariableSet("BRENT_Mag_N"
, 303);

*****

***** tst1.txt
iableSet("USDMXN_Diff", 0); */

   GlobalVariableSet("BTCUSD_H1", 1);    GlobalVariableSet("BTCUSD_H2", 1);    GlobalVariableSet("BTCUSD_H3", 23);     GlobalVa
riableSet("BTCUSD_Diff", 0);
/*   GlobalVariableSet("ETHUSD_H1", 1);    GlobalVariableSet("ETHUSD_H2", 1);    GlobalVariableSet("ETHUSD_H3", 0);     GlobalV
***** TST2.TXT
iableSet("USDMXN_Diff", 0); */
   GlobalVariableSet("CADJPY_H1", 6);    GlobalVariableSet("CADJPY_H2", 8);    GlobalVariableSet("CADJPY_H3", 23);    GlobalVar
iableSet("CADJPY_Diff", 0);
   GlobalVariableSet("EURGBP_H1", 6);    GlobalVariableSet("EURGBP_H2", 8);    GlobalVariableSet("EURGBP_H3", 23);    GlobalVar
iableSet("EURGBP_Diff", 0);
   GlobalVariableSet("EURJPY_H1", 6);    GlobalVariableSet("EURJPY_H2", 8);    GlobalVariableSet("EURJPY_H3", 23);    GlobalVar
iableSet("EURJPY_Diff", 0);
   GlobalVariableSet("GBPJPY_H1", 6);    GlobalVariableSet("GBPJPY_H2", 8);    GlobalVariableSet("GBPJPY_H3", 23);    GlobalVar
iableSet("GBPJPY_Diff", 0);
   GlobalVariableSet("USDTRY_H1", 6);    GlobalVariableSet("USDTRY_H2", 8);    GlobalVariableSet("USDTRY_H3", 23);    GlobalVar
iableSet("USDTRY_Diff", 0);

   GlobalVariableSet("BTCUSD_H1", 1);    GlobalVariableSet("BTCUSD_H2", 1);    GlobalVariableSet("BTCUSD_H3", 0);     GlobalVar
iableSet("BTCUSD_Diff", 0);
/*   GlobalVariableSet("ETHUSD_H1", 1);    GlobalVariableSet("ETHUSD_H2", 1);    GlobalVariableSet("ETHUSD_H3", 0);     GlobalV
*****

***** tst1.txt

   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);

***** TST2.TXT

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

*****

***** tst1.txt
  diff = GlobalVariableGet(StringSubstr(Symbol(), 0, 6) + "_Diff");
  SL =   GlobalVariableGet("All_SL") / 1000.0 * (Ask > 1000 ? round((Bid+Ask) / 2000.0) * 1000 :
***** TST2.TXT
  diff = GlobalVariableGet(StringSubstr(Symbol(), 0, 6) + "_Diff");
  Mg_N = GlobalVariableGet(StringSubstr(Symbol(), 0, 6) + "_Mag_N");
  SL =   GlobalVariableGet("All_SL") / 1000.0 * (Ask > 1000 ? round((Bid+Ask) / 2000.0) * 1000 :
*****

***** tst1.txt
void Close_All_Trades() { string temp;
/* for (int i = OrdersTotal()-1; i >= 0; i --) {
    if (OrderSelect(i, SELECT_BY_POS)) {
***** TST2.TXT
void Close_All_Trades() { string temp;
  for (int i = OrdersTotal()-1; i >= 0; i --) {
    if (OrderSelect(i, SELECT_BY_POS)) {
*****

***** tst1.txt
oubleToStr(AccBalance_day,2)+") *****";
  Alert(temp);          copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) + " " + Symbol() + ": " + temp);
  t_ngt0 = true;        GlobalVariableSet("t_ngt_3", 1.0);        Sleep(100);          ExpertRemove(); }
#endif
***** TST2.TXT
oubleToStr(AccBalance_day,2)+") *****";
  Alert(temp);          copy_file_(3, TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES) +" "+Symbol()+","+stmfr+": " + temp);
  t_ngt0 = true;        GlobalVariableSet("t_ngt_3", 1.0);        Sleep(100);          ExpertRemove(); }

double m3_RSI (ENUM_TIMEFRAMES per,int nb) {
   return((iCustom(NULL, per, "RSI.ex4", 0, 1) + iCustom(NULL, per, "RSI.ex4", 0, 2) +
      (nb == 3 ? iCustom(NULL, per, "RSI.ex4", 0, 3) : 0.0)) / nb); }
#endif
*****

