#property indicator_chart_window

bool show=false, ea_show=false, Op_ShwB=false, Op_Show=false, Op_HiLo=false, Op_OHL=true, Op_DDw=false,Op_DDw2=false,Op_DDw3=false,
      script=false, rate1c=true, rate2c=false, rate3c=false, rate4c=false;     // ^ test iOPen/(iHigh+iLow)/2
int frameX=35, frameY=40, Op_Liqu, iEvent=0, d0Color, d1Color, d2Color, d3Color, d4Color, d5Color, d6Color, d7Color;

bool op_case01, op_case02, op_case03, op_case11, op_case12, op_case13, op_case21, op_case22, op_case23, op_case24, op_case25, op_case26, 
   op_HiLo, op_HiLo1, op_HiLo2, op_Exp, op_Exp1, op_Exp2, op_20p1, op_20p2, op_20p3, op_20p4, op_20p5, op_20p6, op_20p7, op_30p1, op_30p2, 
   op_75p1, op_hap1, op_hap2, op_hap3, ha_Opt, ha_Buff, ha_Prev, Op_Liq2, Op_Liq3, Op_Liq4, Op_2xBl, Op_1xBl, init1_6, init1_7;

int init()
  { EventSetMillisecondTimer(100);

  int ind_total=ChartIndicatorsTotal(0,0);   for (int pos=0; pos<ind_total; pos++)
   if (ChartIndicatorName(0,0,pos)=="Liste dOptions (opt_del)" && ChartIndicatorsTotal(0,0) > 1)
      ChartIndicatorDelete(0,0,"Liste dOptions (opt_del)");
   else if (ChartIndicatorName(0,0,pos)=="ATS V2.0 User") ChartIndicatorDelete(0,0,"ATS V2.0 User");

  Options_List();

  IndicatorSetString(INDICATOR_SHORTNAME,"Liste dOptions (opt_del)");
  return(0);
  }
int deinit()
  {
//   ObjectsDelete(0);
  if (! ChartIndicatorsTotal(0,0)) CreateButton("DELETED",1,40,300,-1);
  return(0);
  }

int start() { iEvent ++;

   script = GlobalVariableGet("OScript");
   if (script) EventSetMillisecondTimer(200);
   if (! (iEvent % 5)) { frameX = 35;  frameY = 40;   Options_List(); }

   if (iEvent > 2 && (d0Color != clrSilver || d1Color != clrSilver || d2Color != clrSilver ||
      d3Color!=clrSilver || d4Color!=clrSilver || d5Color!=clrSilver || d6Color!=clrSilver || d7Color!=clrSilver)) {
      iEvent = 0;          d0Color = clrSilver;       d1Color = clrSilver;    d2Color = clrSilver;
      d3Color = clrSilver;    d4Color = clrSilver;    d5Color = clrSilver;    d6Color = clrSilver;    d7Color = clrSilver;
      ObjectSetInteger(0,PREFIX+"_Label_Default (0)",OBJPROP_COLOR, clrSilver);
      ObjectSetInteger(0,PREFIX+"_Label_Default (1)",OBJPROP_COLOR, clrSilver);
      ObjectSetInteger(0,PREFIX+"_Label_Default (5)",OBJPROP_COLOR, clrSilver);
      ObjectSetInteger(0,PREFIX+"_Label_Default (5b)",OBJPROP_COLOR, clrSilver);
//      ObjectSetInteger(0,PREFIX+"_Label_Default (6)",OBJPROP_COLOR, clrSilver);
      ObjectSetInteger(0,PREFIX+"_Label_Default (6b)",OBJPROP_COLOR, clrSilver);
      ObjectSetInteger(0,PREFIX+"_Label_Default EA1",OBJPROP_COLOR, clrSilver);
      ObjectSetInteger(0,PREFIX+"_Label_Default EA2",OBJPROP_COLOR, clrSilver);
      ObjectSetInteger(0,PREFIX+"_Label_(x)",   OBJPROP_COLOR,    clrSilver);
      ObjectSetInteger(0,PREFIX+"_Label_-> EA options",OBJPROP_COLOR, clrSilver);
      ObjectSetInteger(0,PREFIX+"_Label_-> EA Op_Liq2",OBJPROP_COLOR, clrSilver); }

//Print("*** "+iEvent+" ***");
  return(0);
}

