//+------------------------------------------------------------------+
//|                                                  Signal_Bars.mq4 |
//|                      Copyright © 2006, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
//|                                                  InfoTrade5D.mq4 |
//|                          Actualizaciones: Dic 2009 - MasterWhite | 
//|                            contacto: rubendieminger@arnet.com.ar | 
//|                              http://analizandoForex.blogspot.com | 
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"
#property indicator_chart_window

extern string configuracion            = "-----Multidisplay config";
extern bool   See_in_Right_corner      = true;
extern bool   See_Price                = true;
extern bool   See_Details              = true;
extern bool   See_HiLowPriceSignal     = true;
string        IndicatorTitle           = "InfoTrade 5Dec";
string        GblName                  = "";
extern color  color_CandelTime         = White;
extern int    NoSeeTimesBiggerThan     = 240;
int m,s,k;
double s1[];


int Shift = 0; 
string SSignalMACDH1,SSignalMACDH4,SSignalMACDM1, SSignalMACDM5,SSignalMACDM15,SSignalMACDM30;   
color  colMACDH1,colMACDH4,colMACDM1,colMACDM5,colMACDM15,colMACDM30;  
color  color_signal,color_m1,color_m5,color_m15,color_m30,color_m60,color_m240;
string M1_EMA,M5_EMA, M15_EMA, M30_EMA, H1_EMA, H4_EMA,PRC1;
color  color_EMAm1,color_EMAm5,color_EMAm15,color_EMAm30,color_EMAm60,color_EMAm240;             
string HI,LO,SPREAD,PIPS,DAV,HILO,PRC,Pips,Av,AV_Yest;
string STR_m1,STR_m5,STR_m15,STR_m30,STR_h1,STR_h4,STR_d1,STR_w1;

color color_pip,color_av;
int MoverAnexos=0;

// BlackBox --------------------------
int g_window_176 = 0;
int g_x_656 = 1;
int g_y_660 = 1;
extern color Chart_Color = C'0x23,0x23,0x23';


int BorrarObjetos()
{
   ObjectDelete("Rewrited_by_MasterWhite");
   ObjectDelete("Numbers");
   ObjectDelete("SSignalMACDM1t");
   ObjectDelete("SSignalMACDM1");
   ObjectDelete("SSignalMACDM5");
   ObjectDelete("SSignalMACDM15");
   ObjectDelete("SSignalMACDM30");           
   ObjectDelete("SSignalMACDH1");
   ObjectDelete("SSignalMACDH4");
   ObjectDelete("SeñalSTRM1t");
   ObjectDelete("SeñalSTRM1");
   ObjectDelete("SeñalSTRM5");
   ObjectDelete("SeñalSTRM15");
   ObjectDelete("SeñalSTRM30");
   ObjectDelete("SeñalSTRM60");
   ObjectDelete("SeñalSTRM240");
   ObjectDelete("SeñalEMAM1t");
   ObjectDelete("SeñalEMAM1");
   ObjectDelete("SeñalEMAM5");
   ObjectDelete("SeñalEMAM15");
   ObjectDelete("SeñalEMAM30");
   ObjectDelete("SeñalEMAM60");      
   ObjectDelete("SeñalEMAM240");
   ObjectDelete("PrecioActual");
   ObjectDelete("ValorSpread");
   ObjectDelete("MMLEVELS8");
   ObjectDelete("PipsDesdeApertura");
   ObjectDelete("MMLEVELS10");
   ObjectDelete("Diferencia_pips_max_min");
   ObjectDelete("MMLEVELS12");
   ObjectDelete("Media_Diaria");
   ObjectDelete("MMLEVELS14");
   ObjectDelete("HoraBroker");
   ObjectDelete("MMLEVELS15");
   ObjectDelete("ParActual");
   ObjectDelete("InfTDC_Sup");
   ObjectDelete("InfTDC_Act");
   ObjectDelete("InfTDC_Inf");
   ObjectDelete("CandelTime");  

   ObjectDelete("aTrix_Label_back");
   ObjectDelete("aTrix_Label_backa");
   ObjectDelete("aTrix_Label_backb");
   ObjectDelete("aTrix_Label_backc");
   ObjectDelete("aTrix_Label_backd");
   ObjectDelete("aTrix_Label_backe");

}

//========================================================
//| Inicio de Función Custom indicator initialization function                         |
//========================================================
int init()
{
   BorrarObjetos();
   BlackBox();
   return(0);
}


//========================================================
//| Finalización de función
//========================================================
int deinit()
{
   BorrarObjetos();  
   return(0);
}


//========================================================
//| Custom indicator iteration function                              |
//========================================================
int start()
{
   int counted_bars=IndicatorCounted();

   PonerTitulos();
   InfoMacd();
   InfoRsi();
   InfoEma();
   
   //Info

   InfoAnexos();
   if (See_Price) InfoPrecio();   
   
   // Candel Time
	double i;
   m=Time[0]+Period()*60-CurTime();
   i=m/60.0;
   s=m%60;
   m=(m-m%60)/60;
   ObjectDelete("CandelTime");  
   InfoCandel();
    
   return(0);
}

