/*
   Generated by EX4-TO-MQ4 decompiler V4.0.220.2c []
   Website: http://purebeam.biz
   E-mail : purebeam@gmail.com
*/
#property copyright ""
#property link      ""
extern string Les_ForceClose ="99 et 99 pour defaut, sinon rentrer";
extern double ForceCloseTodayH  =99;
extern double ForceCloseTodayM  =99;
color v_color=Aqua; 
color v_color2=Lime; 

string ForceCloseToday="";
string tempstringH="0";
string tempstringM="0"; 

int init() {
}

int start() {
   //PrintLNbig ("Equity : " + DoubleToStr(AccountEquity(), 1)+"      ForceCloseToday : "+ForceCloseToday, Lime, 0,  0, 10); //le dernier chiffre décalage
   PrintLNbig ("Equity : " + DoubleToStr(AccountEquity(), 1), Lime, 0,  0, 10); //le dernier chiffre décalage
   
 
   if (ForceCloseTodayH<10) {tempstringH="0"+DoubleToStr(ForceCloseTodayH,0);} else {tempstringH=DoubleToStr(ForceCloseTodayH,0);}
   if (ForceCloseTodayM<10) {tempstringM="0"+DoubleToStr(ForceCloseTodayM,0);} else {tempstringM=DoubleToStr(ForceCloseTodayM,0);}
   ForceCloseToday=tempstringH+":"+tempstringM;

   v_color2=Lime; if (ForceCloseToday!="99:99") v_color2=Red;
   //PrintLNbig10 ("ForceCloseToday : "+ForceCloseToday, v_color2, 0,  0, 280); 
   PrintLNbig2("floating :  " + DoubleToStr(AccountProfit(), 1), Orange, 0,  2.5, 10); 
   PrintLNbig3("Balance  :  " + DoubleToStr(AccountBalance(), 1), OrangeRed, 0,  4.5, 10); 

/*
   v_color=Orange; if (Riskcoef_Global<1) v_color=YellowGreen; if (Riskcoef_Global<0.8) v_color=Green; if (Riskcoef_Global>1) v_color=Red;if (Riskcoef_Global>=1.2) v_color=MediumVioletRed;
   PrintLNbig4("Riskcoef  : " + DoubleToStr(Riskcoef_Global, 2), v_color, 0,  7, 10); //le dernier chiffre décalage
 
   v_color=Orange; if (Riskcoef_Apollo<1) v_color=YellowGreen; if (Riskcoef_Apollo<0.8) v_color=Green; if (Riskcoef_Apollo>1) v_color=Red;if (Riskcoef_Apollo>=1.2) v_color=MediumVioletRed;
   PrintLNbig5("Apollo   : " + DoubleToStr(Riskcoef_Apollo, 2), v_color, 0,  9, 10); //le dernier chiffre décalage
   
   v_color=Orange; if (Riskcoef_Generic<1) v_color=YellowGreen; if (Riskcoef_Generic<0.8) v_color=Green; if (Riskcoef_Generic>1) v_color=Red;if (Riskcoef_Generic>=1.2) v_color=MediumVioletRed;
   PrintLNbig6("Generic  : " + DoubleToStr(Riskcoef_Generic, 2), v_color, 0,  10, 10); //le dernier chiffre décalage
   v_color=Orange; if (Riskcoef_GenericD<1) v_color=YellowGreen; if (Riskcoef_GenericD<0.8) v_color=Green; if (Riskcoef_GenericD>1) v_color=Red;if (Riskcoef_GenericD>=1.2) v_color=MediumVioletRed;
   PrintLNbig6b("GenericD : " + DoubleToStr(Riskcoef_GenericD, 2), v_color, 0,  11, 10); //le dernier chiffre décalage
   
   v_color=Orange; if (Riskcoef_Xialong<1) v_color=YellowGreen; if (Riskcoef_Xialong<0.8) v_color=Green; if (Riskcoef_Xialong>1) v_color=Red;if (Riskcoef_Xialong>=1.2) v_color=MediumVioletRed;
   PrintLNbig7("Xialong  : " + DoubleToStr(Riskcoef_Xialong, 2), v_color, 0,  12, 10); //le dernier chiffre décalage
   v_color=Orange; if (Riskcoef_XialongM2<1) v_color=YellowGreen; if (Riskcoef_XialongM2<0.8) v_color=Green; if (Riskcoef_XialongM2>1) v_color=Red;if (Riskcoef_XialongM2>=1.2) v_color=MediumVioletRed;
   PrintLNbig7b("XialongM2: " + DoubleToStr(Riskcoef_XialongM2, 2), v_color, 0,  13, 10); //le dernier chiffre décalage
   
   v_color=Orange; if (Riskcoef_XXlong<1) v_color=YellowGreen; if (Riskcoef_XXlong<0.8) v_color=Green; if (Riskcoef_XXlong>1) v_color=Red;if (Riskcoef_XXlong>=1.2) v_color=MediumVioletRed;
   PrintLNbig8("XXlong   : " + DoubleToStr(Riskcoef_XXlong, 2), v_color, 0,  14, 10); //le dernier chiffre décalage
   
   v_color=Orange; if (Riskcoef_Lilie<1) v_color=YellowGreen; if (Riskcoef_Lilie<0.8) v_color=Green; if (Riskcoef_Lilie>1) v_color=Red;if (Riskcoef_Lilie>=1.2) v_color=MediumVioletRed;
   PrintLNbig9("Lilie    : " + DoubleToStr(Riskcoef_Lilie, 2), v_color, 0,  15, 10); //le dernier chiffre décalage
  */ 
   string strStartMinute;
 /*
   strStartMinute=DoubleToStr(Start_OTH_M, 0);
     if (Start_OTH_M<10) {strStartMinute="0"+DoubleToStr(Start_OTH_M, 0);}
      PrintLNbig11 ("start OTH: "+DoubleToStr(Start_OTH_H,0)+":"+strStartMinute, Red, 0,  1, 280); 
   strStartMinute=DoubleToStr(Start_GBP_M, 0);
      if (Start_GBP_M<10) {strStartMinute="0"+DoubleToStr(Start_GBP_M, 0);}
      PrintLNbig12 ("start GBP: "+DoubleToStr(Start_GBP_H,0)+":"+strStartMinute, Red, 0,  2, 280); 
   strStartMinute=DoubleToStr(Start_JPY_M, 0);
      if (Start_JPY_M<10) {strStartMinute="0"+DoubleToStr(Start_JPY_M, 0);}
      PrintLNbig13 ("start JPY: "+DoubleToStr(Start_JPY_H,0)+":"+strStartMinute, Red, 0,  3, 280); 
   strStartMinute=DoubleToStr(Start_CAD_M, 0);
      if (Start_CAD_M<10) {strStartMinute="0"+DoubleToStr(Start_CAD_M, 0);}
      PrintLNbig14 ("start CAD: "+DoubleToStr(Start_CAD_H,0)+":"+strStartMinute, Red, 0,  4, 280); 
*/

GlobalVariableSet( "vGrafBalance", AccountBalance() );
GlobalVariableSet( "vGrafEquity" , AccountEquity () );
GlobalVariableSet( "vGrafMargin" , AccountFreeMargin () );

// calcul total lots
double TotalLots=0;
for(int cnt=OrdersTotal()-1;cnt>=0;cnt--)
        {
         OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
         TotalLots=TotalLots+ OrderLots();
         }
GlobalVariableSet( "vGrafTotalLots" , TotalLots);







} 
          
      
 