const string PREFIX = "EA_Test";
void OnChartEvent(const int id,const long &lparam,const double &dparam,const string &sparam){
//   Print("*** ",lparam," - ",dparam," - ",sparam," ***");
   if (id == CHARTEVENT_OBJECT_CLICK) {      //CHARTEVENT_OBJECT_DRAG
//         framex = ObjectGetInteger(0,"Label_Equity",OBJPROP_XDISTANCE);
//         framey = ObjectGetInteger(0,"Label_Equity",OBJPROP_YDISTANCE);
//         ObjectSetInteger(0,"Label_Equity",OBJPROP_XDISTANCE,300);
//         ObjectSetInteger(0,"Label_Equity",OBJPROP_YDISTANCE,framey);
//         Sleep(3000);

      if (sparam != PREFIX+"_Label_OScript" && sparam != PREFIX+"_Label_ShowAll" && sparam != PREFIX+"_Label_Op_Show" &&
      sparam != PREFIX+"_Label_Show_EA" && sparam != PREFIX+"_Label_Op_ShwB" && sparam != PREFIX+"_Label_Op_HiLo" &&
      sparam != PREFIX+"_Label_Op_DDw" && sparam != PREFIX+"_Label_Op_DDw2" && sparam != PREFIX+"_Label_Op_DDw3") {
         if (TerminalInfoInteger(TERMINAL_TRADE_ALLOWED) && AccountInfoInteger(ACCOUNT_TRADE_MODE)==ACCOUNT_TRADE_MODE_REAL) {
            Alert("*** Attention : TERMINAL_TRADE_ALLOWED ! ***");      return; }
         ObjectDelete(PREFIX+"_Label_-> EA options");    ObjectDelete(PREFIX+"_Label_-> EA Op_Liq2");
         init1_6 = false;     init1_7 = false; }
      /*if (sparam == PREFIX+"_Label_Show") { show = (show ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, show? clrAqua: clrSilver);
//            Print("*** Option ShowAll = ",show? true: false," ***");
            GlobalVariableSet("ShowAll", show); }
      else if (sparam == PREFIX+"_Label_Show-EA") { ea_show = (ea_show ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, ea_show? clrAqua: clrSilver);
//            Print("*** Option Show-EA = ",ea_show? true: false," ***");
            GlobalVariableSet("Show_EA", ea_show); }
      else if (sparam == PREFIX+"_Label_Op_Show") { Op_Show = (Op_Show ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, Op_Show? clrAqua: clrSilver);
//            Print("*** Option Op_Show = ",Op_Show? true: false," ***");
            GlobalVariableSet("Op_Show", Op_Show); }
      else if (sparam == PREFIX+"_Label_Op_pDDw") { Op_DDw = (Op_DDw ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, Op_DDw? clrAqua: clrSilver);
//            Print("*** Option Op_DDw = ",Op_DDw? true: false," ***");
            GlobalVariableSet("Op_DDw", Op_DDw); }
      else if (sparam == PREFIX+"_Label_Op_DDw1") { Op_DDw2 = (Op_DDw2 ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, Op_DDw2? clrAqua: clrSilver);
//            Print("*** Option Op_DDw2 = ",Op_DDw2? true: false," ***");
            GlobalVariableSet("Op_DDw2", Op_DDw2); }
      else if (sparam == PREFIX+"_Label_Op_DDw2") { Op_DDw3 = (Op_DDw3 ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, Op_DDw3? clrAqua: clrSilver);
//            Print("*** Option Op_DDw3 = ",Op_DDw3? true: false," ***");
            GlobalVariableSet("Op_DDw3", Op_DDw3); }
      else if (sparam == PREFIX+"_Label_Script") { script = (script ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, script? clrAqua: clrSilver);
//            Print("*** Option OScript = ",script? true: false," ***");
            GlobalVariableSet("OScript", script); }
      else if (sparam == PREFIX+"_Label_||") { Op_ShwB = (Op_ShwB ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, Op_ShwB? clrAqua: clrSilver);
//            Print("*** Option Op_ShwB = ",Op_ShwB? true: false," ***");
            GlobalVariableSet("Op_ShwB", Op_ShwB); }

      else */if (sparam == PREFIX+"_Label_Op_Case01") { op_case01 = (op_case01 ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, op_case01? clrAqua: clrSilver);
            if (op_case01) { GlobalVariableSet("Op_Case02", false);
               GlobalVariableSet("Op_Case03", false); }
            GlobalVariableSet("Op_Case01", op_case01); }
      else if (sparam == PREFIX+"_Label_Op_Case02") { op_case02 = (op_case02 ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, op_case02? clrAqua: clrSilver);
            if (op_case02) { GlobalVariableSet("Op_Case01", false);
               GlobalVariableSet("Op_Case03", false); }
            GlobalVariableSet("Op_Case02", op_case02); }
      else if (sparam == PREFIX+"_Label_Op_Case03") { op_case03 = (op_case03 ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, op_case03? clrAqua: clrSilver);
            if (op_case03) { GlobalVariableSet("Op_Case01", false);
               GlobalVariableSet("Op_Case02", false); }
            GlobalVariableSet("Op_Case03", op_case03); }
      else if (sparam == PREFIX+"_Label_Op_Case11") { op_case11 = (op_case11 ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, op_case11? clrAqua: clrSilver);
            if (op_case11) { GlobalVariableSet("Op_Case12", false);
               GlobalVariableSet("Op_Case13", false); }
            GlobalVariableSet("Op_Case11", op_case11); }
      else if (sparam == PREFIX+"_Label_Op_Case12") { op_case12 = (op_case12 ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, op_case12? clrAqua: clrSilver);
            if (op_case12) { GlobalVariableSet("Op_Case11", false);
               GlobalVariableSet("Op_Case13", false); }
            GlobalVariableSet("Op_Case12", op_case12); }
      else if (sparam == PREFIX+"_Label_Op_Case13") { op_case13 = (op_case13 ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, op_case13? clrAqua: clrSilver);
            if (op_case13) { GlobalVariableSet("Op_Case11", false);
               GlobalVariableSet("Op_Case12", false); }
            GlobalVariableSet("Op_Case13", op_case13); }
      else if (sparam == PREFIX+"_Label_Op_Case21") { op_case21 = (op_case21 ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, op_case21? clrAqua: clrSilver);
            if (op_case21) { GlobalVariableSet("Op_Case22", false);
               GlobalVariableSet("Op_Case23", false); GlobalVariableSet("Op_Case25", false);
               GlobalVariableSet("Op_Case26", false); }
            GlobalVariableSet("Op_Case21", op_case21); }
      else if (sparam == PREFIX+"_Label_Op_Case22") { op_case22 = (op_case22 ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, op_case22? clrAqua: clrSilver);
            if (op_case22) { GlobalVariableSet("Op_Case21", false);
               GlobalVariableSet("Op_Case23", false); GlobalVariableSet("Op_Case25", false);
               GlobalVariableSet("Op_Case26", false); }
            GlobalVariableSet("Op_Case22", op_case22); }
      else if (sparam == PREFIX+"_Label_Op_Case23") { op_case23 = (op_case23 ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, op_case23? clrAqua: clrSilver);
            if (op_case23) { GlobalVariableSet("Op_Case21", false);
               GlobalVariableSet("Op_Case22", false); GlobalVariableSet("Op_Case25", false);
               GlobalVariableSet("Op_Case26", false); }
            GlobalVariableSet("Op_Case23", op_case23); }
      else if (sparam == PREFIX+"_Label_op_Case24") { op_case24 = (op_case24 ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, op_case24? clrAqua: clrSilver);
            GlobalVariableSet("Op_Case24", op_case24); }
      else if (sparam == PREFIX+"_Label_Op_Case25") { op_case25 = (op_case25 ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, op_case25? clrAqua: clrSilver);
            if (op_case25) { GlobalVariableSet("Op_Case21", false);
               GlobalVariableSet("Op_Case22", false); GlobalVariableSet("Op_Case23", false);
               GlobalVariableSet("Op_Case26", false); }
            GlobalVariableSet("Op_Case25", op_case25); }
      else if (sparam == PREFIX+"_Label_Op_Case26") { op_case26 = (op_case26 ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, op_case26? clrAqua: clrSilver);
            if (op_case26) { GlobalVariableSet("Op_Case21", false);
               GlobalVariableSet("Op_Case22", false); GlobalVariableSet("Op_Case23", false);
               GlobalVariableSet("Op_Case25", false); }
            GlobalVariableSet("Op_Case26" , op_case26); }

      else if (sparam == PREFIX+"_Label_op_20p1") { op_20p1 = (op_20p1 ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, op_20p1? clrAqua: clrSilver);
            GlobalVariableSet("op_20p1", op_20p1); }
      else if (sparam == PREFIX+"_Label_op_20p2") { op_20p2 = (op_20p2 ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, op_20p2? clrAqua: clrSilver);
            GlobalVariableSet("op_20p2", op_20p2); }
      else if (sparam == PREFIX+"_Label_op_20p3") { op_20p3 = (op_20p3 ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, op_20p3? clrAqua: clrSilver);
            GlobalVariableSet("op_20p3", op_20p3); }
      else if (sparam == PREFIX+"_Label_op_20p4") { op_20p4 = (op_20p4 ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, op_20p4? clrAqua: clrSilver);
            GlobalVariableSet("op_20p4", op_20p4); }
      else if (sparam == PREFIX+"_Label_op_20p5") { op_20p5 = (op_20p5 ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, op_20p5? clrAqua: clrSilver);
            GlobalVariableSet("op_20p5", op_20p5); }
      else if (sparam == PREFIX+"_Label_op_20p6") { op_20p6 = (op_20p6 ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, op_20p6? clrAqua: clrSilver);
            GlobalVariableSet("op_20p6", op_20p6); }
      else if (sparam == PREFIX+"_Label_op_20p7") { op_20p7 = (op_20p7 ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, op_20p7? clrAqua: clrSilver);
            GlobalVariableSet("op_20p7", op_20p7); }
      else if (sparam == PREFIX+"_Label_op_30p1") { op_30p1 = (op_30p1 ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, op_30p1? clrAqua: clrSilver);
            GlobalVariableSet("op_30p1", op_30p1); }
      else if (sparam == PREFIX+"_Label_op_30p2") { op_30p2 = (op_30p2 ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, op_30p2? clrAqua: clrSilver);
            GlobalVariableSet("op_30p2", op_30p2); }
      else if (sparam == PREFIX+"_Label_op_75p1") { op_75p1 = (op_75p1 ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, op_75p1? clrAqua: clrSilver);
            GlobalVariableSet("op_75p1", op_75p1); }

      else if (sparam == PREFIX+"_Label_op_OHL") { Op_OHL = (Op_OHL ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, Op_OHL? clrAqua: clrSilver);
            GlobalVariableSet("Op_OHL", Op_OHL); }
      else if (sparam == PREFIX+"_Label_op_HAp1") { op_hap1 = (op_hap1 ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, op_hap1? clrAqua: clrSilver);
            GlobalVariableSet("op_HAp1", op_hap1); }
      else if (sparam == PREFIX+"_Label_op_HAp2") { op_hap2 = (op_hap2 ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, op_hap2? clrAqua: clrSilver);
            GlobalVariableSet("op_HAp2", op_hap2); }
      else if (sparam == PREFIX+"_Label_op_HAp3") { op_hap3 = (op_hap3 ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, op_hap3? clrAqua: clrSilver);
            GlobalVariableSet("op_HAp3", op_hap3); }
      else if (sparam == PREFIX+"_Label_H_A_Opt") { ha_Opt = (ha_Opt ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, ha_Opt? clrAqua: clrSilver);
            GlobalVariableSet("H_A_Opt", ha_Opt); }
      else if (sparam == PREFIX+"_Label_H_A_Buff") { ha_Buff = (ha_Buff ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, ha_Buff? clrAqua: clrSilver);
            GlobalVariableSet("H_A_Buff", ha_Buff); }
      else if (sparam == PREFIX+"_Label_H_A_Prev") { ha_Prev = (ha_Prev ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, ha_Prev? clrAqua: clrSilver);
            GlobalVariableSet("H_A_Prev", ha_Prev); }

      else if (sparam == PREFIX+"_Label_Op_2xBl") { Op_2xBl = (Op_2xBl ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, Op_2xBl? clrAqua: clrSilver);
            GlobalVariableSet("Op_2xBl", Op_2xBl); }

      else if (sparam == PREFIX+"_Label_2liq-Error") { Op_Liqu = 0;
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, clrAqua);
            ObjectSetInteger(0,PREFIX+"_Label_2liq-Sol1",OBJPROP_COLOR,clrSilver);
            ObjectSetInteger(0,PREFIX+"_Label_2liq-Sol2",OBJPROP_COLOR,clrSilver);
            ObjectSetInteger(0,PREFIX+"_Label_2liq-Sol3",OBJPROP_COLOR,clrSilver);
            GlobalVariableSet("Op_Liqu", Op_Liqu);    copy_file(0, "*** -> Op_Liqu = 0; ***");
            copy_file(1, "*** -> Op_Liqu = 0; ***");  copy_file(2, "*** -> Op_Liqu = 0; ***"); }
      else if (sparam == PREFIX+"_Label_2liq-Sol1") { Op_Liqu = 1;
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, clrAqua);
            ObjectSetInteger(0,PREFIX+"_Label_2liq-Error",OBJPROP_COLOR,clrSilver);
            ObjectSetInteger(0,PREFIX+"_Label_2liq-Sol2",OBJPROP_COLOR,clrSilver);
            ObjectSetInteger(0,PREFIX+"_Label_2liq-Sol3",OBJPROP_COLOR,clrSilver);
            GlobalVariableSet("Op_Liqu", Op_Liqu);    copy_file(0, "*** -> Op_Liqu = 1; ***");
            copy_file(1, "*** -> Op_Liqu = 1; ***");  copy_file(2, "*** -> Op_Liqu = 1; ***"); }
      else if (sparam == PREFIX+"_Label_2liq-Sol2") { Op_Liqu = 2;
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, clrAqua);
            ObjectSetInteger(0,PREFIX+"_Label_2liq-Error",OBJPROP_COLOR,clrSilver);
            ObjectSetInteger(0,PREFIX+"_Label_2liq-Sol1",OBJPROP_COLOR,clrSilver);
            ObjectSetInteger(0,PREFIX+"_Label_2liq-Sol3",OBJPROP_COLOR,clrSilver);
            GlobalVariableSet("Op_Liqu", Op_Liqu);    copy_file(0, "*** -> Op_Liqu = 2; ***");
            copy_file(1, "*** -> Op_Liqu = 2; ***");  copy_file(2, "*** -> Op_Liqu = 2; ***"); }
      else if (sparam == PREFIX+"_Label_2liq-Sol3") { Op_Liqu = 3;
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, clrAqua);
            ObjectSetInteger(0,PREFIX+"_Label_2liq-Error",OBJPROP_COLOR,clrSilver);
            ObjectSetInteger(0,PREFIX+"_Label_2liq-Sol1",OBJPROP_COLOR,clrSilver);
            ObjectSetInteger(0,PREFIX+"_Label_2liq-Sol2",OBJPROP_COLOR,clrSilver);
            GlobalVariableSet("Op_Liqu", Op_Liqu);    copy_file(0, "*** -> Op_Liqu = 3; ***");
            copy_file(1, "*** -> Op_Liqu = 3; ***");  copy_file(2, "*** -> Op_Liqu = 3; ***"); }
      else if (sparam == PREFIX+"_Label_Op_Liq2") { Op_Liq2 = (Op_Liq2 ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, Op_Liq2? clrAqua: clrSilver);
            GlobalVariableSet("Op_Liq2", Op_Liq2);
            copy_file(0, "*** -> Op_Liq2 = "+(Op_Liq2? "TRUE": "FALSE")+"; ***");
            copy_file(1, "*** -> Op_Liq2 = "+(Op_Liq2? "TRUE": "FALSE")+"; ***");
            copy_file(2, "*** -> Op_Liq2 = "+(Op_Liq2? "TRUE": "FALSE")+"; ***"); }
      else if (sparam == PREFIX+"_Label_Op_Liq3") { Op_Liq3 = (Op_Liq3 ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, Op_Liq3? clrAqua: clrSilver);
            GlobalVariableSet("Op_Liq3", Op_Liq3);
            copy_file(0, "*** -> Op_Liq3 = "+(Op_Liq3? "TRUE": "FALSE")+"; ***");
            copy_file(1, "*** -> Op_Liq3 = "+(Op_Liq3? "TRUE": "FALSE")+"; ***");
            copy_file(2, "*** -> Op_Liq3 = "+(Op_Liq3? "TRUE": "FALSE")+"; ***"); }
      else if (sparam == PREFIX+"_Label_Op_Liq4") { Op_Liq4 = (Op_Liq4 ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, Op_Liq4? clrAqua: clrSilver);
            GlobalVariableSet("Op_Liq4", Op_Liq4);
            copy_file(0, "*** -> Op_Liq4 = "+(Op_Liq4? "TRUE": "FALSE")+"; ***");
            copy_file(1, "*** -> Op_Liq4 = "+(Op_Liq4? "TRUE": "FALSE")+"; ***");
            copy_file(2, "*** -> Op_Liq4 = "+(Op_Liq4? "TRUE": "FALSE")+"; ***"); }

      else if (sparam == PREFIX+"_Label_op_HiLo") { op_HiLo = (op_HiLo ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, op_HiLo? clrAqua: clrSilver);
            GlobalVariableSet("op_HiLo", op_HiLo); }
      else if (sparam == PREFIX+"_Label_op_HiLo1") { op_HiLo1 = (op_HiLo1 ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, op_HiLo1? clrAqua: clrSilver);
            GlobalVariableSet("op_HiLo1", op_HiLo1); }
      else if (sparam == PREFIX+"_Label_op_HiLo2") { op_HiLo2 = (op_HiLo2 ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, op_HiLo2? clrAqua: clrSilver);
            GlobalVariableSet("op_HiLo2", op_HiLo2); }
      else if (sparam == PREFIX+"_Label_op_Exp") { op_Exp = (op_Exp ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, op_Exp? clrAqua: clrSilver);
            GlobalVariableSet("op_Exp", op_Exp); }
      else if (sparam == PREFIX+"_Label_op_Exp1") { op_Exp1 = (op_Exp1 ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, op_Exp1? clrAqua: clrSilver);
            GlobalVariableSet("op_Exp1", op_Exp1); }
      else if (sparam == PREFIX+"_Label_op_Exp2") { op_Exp2 = (op_Exp2 ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, op_Exp2? clrAqua: clrSilver);
            GlobalVariableSet("op_Exp2", op_Exp2); }

      else if (sparam == PREFIX+"_Label_OScript") { script = (script ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, script? clrAqua: clrSilver);
            GlobalVariableSet("OScript", script); }
      else if (sparam == PREFIX+"_Label_ShowAll") { show = (show ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, show? clrAqua: clrSilver);
            GlobalVariableSet("ShowAll", show); }
      else if (sparam == PREFIX+"_Label_Op_Show") {// Alert("Op_Show -> n'est pas modifiable ici !");
            Op_Show = (Op_Show ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, Op_Show? clrAqua: clrSilver);
            GlobalVariableSet("Op_Show", Op_Show); }
      else if (sparam == PREFIX+"_Label_Show_EA") {// Alert("Show_EA -> n'est pas modifiable ici !");
            ea_show = (ea_show ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, ea_show? clrAqua: clrSilver);
            GlobalVariableSet("Show_EA", ea_show); }
      else if (sparam == PREFIX+"_Label_Op_ShwB") {// Alert("Op_ShwB -> n'est pas modifiable ici !");
            Op_ShwB = (Op_ShwB ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, Op_ShwB? clrAqua: clrSilver);
            GlobalVariableSet("Op_ShwB", Op_ShwB); }
      else if (sparam == PREFIX+"_Label_Op_HiLo") {// Alert("Op_HiLo -> n'est pas modifiable ici !");
            Op_HiLo = (Op_HiLo ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, Op_HiLo? clrAqua: clrSilver);
            GlobalVariableSet("Op_HiLo", Op_HiLo); }
      else if (sparam == PREFIX+"_Label_Op_DDw") {// Alert("Op_DDw -> n'est pas modifiable ici !");
            Op_DDw = (Op_DDw ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, Op_DDw? clrAqua: clrSilver);
            GlobalVariableSet("Op_DDw", Op_DDw); }
      else if (sparam == PREFIX+"_Label_Op_DDw2") {// Alert("Op_DDw2 -> n'est pas modifiable ici !");
            Op_DDw2 = (Op_DDw2 ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, Op_DDw2? clrAqua: clrSilver);
            GlobalVariableSet("Op_DDw2", Op_DDw2); }
      else if (sparam == PREFIX+"_Label_Op_DDw3") {// Alert("Op_DDw3 -> n'est pas modifiable ici !");
            Op_DDw3 = (Op_DDw3 ? false : true);
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, Op_DDw3? clrAqua: clrSilver);
            GlobalVariableSet("Op_DDw3", Op_DDw3); }

      else if (sparam == PREFIX+"_Label_RateOC1") { rate1c = (rate1c ? false : true);
            rate2c = false;      rate3c = false;      rate4c = false;
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, rate1c? clrSkyBlue: clrSilver);
//            Print("*** Option RateOC1 = ",rate1c? true: false," ***");
            ObjectSetInteger(0,PREFIX+"_Label_RateOC2",OBJPROP_COLOR, clrSilver);
