Download MetaTrader 5
To add comments, please log in or register
Join MQL5 Cloud Network. Start earning money!
Sven Hohmann
120
Sven Hohmann 2014.11.23 10:44 

Hello,

i dont find quick a answer in the reference, so i ask here:

My proplem is, that i want to know the Trend of different timeframes, but in the chart there is just the last Object. How i seperate the M5 Timeframe from the M30 (First 2 if's vs. Second 2 if's)?

I just want to ask if (...)     AND   if(..)     AND if(..)   (all independet from each other)

int OnInit()
  {
    
   if (Close_M30 > EMA_M30)
    {
   ObjectCreate("ObjName", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("ObjName", "Up",15, "Verdana", Blue);
   ObjectSet("ObjName", OBJPROP_CORNER, 2);
   ObjectSet("ObjName", OBJPROP_XDISTANCE, 20);
   ObjectSet("ObjName", OBJPROP_YDISTANCE, 20);
   }
 
  if (Close_M30 < EMA_M30)
 
   {
   ObjectCreate("ObjName", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("ObjName", "Down",15, "Verdana", Red);
   ObjectSet("ObjName", OBJPROP_CORNER, 2);
   ObjectSet("ObjName", OBJPROP_XDISTANCE, 20);
   ObjectSet("ObjName", OBJPROP_YDISTANCE, 20);
   }
  
     if (Close_M5 > EMA_M5)
    {
   ObjectCreate("ObjName", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("ObjName", "Up",15, "Verdana", Blue);
   ObjectSet("ObjName", OBJPROP_CORNER, 1);
   ObjectSet("ObjName", OBJPROP_XDISTANCE, 20);
   ObjectSet("ObjName", OBJPROP_YDISTANCE, 20);
   }
 
  if (Close_M5 < EMA_M5)
 
   {
   ObjectCreate("ObjName", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("ObjName", "Down",15, "Verdana", Red);
   ObjectSet("ObjName", OBJPROP_CORNER, 1);
   ObjectSet("ObjName", OBJPROP_XDISTANCE, 20);
   ObjectSet("ObjName", OBJPROP_YDISTANCE, 20);
   }

   return(INIT_SUCCEEDED);
  }
/
To add comments, please log in or register