void PrintLNbig(string a_text_0, color a_color_8 = -1, int ai_12 = -1, double ad_16 = -1.0, int ai_24 = 0) {
   if (ai_12 == -1) ai_12 = 0;
   if (ad_16 == -1.0) ad_16 = 0;
   string str1 = "mystring";
   if (ObjectFind(str1) != 0) {
      ObjectCreate(str1, OBJ_LABEL, 0, 0, 0);
      ObjectSet(str1, OBJPROP_CORNER, 0);
   }
   ObjectSetText(str1, a_text_0, 20, "Quartz", a_color_8);
   ObjectSet(str1, OBJPROP_XDISTANCE, 0 + ai_24);
   ObjectSet(str1, OBJPROP_YDISTANCE, 0 + 14.0 * ad_16);
}
void PrintLNbig2(string a_text_0, color a_color_8 = -1, int ai_12 = -1, double ad_16 = -1.0, int ai_24 = 0) {
   if (ai_12 == -1) ai_12 = 0;
   if (ad_16 == -1.0) ad_16 = 0;
   string str2 = "mystring2";
   if (ObjectFind(str2) != 0) {
      ObjectCreate(str2, OBJ_LABEL, 0, 0, 0);
      ObjectSet(str2, OBJPROP_CORNER, 0);
   }
   ObjectSetText(str2, a_text_0, 16, "Quartz", a_color_8);
   ObjectSet(str2, OBJPROP_XDISTANCE, 0 + ai_24);
   ObjectSet(str2, OBJPROP_YDISTANCE, 0 + 14.0 * ad_16);
}
void PrintLNbig3(string a_text_0, color a_color_8 = -1, int ai_12 = -1, double ad_16 = -1.0, int ai_24 = 0) {
   if (ai_12 == -1) ai_12 = 0;
   if (ad_16 == -1.0) ad_16 = 0;
   string str3 = "mystring3";
   if (ObjectFind(str3) != 0) {
      ObjectCreate(str3, OBJ_LABEL, 0, 0, 0);
      ObjectSet(str3, OBJPROP_CORNER, 0);
   }
   ObjectSetText(str3, a_text_0, 16, "Quartz", a_color_8);
   ObjectSet(str3, OBJPROP_XDISTANCE, 0 + ai_24);
   ObjectSet(str3, OBJPROP_YDISTANCE, 0 + 14.0 * ad_16);
}
void PrintLNbig4(string a_text_0, color a_color_8 = -1, int ai_12 = -1, double ad_16 = -1.0, int ai_24 = 0) {
   if (ai_12 == -1) ai_12 = 0;
   if (ad_16 == -1.0) ad_16 = 0;
   string str4 = "mystring4";
   if (ObjectFind(str4) != 0) {
      ObjectCreate(str4, OBJ_LABEL, 0, 0, 0);
      ObjectSet(str4, OBJPROP_CORNER, 0);
   }
   ObjectSetText(str4, a_text_0, 15, "Quartz", a_color_8);
   ObjectSet(str4, OBJPROP_XDISTANCE, 0 + ai_24);
   ObjectSet(str4, OBJPROP_YDISTANCE, 0 + 14.0 * ad_16);
}