//            Print("*** Option RateOC2 = ",rate2c? true: false," ***");
            ObjectSetInteger(0,PREFIX+"_Label_RateOC3",OBJPROP_COLOR, clrSilver);
//            Print("*** Option RateOC3 = ",rate3c? true: false," ***");
            ObjectSetInteger(0,PREFIX+"_Label_RateOC4",OBJPROP_COLOR, clrSilver);
//            Print("*** Option RateOC4 = ",rate4c? true: false," ***");
            GlobalVariableSet("RateOC1", rate1c);
            GlobalVariableSet("RateOC2", rate2c);
            GlobalVariableSet("RateOC3", rate3c);
            GlobalVariableSet("RateOC4", rate4c); }
      else if (sparam == PREFIX+"_Label_RateOC2") { rate2c = (rate2c ? false : true);
            rate1c = false;      rate3c = false;      rate4c = false;
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, rate2c? clrSkyBlue: clrSilver);
//            Print("*** Option RateOC2 = ",rate2c? true: false," ***");
            ObjectSetInteger(0,PREFIX+"_Label_RateOC1",OBJPROP_COLOR, clrSilver);
//            Print("*** Option RateOC1 = ",rate1c? true: false," ***");
            ObjectSetInteger(0,PREFIX+"_Label_RateOC3",OBJPROP_COLOR, clrSilver);
//            Print("*** Option RateOC3 = ",rate3c? true: false," ***");
            ObjectSetInteger(0,PREFIX+"_Label_RateOC4",OBJPROP_COLOR, clrSilver);
//            Print("*** Option RateOC4 = ",rate4c? true: false," ***");
            GlobalVariableSet("RateOC1", rate1c);
            GlobalVariableSet("RateOC2", rate2c);
            GlobalVariableSet("RateOC3", rate3c);
            GlobalVariableSet("RateOC4", rate4c); }
      else if (sparam == PREFIX+"_Label_RateOC3") { rate3c = (rate3c ? false : true);
            rate1c = false;      rate2c = false;      rate4c = false;
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, rate3c? clrSkyBlue: clrSilver);
//            Print("*** Option RateOC3 = ",rate3c? true: false," ***");
            ObjectSetInteger(0,PREFIX+"_Label_RateOC1",OBJPROP_COLOR, clrSilver);
//            Print("*** Option RateOC1 = ",rate1c? true: false," ***");
            ObjectSetInteger(0,PREFIX+"_Label_RateOC2",OBJPROP_COLOR, clrSilver);
//            Print("*** Option RateOC2 = ",rate2c? true: false," ***");
            ObjectSetInteger(0,PREFIX+"_Label_RateOC4",OBJPROP_COLOR, clrSilver);
//            Print("*** Option RateOC4 = ",rate4c? true: false," ***");
            GlobalVariableSet("RateOC1", rate1c);
            GlobalVariableSet("RateOC2", rate2c);
            GlobalVariableSet("RateOC3", rate3c);
            GlobalVariableSet("RateOC4", rate4c); }
      else if (sparam == PREFIX+"_Label_RateOC4") { rate4c = (rate4c ? false : true);
            rate1c = false;      rate2c = false;      rate3c = false;
            ObjectSetInteger(0,sparam,OBJPROP_COLOR, rate4c? clrSkyBlue: clrSilver);
//            Print("*** Option RateOC4 = ",rate4c? true: false," ***");
            ObjectSetInteger(0,PREFIX+"_Label_RateOC1",OBJPROP_COLOR, clrSilver);
//            Print("*** Option RateOC1 = ",rate1c? true: false," ***");
            ObjectSetInteger(0,PREFIX+"_Label_RateOC2",OBJPROP_COLOR, clrSilver);
//            Print("*** Option RateOC2 = ",rate2c? true: false," ***");
            ObjectSetInteger(0,PREFIX+"_Label_RateOC3",OBJPROP_COLOR, clrSilver);
//            Print("*** Option RateOC3 = ",rate3c? true: false," ***");
            GlobalVariableSet("RateOC1", rate1c);
            GlobalVariableSet("RateOC2", rate2c);
            GlobalVariableSet("RateOC3", rate3c);
            GlobalVariableSet("RateOC4", rate4c); }

      else if (sparam == PREFIX+"_Label_Default (0)") { script = GlobalVariableGet("OScript");
            if (! script) { frameX = 35;     frameY = 40;      iEvent = 0;
               ObjectSetInteger(0,sparam, OBJPROP_COLOR, clrDeepSkyBlue);
               ObjectSetInteger(0,PREFIX+"_Label_Default (1)",OBJPROP_COLOR, clrSilver);
               ObjectSetInteger(0,PREFIX+"_Label_Default (5)",OBJPROP_COLOR, clrSilver);
               ObjectSetInteger(0,PREFIX+"_Label_Default (5b)",OBJPROP_COLOR, clrSilver);
//               ObjectSetInteger(0,PREFIX+"_Label_Default (6)",OBJPROP_COLOR, clrSilver);
               ObjectSetInteger(0,PREFIX+"_Label_Default (6b)",OBJPROP_COLOR, clrSilver);
               ObjectSetInteger(0,PREFIX+"_Label_Default EA1",OBJPROP_COLOR, clrSilver);
               ObjectSetInteger(0,PREFIX+"_Label_Default EA2",OBJPROP_COLOR, clrSilver);
               d0Color = clrDeepSkyBlue;     d1Color = clrSilver;    d2Color = clrSilver;
               d3Color = clrSilver;          d4Color = clrSilver;    d5Color = clrSilver;
               d6Color = clrSilver;          d7Color = clrSilver;
               Op_Default(0);             Options_List(); }
            else Alert("Attention : OScript est activé !"); }
      else if (sparam == PREFIX+"_Label_Default (1)") { script = GlobalVariableGet("OScript");
            if (! script) { frameX = 35;     frameY = 40;      iEvent = 0;
               ObjectSetInteger(0,PREFIX+"_Label_Default (0)",OBJPROP_COLOR, clrSilver);
               ObjectSetInteger(0,sparam, OBJPROP_COLOR, clrDeepSkyBlue);
               ObjectSetInteger(0,PREFIX+"_Label_Default (5)",OBJPROP_COLOR, clrSilver);
               ObjectSetInteger(0,PREFIX+"_Label_Default (5b)",OBJPROP_COLOR, clrSilver);
//               ObjectSetInteger(0,PREFIX+"_Label_Default (6)",OBJPROP_COLOR, clrSilver);
               ObjectSetInteger(0,PREFIX+"_Label_Default (6b)",OBJPROP_COLOR, clrSilver);
               ObjectSetInteger(0,PREFIX+"_Label_Default EA1",OBJPROP_COLOR, clrSilver);
               ObjectSetInteger(0,PREFIX+"_Label_Default EA2",OBJPROP_COLOR, clrSilver);
               d0Color = clrSilver;       d1Color = clrDeepSkyBlue;    d2Color = clrSilver;
               d3Color = clrSilver;       d4Color = clrSilver;         d5Color = clrSilver;
               d6Color = clrSilver;       d7Color = clrSilver;
               Op_Default(1);             Options_List(); }
            else Alert("Attention : OScript est activé !"); }
      else if (sparam == PREFIX+"_Label_Default (5)") { script = GlobalVariableGet("OScript");
            if (! script) { frameX = 35;     frameY = 40;      iEvent = 0;
               ObjectSetInteger(0,PREFIX+"_Label_Default (0)",OBJPROP_COLOR, clrSilver);
               ObjectSetInteger(0,PREFIX+"_Label_Default (1)",OBJPROP_COLOR, clrSilver);
               ObjectSetInteger(0,sparam, OBJPROP_COLOR, clrDeepSkyBlue);
               ObjectSetInteger(0,PREFIX+"_Label_Default (5b)",OBJPROP_COLOR, clrSilver);
//               ObjectSetInteger(0,PREFIX+"_Label_Default (6)",OBJPROP_COLOR, clrSilver);
               ObjectSetInteger(0,PREFIX+"_Label_Default (6b)",OBJPROP_COLOR, clrSilver);
               ObjectSetInteger(0,PREFIX+"_Label_Default EA1",OBJPROP_COLOR, clrSilver);
               ObjectSetInteger(0,PREFIX+"_Label_Default EA2",OBJPROP_COLOR, clrSilver);
               d0Color = clrSilver;       d1Color = clrSilver;    d2Color = clrDeepSkyBlue;
               d3Color = clrSilver;       d4Color = clrSilver;    d5Color = clrSilver;
               d6Color = clrSilver;       d7Color = clrSilver;
               Op_Default(2);             Options_List(); }
            else Alert("Attention : OScript est activé !"); }
      else if (sparam == PREFIX+"_Label_Default (5b)") { script = GlobalVariableGet("OScript");
            if (! script) { frameX = 35;     frameY = 40;      iEvent = 0;
               ObjectSetInteger(0,PREFIX+"_Label_Default (0)",OBJPROP_COLOR, clrSilver);
               ObjectSetInteger(0,PREFIX+"_Label_Default (1)",OBJPROP_COLOR, clrSilver);
               ObjectSetInteger(0,PREFIX+"_Label_Default (5)",OBJPROP_COLOR, clrSilver);
               ObjectSetInteger(0,sparam, OBJPROP_COLOR, clrDeepSkyBlue);
//               ObjectSetInteger(0,PREFIX+"_Label_Default (6)",OBJPROP_COLOR, clrSilver);
               ObjectSetInteger(0,PREFIX+"_Label_Default (6b)",OBJPROP_COLOR, clrSilver);
               ObjectSetInteger(0,PREFIX+"_Label_Default EA1",OBJPROP_COLOR, clrSilver);
               ObjectSetInteger(0,PREFIX+"_Label_Default EA2",OBJPROP_COLOR, clrSilver);
               d0Color = clrSilver;          d1Color = clrSilver;    d2Color = clrSilver;
               d3Color = clrDeepSkyBlue;     d4Color = clrSilver;    d5Color = clrSilver;
               d6Color = clrSilver;          d7Color = clrSilver;
               Op_Default(3);             Options_List(); }
            else Alert("Attention : OScript est activé !"); }
