Navigation:Home > Content >

Indicator_MultiTimeFrame.mq4

Time: 2016-02-02 | Download file:Indicator_MultiTimeFrame.mq4

//+------------------------------------------------------------------+
//|                                                  МультиФрейм.mq4 |
//|                                Copyright © 2010, SoloatovS Corp. |
//|                                           "SolomatovS@GMail.com" |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2010, SoloatovS Corp."
#property link      "SolomatovS@GMail.com"

#property indicator_separate_window
#property indicator_minimum 0
#property indicator_maximum 1

extern color    UP   = Green;
extern color    DOWN = Red;
extern color    DOJI = Yellow;
extern bool     time = true;
extern color    TIME = White;
extern bool     volume = true;
extern color    VOLUME = Black;
extern string   symbol1 = "EURUSD";
extern string   symbol2 = "GBPUSD";
extern string   symbol3 = "EURGBP";
extern string   symbol4 = "";
extern string   symbol5 = "";
extern string   symbol6 = "";
extern string   symbol7 = "";
extern string   symbol8 = "";
extern string   symbol9 = "";
extern string   symbol10 = "";
extern string   symbol11 = "";
extern string   symbol12 = "";
extern string   symbol13 = "";
extern string   symbol14 = "";
extern string   symbol15 = "";
extern string   symbol16 = "";
extern string   symbol17 = "";
extern string   symbol18 = "";
extern string   symbol19 = "";
extern string   symbol20 = "";

string   symbol, SYMBOL[], TimeFrame;
int      HandleWindow, KolSybmol = 20;

int init()
{
   int      Len, i=0;
   symbol = Symbol();

   IndicatorShortName(symbol);
   if(StringLen(symbol1) == 0)   KolSybmol--;
   else
   {
      ArrayResize(SYMBOL, ArraySize(SYMBOL)+1);
      SYMBOL[i]   = symbol1;
      i++;
   }
   if(StringLen(symbol2) == 0)   KolSybmol--;
   else
   {
      ArrayResize(SYMBOL, ArraySize(SYMBOL)+1);
      SYMBOL[i]   = symbol2;
      i++;
   }
   if(StringLen(symbol3) == 0)   KolSybmol--;
   else
   {
      ArrayResize(SYMBOL, ArraySize(SYMBOL)+1);
      SYMBOL[i]   = symbol3;
      i++;
   }
   if(StringLen(symbol4) == 0)   KolSybmol--;
   else
   {
      ArrayResize(SYMBOL, ArraySize(SYMBOL)+1);
      SYMBOL[i]   = symbol4;
      i++;
   }
   if(StringLen(symbol5) == 0)   KolSybmol--;
   else
   {
      ArrayResize(SYMBOL, ArraySize(SYMBOL)+1);
      SYMBOL[i]   = symbol5;
      i++;
   }
   if(StringLen(symbol6) == 0)   KolSybmol--;
   else
   {
      ArrayResize(SYMBOL, ArraySize(SYMBOL)+1);
      SYMBOL[i]   = symbol6;
      i++;
   }
   if(StringLen(symbol7) == 0)   KolSybmol--;
   else
   {
      ArrayResize(SYMBOL, ArraySize(SYMBOL)+1);
      SYMBOL[i]   = symbol7;
      i++;
   }
   if(StringLen(symbol8) == 0)   KolSybmol--;
   else
   {
      ArrayResize(SYMBOL, ArraySize(SYMBOL)+1);
      SYMBOL[i]   = symbol8;
      i++;
   }
   if(StringLen(symbol9) == 0)   KolSybmol--;
   else
   {
      ArrayResize(SYMBOL, ArraySize(SYMBOL)+1);
      SYMBOL[i]   = symbol9;
      i++;
   }
   if(StringLen(symbol10) == 0)   KolSybmol--;
   else
   {
      ArrayResize(SYMBOL, ArraySize(SYMBOL)+1);
      SYMBOL[i]   = symbol10;
      i++;
   }
   if(StringLen(symbol11) == 0)   KolSybmol--;
   else
   {
      ArrayResize(SYMBOL, ArraySize(SYMBOL)+1);
      SYMBOL[i]   = symbol11;
      i++;
   }
   if(StringLen(symbol12) == 0)   KolSybmol--;
   else
   {
      ArrayResize(SYMBOL, ArraySize(SYMBOL)+1);
      SYMBOL[i]   = symbol12;
      i++;
   }
   if(StringLen(symbol13) == 0)   KolSybmol--;
   else
   {
      ArrayResize(SYMBOL, ArraySize(SYMBOL)+1);
      SYMBOL[i]   = symbol13;
      i++;
   }
   if(StringLen(symbol14) == 0)   KolSybmol--;
   else
   {
      ArrayResize(SYMBOL, ArraySize(SYMBOL)+1);
      SYMBOL[i]   = symbol14;
      i++;
   }
   if(StringLen(symbol15) == 0)   KolSybmol--;
   else
   {
      ArrayResize(SYMBOL, ArraySize(SYMBOL)+1);
      SYMBOL[i]   = symbol15;
      i++;
   }
   if(StringLen(symbol16) == 0)   KolSybmol--;
   else
   {
      ArrayResize(SYMBOL, ArraySize(SYMBOL)+1);
      SYMBOL[i]   = symbol16;
      i++;
   }
   if(StringLen(symbol17) == 0)   KolSybmol--;
   else
   {
      ArrayResize(SYMBOL, ArraySize(SYMBOL)+1);
      SYMBOL[i]   = symbol17;
      i++;
   }
   if(StringLen(symbol18) == 0)   KolSybmol--;
   else
   {
      ArrayResize(SYMBOL, ArraySize(SYMBOL)+1);
      SYMBOL[i]   = symbol18;
      i++;
   }
   if(StringLen(symbol19) == 0)   KolSybmol--;
   else
   {
      ArrayResize(SYMBOL, ArraySize(SYMBOL)+1);
      SYMBOL[i]   = symbol19;
      i++;
   }
   if(StringLen(symbol20) == 0)   KolSybmol--;
   else
   {
      ArrayResize(SYMBOL, ArraySize(SYMBOL)+1);
      SYMBOL[i]   = symbol20;
      i++;
   }

   return(0);
}