void PrintLNbig5(string a_text_0, color a_color_8 = -1, int ai_12 = -1, double ad_16 = -1.0, int ai_24 = 0) {
   if (ai_12 == -1) ai_12 = 0;
   if (ad_16 == -1.0) ad_16 = 0;
   string str5 = "mystring5";
   if (ObjectFind(str5) != 0) {
      ObjectCreate(str5, OBJ_LABEL, 0, 0, 0);
      ObjectSet(str5, OBJPROP_CORNER, 0);
   }
   ObjectSetText(str5, a_text_0, 15, "Quartz", a_color_8);
   ObjectSet(str5, OBJPROP_XDISTANCE, 0 + ai_24);
   ObjectSet(str5, OBJPROP_YDISTANCE, 0 + 14.0 * ad_16);
}
void PrintLNbig6(string a_text_0, color a_color_8 = -1, int ai_12 = -1, double ad_16 = -1.0, int ai_24 = 0) {
   if (ai_12 == -1) ai_12 = 0;
   if (ad_16 == -1.0) ad_16 = 0;
   string str6 = "mystring6";
   if (ObjectFind(str6) != 0) {
      ObjectCreate(str6, OBJ_LABEL, 0, 0, 0);
      ObjectSet(str6, OBJPROP_CORNER, 0);
   }
   ObjectSetText(str6, a_text_0, 15, "Quartz", a_color_8);
   ObjectSet(str6, OBJPROP_XDISTANCE, 0 + ai_24);
   ObjectSet(str6, OBJPROP_YDISTANCE, 0 + 14.0 * ad_16);
}
void PrintLNbig6b(string a_text_0, color a_color_8 = -1, int ai_12 = -1, double ad_16 = -1.0, int ai_24 = 0) {
   if (ai_12 == -1) ai_12 = 0;
   if (ad_16 == -1.0) ad_16 = 0;
   string str6b = "mystring6b";
   if (ObjectFind(str6b) != 0) {
      ObjectCreate(str6b, OBJ_LABEL, 0, 0, 0);
      ObjectSet(str6b, OBJPROP_CORNER, 0);
   }
   ObjectSetText(str6b, a_text_0, 15, "Quartz", a_color_8);
   ObjectSet(str6b, OBJPROP_XDISTANCE, 0 + ai_24);
   ObjectSet(str6b, OBJPROP_YDISTANCE, 0 + 14.0 * ad_16);
}