/*      else if (sparam == PREFIX+"_Label_Default (6)") { script = GlobalVariableGet("OScript");
            if (! script) { frameX = 35;     frameY = 40;      iEvent = 0;
               ObjectSetInteger(0,PREFIX+"_Label_Default (0)",OBJPROP_COLOR, clrSilver);
               ObjectSetInteger(0,PREFIX+"_Label_Default (1)",OBJPROP_COLOR, clrSilver);
               ObjectSetInteger(0,PREFIX+"_Label_Default (5)",OBJPROP_COLOR, clrSilver);
               ObjectSetInteger(0,PREFIX+"_Label_Default (5b)",OBJPROP_COLOR, clrSilver);
               ObjectSetInteger(0,sparam, OBJPROP_COLOR, clrDeepSkyBlue);
               ObjectSetInteger(0,PREFIX+"_Label_Default (6b)",OBJPROP_COLOR, clrSilver);
               d0Color = clrSilver;       d1Color = clrSilver;         d2Color = clrSilver;
               d3Color = clrSilver;       d4Color = clrDeepSkyBlue;    d5Color = clrSilver;
               Op_Default(4);             Options_List(); }
            else Alert("Attention : OScript est activé !"); } */
      else if (sparam == PREFIX+"_Label_Default (6b)") { script = GlobalVariableGet("OScript");
            if (! script) { frameX = 35;     frameY = 40;      iEvent = 0;
               ObjectSetInteger(0,PREFIX+"_Label_Default (0)",OBJPROP_COLOR, clrSilver);
               ObjectSetInteger(0,PREFIX+"_Label_Default (1)",OBJPROP_COLOR, clrSilver);
               ObjectSetInteger(0,PREFIX+"_Label_Default (5)",OBJPROP_COLOR, clrSilver);
               ObjectSetInteger(0,PREFIX+"_Label_Default (5b)",OBJPROP_COLOR, clrSilver);
//               ObjectSetInteger(0,PREFIX+"_Label_Default (6)",OBJPROP_COLOR, clrSilver);
               ObjectSetInteger(0,sparam, OBJPROP_COLOR, clrDeepSkyBlue);
               ObjectSetInteger(0,PREFIX+"_Label_Default EA1",OBJPROP_COLOR, clrSilver);
               ObjectSetInteger(0,PREFIX+"_Label_Default EA2",OBJPROP_COLOR, clrSilver);
               d0Color = clrSilver;       d1Color = clrSilver;    d2Color = clrSilver;
               d3Color = clrSilver;       d4Color = clrSilver;    d5Color = clrDeepSkyBlue;
               d6Color = clrSilver;       d7Color = clrSilver;
               Op_Default(5);             Options_List(); }
            else Alert("Attention : OScript est activé !"); }
      else if (sparam == PREFIX+"_Label_Default EA1") { script = GlobalVariableGet("OScript");
            if (! script) { frameX = 35;     frameY = 40;      iEvent = 0;
               ObjectSetInteger(0,PREFIX+"_Label_Default (0)",OBJPROP_COLOR, clrSilver);
               ObjectSetInteger(0,PREFIX+"_Label_Default (1)",OBJPROP_COLOR, clrSilver);
               ObjectSetInteger(0,PREFIX+"_Label_Default (5)",OBJPROP_COLOR, clrSilver);
               ObjectSetInteger(0,PREFIX+"_Label_Default (5b)",OBJPROP_COLOR, clrSilver);
//               ObjectSetInteger(0,PREFIX+"_Label_Default (6)",OBJPROP_COLOR, clrSilver);
               ObjectSetInteger(0,PREFIX+"_Label_Default (6b)",OBJPROP_COLOR, clrSilver);
               ObjectSetInteger(0,sparam, OBJPROP_COLOR, clrDeepSkyBlue);
               ObjectSetInteger(0,PREFIX+"_Label_Default EA2",OBJPROP_COLOR, clrSilver);
               d0Color = clrSilver;          d1Color = clrSilver;    d2Color = clrSilver;
               d3Color = clrSilver;          d4Color = clrSilver;    d5Color = clrSilver;
               d6Color = clrDeepSkyBlue;     d7Color = clrSilver;
               Op_Default(6);             Options_List(); }
            else Alert("Attention : OScript est activé !"); }
      else if (sparam == PREFIX+"_Label_Default EA2") { script = GlobalVariableGet("OScript");
            if (! script) { frameX = 35;     frameY = 40;      iEvent = 0;
               ObjectSetInteger(0,PREFIX+"_Label_Default (0)",OBJPROP_COLOR, clrSilver);
               ObjectSetInteger(0,PREFIX+"_Label_Default (1)",OBJPROP_COLOR, clrSilver);
               ObjectSetInteger(0,PREFIX+"_Label_Default (5)",OBJPROP_COLOR, clrSilver);
               ObjectSetInteger(0,PREFIX+"_Label_Default (5b)",OBJPROP_COLOR, clrSilver);
//               ObjectSetInteger(0,PREFIX+"_Label_Default (6)",OBJPROP_COLOR, clrSilver);
               ObjectSetInteger(0,PREFIX+"_Label_Default (6b)",OBJPROP_COLOR, clrSilver);
               ObjectSetInteger(0,PREFIX+"_Label_Default EA1",OBJPROP_COLOR, clrSilver);
               ObjectSetInteger(0,sparam, OBJPROP_COLOR, clrDeepSkyBlue);
               d0Color = clrSilver;       d1Color = clrSilver;       d2Color = clrSilver;
               d3Color = clrSilver;       d4Color = clrSilver;       d5Color = clrSilver;
               d6Color = clrSilver;       d7Color = clrDeepSkyBlue;
               Op_Default(7);             Options_List(); }
            else Alert("Attention : OScript est activé !"); }
      else if (sparam == PREFIX+"_Label_(x)") { script = GlobalVariableGet("OScript");
            if (! script) { frameX = 35;     frameY = 40;      iEvent = 0;
               ObjectSetInteger(0,sparam, OBJPROP_COLOR, clrDeepSkyBlue);
               d0Color = clrDeepSkyBlue;     Op_Default(-1);      Options_List_(); }
            else { Alert("Attention : OScript est activé !");
               Alert("   -> STOP du script en cours !");  GlobalVariableSet("Stop_script", true); } }
      else if (sparam == PREFIX+"_Label_(->)") { script = GlobalVariableGet("OScript");
            if (! script) { frameX = 35;     frameY = 40;      iEvent = 0;
               ObjectSetInteger(0,sparam, OBJPROP_COLOR, clrDeepSkyBlue);
               d0Color = clrSilver;          Op_Default(-2);      Options_List_(); }
            else Alert("Attention : OScript est activé !"); }
   }

/*   else if (Op_ShwB) { datetime ev_Tim1, ev_Tim2;    double ev_Price;    int i;
      ChartXYToTimePrice(0,lparam,dparam, i, ev_Tim1, ev_Price);
      while (ev_Tim1 > ev_Tim2 && i < Bars) { ev_Tim2 = iTime(NULL,0,Bars-(i+1));   i ++; }
      if ((iHigh(NULL,0,Bars-i)-iLow(NULL,0,Bars-i)) > 0) Print("*** ",(Bars-i)," - ",
      iOpen(NULL,0,Bars-i)," - ",iHigh(NULL,0,Bars-i)," - ",iLow(NULL,0,Bars-i)," - ",iClose(NULL,0,Bars-i)," - ",
         ((MathAbs((iClose(NULL,0,Bars-i)-iOpen(NULL,0,Bars-i)) / (iHigh(NULL,0,Bars-i)-iLow(NULL,0,Bars-i)))
         > 0.3 && ((iOpen(NULL,0,Bars-i) - (iHigh(NULL,0,Bars-i)+iLow(NULL,0,Bars-i)) / 2) > 20 * Point ||
         MathAbs((iClose(NULL,0,Bars-i)-iOpen(NULL,0,Bars-i)) / (iHigh(NULL,0,Bars-i)-iLow(NULL,0,Bars-i))) > 0.75)) ||
         ((iClose(NULL,0,Bars-i) - iOpen(NULL,0,Bars-i)) > 20 * Point && 
         (iOpen(NULL,0,Bars-i) - (iHigh(NULL,0,Bars-i)+iLow(NULL,0,Bars-i)) / 2) > 20 * Point &&
         (iOpen(NULL,0,Bars-i) - (iOpen(NULL,0,Bars-i+1)+iClose(NULL,0,Bars-i+1)) / 2) > 20 * Point &&
         MathAbs((iClose(NULL,0,Bars-i)-iOpen(NULL,0,Bars-i)) / (iHigh(NULL,0,Bars-i)-iLow(NULL,0,Bars-i))) < 0.3)),
      " - ",MathAbs(((iClose(NULL,0,Bars-i)-iOpen(NULL,0,Bars-i)) / (iHigh(NULL,0,Bars-i)-iLow(NULL,0,Bars-i))) > 0.3 && 
         ((iOpen(NULL,0,Bars-i) - (iHigh(NULL,0,Bars-i)+iLow(NULL,0,Bars-i)) / 2) > 20 * Point ||
         MathAbs((iClose(NULL,0,Bars-i)-iOpen(NULL,0,Bars-i)) / (iHigh(NULL,0,Bars-i)-iLow(NULL,0,Bars-i))) > 0.75)),
      " - ",((iClose(NULL,0,Bars-i) - iOpen(NULL,0,Bars-i)) > 20 * Point && 
         (iOpen(NULL,0,Bars-i) - (iHigh(NULL,0,Bars-i)+iLow(NULL,0,Bars-i)) / 2) > 20 * Point &&
         (iOpen(NULL,0,Bars-i) - (iOpen(NULL,0,Bars-i+1)+iClose(NULL,0,Bars-i+1)) / 2) > 20 * Point &&
         MathAbs((iClose(NULL,0,Bars-i)-iOpen(NULL,0,Bars-i)) / (iHigh(NULL,0,Bars-i)-iLow(NULL,0,Bars-i))) < 0.3),
      " - ",MathAbs((iClose(NULL,0,Bars-i)-iOpen(NULL,0,Bars-i)) / (iHigh(NULL,0,Bars-i)-iLow(NULL,0,Bars-i))),
      " - ",(iOpen(NULL,0,Bars-i) - (iHigh(NULL,0,Bars-i)+iLow(NULL,0,Bars-i)) / 2),
      " - ",(iOpen(NULL,0,Bars-i) - (iOpen(NULL,0,Bars-i+1)+iClose(NULL,0,Bars-i+1)) / 2),
      " - ",(iClose(NULL,0,Bars-i) - iOpen(NULL,0,Bars-i))," ***");
   } */
}