void InfoCandel()
{
   // --------------------------------------------------------------
   // Poner Tiempo para cerrar Vela
   // --------------------------------------------------------------
   ObjectCreate("CandelTime", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("CandelTime",""+ m+":"+s+"", 10, "Tahoma Narrow",  color_CandelTime);
   ObjectSet("CandelTime", OBJPROP_CORNER, See_in_Right_corner);
   ObjectSet("CandelTime", OBJPROP_XDISTANCE, 7);
   ObjectSet("CandelTime", OBJPROP_YDISTANCE, 130);  
   
}

//========================================================
// Función: PonerTitulos
//     uso: Poner en el chart el nombre de la estrategia
//          y los encabezados de los times 
//========================================================
void PonerTitulos()
{
    if (See_in_Right_corner == true)
    {  
      // ------------------------------
      // Poner titulos a la derecha
      // ------------------------------
      ObjectCreate("Rewrited_by_MasterWhite", OBJ_LABEL, 0, 0, 0);
      ObjectSetText("Rewrited_by_MasterWhite", IndicatorTitle, 09, "Arial Narrow", Yellow);
      ObjectSet("Rewrited_by_MasterWhite", OBJPROP_CORNER, See_in_Right_corner);
      ObjectSet("Rewrited_by_MasterWhite", OBJPROP_XDISTANCE, 17);
      ObjectSet("Rewrited_by_MasterWhite", OBJPROP_YDISTANCE, 25+Shift-14); 

      ObjectCreate("Numbers", OBJ_LABEL, 0, 0, 0);
      ObjectSetText("Numbers", " M1    M5    M15   M30    H1    H4", 6, "Tahoma Narrow", Silver);
      ObjectSet("Numbers", OBJPROP_CORNER, See_in_Right_corner);
      ObjectSet("Numbers", OBJPROP_XDISTANCE, 17);
      ObjectSet("Numbers", OBJPROP_YDISTANCE, 26+Shift); 
   }

   if (See_in_Right_corner == false)
   { 
      // ------------------------------
      // Poner titulos a la izquierda
      // ------------------------------

      ObjectCreate("Rewrited_by_MasterWhite", OBJ_LABEL, 0, 0, 0);
      ObjectSetText("Rewrited_by_MasterWhite", IndicatorTitle, 09, "Arial Narrow", Yellow);
      ObjectSet("Rewrited_by_MasterWhite", OBJPROP_CORNER, See_in_Right_corner);
      ObjectSet("Rewrited_by_MasterWhite", OBJPROP_XDISTANCE, 17);
      ObjectSet("Rewrited_by_MasterWhite", OBJPROP_YDISTANCE, 25+Shift-10); 

      ObjectCreate("Numbers", OBJ_LABEL, 0, 0, 0);
      ObjectSetText("Numbers", "H4    H1    M30   M15    M5    M1", 6, "Tahoma Narrow", Silver);
      ObjectSet("Numbers", OBJPROP_CORNER, See_in_Right_corner);
      ObjectSet("Numbers", OBJPROP_XDISTANCE, 17);
      ObjectSet("Numbers", OBJPROP_YDISTANCE, 26+Shift); 
   }  
}



//========================================================
// Función: InfoMacd
//     uso: Poner en el chart el subtitulo de Macd
//          y los valores para los diferentes Charts
//========================================================
void InfoMacd()
{
   SSignalMACDH1="-";
   SSignalMACDH4="-";
   SSignalMACDM1="-";
   SSignalMACDM5="-";
   SSignalMACDM15="-";
   SSignalMACDM30="-";
   
   // --------------------------------------------------
   // Calcular los valores de Macd
   // --------------------------------------------------
      
   double MACDM1=iMACD(NULL,1,8,17,9,PRICE_CLOSE,MODE_MAIN,0); 
   double MACD_SIGM1=iMACD(NULL,1,8,17,9,PRICE_CLOSE,MODE_SIGNAL,0);    
   double MACDM5=iMACD(NULL,5,8,17,9,PRICE_CLOSE,MODE_MAIN,0); 
   double MACD_SIGM5=iMACD(NULL,5,8,17,9,PRICE_CLOSE,MODE_SIGNAL,0);
   double MACDM15=iMACD(NULL,15,8,17,9,PRICE_CLOSE,MODE_MAIN,0); 
   double MACD_SIGM15=iMACD(NULL,15,8,17,9,PRICE_CLOSE,MODE_SIGNAL,0);       
   double MACDM30=iMACD(NULL,30,8,17,9,PRICE_CLOSE,MODE_MAIN,0); 
   double MACD_SIGM30=iMACD(NULL,30,8,17,9,PRICE_CLOSE,MODE_SIGNAL,0);    
   double MACDH1=iMACD(NULL,60,8,17,9,PRICE_CLOSE,MODE_MAIN,0); 
   double MACD_SIGH1=iMACD(NULL,60,8,17,9,PRICE_CLOSE,MODE_SIGNAL,0); 
   double MACDH4=iMACD(NULL,240,8,17,9,PRICE_CLOSE,MODE_MAIN,0); 
   double MACD_SIGH4=iMACD(NULL,240,8,17,9,PRICE_CLOSE,MODE_SIGNAL,0); 
   
   // -----------------------------------------------------------------
   // Default color
   // -----------------------------------------------------------------
   colMACDM1 =Orange;
   colMACDM5 =Orange;
   colMACDM15 =Orange;
   colMACDM30 =Orange;
   colMACDH1 =Orange;
   colMACDH4 =Orange;
   
   // -----------------------------------------------------------------
   // Estudiar los valores y obtener codigos de color de venta o compra
   // -----------------------------------------------------------------
      
   if (MACDM1>MACD_SIGM1){SSignalMACDM1 = "-"; colMACDM1 = Green;} 
   if (MACDM1<=MACD_SIGM1){SSignalMACDM1 = "-"; colMACDM1 = Tomato;} 
   if ((MACDM1>MACD_SIGM1)&&(MACDM1>0)){SSignalMACDM1 = "-"; colMACDM1 = Lime;} 
   if ((MACDM1<=MACD_SIGM1)&&(MACDM1<0)){SSignalMACDM1 = "-"; colMACDM1 = Red;} 
         
   if (MACDM5>MACD_SIGM5){SSignalMACDM5 = "-"; colMACDM5 = Green;} 
   if (MACDM5<=MACD_SIGM5){SSignalMACDM5 = "-"; colMACDM5 = Tomato;}
   if ((MACDM5>MACD_SIGM5)&&(MACDM5>0)){SSignalMACDM5 = "-"; colMACDM5 = Lime;} 
   if ((MACDM5<=MACD_SIGM5)&&(MACDM5<0)){SSignalMACDM5 = "-"; colMACDM5 = Red;} 
      
   if (MACDM15>MACD_SIGM15){SSignalMACDM15 = "-"; colMACDM15 = Green;} 
   if (MACDM15<=MACD_SIGM15){SSignalMACDM15 = "-"; colMACDM15 = Tomato;}
   if ((MACDM15>MACD_SIGM15)&&(MACDM15>0)){SSignalMACDM15 = "-"; colMACDM15 = Lime;} 
   if ((MACDM15<=MACD_SIGM15)&&(MACDM15<0)){SSignalMACDM15 = "-"; colMACDM15 = Red;} 
          
   if (MACDM30>MACD_SIGM30){SSignalMACDM30 = "-"; colMACDM30 = Green;} 
   if (MACDM30<=MACD_SIGM30){SSignalMACDM30 = "-"; colMACDM30 = Tomato;}
   if ((MACDM30>MACD_SIGM30)&&(MACDM30>0)){SSignalMACDM30 = "-"; colMACDM30 = Lime;} 
   if ((MACDM30<=MACD_SIGM30)&&(MACDM30<0)){SSignalMACDM30 = "-"; colMACDM30 = Red;}  
           
   if (MACDH1>MACD_SIGH1){SSignalMACDH1 = "-"; colMACDH1 = Green;} 
   if (MACDH1<=MACD_SIGH1){SSignalMACDH1 = "-"; colMACDH1 = Tomato;}
   if ((MACDH1>MACD_SIGH1)&&(MACDH1>0)){SSignalMACDH1 = "-"; colMACDH1 = Lime;} 
   if ((MACDH1<=MACD_SIGH1)&&(MACDH1<0)){SSignalMACDH1 = "-"; colMACDH1 = Red;}  
         
   if (MACDH4>MACD_SIGH4){SSignalMACDH4 = "-"; colMACDH4 = Green;} 
   if (MACDH4<=MACD_SIGH4){SSignalMACDH4 = "-"; colMACDH4 = Tomato;}
   if ((MACDH4>MACD_SIGH4)&&(MACDH4>0)){SSignalMACDH4 = "-"; colMACDH4 = Lime;} 
   if ((MACDH4<=MACD_SIGH4)&&(MACDH4<0)){SSignalMACDH4 = "-"; colMACDH4 = Red;}    
      
   // --------------------------------------------------
   // Poner señales de Macd
   // --------------------------------------------------
      
   ObjectCreate("SSignalMACDM1t", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("SSignalMACDM1t", "MACD", 6, "Tahoma Narrow", Silver);
   ObjectSet("SSignalMACDM1t", OBJPROP_CORNER, See_in_Right_corner);
   ObjectSet("SSignalMACDM1t", OBJPROP_XDISTANCE, 132);
   ObjectSet("SSignalMACDM1t", OBJPROP_YDISTANCE, 35+Shift); 
   
   ObjectCreate("SSignalMACDM1", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("SSignalMACDM1", SSignalMACDM1, 45, "Tahoma Narrow", colMACDM1);
   ObjectSet("SSignalMACDM1", OBJPROP_CORNER, See_in_Right_corner);
   ObjectSet("SSignalMACDM1", OBJPROP_XDISTANCE, 110);
   ObjectSet("SSignalMACDM1", OBJPROP_YDISTANCE, 2+Shift); 
   
   ObjectCreate("SSignalMACDM5", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("SSignalMACDM5", SSignalMACDM5, 45, "Tahoma Narrow", colMACDM5);
   ObjectSet("SSignalMACDM5", OBJPROP_CORNER, See_in_Right_corner);
   ObjectSet("SSignalMACDM5", OBJPROP_XDISTANCE, 90);
   ObjectSet("SSignalMACDM5", OBJPROP_YDISTANCE, 2+Shift);   
      
   ObjectCreate("SSignalMACDM15", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("SSignalMACDM15", SSignalMACDM15, 45, "Tahoma Narrow", colMACDM15);
   ObjectSet("SSignalMACDM15", OBJPROP_CORNER, See_in_Right_corner);
   ObjectSet("SSignalMACDM15", OBJPROP_XDISTANCE, 70);
   ObjectSet("SSignalMACDM15", OBJPROP_YDISTANCE, 2+Shift); 
      
   ObjectCreate("SSignalMACDM30", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("SSignalMACDM30", SSignalMACDM30, 45, "Tahoma Narrow", colMACDM30);
   ObjectSet("SSignalMACDM30", OBJPROP_CORNER, See_in_Right_corner);
   ObjectSet("SSignalMACDM30", OBJPROP_XDISTANCE, 50);
   ObjectSet("SSignalMACDM30", OBJPROP_YDISTANCE, 2+Shift); 
                
   ObjectCreate("SSignalMACDH1", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("SSignalMACDH1", SSignalMACDH1, 45, "Tahoma Narrow", colMACDH1);
   ObjectSet("SSignalMACDH1", OBJPROP_CORNER, See_in_Right_corner);
   ObjectSet("SSignalMACDH1", OBJPROP_XDISTANCE, 30);
   ObjectSet("SSignalMACDH1", OBJPROP_YDISTANCE, 2+Shift); 
   
   ObjectCreate("SSignalMACDH4", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("SSignalMACDH4", SSignalMACDH4, 45, "Tahoma Narrow", colMACDH4);
   ObjectSet("SSignalMACDH4", OBJPROP_CORNER, See_in_Right_corner);
   ObjectSet("SSignalMACDH4", OBJPROP_XDISTANCE, 10);
   ObjectSet("SSignalMACDH4", OBJPROP_YDISTANCE, 2+Shift); 
       
}



//========================================================
// Función: InfoRsi
//     uso: Poner en el chart el subtitulo de fortaleza
//          y los valores para los diferentes Charts
//========================================================
void InfoRsi()
{
   // --------------------------------------------------
   // Leer RSI
   // --------------------------------------------------

   double rsi_h4  = iRSI(NULL, PERIOD_H4, 9, PRICE_CLOSE, 0);
   double rsi_h1  = iRSI(NULL, PERIOD_H1, 9, PRICE_CLOSE, 0);
   double rsi_m30 = iRSI(NULL, PERIOD_M30, 9, PRICE_CLOSE, 0);
   double rsi_m15 = iRSI(NULL, PERIOD_M15, 9, PRICE_CLOSE, 0);
   double rsi_m5  = iRSI(NULL, PERIOD_M5, 9, PRICE_CLOSE, 0);
   double rsi_m1  = iRSI(NULL, PERIOD_M1, 9, PRICE_CLOSE, 0);
   
   // --------------------------------------------------
   // Leer estocastico
   // --------------------------------------------------
   
   double stoc_H4 = iStochastic(NULL, PERIOD_H4, 5,3,3, MODE_EMA, 0, MODE_MAIN, 0);
   double stoc_H1 = iStochastic(NULL, PERIOD_H1, 5,3,3, MODE_EMA, 0, MODE_MAIN, 0);
   double stoc_M30 = iStochastic(NULL, PERIOD_M30, 5,3,3, MODE_EMA, 0, MODE_MAIN, 0);
   double stoc_M15 = iStochastic(NULL, PERIOD_M15, 5,3,3, MODE_EMA, 0, MODE_MAIN, 0);//sto was 15,5,5
   double stoc_M5 = iStochastic(NULL, PERIOD_M5, 5,3,3, MODE_EMA, 0, MODE_MAIN, 0);
   double stoc_M1 = iStochastic(NULL, PERIOD_M1, 5,3,3, MODE_EMA, 0, MODE_MAIN, 0);// was mode signal now gets value off main line
   
   // --------------------------------------------------
   // Leer cci
   // --------------------------------------------------
   
   double cci_HH4  = iCCI(NULL, PERIOD_H4,13, PRICE_CLOSE, 0);
   double cci_HH1  = iCCI(NULL, PERIOD_H1,13, PRICE_CLOSE, 0); 
   double cci_MM30 = iCCI(NULL, PERIOD_M30,13, PRICE_CLOSE, 0);     
   double cci_MM15 = iCCI(NULL, PERIOD_M15,13, PRICE_CLOSE, 0);    
   double cci_MM5  = iCCI(NULL, PERIOD_M5,13, PRICE_CLOSE, 0);       
   double cci_MM1  = iCCI(NULL, PERIOD_M1,13, PRICE_CLOSE, 0);
     
   STR_m1 = "-";
   STR_m5 = "-";
   STR_m15= "-";
   STR_m30= "-";
   STR_h1 = "-";
   STR_h4 = "-";
   STR_d1 = "-";
   STR_w1 = "-";
   
   // --------------------------------------------------
   // Default color
   // --------------------------------------------------
   color_m240 = Orange;
   color_m60 = Orange;
   color_m30 = Orange;
   color_m15 = Orange;
   color_m5 = Orange;
   color_m1 = Orange;
   
   // --------------------------------------------------
   // Strong Color Analize
   // --------------------------------------------------

   if ((rsi_h4 > 50) && (stoc_H4 > 40) && (cci_HH4 > 0)) { STR_h4 = "-";color_m240 = Lime;}  //&& (wpr_HHH4 > -50)
   if ((rsi_h1 > 50) && (stoc_H1 > 40) && (cci_HH1 > 0)) { STR_h1 = "-";color_m60 = Lime;}
   if ((rsi_m30 > 50) && (stoc_M30 > 40) && (cci_MM30 > 0)) { STR_m30 = "-";color_m30 = Lime; }
   if ((rsi_m15 > 50) && (stoc_M15 > 40) && (cci_MM15 > 0)) { STR_m15 = "-";color_m15 = Lime; }
   if ((rsi_m5 > 50) && (stoc_M5 > 40) && (cci_MM5 > 0)) { STR_m5 = "-"; color_m5 = Lime;}
   if ((rsi_m1 > 50) && (stoc_M1 > 40) && (cci_MM1 > 0)) { STR_m1 = "-";  color_m1 = Lime;}
   
   if ((rsi_h4 < 50) && (stoc_H4 < 60) && (cci_HH4 < 0)) { STR_h4 = "-";color_m240 = Red;}
   if ((rsi_h1 < 50) && (stoc_H1 < 60) && (cci_HH1 < 0)) { STR_h1 = "-";color_m60 = Red;}
   if ((rsi_m30 < 50) && (stoc_M30 < 60) && (cci_MM30 < 0)) { STR_m30 = "-";color_m30 = Red;}
   if ((rsi_m15 < 50) && (stoc_M15 < 60) && (cci_MM15 < 0)) { STR_m15 = "-";color_m15 = Red;}
   if ((rsi_m5 < 50) && (stoc_M5 < 60) && (cci_MM5 < 0)) { STR_m5 = "-";color_m5 = Red;}
   if ((rsi_m1 < 50) && (stoc_M1 < 60) && (cci_MM1 < 0)) { STR_m1 = "-"; color_m1 = Red;}
     
   if ((rsi_m1 < 50) && (stoc_M1 > 40) && (cci_MM1 > 0)) { STR_m1 = "-";  color_m1 = Orange;}
   if ((rsi_m1 > 50) && (stoc_M1 < 60) && (cci_MM1 < 0)) { STR_m1 = "-";  color_m1 = Orange;}
   if ((rsi_m1 < 50) && (stoc_M1 > 40) && (cci_MM1 < 0)) { STR_m1 = "-";  color_m1 = Orange;}
   if ((rsi_m1 > 50) && (stoc_M1 < 60) && (cci_MM1 > 0)) { STR_m1 = "-";  color_m1 = Orange;}
   if ((rsi_m1 > 50) && (stoc_M1 > 40) && (cci_MM1 < 0)) { STR_m1 = "-";  color_m1 = Orange;}  
   if ((rsi_m1 > 50) && (stoc_M1 < 60) && (cci_MM1 < 0)) { STR_m1 = "-";  color_m1 = Orange;}
   
   if ((rsi_m5 < 50) && (stoc_M5 > 40) && (cci_MM5 > 0)) { STR_m5 = "-";  color_m5 = Orange;}
   if ((rsi_m5 > 50) && (stoc_M5 < 60) && (cci_MM5 < 0)) { STR_m5 = "-";  color_m5 = Orange;}
   if ((rsi_m5 < 50) && (stoc_M5 > 40) && (cci_MM5 < 0)) { STR_m5 = "-";  color_m5 = Orange;}
   if ((rsi_m5 > 50) && (stoc_M5 < 60) && (cci_MM5 > 0)) { STR_m5 = "-";  color_m5 = Orange;}
   if ((rsi_m5 > 50) && (stoc_M5 > 40) && (cci_MM5 < 0)) { STR_m5 = "-";  color_m5 = Orange;}  
   if ((rsi_m5 > 50) && (stoc_M5 < 60) && (cci_MM5 < 0)) { STR_m5 = "-";  color_m5 = Orange;}
   
   if ((rsi_m15 < 50) && (stoc_M15 > 40) && (cci_MM15 > 0)) { STR_m15 = "-";  color_m15 = Orange;}
   if ((rsi_m15 > 50) && (stoc_M15 < 60) && (cci_MM15 < 0)) { STR_m15 = "-";  color_m15 = Orange;}
   if ((rsi_m15 < 50) && (stoc_M15 > 40) && (cci_MM15 < 0)) { STR_m15 = "-";  color_m15 = Orange;}
   if ((rsi_m15 > 50) && (stoc_M15 < 60) && (cci_MM15 > 0)) { STR_m15 = "-";  color_m15 = Orange;}
   if ((rsi_m15 > 50) && (stoc_M15 > 40) && (cci_MM15 < 0)) { STR_m15 = "-";  color_m15 = Orange;}  
   if ((rsi_m15 > 50) && (stoc_M15 < 60) && (cci_MM15 < 0)) { STR_m15 = "-";  color_m15 = Orange;}
      
   if ((rsi_m30 < 50) && (stoc_M30 > 40) && (cci_MM30 > 0)) { STR_m30 = "-";  color_m30 = Orange;}
   if ((rsi_m30 > 50) && (stoc_M30 < 60) && (cci_MM30 < 0)) { STR_m30 = "-";  color_m30 = Orange;}
   if ((rsi_m30 < 50) && (stoc_M30 > 40) && (cci_MM30 < 0)) { STR_m30 = "-";  color_m30 = Orange;}
   if ((rsi_m30 > 50) && (stoc_M30 < 60) && (cci_MM30 > 0)) { STR_m30 = "-";  color_m30 = Orange;}
   if ((rsi_m30 > 50) && (stoc_M30 > 40) && (cci_MM30 < 0)) { STR_m30 = "-";  color_m30 = Orange;}  
   if ((rsi_m30 > 50) && (stoc_M30 < 60) && (cci_MM30 < 0)) { STR_m30 = "-";  color_m30 = Orange;}
   
   if ((rsi_h1 < 50) && (stoc_H1 > 40) && (cci_HH1 > 0)) { STR_h1 = "-";  color_m60 = Orange;}
   if ((rsi_h1 > 50) && (stoc_H1 < 60) && (cci_HH1 < 0)) { STR_h1 = "-";  color_m60 = Orange;}
   if ((rsi_h1 < 50) && (stoc_H1 > 40) && (cci_HH1 < 0)) { STR_h1 = "-";  color_m60 = Orange;}
   if ((rsi_h1 > 50) && (stoc_H1 < 60) && (cci_HH1 > 0)) { STR_h1 = "-";  color_m60 = Orange;}
   if ((rsi_h1 > 50) && (stoc_H1 > 40) && (cci_HH1 < 0)) { STR_h1 = "-";  color_m60 = Orange;}  
   if ((rsi_h1 > 50) && (stoc_H1 < 60) && (cci_HH1 < 0)) { STR_h1 = "-";  color_m60 = Orange;}
   
   if ((rsi_h4 < 50) && (stoc_H4 > 40) && (cci_HH4 > 0)) { STR_h4 = "-";  color_m240 = Orange;}
   if ((rsi_h4 > 50) && (stoc_H4 < 60) && (cci_HH4 < 0)) { STR_h4 = "-";  color_m240 = Orange;}
   if ((rsi_h4 < 50) && (stoc_H4 > 40) && (cci_HH4 < 0)) { STR_h4 = "-";  color_m240 = Orange;}
   if ((rsi_h4 > 50) && (stoc_H4 < 60) && (cci_HH4 > 0)) { STR_h4 = "-";  color_m240 = Orange;}
   if ((rsi_h4 > 50) && (stoc_H4 > 40) && (cci_HH4 < 0)) { STR_h4 = "-";  color_m240 = Orange;}  
   if ((rsi_h4 > 50) && (stoc_H4 < 60) && (cci_HH4 < 0)) { STR_h4 = "-";  color_m240 = Orange;}
     
   // ------------------------------------------------------------------------------
   // Poner Subtitulo y valores
   // -----------------------------------------------------------------------------
   ObjectCreate("SeñalSTRM1t", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("SeñalSTRM1t","STR", 6, "Tahoma Narrow",  Silver);
   ObjectSet("SeñalSTRM1t", OBJPROP_CORNER, See_in_Right_corner);
   ObjectSet("SeñalSTRM1t", OBJPROP_XDISTANCE, 132);
   ObjectSet("SeñalSTRM1t", OBJPROP_YDISTANCE, 43+Shift); 
    
   ObjectCreate("SeñalSTRM1", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("SeñalSTRM1", STR_m1, 45, "Tahoma Narrow",  color_m1);
   ObjectSet("SeñalSTRM1", OBJPROP_CORNER, See_in_Right_corner);
   ObjectSet("SeñalSTRM1", OBJPROP_XDISTANCE, 110);
   ObjectSet("SeñalSTRM1", OBJPROP_YDISTANCE, 10+Shift); 
        
   ObjectCreate("SeñalSTRM5", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("SeñalSTRM5", STR_m5, 45, "Tahoma Narrow",  color_m5);
   ObjectSet("SeñalSTRM5", OBJPROP_CORNER, See_in_Right_corner);
   ObjectSet("SeñalSTRM5", OBJPROP_XDISTANCE, 90);
   ObjectSet("SeñalSTRM5", OBJPROP_YDISTANCE, 10+Shift); 
      
   ObjectCreate("SeñalSTRM15", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("SeñalSTRM15", STR_m15, 45, "Tahoma Narrow",  color_m15);
   ObjectSet("SeñalSTRM15", OBJPROP_CORNER, See_in_Right_corner);
   ObjectSet("SeñalSTRM15", OBJPROP_XDISTANCE, 70);
   ObjectSet("SeñalSTRM15", OBJPROP_YDISTANCE, 10+Shift); 
      
   ObjectCreate("SeñalSTRM30", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("SeñalSTRM30", STR_m30, 45, "Tahoma Narrow",  color_m30);
   ObjectSet("SeñalSTRM30", OBJPROP_CORNER, See_in_Right_corner);
   ObjectSet("SeñalSTRM30", OBJPROP_XDISTANCE, 50);
   ObjectSet("SeñalSTRM30", OBJPROP_YDISTANCE, 10+Shift); 
      
   ObjectCreate("SeñalSTRM60", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("SeñalSTRM60", STR_h1, 45, "Tahoma Narrow",  color_m60);
   ObjectSet("SeñalSTRM60", OBJPROP_CORNER, See_in_Right_corner);
   ObjectSet("SeñalSTRM60", OBJPROP_XDISTANCE, 30);
   ObjectSet("SeñalSTRM60", OBJPROP_YDISTANCE, 10+Shift); 
         
   ObjectCreate("SeñalSTRM240", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("SeñalSTRM240", STR_h4, 45, "Tahoma Narrow",  color_m240);
   ObjectSet("SeñalSTRM240", OBJPROP_CORNER, See_in_Right_corner);
   ObjectSet("SeñalSTRM240", OBJPROP_XDISTANCE, 10);
   ObjectSet("SeñalSTRM240", OBJPROP_YDISTANCE, 10+Shift); 
}



//========================================================
// Función: InfoEma
//     uso: Poner en el chart el subtitulo de Ema
//          y los valores para los diferentes Charts
//========================================================
void InfoEma()
{
   //******************************************************************************************************************
   //EMA Signals
   
   double EMA_M1  = iMA(Symbol(),1,5,0,MODE_EMA,PRICE_CLOSE,0);
   double ema_m1  = iMA(Symbol(),1,9,0,MODE_EMA,PRICE_CLOSE,0);
   double EMA_M5  = iMA(Symbol(),5,5,0,MODE_EMA,PRICE_CLOSE,0);
   double ema_m5  = iMA(Symbol(),5,9,0,MODE_EMA,PRICE_CLOSE,0);
   double EMA_M15 = iMA(Symbol(),15,5,0,MODE_EMA,PRICE_CLOSE,0);
   double ema_m15 = iMA(Symbol(),15,9,0,MODE_EMA,PRICE_CLOSE,0);
   double EMA_M30 = iMA(Symbol(),30,5,0,MODE_EMA,PRICE_CLOSE,0);
   double ema_m30 = iMA(Symbol(),30,9,0,MODE_EMA,PRICE_CLOSE,0);
   double EMA_H1  = iMA(Symbol(),60,5,0,MODE_EMA,PRICE_CLOSE,0);
   double ema_h1  = iMA(Symbol(),60,9,0,MODE_EMA,PRICE_CLOSE,0);
   double EMA_H4  = iMA(Symbol(),240,5,0,MODE_EMA,PRICE_CLOSE,0);
   double ema_h4  = iMA(Symbol(),240,9,0,MODE_EMA,PRICE_CLOSE,0);
   double EMA_D1  = iMA(Symbol(),1440,5,0,MODE_EMA,PRICE_CLOSE,0);
   double ema_d1  = iMA(Symbol(),1440,9,0,MODE_EMA,PRICE_CLOSE,0);
   double EMA_W1  = iMA(Symbol(),10080,5,0,MODE_EMA,PRICE_CLOSE,0);
   double ema_w1  = iMA(Symbol(),10080,9,0,MODE_EMA,PRICE_CLOSE,0);
    
   M1_EMA = "-";
   M5_EMA = "-";
   M15_EMA= "-";
   M30_EMA= "-";
   H1_EMA = "-";
   H4_EMA = "-";
   
   // --------------------------------------------------------
   // Default color
   // --------------------------------------------------------
   color_EMAm1=Orange;
   color_EMAm5=Orange;
   color_EMAm15=Orange;
   color_EMAm60=Orange;
   color_EMAm240=Orange;
 
   if (EMA_M1 > ema_m1) {M1_EMA= "-";color_EMAm1 = Lime; }
   if (EMA_M1 <= ema_m1) {M1_EMA= "-";color_EMAm1 = Red; }
    
   if (EMA_M5 > ema_m5) {M5_EMA= "-";color_EMAm5 = Lime; }
   if (EMA_M5 <= ema_m5) {M5_EMA= "-";color_EMAm5 = Red; }
    
   if (EMA_M15 > ema_m15) {M15_EMA= "-";color_EMAm15 = Lime; }
   if (EMA_M15 <= ema_m15) {M15_EMA= "-";color_EMAm15 = Red; }
    
   if (EMA_M30 > ema_m30) {M30_EMA= "-";color_EMAm30 = Lime; }
   if (EMA_M30 <= ema_m30) {M30_EMA= "-";color_EMAm30 = Red; }
    
   if (EMA_H1 > ema_h1) {H1_EMA= "-";color_EMAm60 = Lime; }
   if (EMA_H1 <= ema_h1) {H1_EMA= "-";color_EMAm60 = Red; }
    
   if (EMA_H4 > ema_h4) {H4_EMA= "-";color_EMAm240 = Lime; }
   if (EMA_H4 <= ema_h4) {H4_EMA= "-";color_EMAm240 = Red; }
    
          
   ObjectCreate("SeñalEMAM1t", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("SeñalEMAM1t","EMA", 6, "Tahoma Narrow",  Silver);
   ObjectSet("SeñalEMAM1t", OBJPROP_CORNER, See_in_Right_corner);
   ObjectSet("SeñalEMAM1t", OBJPROP_XDISTANCE, 132);
   ObjectSet("SeñalEMAM1t", OBJPROP_YDISTANCE, 51+Shift);  
       
   ObjectCreate("SeñalEMAM1", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("SeñalEMAM1", M1_EMA, 45, "Tahoma Narrow",  color_EMAm1);
   ObjectSet("SeñalEMAM1", OBJPROP_CORNER, See_in_Right_corner);
   ObjectSet("SeñalEMAM1", OBJPROP_XDISTANCE, 110);
   ObjectSet("SeñalEMAM1", OBJPROP_YDISTANCE, 18+Shift); 
        
   ObjectCreate("SeñalEMAM5", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("SeñalEMAM5", M5_EMA, 45, "Tahoma Narrow",  color_EMAm5);
   ObjectSet("SeñalEMAM5", OBJPROP_CORNER, See_in_Right_corner);
   ObjectSet("SeñalEMAM5", OBJPROP_XDISTANCE, 90);
   ObjectSet("SeñalEMAM5", OBJPROP_YDISTANCE, 18+Shift); 
      
   ObjectCreate("SeñalEMAM15", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("SeñalEMAM15", M15_EMA, 45, "Tahoma Narrow",  color_EMAm15);
   ObjectSet("SeñalEMAM15", OBJPROP_CORNER, See_in_Right_corner);
   ObjectSet("SeñalEMAM15", OBJPROP_XDISTANCE, 70);
   ObjectSet("SeñalEMAM15", OBJPROP_YDISTANCE, 18+Shift); 
      
   ObjectCreate("SeñalEMAM30", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("SeñalEMAM30", M30_EMA, 45, "Tahoma Narrow",  color_EMAm30);
   ObjectSet("SeñalEMAM30", OBJPROP_CORNER, See_in_Right_corner);
   ObjectSet("SeñalEMAM30", OBJPROP_XDISTANCE, 50);
   ObjectSet("SeñalEMAM30", OBJPROP_YDISTANCE, 18+Shift); 
      
   ObjectCreate("SeñalEMAM60", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("SeñalEMAM60", H1_EMA, 45, "Tahoma Narrow",  color_EMAm60);
   ObjectSet("SeñalEMAM60", OBJPROP_CORNER, See_in_Right_corner);
   ObjectSet("SeñalEMAM60", OBJPROP_XDISTANCE, 30);
   ObjectSet("SeñalEMAM60", OBJPROP_YDISTANCE, 18+Shift); 
         
   ObjectCreate("SeñalEMAM240", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("SeñalEMAM240", H4_EMA, 45, "Tahoma Narrow",  color_EMAm240);
   ObjectSet("SeñalEMAM240", OBJPROP_CORNER, See_in_Right_corner);
   ObjectSet("SeñalEMAM240", OBJPROP_XDISTANCE, 10);
   ObjectSet("SeñalEMAM240", OBJPROP_YDISTANCE, 18+Shift);   
}




//========================================================
// Función: InfoPrecio
//     uso: Poner en el chart el valor del Precio
//========================================================
void InfoPrecio()
{
   // --------------------------------------------------------------
   // Poner Precio
   // --------------------------------------------------------------
   double Price1 = iMA(Symbol(),0,1,0,MODE_EMA,PRICE_CLOSE,0);   
   PRC1 = DoubleToStr(Price1,Digits);   

   ObjectCreate("PrecioActual", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("PrecioActual",""+PRC1+"", 16, "Tahoma Narrow",  color_m30);
   ObjectSet("PrecioActual", OBJPROP_CORNER, See_in_Right_corner);
   ObjectSet("PrecioActual", OBJPROP_XDISTANCE, 45);
   ObjectSet("PrecioActual", OBJPROP_YDISTANCE, 87+Shift+MoverAnexos);  
   
   RegistrarDato(Symbol(),Period(),color_m30,PRC1,PRC1);
   InfoPar();
}

//========================================================
// Función: InfoPar
//     uso: Poner en el chart datos del Par y TimeFrame
//========================================================
void InfoPar()
{
   // --------------------------------------------------------------
   // Poner Par y Time
   // --------------------------------------------------------------
   string QueTF ="??";
   if (Period()==1)    QueTF ="M1"; //Bars;
   if (Period()==5)    QueTF ="M5"; //Bars;
   if (Period()==15)   QueTF ="M15"; //Bars;
   if (Period()==30)   QueTF ="M30"; //Bars;
   if (Period()==60)   QueTF ="H1"; //Bars;
   if (Period()==240)  QueTF ="H4"; //Bars;
   if (Period()==1440) QueTF ="D1"; //Bars;
    
   ObjectCreate("ParActual", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("ParActual",""+Symbol()+"-"+QueTF, 12, "Arial Black",  Blue);
   ObjectSet("ParActual", OBJPROP_CORNER, See_in_Right_corner);
   ObjectSet("ParActual", OBJPROP_XDISTANCE, 7);
   ObjectSet("ParActual", OBJPROP_YDISTANCE, 110+Shift+MoverAnexos);  
   
   RegistrarDato(Symbol(),Period(),color_m30,PRC1,PRC1);
}


//========================================================
// Función: InfoAnexos
//     uso: Poner en el chart el valor anexos
//========================================================
void InfoAnexos()
{

   HI="";
   LO="";
   SPREAD="";
   PIPS="";
   DAV="";
   HILO="";
   Pips="";
   Av="";
   AV_Yest="";
   
   //-------------------------------------------------------
   // Obtener valores
   //-------------------------------------------------------
   
   int R1=0,R5=0,R10=0,R20=0,RAvg=0,i=0;
   R1 =  (iHigh(NULL,PERIOD_D1,1)-iLow(NULL,PERIOD_D1,1))/Point;
   for(i=1;i<=5;i++)
      R5 =  R5  + (iHigh(NULL,PERIOD_D1,i)-iLow(NULL,PERIOD_D1,i))/Point;
   for(i=1;i<=10;i++)
      R10 = R10 + (iHigh(NULL,PERIOD_D1,i)-iLow(NULL,PERIOD_D1,i))/Point;
   for(i=1;i<=20;i++)
      R20 = R20 + (iHigh(NULL,PERIOD_D1,i)-iLow(NULL,PERIOD_D1,i))/Point;

   R5   = R5/5;
   R10  = R10/10;
   R20  = R20/20;
   RAvg =  (R1+R5+R10+R20)/4;    
   
   // 5Decimal adjust
   
   R5   = R5/10;
   R10  = R10/10;
   R20  = R20/100;
   RAvg = RAvg/10;

   double OPEN = iOpen(NULL,1440,0);
   double CLOSE = iClose(NULL,1440,0);
   double SPRD = (Ask - Bid)/Point;
   double High_Today = iHigh(NULL,1440,0);
   double Low_Today = iLow(NULL,1440,0);
   PIPS =  DoubleToStr((CLOSE-OPEN)/Point,0);
   
   if (SPRD>10) 
   {
      SPREAD=DoubleToStr(SPRD/10,1);
   }
   else
   {
      SPREAD=DoubleToStr(SPRD,1);
   }
   DAV     = (DoubleToStr(RAvg,0));
   AV_Yest =  (iHigh(NULL,PERIOD_D1,1)-iLow(NULL,PERIOD_D1,1))/Point;
   HILO    = DoubleToStr(((High_Today-Low_Today)/10)/Point,0);
  
   if (CLOSE >= OPEN) {Pips= "-";color_pip = Lime; }
   if (CLOSE < OPEN) {Pips= "-";color_pip = OrangeRed; }
   if (DAV > AV_Yest) {Av= "-";color_av = Lime; }
   if (DAV < AV_Yest) {Av= "-";color_av = OrangeRed; }
     
   if (See_Details == true ) LetrasChicas();

}



//========================================================
// Función: LetrasChicas
//     uso: Poner en el chart 
//========================================================
void LetrasChicas()
{
   ObjectCreate("ValorSpread", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("ValorSpread","Spread", 7, "Arial", LightSteelBlue);
   ObjectSet("ValorSpread", OBJPROP_CORNER, See_in_Right_corner);
   ObjectSet("ValorSpread", OBJPROP_XDISTANCE, 110);
   ObjectSet("ValorSpread", OBJPROP_YDISTANCE, 60+Shift+MoverAnexos); 
   
   ObjectCreate("MMLEVELS8", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("MMLEVELS8",""+SPREAD+"", 9, "Arial Bold", Gold);
   ObjectSet("MMLEVELS8", OBJPROP_CORNER, See_in_Right_corner);
   ObjectSet("MMLEVELS8", OBJPROP_XDISTANCE, 115);
   ObjectSet("MMLEVELS8", OBJPROP_YDISTANCE, 70+Shift+MoverAnexos);  
        
   ObjectCreate("PipsDesdeApertura", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("PipsDesdeApertura","ToOpen", 7, "Arial", LightSteelBlue);
   ObjectSet("PipsDesdeApertura", OBJPROP_CORNER, See_in_Right_corner);
   ObjectSet("PipsDesdeApertura", OBJPROP_XDISTANCE, 70);
   ObjectSet("PipsDesdeApertura", OBJPROP_YDISTANCE, 60+Shift+MoverAnexos); 
   
   ObjectCreate("MMLEVELS10", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("MMLEVELS10",""+PIPS+"", 9, "Arial Bold", color_pip);
   ObjectSet("MMLEVELS10", OBJPROP_CORNER, See_in_Right_corner);
   ObjectSet("MMLEVELS10", OBJPROP_XDISTANCE, 75);
   ObjectSet("MMLEVELS10", OBJPROP_YDISTANCE, 70+Shift+MoverAnexos);  
      
   ObjectCreate("Diferencia_pips_max_min", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("Diferencia_pips_max_min","Mn/Mx", 7, "Arial", LightSteelBlue);
   ObjectSet("Diferencia_pips_max_min", OBJPROP_CORNER, See_in_Right_corner);
   ObjectSet("Diferencia_pips_max_min", OBJPROP_XDISTANCE, 40);
   ObjectSet("Diferencia_pips_max_min", OBJPROP_YDISTANCE, 60+Shift+MoverAnexos); 
   
   ObjectCreate("MMLEVELS12", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("MMLEVELS12",""+HILO+"", 9, "Arial Bold", Gold);
   ObjectSet("MMLEVELS12", OBJPROP_CORNER, See_in_Right_corner);
   ObjectSet("MMLEVELS12", OBJPROP_XDISTANCE, 40);
   ObjectSet("MMLEVELS12", OBJPROP_YDISTANCE, 70+Shift+MoverAnexos);  
   
   ObjectCreate("Media_Diaria", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("Media_Diaria","1/2Day", 7, "Arial",LightSteelBlue);
   ObjectSet("Media_Diaria", OBJPROP_CORNER, See_in_Right_corner);
   ObjectSet("Media_Diaria", OBJPROP_XDISTANCE, 7);
   ObjectSet("Media_Diaria", OBJPROP_YDISTANCE, 60+Shift+MoverAnexos); 
   
   ObjectCreate("MMLEVELS14", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("MMLEVELS14",""+DAV+"", 9, "Arial Bold", color_av);
   ObjectSet("MMLEVELS14", OBJPROP_CORNER, See_in_Right_corner);
   ObjectSet("MMLEVELS14", OBJPROP_XDISTANCE, 10);
   ObjectSet("MMLEVELS14", OBJPROP_YDISTANCE, 70+Shift+MoverAnexos); 

   // Hora Broker y tu
   string QueTime =  Hour()+":"+Minute();
   ObjectCreate("HoraBroker", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("HoraBroker","Broker", 7, "Arial",LightSteelBlue);
   ObjectSet("HoraBroker", OBJPROP_CORNER, See_in_Right_corner);
   ObjectSet("HoraBroker", OBJPROP_XDISTANCE, 10);
   ObjectSet("HoraBroker", OBJPROP_YDISTANCE, 90+Shift+MoverAnexos); 
   
   ObjectCreate("MMLEVELS15", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("MMLEVELS15",QueTime, 8, "Arial Bold", Gold);
   ObjectSet("MMLEVELS15", OBJPROP_CORNER, See_in_Right_corner);
   ObjectSet("MMLEVELS15", OBJPROP_XDISTANCE, 10);
   ObjectSet("MMLEVELS15", OBJPROP_YDISTANCE, 100+Shift+MoverAnexos); 

}




//========================================================
//Function: RegistrarDato
//
//          Register info to text file, to external study
//          MasterWhite - ConsultoraDieminger@Hotmail.com
//
//          time1 its local time
//
//========================================================
int RegistrarDato(string _QuePar, int _TimeFrame, string _Accion, double _Val1, double _Val2)
{
   // --------------------------------------------------------
   // Registrar la detección de situación de Zona.
   // --------------------------------------------------------
   string fname = "MasterWhite-Price-"+_QuePar+ "" + _TimeFrame+ ".txt";                         
   int handle = FileOpen(fname, FILE_CSV|FILE_WRITE, ",");         
   if(handle>0)
   {
      //FileWrite(handle,"Par,Fecha,Hora,Precio,Accion,limite1,limite2");

      string date1 = TimeToStr(iTime(_QuePar,_TimeFrame,0),TIME_DATE);
      date1 =  StringSubstr(date1,0,4) + "-"+ StringSubstr(date1,5,2) + "-" + StringSubstr(date1,8,2);
      // Formato usado: YY-MM-DD
      string time1 = TimeToStr(iTime(_QuePar,_TimeFrame,0),TIME_MINUTES);
      FileWrite(handle, _QuePar, date1, time1, DoubleToStr(Ask,4),_Accion,DoubleToStr(_Val1,4), DoubleToStr(_Val2,4));
       
   }
   FileClose(handle);
   return(0);
}

void BlackBox()
{
   ObjectCreate("aTrix_Label_back", OBJ_LABEL, g_window_176, 0, 0, 0, 0);
   ObjectSetText("aTrix_Label_back", "g", 125, "Webdings");
   ObjectSet("aTrix_Label_back", OBJPROP_CORNER, 1);
   ObjectSet("aTrix_Label_back", OBJPROP_XDISTANCE, g_x_656);
   ObjectSet("aTrix_Label_back", OBJPROP_YDISTANCE, g_y_660);
   ObjectSet("aTrix_Label_back", OBJPROP_COLOR, Chart_Color);
   ObjectSet("aTrix_Label_back", OBJPROP_BACK, FALSE);
   //
   ObjectCreate("aTrix_Label_backa", OBJ_LABEL, g_window_176, 0, 0, 0, 0);
   ObjectSetText("aTrix_Label_backa", "g", 125, "Webdings");
   ObjectSet("aTrix_Label_backa", OBJPROP_CORNER, 1);
   ObjectSet("aTrix_Label_backa", OBJPROP_XDISTANCE, g_x_656);
   ObjectSet("aTrix_Label_backa", OBJPROP_YDISTANCE, g_y_660 + 160);
   ObjectSet("aTrix_Label_backa", OBJPROP_COLOR, Chart_Color);
   ObjectSet("aTrix_Label_backa", OBJPROP_BACK, FALSE);
   //
   ObjectCreate("aTrix_Label_backb", OBJ_LABEL, g_window_176, 0, 0, 0, 0);
   ObjectSetText("aTrix_Label_backb", "g", 125, "Webdings");
   ObjectSet("aTrix_Label_backb", OBJPROP_CORNER, 1);
   ObjectSet("aTrix_Label_backb", OBJPROP_XDISTANCE, g_x_656);
   ObjectSet("aTrix_Label_backb", OBJPROP_YDISTANCE, g_y_660 + 320);
   ObjectSet("aTrix_Label_backb", OBJPROP_COLOR, Chart_Color);
   ObjectSet("aTrix_Label_backb", OBJPROP_BACK, FALSE);
   //
   ObjectCreate("aTrix_Label_backc", OBJ_LABEL, g_window_176, 0, 0, 0, 0);
   ObjectSetText("aTrix_Label_backc", "g", 125, "Webdings");
   ObjectSet("aTrix_Label_backc", OBJPROP_CORNER, 1);
   ObjectSet("aTrix_Label_backc", OBJPROP_XDISTANCE, g_x_656);
   ObjectSet("aTrix_Label_backc", OBJPROP_YDISTANCE, g_y_660 + 480);
   ObjectSet("aTrix_Label_backc", OBJPROP_COLOR, Chart_Color);
   ObjectSet("aTrix_Label_backc", OBJPROP_BACK, FALSE);
   //
   ObjectCreate("aTrix_Label_backd", OBJ_LABEL, g_window_176, 0, 0, 0, 0);
   ObjectSetText("aTrix_Label_backd", "g", 125, "Webdings");
   ObjectSet("aTrix_Label_backd", OBJPROP_CORNER, 1);
   ObjectSet("aTrix_Label_backd", OBJPROP_XDISTANCE, g_x_656);
   ObjectSet("aTrix_Label_backd", OBJPROP_YDISTANCE, g_y_660 + 540);
   ObjectSet("aTrix_Label_backd", OBJPROP_COLOR, Chart_Color);
   ObjectSet("aTrix_Label_backd", OBJPROP_BACK, FALSE);
   //
   ObjectCreate("aTrix_Label_backe", OBJ_LABEL, g_window_176, 0, 0, 0, 0);
   ObjectSetText("aTrix_Label_backe", "g", 125, "Webdings");
   ObjectSet("aTrix_Label_backe", OBJPROP_CORNER, 1);
   ObjectSet("aTrix_Label_backe", OBJPROP_XDISTANCE, g_x_656);
   ObjectSet("aTrix_Label_backe", OBJPROP_YDISTANCE, g_y_660 + 700);
   ObjectSet("aTrix_Label_backe", OBJPROP_COLOR, Chart_Color);
   ObjectSet("aTrix_Label_backe", OBJPROP_BACK, FALSE);
}



 