void PrintLNbig7(string a_text_0, color a_color_8 = -1, int ai_12 = -1, double ad_16 = -1.0, int ai_24 = 0) {
   if (ai_12 == -1) ai_12 = 0;
   if (ad_16 == -1.0) ad_16 = 0;
   string str7 = "mystring7";
   if (ObjectFind(str7) != 0) {
      ObjectCreate(str7, OBJ_LABEL, 0, 0, 0);
      ObjectSet(str7, OBJPROP_CORNER, 0);
   }
   ObjectSetText(str7, a_text_0, 15, "Quartz", a_color_8);
   ObjectSet(str7, OBJPROP_XDISTANCE, 0 + ai_24);
   ObjectSet(str7, OBJPROP_YDISTANCE, 0 + 14.0 * ad_16);
}
void PrintLNbig7b(string a_text_0, color a_color_8 = -1, int ai_12 = -1, double ad_16 = -1.0, int ai_24 = 0) {
   if (ai_12 == -1) ai_12 = 0;
   if (ad_16 == -1.0) ad_16 = 0;
   string str7b = "mystring7b";
   if (ObjectFind(str7b) != 0) {
      ObjectCreate(str7b, OBJ_LABEL, 0, 0, 0);
      ObjectSet(str7b, OBJPROP_CORNER, 0);
   }
   ObjectSetText(str7b, a_text_0, 15, "Quartz", a_color_8);
   ObjectSet(str7b, OBJPROP_XDISTANCE, 0 + ai_24);
   ObjectSet(str7b, OBJPROP_YDISTANCE, 0 + 14.0 * ad_16);
}
void PrintLNbig8(string a_text_0, color a_color_8 = -1, int ai_12 = -1, double ad_16 = -1.0, int ai_24 = 0) {
   if (ai_12 == -1) ai_12 = 0;
   if (ad_16 == -1.0) ad_16 = 0;
   string str8 = "mystring8";
   if (ObjectFind(str8) != 0) {
      ObjectCreate(str8, OBJ_LABEL, 0, 0, 0);
      ObjectSet(str8, OBJPROP_CORNER, 0);
   }
   ObjectSetText(str8, a_text_0, 15, "Quartz", a_color_8);
   ObjectSet(str8, OBJPROP_XDISTANCE, 0 + ai_24);
   ObjectSet(str8, OBJPROP_YDISTANCE, 0 + 14.0 * ad_16);
}
void PrintLNbig9(string a_text_0, color a_color_8 = -1, int ai_12 = -1, double ad_16 = -1.0, int ai_24 = 0) {
   if (ai_12 == -1) ai_12 = 0;
   if (ad_16 == -1.0) ad_16 = 0;
   string str9 = "mystring9";
   if (ObjectFind(str9) != 0) {
      ObjectCreate(str9, OBJ_LABEL, 0, 0, 0);
      ObjectSet(str9, OBJPROP_CORNER, 0);
   }
   ObjectSetText(str9, a_text_0, 15, "Quartz", a_color_8);
   ObjectSet(str9, OBJPROP_XDISTANCE, 0 + ai_24);
   ObjectSet(str9, OBJPROP_YDISTANCE, 0 + 14.0 * ad_16);
}
void PrintLNbig10(string a_text_0, color a_color_8 = -1, int ai_12 = -1, double ad_16 = -1.0, int ai_24 = 0) {
   if (ai_12 == -1) ai_12 = 0;
   if (ad_16 == -1.0) ad_16 = 0;
   string str10 = "mystring10";
   if (ObjectFind(str10) != 0) {
      ObjectCreate(str10, OBJ_LABEL, 0, 0, 0);
      ObjectSet(str10, OBJPROP_CORNER, 0);
   }
   ObjectSetText(str10, a_text_0, 15, "Quartz", a_color_8);
   ObjectSet(str10, OBJPROP_XDISTANCE, 0 + ai_24);
   ObjectSet(str10, OBJPROP_YDISTANCE, 0 + 14.0 * ad_16);
}
void PrintLNbig11(string a_text_0, color a_color_8 = -1, int ai_12 = -1, double ad_16 = -1.0, int ai_24 = 0) {
   if (ai_12 == -1) ai_12 = 0;
   if (ad_16 == -1.0) ad_16 = 0;
   string str11 = "mystring11";
   if (ObjectFind(str11) != 0) {
      ObjectCreate(str11, OBJ_LABEL, 0, 0, 0);
      ObjectSet(str11, OBJPROP_CORNER, 0);
   }
   ObjectSetText(str11, a_text_0, 15, "Quartz", a_color_8);
   ObjectSet(str11, OBJPROP_XDISTANCE, 0 + ai_24);
   ObjectSet(str11, OBJPROP_YDISTANCE, 0 + 14.0 * ad_16);
}
void PrintLNbig12(string a_text_0, color a_color_8 = -1, int ai_12 = -1, double ad_16 = -1.0, int ai_24 = 0) {
   if (ai_12 == -1) ai_12 = 0;
   if (ad_16 == -1.0) ad_16 = 0;
   string str12 = "mystring12";
   if (ObjectFind(str12) != 0) {
      ObjectCreate(str12, OBJ_LABEL, 0, 0, 0);
      ObjectSet(str12, OBJPROP_CORNER, 0);
   }
   ObjectSetText(str12, a_text_0, 15, "Quartz", a_color_8);
   ObjectSet(str12, OBJPROP_XDISTANCE, 0 + ai_24);
   ObjectSet(str12, OBJPROP_YDISTANCE, 0 + 14.0 * ad_16);
}
void PrintLNbig13(string a_text_0, color a_color_8 = -1, int ai_12 = -1, double ad_16 = -1.0, int ai_24 = 0) {
   if (ai_12 == -1) ai_12 = 0;
   if (ad_16 == -1.0) ad_16 = 0;
   string str13 = "mystring13";
   if (ObjectFind(str13) != 0) {
      ObjectCreate(str13, OBJ_LABEL, 0, 0, 0);
      ObjectSet(str13, OBJPROP_CORNER, 0);
   }
   ObjectSetText(str13, a_text_0, 15, "Quartz", a_color_8);
   ObjectSet(str13, OBJPROP_XDISTANCE, 0 + ai_24);
   ObjectSet(str13, OBJPROP_YDISTANCE, 0 + 14.0 * ad_16);
}
void PrintLNbig14(string a_text_0, color a_color_8 = -1, int ai_12 = -1, double ad_16 = -1.0, int ai_24 = 0) {
   if (ai_12 == -1) ai_12 = 0;
   if (ad_16 == -1.0) ad_16 = 0;
   string str14 = "mystring14";
   if (ObjectFind(str14) != 0) {
      ObjectCreate(str14, OBJ_LABEL, 0, 0, 0);
      ObjectSet(str14, OBJPROP_CORNER, 0);
   }
   ObjectSetText(str14, a_text_0, 15, "Quartz", a_color_8);
   ObjectSet(str14, OBJPROP_XDISTANCE, 0 + ai_24);
   ObjectSet(str14, OBJPROP_YDISTANCE, 0 + 14.0 * ad_16);
}