void Options_List() { ObjectsDelete(0);
  if (GlobalVariableCheck("Op_Case01")) op_case01=GlobalVariableGet("Op_Case01");
  if (GlobalVariableCheck("Op_Case02")) op_case02=GlobalVariableGet("Op_Case02");
  if (GlobalVariableCheck("Op_Case03")) op_case03=GlobalVariableGet("Op_Case03");
  if (GlobalVariableCheck("Op_Case11")) op_case11=GlobalVariableGet("Op_Case11");
  if (GlobalVariableCheck("Op_Case12")) op_case12=GlobalVariableGet("Op_Case12");
  if (GlobalVariableCheck("Op_Case13")) op_case13=GlobalVariableGet("Op_Case13");
  if (GlobalVariableCheck("Op_Case21")) op_case21=GlobalVariableGet("Op_Case21");
  if (GlobalVariableCheck("Op_Case22")) op_case22=GlobalVariableGet("Op_Case22");
  if (GlobalVariableCheck("Op_Case23")) op_case23=GlobalVariableGet("Op_Case23");
  if (GlobalVariableCheck("Op_Case24")) op_case24=GlobalVariableGet("Op_Case24");
  if (GlobalVariableCheck("Op_Case25")) op_case25=GlobalVariableGet("Op_Case25");
  if (GlobalVariableCheck("Op_Case26")) op_case26=GlobalVariableGet("Op_Case26");
  if (GlobalVariableCheck("op_20p1"))  op_20p1 = GlobalVariableGet("op_20p1");
  if (GlobalVariableCheck("op_20p2"))  op_20p2 = GlobalVariableGet("op_20p2");
  if (GlobalVariableCheck("op_20p3"))  op_20p3 = GlobalVariableGet("op_20p3");
  if (GlobalVariableCheck("op_20p4"))  op_20p4 = GlobalVariableGet("op_20p4");
  if (GlobalVariableCheck("op_20p5"))  op_20p5 = GlobalVariableGet("op_20p5");
  if (GlobalVariableCheck("op_20p6"))  op_20p6 = GlobalVariableGet("op_20p6");
  if (GlobalVariableCheck("op_20p7"))  op_20p7 = GlobalVariableGet("op_20p7");
  if (GlobalVariableCheck("op_30p1"))  op_30p1 = GlobalVariableGet("op_30p1");
  if (GlobalVariableCheck("op_30p2"))  op_30p2 = GlobalVariableGet("op_30p2");
  if (GlobalVariableCheck("op_75p1"))  op_75p1 = GlobalVariableGet("op_75p1");

  if (GlobalVariableCheck("Op_OHL"))   Op_OHL = GlobalVariableGet("Op_OHL");
  if (GlobalVariableCheck("op_HAp1"))  op_hap1 = GlobalVariableGet("op_HAp1");
  if (GlobalVariableCheck("op_HAp2"))  op_hap2 = GlobalVariableGet("op_HAp2");
  if (GlobalVariableCheck("op_HAp3"))  op_hap3 = GlobalVariableGet("op_HAp3");

  if (GlobalVariableCheck("H_A_Opt"))  ha_Opt = GlobalVariableGet("H_A_Opt");
  if (GlobalVariableCheck("H_A_Buff")) ha_Buff = GlobalVariableGet("H_A_Buff");
  if (GlobalVariableCheck("H_A_Prev")) ha_Prev = GlobalVariableGet("H_A_Prev");

  if (GlobalVariableCheck("Op_2xBl"))  Op_2xBl = GlobalVariableGet("Op_2xBl");

  if (GlobalVariableCheck("Op_Liqu"))  Op_Liqu = GlobalVariableGet("Op_Liqu");
  if (GlobalVariableCheck("Op_Liq2"))  Op_Liq2 = GlobalVariableGet("Op_Liq2");
  if (GlobalVariableCheck("Op_Liq3"))  Op_Liq3 = GlobalVariableGet("Op_Liq3");
  if (GlobalVariableCheck("Op_Liq4"))  Op_Liq4 = GlobalVariableGet("Op_Liq4");

  if (GlobalVariableCheck("op_HiLo"))  op_HiLo = GlobalVariableGet("op_HiLo");
  if (GlobalVariableCheck("op_HiLo1")) op_HiLo1 = GlobalVariableGet("op_HiLo1");
  if (GlobalVariableCheck("op_HiLo2")) op_HiLo2 = GlobalVariableGet("op_HiLo2");
  if (GlobalVariableCheck("op_Exp"))   op_Exp = GlobalVariableGet("op_Exp");
  if (GlobalVariableCheck("op_Exp1"))  op_Exp1 = GlobalVariableGet("op_Exp1");
  if (GlobalVariableCheck("op_Exp2"))  op_Exp2 = GlobalVariableGet("op_Exp2");

  if (GlobalVariableCheck("ShowAll"))  show = GlobalVariableGet("ShowAll");
  if (GlobalVariableCheck("Op_Show"))  Op_Show = GlobalVariableGet("Op_Show");
  if (GlobalVariableCheck("OScript"))  script = GlobalVariableGet("OScript");
  if (GlobalVariableCheck("Show_EA"))  ea_show = GlobalVariableGet("Show_EA");
  if (GlobalVariableCheck("Op_ShwB"))  Op_ShwB = GlobalVariableGet("Op_ShwB");
  if (GlobalVariableCheck("Op_HiLo"))  Op_HiLo = GlobalVariableGet("Op_HiLo");
  if (GlobalVariableCheck("Op_DDw"))   Op_DDw = GlobalVariableGet("Op_DDw");
  if (GlobalVariableCheck("Op_DDw2"))  Op_DDw2 = GlobalVariableGet("Op_DDw2");
  if (GlobalVariableCheck("Op_DDw3"))  Op_DDw3 = GlobalVariableGet("Op_DDw3");
  if (GlobalVariableCheck("RateOC1"))  rate1c = GlobalVariableGet("RateOC1");
  if (GlobalVariableCheck("RateOC2"))  rate2c = GlobalVariableGet("RateOC2");
  if (GlobalVariableCheck("RateOC3"))  rate3c = GlobalVariableGet("RateOC3");
  if (GlobalVariableCheck("RateOC4"))  rate4c = GlobalVariableGet("RateOC4");

  if (GlobalVariableCheck("Op_1xBl")) Op_1xBl = GlobalVariableGet("Op_1xBl");

  int icolor=0;
  CreateButton("Op_Case01",1,frameX,frameY,icolor);            icolor ++;
  CreateButton("Op_Case02",1,frameX,frameY+15,icolor);         icolor ++;
  CreateButton("Op_Case03",1,frameX,frameY+15*2,icolor);       icolor ++;
  CreateButton("Op_Case11",1,frameX,frameY+15*3,icolor);       icolor ++;
  CreateButton("Op_Case12",1,frameX,frameY+15*4,icolor);       icolor ++;
  CreateButton("Op_Case13",1,frameX,frameY+15*5,icolor);       icolor ++;
  CreateButton("Op_Case21",1,frameX,frameY+15*6,icolor);       icolor ++;
  CreateButton("Op_Case22",1,frameX,frameY+15*7,icolor);       icolor ++;
  CreateButton("Op_Case23",1,frameX,frameY+15*8,icolor);       icolor ++;
  CreateButton("op_Case24",1,frameX,frameY+15*9,icolor);       icolor ++;  // "op" non "Op" car option de calcul
  CreateButton("Op_Case25",1,frameX,frameY+15*10,icolor);      icolor ++;
  CreateButton("Op_Case26",1,frameX,frameY+15*11,icolor);      icolor ++;

  frameX += 150;
  CreateButton("op_20p1",1,frameX,frameY,icolor);              icolor ++;
  CreateButton("op_20p2",1,frameX,frameY+15,icolor);           icolor ++;
  CreateButton("op_20p3",1,frameX,frameY+15*2,icolor);         icolor ++;
  CreateButton("op_20p4",1,frameX,frameY+15*3,icolor);         icolor ++;
  CreateButton("op_20p5",1,frameX,frameY+15*4,icolor);         icolor ++;
  CreateButton("op_20p6",1,frameX,frameY+15*5,icolor);         icolor ++;
  CreateButton("op_20p7",1,frameX,frameY+15*6,icolor);         icolor ++;
  CreateButton("op_30p1",1,frameX,frameY+15*8,icolor);         icolor ++;
  CreateButton("op_30p2",1,frameX,frameY+15*9,icolor);         icolor ++;
  CreateButton("op_75p1",1,frameX,frameY+15*10,icolor);        icolor ++;

  frameX += 150;
  CreateButton("op_OHL",1,frameX,frameY,icolor);               icolor ++;  // attention ici c'est en fait Op_OHL
  CreateButton("op_HAp1",1,frameX,frameY+15*2,icolor);         icolor ++;
  CreateButton("op_HAp2",1,frameX,frameY+15*3,icolor);         icolor ++;
  CreateButton("op_HAp3",1,frameX,frameY+15*4,icolor);         icolor ++;
  CreateButton("H_A_Opt",1,frameX,frameY+15*6,icolor);         icolor ++;
  CreateButton("H_A_Buff",1,frameX,frameY+15*7,icolor);        icolor ++;
  CreateButton("H_A_Prev",1,frameX,frameY+15*8,icolor);        icolor ++;
  CreateButton("Op_2xBl",1,frameX,frameY+15*10,icolor);        icolor ++;

  frameX += 150;
  CreateButton("2liq-Error",1,frameX,frameY,icolor);           icolor ++;
  CreateButton("2liq-Sol1",1,frameX,frameY+15,icolor);         icolor ++;
  CreateButton("2liq-Sol2",1,frameX,frameY+15*2,icolor);       icolor ++;
  CreateButton("2liq-Sol3",1,frameX,frameY+15*3,icolor);       icolor ++;
  CreateButton("Op_Liq2",1,frameX,frameY+15*4,icolor);         icolor ++;
  CreateButton("Op_Liq3",1,frameX,frameY+15*5,icolor);         icolor ++;
  CreateButton("Op_Liq4",1,frameX,frameY+15*6,icolor);         icolor ++;

  CreateButton("op_HiLo",1,frameX,frameY+15*7,icolor);         icolor ++;
  CreateButton("op_HiLo1",1,frameX,frameY+15*8,icolor);        icolor ++;
  CreateButton("op_HiLo2",1,frameX,frameY+15*9,icolor);        icolor ++;
  CreateButton("op_Exp",1,frameX,frameY+15*10,icolor);         icolor ++;
  CreateButton("op_Exp1",1,frameX,frameY+15*11,icolor);        icolor ++;
  CreateButton("op_Exp2",1,frameX,frameY+15*12,icolor);        icolor ++;

  frameX += 150;
// non modifiables dans cette page **
  CreateButton("OScript",1,frameX,frameY,icolor);              icolor ++;
  CreateButton("ShowAll",1,frameX,frameY+15,icolor);           icolor ++;
  CreateButton("Show_EA",1,frameX,frameY+15*3,icolor);         icolor ++;
  CreateButton("Op_Show",1,frameX,frameY+15*4,icolor);         icolor ++;
  CreateButton("Op_ShwB",1,frameX,frameY+15*5,icolor);         icolor ++;
  CreateButton("Op_HiLo",1,frameX,frameY+15*7,icolor);         icolor ++;
  CreateButton("Op_DDw",1,frameX,frameY+15*8,icolor);          icolor ++;
  CreateButton("Op_DDw2",1,frameX,frameY+15*9,icolor);         icolor ++;
  CreateButton("Op_DDw3",1,frameX,frameY+15*10,icolor);        icolor ++;

  frameX += 150;
  CreateButton("RateOC1",1,frameX,frameY,icolor);              icolor ++;
  CreateButton("RateOC2",1,frameX,frameY+15,icolor);           icolor ++;
  CreateButton("RateOC3",1,frameX,frameY+15*2,icolor);         icolor ++;
  CreateButton("RateOC4",1,frameX,frameY+15*3,icolor);

  CreateButton("Default (0)",1,frameX,frameY+15*5,-2);
  CreateButton("Default (1)",1,frameX,frameY+15*6,-3);
  CreateButton("Default (5)",1,frameX,frameY+15*8,-4);
  CreateButton("Default (5b)",1,frameX,frameY+15*9,-5);
//  CreateButton("Default (6)",1,frameX,frameY+15*10,-6);   // identique
  CreateButton("Default (6b)",1,frameX,frameY+15*10,-7);
  CreateButton("Default EA1",1,frameX,frameY+15*12,-8);
  CreateButton("Default EA2",1,frameX,frameY+15*13,-9);

  CreateButton(Op_1xBl? "(x)": "(->)",   0,   130,   frameY, -2);
  if (! Op_1xBl) CreateButton("DESACTIVE !", 1, 40, 300, -1);
  if (init1_6) CreateButton("-> EA options init1 !", 1, 40, 300, -8);
  if (init1_7) CreateButton("-> EA Op_Liq2 - 4 !", 1, 40, 300, -9);
  return; }