int deinit()
{
   ObjectsDeleteAll(HandleWindow);
   return (0);
}

int start()
{
   int    i, TimeFrame_VOLUME;
   color  COLOR;
   datetime Date = TimeCurrent();
   double OPEN, CLOSE, M1, M5, M15, M30, H1, H4, D1, W1, MN1;

   HandleWindow = WindowFind(symbol);

   ObjectCreate("ASK", OBJ_LABEL, HandleWindow, 0, 0, 0, 0);
   ObjectSet("ASK", OBJPROP_XDISTANCE, 523);
   ObjectSet("ASK", OBJPROP_YDISTANCE, 2);
   ObjectSetText("ASK", "...ASK...", 10, "Comic Sans", UP);

   ObjectCreate("BID", OBJ_LABEL, HandleWindow, 0, 0, 0, 0);
   ObjectSet("BID", OBJPROP_XDISTANCE, 593);
   ObjectSet("BID", OBJPROP_YDISTANCE, 2);
   ObjectSetText("BID", "...BID...", 10, "Comic Sans", DOWN);

   //Выводим Пары (Символы)
   for(i=0; i  OPEN)  return(UP);
   if(CLOSE <  OPEN)  return(DOWN);
   if(CLOSE == OPEN)  return(DOJI);
}

string TIME_HOUR(datetime time)
{
   string HOURS, MINUTES, SECONDS;
   HOURS    = DoubleToStr(MathFloor(time / 60 / 24), 0); if(StringLen(HOURS)   == 1)  HOURS   = "0"+HOURS;
   MINUTES  = DoubleToStr(MathMod(time / 60, 60), 0);    if(StringLen(MINUTES) == 1)  MINUTES = "0"+MINUTES;
   SECONDS  = DoubleToStr(MathMod(time, 60), 0);         if(StringLen(SECONDS) == 1)  SECONDS = "0"+SECONDS;
   return(HOURS+":"+MINUTES+":"+SECONDS);
}

Recommend