void Options_List_() { ObjectsDelete(0);
  if (GlobalVariableCheck("Op_1xBl")) Op_1xBl = GlobalVariableGet("Op_1xBl");

  int icolor=0;
  CreateButton("Op_Case01",1,frameX,frameY,icolor);            icolor ++;
  CreateButton("Op_Case02",1,frameX,frameY+15,icolor);         icolor ++;
  CreateButton("Op_Case03",1,frameX,frameY+15*2,icolor);       icolor ++;
  CreateButton("Op_Case11",1,frameX,frameY+15*3,icolor);       icolor ++;
  CreateButton("Op_Case12",1,frameX,frameY+15*4,icolor);       icolor ++;
  CreateButton("Op_Case13",1,frameX,frameY+15*5,icolor);       icolor ++;
  CreateButton("Op_Case21",1,frameX,frameY+15*6,icolor);       icolor ++;
  CreateButton("Op_Case22",1,frameX,frameY+15*7,icolor);       icolor ++;
  CreateButton("Op_Case23",1,frameX,frameY+15*8,icolor);       icolor ++;
  CreateButton("op_Case24",1,frameX,frameY+15*9,icolor);       icolor ++;  // "op" non "Op" car option de calcul
  CreateButton("Op_Case25",1,frameX,frameY+15*10,icolor);      icolor ++;
  CreateButton("Op_Case26",1,frameX,frameY+15*11,icolor);      icolor ++;

  frameX += 150;
  CreateButton("op_20p1",1,frameX,frameY,icolor);              icolor ++;
  CreateButton("op_20p2",1,frameX,frameY+15,icolor);           icolor ++;
  CreateButton("op_20p3",1,frameX,frameY+15*2,icolor);         icolor ++;
  CreateButton("op_20p4",1,frameX,frameY+15*3,icolor);         icolor ++;
  CreateButton("op_20p5",1,frameX,frameY+15*4,icolor);         icolor ++;
  CreateButton("op_20p6",1,frameX,frameY+15*5,icolor);         icolor ++;
  CreateButton("op_20p7",1,frameX,frameY+15*6,icolor);         icolor ++;
  CreateButton("op_30p1",1,frameX,frameY+15*8,icolor);         icolor ++;
  CreateButton("op_30p2",1,frameX,frameY+15*9,icolor);         icolor ++;
  CreateButton("op_75p1",1,frameX,frameY+15*10,icolor);        icolor ++;

  frameX += 150;
  CreateButton("op_OHL",1,frameX,frameY,icolor);               icolor ++;  // attention ici c'est en fait Op_OHL
  CreateButton("op_HAp1",1,frameX,frameY+15*2,icolor);         icolor ++;
  CreateButton("op_HAp2",1,frameX,frameY+15*3,icolor);         icolor ++;
  CreateButton("op_HAp3",1,frameX,frameY+15*4,icolor);         icolor ++;
  CreateButton("H_A_Opt",1,frameX,frameY+15*6,icolor);         icolor ++;
  CreateButton("H_A_Buff",1,frameX,frameY+15*7,icolor);        icolor ++;
  CreateButton("H_A_Prev",1,frameX,frameY+15*8,icolor);        icolor ++;
  CreateButton("Op_2xBl",1,frameX,frameY+15*10,icolor);        icolor ++;

  frameX += 150;
  CreateButton("2liq-Error",1,frameX,frameY,icolor);           icolor ++;
  CreateButton("2liq-Sol1",1,frameX,frameY+15,icolor);         icolor ++;
  CreateButton("2liq-Sol2",1,frameX,frameY+15*2,icolor);       icolor ++;
  CreateButton("2liq-Sol3",1,frameX,frameY+15*3,icolor);       icolor ++;
  CreateButton("Op_Liq2",1,frameX,frameY+15*4,icolor);         icolor ++;
  CreateButton("Op_Liq3",1,frameX,frameY+15*5,icolor);         icolor ++;
  CreateButton("Op_Liq4",1,frameX,frameY+15*6,icolor);         icolor ++;

  CreateButton("op_HiLo",1,frameX,frameY+15*7,icolor);         icolor ++;
  CreateButton("op_HiLo1",1,frameX,frameY+15*8,icolor);        icolor ++;
  CreateButton("op_HiLo2",1,frameX,frameY+15*9,icolor);        icolor ++;
  CreateButton("op_Exp",1,frameX,frameY+15*10,icolor);         icolor ++;
  CreateButton("op_Exp1",1,frameX,frameY+15*11,icolor);        icolor ++;
  CreateButton("op_Exp2",1,frameX,frameY+15*12,icolor);        icolor ++;

  frameX += 150;
// non modifiables dans cette page **
  CreateButton("OScript",1,frameX,frameY,icolor);              icolor ++;
  CreateButton("ShowAll",1,frameX,frameY+15,icolor);           icolor ++;
  CreateButton("Show_EA",1,frameX,frameY+15*3,icolor);         icolor ++;
  CreateButton("Op_Show",1,frameX,frameY+15*4,icolor);         icolor ++;
  CreateButton("Op_ShwB",1,frameX,frameY+15*5,icolor);         icolor ++;
  CreateButton("Op_HiLo",1,frameX,frameY+15*7,icolor);         icolor ++;
  CreateButton("Op_DDw",1,frameX,frameY+15*8,icolor);          icolor ++;
  CreateButton("Op_DDw2",1,frameX,frameY+15*9,icolor);         icolor ++;
  CreateButton("Op_DDw3",1,frameX,frameY+15*10,icolor);        icolor ++;

  frameX += 150;
  CreateButton("RateOC1",1,frameX,frameY,icolor);              icolor ++;
  CreateButton("RateOC2",1,frameX,frameY+15,icolor);           icolor ++;
  CreateButton("RateOC3",1,frameX,frameY+15*2,icolor);         icolor ++;
  CreateButton("RateOC4",1,frameX,frameY+15*3,icolor);

  CreateButton("Default (0)",1,frameX,frameY+15*5,-2);
  CreateButton("Default (1)",1,frameX,frameY+15*6,-3);
  CreateButton("Default (5)",1,frameX,frameY+15*8,-4);
  CreateButton("Default (5b)",1,frameX,frameY+15*9,-5);
//  CreateButton("Default (6)",1,frameX,frameY+15*10,-6);   // identique
  CreateButton("Default (6b)",1,frameX,frameY+15*10,-7);
  CreateButton("Default EA1",1,frameX,frameY+15*12,-8);
  CreateButton("Default EA2",1,frameX,frameY+15*13,-9);

  CreateButton(Op_1xBl? "(x)": "(->)", 0, 130, frameY, -2);
  if (! Op_1xBl) CreateButton("DESACTIVE !", 1, 40, 300, -1);
  return; }

void CreateButton(string vText,int Item,int mX,int mY,int Color) {   //double LinePrice,int BarNum,
   string LabelName = PREFIX+"_Label_"+StringSubstr(vText,0,13);     bool tst=false;
   ObjectCreate(LabelName,OBJ_LABEL,0,0,0);              int vX, vY, icolor=0;
//   if (BarNum && LinePrice) ChartTimePriceToXY(0,0,Time[BarNum],LinePrice,vX,vY);
   ObjectSet(LabelName,OBJPROP_XDISTANCE,mX? mX: vX);
   ObjectSet(LabelName,OBJPROP_YDISTANCE,mY? mY: vY);
   ObjectSet(LabelName,OBJPROP_CORNER,CORNER_LEFT_UPPER);
   ObjectSet(LabelName,OBJPROP_ANCHOR,ANCHOR_LEFT);
   ObjectSetString(0,LabelName,OBJPROP_TEXT,vText);
   ObjectSet(LabelName,OBJPROP_FONTSIZE, Item? 11: 10);
   if (Color == icolor && op_case01) { Color = Op_1xBl? clrSkyBlue: clrLightGray;  tst = true; }   icolor ++;
   if (Color == icolor && op_case02) { Color = Op_1xBl? clrSkyBlue: clrLightGray;  tst = true; }   icolor ++;
   if (Color == icolor && op_case03) { Color = Op_1xBl? clrSkyBlue: clrLightGray;  tst = true; }   icolor ++;
   if (Color == icolor && op_case11) { Color = Op_1xBl? clrSkyBlue: clrLightGray;  tst = true; }   icolor ++;
   if (Color == icolor && op_case12) { Color = Op_1xBl? clrSkyBlue: clrLightGray;  tst = true; }   icolor ++;
   if (Color == icolor && op_case13) { Color = Op_1xBl? clrSkyBlue: clrLightGray;  tst = true; }   icolor ++;
   if (Color == icolor && op_case21) { Color = Op_1xBl? clrSkyBlue: clrLightGray;  tst = true; }   icolor ++;
   if (Color == icolor && op_case22) { Color = Op_1xBl? clrSkyBlue: clrLightGray;  tst = true; }   icolor ++;
   if (Color == icolor && op_case23) { Color = Op_1xBl? clrSkyBlue: clrLightGray;  tst = true; }   icolor ++;
   if (Color == icolor && op_case24) { Color = Op_1xBl? clrSkyBlue: clrLightGray;  tst = true; }   icolor ++;
   if (Color == icolor && op_case25) { Color = Op_1xBl? clrSkyBlue: clrLightGray;  tst = true; }   icolor ++;
   if (Color == icolor && op_case26) { Color = Op_1xBl? clrSkyBlue: clrLightGray;  tst = true; }   icolor ++;
   if (Color == icolor && op_20p1) { Color = Op_1xBl? clrSkyBlue: clrLightGray;    tst = true; }   icolor ++;
   if (Color == icolor && op_20p2) { Color = Op_1xBl? clrSkyBlue: clrLightGray;    tst = true; }   icolor ++;
   if (Color == icolor && op_20p3) { Color = Op_1xBl? clrSkyBlue: clrLightGray;    tst = true; }   icolor ++;
   if (Color == icolor && op_20p4) { Color = Op_1xBl? clrSkyBlue: clrLightGray;    tst = true; }   icolor ++;
   if (Color == icolor && op_20p5) { Color = Op_1xBl? clrSkyBlue: clrLightGray;    tst = true; }   icolor ++;
   if (Color == icolor && op_20p6) { Color = Op_1xBl? clrSkyBlue: clrLightGray;    tst = true; }   icolor ++;
   if (Color == icolor && op_20p7) { Color = Op_1xBl? clrSkyBlue: clrLightGray;    tst = true; }   icolor ++;
   if (Color == icolor && op_30p1) { Color = Op_1xBl? clrSkyBlue: clrLightGray;    tst = true; }   icolor ++;
   if (Color == icolor && op_30p2) { Color = Op_1xBl? clrSkyBlue: clrLightGray;    tst = true; }   icolor ++;
   if (Color == icolor && op_75p1) { Color = Op_1xBl? clrSkyBlue: clrLightGray;    tst = true; }   icolor ++;
   if (Color == icolor && Op_OHL) { Color = Op_1xBl? clrSkyBlue: clrLightGray;     tst = true; }   icolor ++;
   if (Color == icolor && op_hap1) { Color = Op_1xBl? clrSkyBlue: clrLightGray;    tst = true; }   icolor ++;
   if (Color == icolor && op_hap2) { Color = Op_1xBl? clrSkyBlue: clrLightGray;    tst = true; }   icolor ++;
   if (Color == icolor && op_hap3) { Color = Op_1xBl? clrSkyBlue: clrLightGray;    tst = true; }   icolor ++;
   if (Color == icolor && ha_Opt) { Color = Op_1xBl? clrSkyBlue: clrLightGray;     tst = true; }   icolor ++;
   if (Color == icolor && ha_Buff) { Color = Op_1xBl? clrSkyBlue: clrLightGray;    tst = true; }   icolor ++;
   if (Color == icolor && ha_Prev) { Color = Op_1xBl? clrSkyBlue: clrLightGray;    tst = true; }   icolor ++;
   if (Color == icolor && Op_2xBl) { Color = Op_1xBl? clrSkyBlue: clrLightGray;    tst = true; }   icolor ++;
   if (Color == icolor && !Op_Liqu) { Color = Op_1xBl? clrSkyBlue: clrLightGray;   tst = true; }   icolor ++;
   if (Color == icolor && Op_Liqu==1) { Color = Op_1xBl? clrSkyBlue: clrLightGray; tst = true; }   icolor ++;
   if (Color == icolor && Op_Liqu==2) { Color = Op_1xBl? clrSkyBlue: clrLightGray; tst = true; }   icolor ++;
   if (Color == icolor && Op_Liqu==3) { Color = Op_1xBl? clrSkyBlue: clrLightGray; tst = true; }   icolor ++;
   if (Color == icolor && Op_Liq2) { Color = Op_1xBl? clrSkyBlue: clrLightGray;    tst = true; }   icolor ++;
   if (Color == icolor && Op_Liq3) { Color = Op_1xBl? clrSkyBlue: clrLightGray;    tst = true; }   icolor ++;
   if (Color == icolor && Op_Liq4) { Color = Op_1xBl? clrSkyBlue: clrLightGray;    tst = true; }   icolor ++;
   if (Color == icolor && op_HiLo) { Color = Op_1xBl? clrSkyBlue: clrLightGray;    tst = true; }   icolor ++;
   if (Color == icolor && op_HiLo1) { Color = Op_1xBl? clrSkyBlue: clrLightGray;   tst = true; }   icolor ++;
   if (Color == icolor && op_HiLo2) { Color = Op_1xBl? clrSkyBlue: clrLightGray;   tst = true; }   icolor ++;
   if (Color == icolor && op_Exp) { Color = Op_1xBl? clrSkyBlue: clrLightGray;     tst = true; }   icolor ++;
   if (Color == icolor && op_Exp1) { Color = Op_1xBl? clrSkyBlue: clrLightGray;    tst = true; }   icolor ++;
   if (Color == icolor && op_Exp2) { Color = Op_1xBl? clrSkyBlue: clrLightGray;    tst = true; }   icolor ++;
   if (Color == icolor && script) { Color = Op_1xBl? clrSkyBlue: clrLightGray;     tst = true; }   icolor ++;
   if (Color == icolor && show) { Color = Op_1xBl? clrSkyBlue: clrLightGray;       tst = true; }   icolor ++;
   if (Color == icolor && ea_show) { Color = Op_1xBl? clrSkyBlue: clrLightGray;    tst = true; }   icolor ++;
   if (Color == icolor && Op_Show) { Color = Op_1xBl? clrSkyBlue: clrLightGray;    tst = true; }   icolor ++;
   if (Color == icolor && Op_ShwB) { Color = Op_1xBl? clrSkyBlue: clrLightGray;    tst = true; }   icolor ++;
   if (Color == icolor && Op_HiLo) { Color = Op_1xBl? clrSkyBlue: clrLightGray;    tst = true; }   icolor ++;
   if (Color == icolor && Op_DDw) { Color = Op_1xBl? clrSkyBlue: clrLightGray;     tst = true; }   icolor ++;
   if (Color == icolor && Op_DDw2) { Color = Op_1xBl? clrSkyBlue: clrLightGray;    tst = true; }   icolor ++;
   if (Color == icolor && Op_DDw3) { Color = Op_1xBl? clrSkyBlue: clrLightGray;    tst = true; }   icolor ++;
   if (Color == icolor && rate1c) { Color = Op_1xBl? clrSkyBlue: clrLightGray;     tst = true; }   icolor ++;
   if (Color == icolor && rate2c) { Color = Op_1xBl? clrSkyBlue: clrLightGray;     tst = true; }   icolor ++;
   if (Color == icolor && rate3c) { Color = Op_1xBl? clrSkyBlue: clrLightGray;     tst = true; }   icolor ++;
   if (Color == icolor && rate4c) { Color = Op_1xBl? clrSkyBlue: clrLightGray;     tst = true; }
   if (Color < -1 && (d0Color||d1Color||d2Color||d3Color||d4Color||d5Color||d6Color||d7Color)) { tst = true;
      if (Color == -2) Color = d0Color;      if (Color == -3) Color = d1Color;
      if (Color == -4) Color = d2Color;      if (Color == -5) Color = d3Color;
      if (Color == -6) Color = d4Color;      if (Color == -7) Color = d5Color;
      if (Color == -8) Color = d6Color;      if (Color == -9) Color = d7Color; }
   ObjectSet(LabelName,OBJPROP_COLOR, Color==-1? clrOrangeRed: tst? Color: Op_1xBl? clrSilver: clrDarkGray);
   ObjectSet(LabelName,OBJPROP_SELECTABLE, true);
   ObjectSet(LabelName,OBJPROP_SELECTED, false);
   ObjectSet(LabelName,OBJPROP_HIDDEN, true);
}

void Op_Default(int init1) {     // 0 -> 0, 1 -> 1, 2 -> 5, 3 -> 5b, 4 -> 6, 5 -> 6b, 6 -> EA options init1, 7 -> EA Op_Liq2-4
   if (init1 >= 0) {
            GlobalVariableSet("RateOC1", init1==2);               GlobalVariableSet("RateOC2", false);
            GlobalVariableSet("RateOC3", init1==1||init1>=3);     GlobalVariableSet("RateOC4", false);
            GlobalVariableSet("H_A_Opt", false);                  GlobalVariableSet("Op_Liqu", init1 && init1!=3);
            GlobalVariableSet("op_HiLo", init1 && init1<=7);      GlobalVariableSet("op_30p1", init1 && init1<=7);
            GlobalVariableSet("op_20p1", init1 && init1<=7);      GlobalVariableSet("op_20p2", init1 && init1<=7);
            GlobalVariableSet("op_Exp",  init1==1);               GlobalVariableSet("Op_OHL",  init1 && init1<=7);
            GlobalVariableSet("op_20p5", init1 && init1<=7);      GlobalVariableSet("op_20p3", init1 && init1<=7);
            GlobalVariableSet("op_20p4", init1 && init1<=7);      GlobalVariableSet("op_30p2", init1 && init1<=7);
            GlobalVariableSet("op_75p1", init1 && init1<=7);      GlobalVariableSet("op_Exp1", init1==1);
            GlobalVariableSet("op_HiLo1", init1 && init1<=7);     GlobalVariableSet("op_20p6", init1 && init1<=7);
            GlobalVariableSet("op_Exp2", init1==1);               GlobalVariableSet("op_HiLo2", init1 && init1<=7);
            GlobalVariableSet("op_20p7", init1 && init1<=7);      GlobalVariableSet("Op_Liq2", init1==7);
            GlobalVariableSet("Op_Liq3", false);                  GlobalVariableSet("Op_Liq4", init1==7);
            GlobalVariableSet("op_HAp1", false);                  GlobalVariableSet("op_HAp2", false);
            GlobalVariableSet("op_HAp3", false);                  GlobalVariableSet("H_A_Buff", false);  // penser à H_A_Opt=1 + H_A_Buff=0
            GlobalVariableSet("H_A_Prev", false);                 GlobalVariableSet("Op_2xBl", init1==1);
            GlobalVariableSet("Op_Case01", init1 && init1<=7);    GlobalVariableSet("Op_Case02", false);
            GlobalVariableSet("Op_Case03", false);                GlobalVariableSet("Op_Case11", init1 && init1<=7);
            GlobalVariableSet("Op_Case12", false);                GlobalVariableSet("Op_Case13", false);
            GlobalVariableSet("Op_Case21", init1==1||init1==2||init1>=6);   GlobalVariableSet("Op_Case22", false);
            GlobalVariableSet("Op_Case23", init1>=3 && init1<=5);    GlobalVariableSet("Op_Case24", false);
            GlobalVariableSet("Op_Case25", false);                GlobalVariableSet("Op_Case26", false);
            if (ObjectFind("Label_Opt_")>=0) { ObjectDelete("Label_Opt_");    ObjectDelete("Label_Opt_3"); }
            if (init1 == 6) { CreateButton("-> EA options init1 !", 1, 40, 300, -8);    init1_6 = true;   init1_7 = false; }
            else if (init1 == 7) { CreateButton("-> EA Op_Liq2 - 4 !", 1, 40, 300, -9);   init1_6 = false;  init1_7 = true; }
            else { init1_6 = false;    init1_7 = false; } }
   else {   if (init1 == -1) { GlobalVariableSet("Op_1xBl", false);
               ObjectSetString(0,PREFIX+"_Label_(x)",OBJPROP_TEXT, "(->)");
               CreateButton("DESACTIVE !", 1, 40, 300, -1); }
            if (init1 == -2) { GlobalVariableSet("Op_1xBl", true);
               ObjectSetString(0,PREFIX+"_Label_(->)",OBJPROP_TEXT, "(x)"); } }
 }

void ObjectsDelete(int P) {
   int obj_total=ObjectsTotal(), i=0, j=0;
   string name;
   for (int pos=0; pos<obj_total; pos++) {
     name = ObjectName(pos);
     if ((StringSubstr(name,0,8) == "EA_Test_" || StringSubstr(name,0,9) == "H-A_Test_")) {
         j ++;   if (ObjectDelete(name)) { i ++;  pos --; } } }
   if (P) Print (pos, " objects, DELETED: ", i, " / ", j, " / ", obj_total);
   return; }

/* ---------------------------
         ha_Opt=GlobalVariableGet("H_A_Opt");   ha_Buff=GlobalVariableGet("H_A_Buff");    Op_Liq2=GlobalVariableGet("Op_Liq2");     Op_Liq3=GlobalVariableGet("Op_Liq3");
         Op_Liq4=GlobalVariableGet("Op_Liq4");  op_hap3=GlobalVariableGet("op_HAp3");     op_case01=GlobalVariableGet("Op_Case01"); op_case02=GlobalVariableGet("Op_Case02");
         op_case03=GlobalVariableGet("Op_Case03"); op_case11=GlobalVariableGet("Op_Case11"); op_case12=GlobalVariableGet("Op_Case12"); op_case13=GlobalVariableGet("Op_Case13");
         op_case21=GlobalVariableGet("Op_Case21"); op_case22=GlobalVariableGet("Op_Case22"); op_case23=GlobalVariableGet("Op_Case23"); op_case24=GlobalVariableGet("Op_Case24");
         op_case25=GlobalVariableGet("Op_Case25"); op_case26=GlobalVariableGet("Op_Case26"); op_HiLo=GlobalVariableGet("op_HiLo");  op_HiLo1=GlobalVariableGet("op_HiLo1");
         op_HiLo2=GlobalVariableGet("op_HiLo2"); op_Exp=GlobalVariableGet("op_Exp");      op_Exp1=GlobalVariableGet("op_Exp1");     op_Exp2=GlobalVariableGet("op_Exp2");
         op_20p1=GlobalVariableGet("op_20p1");  op_20p2=GlobalVariableGet("op_20p2");     op_20p3=GlobalVariableGet("op_20p3");     op_20p4=GlobalVariableGet("op_20p4");
         op_20p5=GlobalVariableGet("op_20p5");  op_20p6=GlobalVariableGet("op_20p6");     op_20p7=GlobalVariableGet("op_20p7");     op_30p1=GlobalVariableGet("op_30p1");
         op_30p2=GlobalVariableGet("op_30p2");  op_75p1=GlobalVariableGet("op_75p1");     Op_OHL=GlobalVariableGet("Op_OHL");

   bool op_case01=GlobalVariableGet("Op_Case01"), op_case02=GlobalVariableGet("Op_Case02"), op_case03=GlobalVariableGet("Op_Case03"),
      op_case11=GlobalVariableGet("Op_Case11"), op_case12=GlobalVariableGet("Op_Case12"), op_case13=GlobalVariableGet("Op_Case13"), 
      op_case21=GlobalVariableGet("Op_Case21"), op_case22=GlobalVariableGet("Op_Case22"), op_case23=GlobalVariableGet("Op_Case23"), 
      op_case24=GlobalVariableGet("Op_Case24"), op_case25=GlobalVariableGet("Op_Case25"), op_case26=GlobalVariableGet("Op_Case26"), 
      op_HiLo = GlobalVariableGet("op_HiLo"), op_HiLo1 = GlobalVariableGet("op_HiLo1"), op_HiLo2 = GlobalVariableGet("op_HiLo2"), 
      op_Exp = GlobalVariableGet("op_Exp"), op_Exp1 = GlobalVariableGet("op_Exp1"), op_Exp2 = GlobalVariableGet("op_Exp2"), 
      op_20p1 = GlobalVariableGet("op_20p1"), op_20p2 = GlobalVariableGet("op_20p2"), op_20p3 = GlobalVariableGet("op_20p3"), 
      op_20p4 = GlobalVariableGet("op_20p4"), op_20p5 = GlobalVariableGet("op_20p5"), op_20p6 = GlobalVariableGet("op_20p6"), 
      op_20p7 = GlobalVariableGet("op_20p7"), op_30p1 = GlobalVariableGet("op_30p1"), op_30p2 = GlobalVariableGet("op_30p2"), 
      op_hap1 = GlobalVariableGet("op_HAp1"), op_hap2 = GlobalVariableGet("op_HAp2"), op_hap3 = GlobalVariableGet("op_HAp3"), 
      op_75p1 = GlobalVariableGet("op_75p1");

---------------------------
              op_case01=GlobalVariableGet("Op_Case01"); op_case02=GlobalVariableGet("Op_Case02");
         op_case03=GlobalVariableGet("Op_Case03"); op_case11=GlobalVariableGet("Op_Case11"); op_case12=GlobalVariableGet("Op_Case12"); op_case13=GlobalVariableGet("Op_Case13");
         op_case21=GlobalVariableGet("Op_Case21"); op_case22=GlobalVariableGet("Op_Case22"); op_case23=GlobalVariableGet("Op_Case23"); op_case24=GlobalVariableGet("Op_Case24");
         op_case25=GlobalVariableGet("Op_Case25"); op_case26=GlobalVariableGet("Op_Case26"); 
         op_20p1=GlobalVariableGet("op_20p1");  op_20p2=GlobalVariableGet("op_20p2");     op_20p3=GlobalVariableGet("op_20p3");     op_20p4=GlobalVariableGet("op_20p4");
         op_20p5=GlobalVariableGet("op_20p5");  op_20p6=GlobalVariableGet("op_20p6");     op_20p7=GlobalVariableGet("op_20p7");     op_30p1=GlobalVariableGet("op_30p1");
         op_30p2=GlobalVariableGet("op_30p2");  op_75p1=GlobalVariableGet("op_75p1");     Op_OHL=GlobalVariableGet("Op_OHL");

      op_hap1 = GlobalVariableGet("op_HAp1"), op_hap2 = GlobalVariableGet("op_HAp2"), op_hap3=GlobalVariableGet("op_HAp3");

  if (GlobalVariableCheck("H_A_Opt")) ha_Opt = GlobalVariableGet("H_A_Opt");
  if (GlobalVariableCheck("H_A_Buff")) ha_Buff = GlobalVariableGet("H_A_Buff");
  if (GlobalVariableCheck("Op_Liqu")) Op_Liqu = GlobalVariableGet("Op_Liqu");
  if (GlobalVariableCheck("Op_Liq2")) Op_Liq2 = GlobalVariableGet("Op_Liq2");
  if (GlobalVariableCheck("Op_Liq3")) Op_Liq3 = GlobalVariableGet("Op_Liq3");
  if (GlobalVariableCheck("Op_Liq4")) Op_Liq4 = GlobalVariableGet("Op_Liq4");

   if (GlobalVariableCheck("Op_OHL")) Op_OHL = GlobalVariableGet("Op_OHL");
   if (GlobalVariableCheck("Op_HiLo")) Op_HiLo = GlobalVariableGet("Op_HiLo");
   if (GlobalVariableCheck("Op_HiLo")) Op_HiLo = GlobalVariableGet("Op_HiLo1");
   if (GlobalVariableCheck("Op_HiLo")) Op_HiLo = GlobalVariableGet("Op_HiLo2");
   if (GlobalVariableCheck("Op_HiLo")) Op_HiLo = GlobalVariableGet("op_Exp");
   if (GlobalVariableCheck("Op_HiLo")) Op_HiLo = GlobalVariableGet("op_Exp1");
   if (GlobalVariableCheck("Op_HiLo")) Op_HiLo = GlobalVariableGet("op_Exp2");

  if (GlobalVariableCheck("ShowAll")) show = GlobalVariableGet("ShowAll");
  if (GlobalVariableCheck("Op_Show")) Op_Show = GlobalVariableGet("Op_Show");
  if (GlobalVariableCheck("OScript")) script = GlobalVariableGet("OScript");
   if (GlobalVariableCheck("Show_EA")) ea_show = GlobalVariableGet("Show_EA");
   if (GlobalVariableCheck("Op_ShwB")) Op_ShwB = GlobalVariableGet("Op_ShwB");
   if (GlobalVariableCheck("Op_Show")) Op_Show = GlobalVariableGet("Op_Show");
   if (GlobalVariableCheck("Op_DDw")) Op_DDw = GlobalVariableGet("Op_DDw");
   if (GlobalVariableCheck("Op_DDw2")) Op_DDw2 = GlobalVariableGet("Op_DDw2");
   if (GlobalVariableCheck("Op_DDw3")) Op_DDw3 = GlobalVariableGet("Op_DDw3");
  if (GlobalVariableCheck("RateOC1")) rate1c = GlobalVariableGet("RateOC1");
  if (GlobalVariableCheck("RateOC2")) rate2c = GlobalVariableGet("RateOC2");
  if (GlobalVariableCheck("RateOC3")) rate3c = GlobalVariableGet("RateOC3");
  if (GlobalVariableCheck("RateOC4")) rate4c = GlobalVariableGet("RateOC4");

---------------------------

"Op_Case01"
"Op_Case02"
"Op_Case03"
"Op_Case11"
"Op_Case12"
"Op_Case13"
"Op_Case21"
"Op_Case22"
"Op_Case23"
"Op_Case24"
"Op_Case25"
"Op_Case26" 

"op_20p1"
"op_20p2"
"op_20p3"
"op_20p4"
"op_20p5"
"op_20p6"
"op_20p7"

"op_30p1"
"op_30p2"
"op_75p1"

"Op_OHL"

"op_HAp1"
"op_HAp2"
"op_HAp3"

"H_A_Opt"
"H_A_Buff"

"Op_Liqu"
"Op_Liq2"
"Op_Liq3"
"Op_Liq4"

"Op_HiLo"
"Op_HiLo1"
"Op_HiLo2"
"op_Exp"
"op_Exp1"
"op_Exp2"

"OScript"
"ShowAll"
"Op_Show"
"Show_EA"
"Op_ShwB"
"Op_DDw"
"Op_DDw2"
"Op_DDw3"

"RateOC1"
"RateOC2"
"RateOC3"
"RateOC4"

op_case01
op_case02
op_case03
op_case11
op_case12
op_case13
op_case21
op_case22
op_case23
op_case24
op_case25
op_case26

op_20p1
op_20p2
op_20p3
op_20p4
op_20p5
op_20p6
op_20p7
op_30p1
op_30p2
op_75p1

Op_OHL
op_hap1
op_hap2
op_hap3

ha_Opt
ha_Buff

Op_Liqu
Op_Liq2
Op_Liq3
Op_Liq4

Op_HiLo
Op_HiLo1
Op_HiLo2
op_Exp
op_Exp1
op_Exp2

script
show
Op_Show
ea_show
Op_ShwB
Op_DDw
Op_DDw2
Op_DDw3

rate1c
rate2c
rate3c
rate4c */

void copy_file(int Item, string tmp) { int handle;
   string filename="EA-write-file_Liste-Trades"+(Item?"("+IntegerToString(Item+1)+")":"")+".txt";
   if (!FileIsExist(filename)) handle = FileOpen (filename,FILE_TXT|FILE_WRITE);
   else   handle = FileOpen (filename,FILE_TXT|FILE_READ|FILE_WRITE);
   if (handle != INVALID_HANDLE) {
       if (FileSize(handle)) FileSeek(handle, FileSize(handle), 0);
       FileWrite(handle, tmp); }
//   else Print ("Problème : handle == INVALID_HANDLE. (2) / "+vSymbol+" ***");
   FileClose(handle); }
