_TRO_Dashboard_3LZZ

Author: Copyright � 2008, Avery T. Horton, Jr. aka TheRumpledOne
Price Data Components
Series array that contains close prices for each barSeries array that contains open prices of each bar
Miscellaneous
It issuies visual alerts to the screen
0 Views
0 Downloads
0 Favorites
_TRO_Dashboard_3LZZ
//+------------------------------------------------------------------+
//|                                        _TRO_Dashboard_3LZZ.mq4   |
//|                                        Copyright © 2008, "TRO"   |
//|                                                                  |
//+------------------------------------------------------------------+

#property copyright "Copyright © 2008, Avery T. Horton, Jr. aka TheRumpledOne"
#property link      "therumpledone@gmail.com"
 

#property indicator_separate_window  

#property indicator_buffers 0
#property indicator_minimum 0
#property indicator_maximum 1

extern bool   Sound.Alert    = true ;



extern  double Period1=5; 
extern  double Period2=13; 
extern  double Period3=34; 

 string   Dev_Step_1="1,3";
 string   Dev_Step_2="8,5";
 string   Dev_Step_3="13,8";
 int Symbol_1_Kod=140;//129
 int Symbol_2_Kod=141;//130
 int Symbol_3_Kod=142;//131
 
 string sSymbol_1_Kod =     "Œ"; 
 string sSymbol_2_Kod =     "‚"; 
 string sSymbol_3_Kod =     "Ž"; 
  
 string  note_TimeFrames = "M1;5,15,30,60H1;240H4;1440D1;10080W1;43200MN|0-CurrentTF";
 string  Arrow_Codes = "140(129)=1; 141(130)=2; 142(131)=3";





extern string _            = "PAIRS";
//extern string pairs        = "GBPUSD;";

extern string pairs        = "GBPUSD;EURUSD;USDCHF;USDJPY;USDCAD;GBPJPY;";
//extern string pairs        = "GBPUSD;EURUSD;USDCHF;USDJPY;USDCAD;GBPJPY;EURJPY;GBPCHF;";
extern string timeFrames   = "H1;H4;D1;W1";
//extern string timeFrames   = "M1;M5;M15;H1;H4;D1;W1";
extern int    myUp         = 1;
extern int    myEq         = -1;
extern int    myDn         = 0;

extern color  ColorUp      = Blue;
extern color  ColorNeutral = DimGray ;
extern color  ColorDn      = Red ;
extern color  ValueColor   = DodgerBlue;
extern int    ValueSize    = 10;
extern string ValueFont    = "Verdana";



bool show.SCORE = false ; 

int      window;  
int      totalPairs;
int      totalTimeFrames;
int      totalLabels;
int      aTimes[];
string   aPairs[];
string   sTimes[];
color    ColorLabels  = White;
color    MA_color;
color    srsi_color;
color    cad_color;
string   MA_arrow;
string   srsi_arrow;
string   cad_arrow;
string   labelNames;
string   shortName;
int      corner;
int       INC_UP ;
int       INC_UC ;
int       INC_DN;
int       MAMode;
int       PRMode;
int       RSIMode;
string    strMAType;
string    strRSIType;
bool   ShowCount    = true;



string Pair0    = ""      ;
string Pair1    = ""      ;
string Pair2    = ""      ;
string Pair3    = ""      ;
string Pair4    = ""      ;
string Pair5    = ""      ; 
string Pair6    = ""      ;
string Pair7    = ""      ;
string Pair8    = ""      ;
string Pair9    = ""      ;
string Pair10   = ""      ;
string Pair11   = ""      ;
string Pair12   = ""      ;
string Pair13   = ""      ;
string Pair14   = ""      ;
string Pair15   = ""      ;
string Pair16   = ""      ;
string Pair17   = ""      ;
string Pair18   = ""      ;
string Pair19   = ""      ;
string Pair20   = ""      ;

double cVal = 0, pVal = 0;

double cdayClose;
double cdayOpen;
color  ColorPrice ; 
double point  ;
int    xPoint ;



//---- buffers 
double FP_BuferUp;
double FP_BuferDn; 
double NP_BuferUp;
double NP_BuferDn; 
double HP_BuferUp;
double HP_BuferDn;

 

int OldBars = -1 ;

bool Trigger[21][9];

string tAlert ;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+

int init()
{

   corner     = 0;
   shortName  = MakeUniqueName("3LZZ ","");
   labelNames = shortName;
   IndicatorShortName(shortName);

    
      pairs = StringUpperCase(StringTrimLeft(StringTrimRight(pairs)));
      if (StringSubstr(pairs,StringLen(pairs),1) != ";")
      pairs = StringConcatenate(pairs,";");
                                  

         bool isMini = IsMini();            
         int  s      = 0;
         int  i      = StringFind(pairs,";",s);
         int time;
         string current;
        
         string temp;
         
            while (i > 0)
            {
               current = StringSubstr(pairs,s,i-s);
               if (isMini) current = StringConcatenate(current,"m");
              time    = stringToTimeFrame(current);
               current = StringSubstr(pairs,s,i-s);
               if (isMini) current = StringConcatenate(current,"m");
               if (iClose(current,0,0) > 0) {
               ArrayResize(aPairs,ArraySize(aPairs)+1);
                aPairs[ArraySize(aPairs)-1] = current; }
                 s = i + 1;
                i = StringFind(pairs,";",s);
                                                                                   
                                     
            }
    

      timeFrames = StringUpperCase(StringTrimLeft(StringTrimRight(timeFrames)));
      if (StringSubstr(timeFrames,StringLen(timeFrames),1) != ";")
       timeFrames = StringConcatenate(timeFrames,";");

                                                  
         s = 0;
         i = StringFind(timeFrames,";",s);
         //int time;
          while (i > 0)
            {
           current = StringSubstr(timeFrames,s,i-s);
           time    = stringToTimeFrame(current);
           if (time > 0) {
           ArrayResize(sTimes,ArraySize(sTimes)+1);
           ArrayResize(aTimes,ArraySize(aTimes)+1);
           sTimes[ArraySize(sTimes)-1] = TimeFrameToString(time); 
           aTimes[ArraySize(aTimes)-1] = time; }
           s = i + 1;
           i = StringFind(timeFrames,";",s);
            }
  

      totalTimeFrames = ArraySize(aTimes);
      totalPairs      = ArraySize(aPairs);
      totalLabels     = 0;
      
      
      
Pair0    = aPairs[0];
Pair1    = aPairs[1];
Pair2    = aPairs[2];
Pair3    = aPairs[3];
Pair4    = aPairs[4];
Pair5    = aPairs[5];
Pair6    = aPairs[6];
Pair7    = aPairs[7];
Pair8    = aPairs[8];
Pair9    = aPairs[9];
Pair10   = aPairs[10];
Pair11   = aPairs[11];
Pair12   = aPairs[12];
Pair13   = aPairs[13];
Pair14   = aPairs[14];
Pair15   = aPairs[15];
Pair16   = aPairs[16];
Pair17   = aPairs[17];
Pair18   = aPairs[18];
Pair19   = aPairs[19];
Pair20   = aPairs[20];   
      
   return(0);
   
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
{
   while (totalLabels>0) { ObjectDelete(StringConcatenate(labelNames,totalLabels)); totalLabels--;}
     
   return(0);
}


//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+

int start()
{


ObjectsDeleteAll(window);

int m,n;
int i,k;


if( Bars != OldBars )
{ 
   for( m = 0, n = 0 ; m < 21 ; m++, n+=9) {Trigger[m][n] = True ; } 
}


   window      = WindowFind(shortName);
   totalLabels = 0;
    for (i=0,m=30; i < totalPairs;      i++, m+=25)
    {
      INC_UP = 0;
      INC_UC = 0;
      INC_DN = 0; 
   
      for (k=0,n=170; k < totalTimeFrames; k++, n+=46)
      {   
          tAlert = "" ;  
          showPair(aPairs[i],aTimes[k],sTimes[k],m,n);
          if ( Trigger[i][k] &&  Sound.Alert ) 
          {
            if( tAlert != "" ) { Trigger[i][k] = False ; Alert(aPairs[i],"  ", sTimes[k], " " , tAlert);  }
          }
          
          
      } // for k

      if (ShowCount)  DoShowCount(m,n); 
      
    } // for i  
               
      if (Pair1 == "") Pair1 = Symbol();
      
   OldBars = Bars ;   
          
   return(0);
}


//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+


void DoShowCount( int xdistance, int ydistance )
{

int x_Pair, y_Pair , y_Inc ;

x_Pair = 10;
y_Pair = 40;
y_Inc  = 25;


double PERp,PERC,PER;
int yInc = -125;

  PER = INC_UP; 
  PERC= PER*100;
  PERp= PERC / totalTimeFrames ; // 7
  string PER_Str =DoubleToStr(PERp,Point);
   
color xColor = Yellow ;
 
if( PERp > 50) { xColor = LimeGreen ; }
else if( PERp < 50 ) { xColor = Crimson ; }


 if(ValueSize>12) ValueSize=12;
 
 setObject(next()," FX DASHBOARD 3LZZ © 2008 ",70,5, Gray ,ValueFont,7,0);

  if(show.SCORE){  
  setObject(next(),PER_Str,525,xdistance+10, xColor ,"Arial bold",10,0);}
  
  
  setObject(next(),Pair0,x_Pair,40, ValueColor ,ValueFont,ValueSize);
  setObject(next(),Pair1,x_Pair,65, ValueColor ,ValueFont,ValueSize);
  setObject(next(),Pair2,x_Pair,90, ValueColor ,ValueFont,ValueSize);
  setObject(next(),Pair3,x_Pair,115, ValueColor ,ValueFont,ValueSize);
  setObject(next(),Pair4,x_Pair,140, ValueColor ,ValueFont,ValueSize);
  setObject(next(),Pair5,x_Pair,165, ValueColor ,ValueFont,ValueSize);
  setObject(next(),Pair6,x_Pair,190, ValueColor ,ValueFont,ValueSize);
  setObject(next(),Pair7,x_Pair,215, ValueColor ,ValueFont,ValueSize);
  setObject(next(),Pair8,x_Pair,240, ValueColor ,ValueFont,ValueSize);
  setObject(next(),Pair9,x_Pair,265, ValueColor ,ValueFont,ValueSize);
  setObject(next(),Pair10,x_Pair,290, ValueColor ,ValueFont,ValueSize);
  setObject(next(),Pair11,x_Pair,315, ValueColor ,ValueFont,ValueSize);
  setObject(next(),Pair12,x_Pair,340, ValueColor ,ValueFont,ValueSize);
  setObject(next(),Pair13,x_Pair,365, ValueColor ,ValueFont,ValueSize);
  setObject(next(),Pair14,x_Pair,390, ValueColor ,ValueFont,ValueSize);
  setObject(next(),Pair15,x_Pair,415, ValueColor ,ValueFont,ValueSize);
  setObject(next(),Pair16,x_Pair,440, ValueColor ,ValueFont,ValueSize);
  setObject(next(),Pair17,x_Pair,465, ValueColor ,ValueFont,ValueSize);
  setObject(next(),Pair18,x_Pair,490, ValueColor ,ValueFont,ValueSize);
  setObject(next(),Pair19,x_Pair,515, ValueColor ,ValueFont,ValueSize);

string cTitle = "" ;



   setObject(next(),cTitle,340,3, ValueColor ,"Verdana Bold",ValueSize);
   setObject(next(),"PAIR",x_Pair,18, ValueColor ,ValueFont,ValueSize);
   setObject(next(),sTimes[0],200,18, ValueColor ,ValueFont,ValueSize);
   setObject(next(),sTimes[1],245,18, ValueColor ,ValueFont,ValueSize);
   setObject(next(),sTimes[2],290,18, ValueColor ,ValueFont,ValueSize);
   setObject(next(),sTimes[3],340,18, ValueColor ,ValueFont,ValueSize);
   setObject(next(),sTimes[4],385,18, ValueColor ,ValueFont,ValueSize);
   setObject(next(),sTimes[5],430,18, ValueColor ,ValueFont,ValueSize);
   setObject(next(),sTimes[6],475,18, ValueColor ,ValueFont,ValueSize);

 //  setObject(next(),"%",525,18, ValueColor ,ValueFont,ValueSize);
     

x_Pair = x_Pair + 70 ;

setObject(next(),"Price",x_Pair,18, ValueColor ,ValueFont,ValueSize);
   
if( Pair0 != "" ) { DoPrice( Pair0, x_Pair  , y_Pair ) ; }
if( Pair1 != "" ) { y_Pair = y_Pair + y_Inc ; DoPrice( Pair1, x_Pair  , y_Pair ) ; }
if( Pair2 != "" ) { y_Pair = y_Pair + y_Inc ; DoPrice( Pair2, x_Pair  , y_Pair ) ; }
if( Pair3 != "" ) { y_Pair = y_Pair + y_Inc ; DoPrice( Pair3, x_Pair  , y_Pair ) ; }
if( Pair4 != "" ) { y_Pair = y_Pair + y_Inc ; DoPrice( Pair4, x_Pair  , y_Pair ) ; }
if( Pair5 != "" ) { y_Pair = y_Pair + y_Inc ; DoPrice( Pair5, x_Pair  , y_Pair ) ; }
if( Pair6 != "" ) { y_Pair = y_Pair + y_Inc ; DoPrice( Pair6, x_Pair  , y_Pair ) ; }
if( Pair7 != "" ) { y_Pair = y_Pair + y_Inc ; DoPrice( Pair7, x_Pair  , y_Pair ) ; }
if( Pair8 != "" ) { y_Pair = y_Pair + y_Inc ; DoPrice( Pair8, x_Pair  , y_Pair ) ; }
if( Pair9 != "" ) { y_Pair = y_Pair + y_Inc ; DoPrice( Pair9, x_Pair  , y_Pair ) ; }     
if( Pair10 != "" ) { y_Pair = y_Pair + y_Inc ; DoPrice( Pair10, x_Pair  , y_Pair ) ; }
if( Pair11 != "" ) { y_Pair = y_Pair + y_Inc ; DoPrice( Pair11, x_Pair  , y_Pair ) ; }
if( Pair12 != "" ) { y_Pair = y_Pair + y_Inc ; DoPrice( Pair12, x_Pair  , y_Pair ) ; }
if( Pair13 != "" ) { y_Pair = y_Pair + y_Inc ; DoPrice( Pair13, x_Pair  , y_Pair ) ; }
if( Pair14 != "" ) { y_Pair = y_Pair + y_Inc ; DoPrice( Pair14, x_Pair  , y_Pair ) ; }
if( Pair15 != "" ) { y_Pair = y_Pair + y_Inc ; DoPrice( Pair15, x_Pair  , y_Pair ) ; }
if( Pair16 != "" ) { y_Pair = y_Pair + y_Inc ; DoPrice( Pair16, x_Pair  , y_Pair ) ; }
if( Pair17 != "" ) { y_Pair = y_Pair + y_Inc ; DoPrice( Pair17, x_Pair  , y_Pair ) ; }
if( Pair18 != "" ) { y_Pair = y_Pair + y_Inc ; DoPrice( Pair18, x_Pair  , y_Pair ) ; }
if( Pair19 != "" ) { y_Pair = y_Pair + y_Inc ; DoPrice( Pair19, x_Pair  , y_Pair ) ; }         
}

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void DoPrice( string dpSymbol, int dp_xAxis, int dp_yAxis )
{
   cdayClose      = iClose(dpSymbol,PERIOD_D1,0);
   cdayOpen       = iOpen(dpSymbol,PERIOD_D1,0);
   
   if(cdayClose > cdayOpen) { ColorPrice = LimeGreen ; } else {
   if(cdayClose < cdayOpen) { ColorPrice = Red ; } else {ColorPrice = Yellow ; } }

double xPrice, xPsycho, bid, ask, bidmod, askmod ;

   point   = MarketInfo(dpSymbol,MODE_POINT);  
   bid     = MarketInfo(dpSymbol,MODE_BID);  
   ask     = MarketInfo(dpSymbol,MODE_ASK);  

   if ( point == 0.01 ) { xPsycho = 0.25; xPoint = 2 ; } 
   else { xPsycho = 0.0025; xPoint = 4 ; }

   bidmod = MathMod(bid ,xPsycho) ;         
   askmod = MathMod(ask ,xPsycho) ;         
   xPrice = cdayClose - bidmod ; 

   if(bidmod == 0 || askmod == 0) { ColorPrice = Orange ; }

   setObject(next(),DoubleToStr(cdayClose,xPoint),dp_xAxis, dp_yAxis, ColorPrice ,ValueFont,ValueSize);   
}

//+------------------------------------------------------------------+

void showPair(string pair, int timeFrame,string label, int xdistance, int ydistance)
{


   
   DoWork(pair,timeFrame,0) ;    
   
   if (HP_BuferUp != 0 ) { tAlert = "3-LZZ HI" ; INC_UP = INC_UP +1 ; MA_color = ColorUp; MA_arrow = sSymbol_3_Kod ; } else {
   if (HP_BuferDn != 0 ) { tAlert = "3-LZZ LO" ; INC_DN = INC_DN +1 ; MA_color = ColorDn; MA_arrow = sSymbol_3_Kod ; } else {   
   if (NP_BuferUp != 0 ) { tAlert = "2-LZZ HI" ; INC_UP = INC_UP +1 ; MA_color = ColorUp; MA_arrow = sSymbol_2_Kod ; } else {
   if (NP_BuferDn != 0 ) { tAlert = "2-LZZ LO" ; INC_DN = INC_DN +1 ; MA_color = ColorDn; MA_arrow = sSymbol_2_Kod ; } else {    
   if (FP_BuferUp != 0 ) { tAlert = "1-LZZ HI" ; INC_UP = INC_UP +1 ; MA_color = ColorUp; MA_arrow = sSymbol_1_Kod ; } else {
   if (FP_BuferDn != 0 ) { tAlert = "1-LZZ LO" ; INC_DN = INC_DN +1 ; MA_color = ColorDn; MA_arrow = sSymbol_1_Kod ; } else {   
                                                INC_UC = INC_UC +1 ; MA_color = ColorNeutral; MA_arrow = "Ÿ"; } }}}}}
   
   setLabel(" "  ,xdistance+10,ydistance+30," ",MA_color,MA_arrow);
       
  }

//+------------------------------------------------------------------+
//| Custom functions and procedures                                  |
//+------------------------------------------------------------------+

string next() { totalLabels++; return(totalLabels); }  


//+------------------------------------------------------------------+

void setLabel(string text,int x,int y,string sarv, color theColor, string arrow, bool isADX=true)
{
    
  setObject(next(),arrow                  ,y,x,theColor,"Wingdings",14,0); //"Wingdings"
      
 }              
             

//+------------------------------------------------------------------+
void setObject(string name,string text,int x,int y,color theColor, string font = "Verdana",int size=10,int angle=0)
{
   string labelName = StringConcatenate(labelNames,name);

  
      if (ObjectFind(labelName) == -1)
          {
             ObjectCreate(labelName,OBJ_LABEL,window,0,0);
             ObjectSet(labelName,OBJPROP_CORNER,corner);
             if (angle != 0)
             ObjectSet(labelName,OBJPROP_ANGLE,angle);
          }               
       ObjectSet(labelName,OBJPROP_XDISTANCE,x);
       ObjectSet(labelName,OBJPROP_YDISTANCE,y);
       ObjectSetText(labelName,text,size,font,theColor);
}


//+------------------------------------------------------------------+
int stringToTimeFrame(string tfs)
{
   int tf=0;
       tfs = StringTrimLeft(StringTrimRight(StringUpperCase(tfs)));
         if (tfs=="M1" || tfs=="1")     tf=PERIOD_M1;
         if (tfs=="M5" || tfs=="5")     tf=PERIOD_M5;
         if (tfs=="M15"|| tfs=="15")    tf=PERIOD_M15;
         if (tfs=="M30"|| tfs=="30")    tf=PERIOD_M30;
         if (tfs=="H1" || tfs=="60")    tf=PERIOD_H1;
         if (tfs=="H4" || tfs=="240")   tf=PERIOD_H4;
         if (tfs=="D1" || tfs=="1440")  tf=PERIOD_D1;
         if (tfs=="W1" || tfs=="10080") tf=PERIOD_W1;
         if (tfs=="MN" || tfs=="43200") tf=PERIOD_MN1;
         if (tfs=="MN1" || tfs=="43200") tf=PERIOD_MN1;   
  return(tf);
}

//+------------------------------------------------------------------+
string TimeFrameToString(int tf)
{
   string tfs;
   switch(tf) {
      case PERIOD_M1:  tfs="M1"  ; break;
      case PERIOD_M5:  tfs="M5"  ; break;
      case PERIOD_M15: tfs="M15" ; break;
      case PERIOD_M30: tfs="M30" ; break;
      case PERIOD_H1:  tfs="H1"  ; break;
      case PERIOD_H4:  tfs="H4"  ; break;
      case PERIOD_D1:  tfs="D1"  ; break;
      case PERIOD_W1:  tfs="W1"  ; break;
      case PERIOD_MN1: tfs="MN1";
   }
   return(tfs);
}

//+------------------------------------------------------------------+
string StringUpperCase(string str)
{
   string   s = str;
   int      lenght = StringLen(str) - 1;
   int      char;
   
   while(lenght >= 0)
      {
         char = StringGetChar(s, lenght);
                 
         if((char > 96 && char < 123) || (char > 223 && char < 256))
                  s = StringSetChar(s, lenght, char - 32);
          else 
              if(char > -33 && char < 0)
                  s = StringSetChar(s, lenght, char + 224);
         lenght--;
   }
  
   
   return(s);
}

//+------------------------------------------------------------------+
string MakeUniqueName(string first, string rest)
{
   string result = first+(MathRand()%1001)+rest;

   while (WindowFind(result)> 0)
          result = first+(MathRand()%1001)+rest;
   return(result);
}

//+------------------------------------------------------------------+
bool IsMini()
{
   if (StringFind(Symbol(),"m") > -1)
         return(true);
   else  return(false);    
}


  
//+------------------------------------------------------------------+

void DoWork( string myPair, int TimeFrame , int myShift  )  
{

   datetime TimeArray[];
   int    i,limit,y=0,counted_bars=IndicatorCounted();
 
// Plot defined time frame on to current time frame

   ArrayCopySeries(TimeArray,MODE_TIME,Symbol(),TimeFrame);  
   
   limit=1;     
   
   for(i=0,y=0;i<limit;i++)
   {
 
   if (Time[i]<TimeArray[y]) y++;   

 FP_BuferUp=iCustom(myPair,TimeFrame,"3_Level_ZZ_Semafor",Period1,Period2,Period3,
                                      Dev_Step_1,Dev_Step_2,Dev_Step_3,
                                      Symbol_1_Kod,Symbol_2_Kod,Symbol_3_Kod,0,y);
 FP_BuferDn =iCustom(myPair,TimeFrame,"3_Level_ZZ_Semafor",Period1,Period2,Period3,
                                      Dev_Step_1,Dev_Step_2,Dev_Step_3,
                                      Symbol_1_Kod,Symbol_2_Kod,Symbol_3_Kod,1,y); 
 NP_BuferUp =iCustom(myPair,TimeFrame,"3_Level_ZZ_Semafor",Period1,Period2,Period3,
                                      Dev_Step_1,Dev_Step_2,Dev_Step_3,
                                      Symbol_1_Kod,Symbol_2_Kod,Symbol_3_Kod,2,y);   
 NP_BuferDn =iCustom(myPair,TimeFrame,"3_Level_ZZ_Semafor",Period1,Period2,Period3,
                                      Dev_Step_1,Dev_Step_2,Dev_Step_3,
                                      Symbol_1_Kod,Symbol_2_Kod,Symbol_3_Kod,3,y);    
 HP_BuferUp =iCustom(myPair,TimeFrame,"3_Level_ZZ_Semafor",Period1,Period2,Period3,
                                      Dev_Step_1,Dev_Step_2,Dev_Step_3,
                                      Symbol_1_Kod,Symbol_2_Kod,Symbol_3_Kod,4,y);    
 HP_BuferDn =iCustom(myPair,TimeFrame,"3_Level_ZZ_Semafor",Period1,Period2,Period3,
                                      Dev_Step_1,Dev_Step_2,Dev_Step_3,
                                      Symbol_1_Kod,Symbol_2_Kod,Symbol_3_Kod,5,y);   


   } // for

                                       
}

/*


 FP_BuferUp[i]=iCustom(NULL,TimeFrame,"3_Level_ZZ_Semafor",Period1,Period2,Period3,
                                      Dev_Step_1,Dev_Step_2,Dev_Step_3,
                                      Symbol_1_Kod,Symbol_2_Kod,Symbol_3_Kod,0,y);
 FP_BuferDn[i]=iCustom(NULL,TimeFrame,"3_Level_ZZ_Semafor",Period1,Period2,Period3,
                                      Dev_Step_1,Dev_Step_2,Dev_Step_3,
                                      Symbol_1_Kod,Symbol_2_Kod,Symbol_3_Kod,1,y); 
 NP_BuferUp[i]=iCustom(NULL,TimeFrame,"3_Level_ZZ_Semafor",Period1,Period2,Period3,
                                      Dev_Step_1,Dev_Step_2,Dev_Step_3,
                                      Symbol_1_Kod,Symbol_2_Kod,Symbol_3_Kod,2,y);   
 NP_BuferDn[i]=iCustom(NULL,TimeFrame,"3_Level_ZZ_Semafor",Period1,Period2,Period3,
                                      Dev_Step_1,Dev_Step_2,Dev_Step_3,
                                      Symbol_1_Kod,Symbol_2_Kod,Symbol_3_Kod,3,y);    
 HP_BuferUp[i]=iCustom(NULL,TimeFrame,"3_Level_ZZ_Semafor",Period1,Period2,Period3,
                                      Dev_Step_1,Dev_Step_2,Dev_Step_3,
                                      Symbol_1_Kod,Symbol_2_Kod,Symbol_3_Kod,4,y);    
 HP_BuferDn[i]=iCustom(NULL,TimeFrame,"3_Level_ZZ_Semafor",Period1,Period2,Period3,
                                      Dev_Step_1,Dev_Step_2,Dev_Step_3,
                                      Symbol_1_Kod,Symbol_2_Kod,Symbol_3_Kod,5,y);   


 // +++++++++++++++++++++++++++++++++++++ Refresh buffers 
   if (TimeFrame>Period()) {
     int PerINT=TimeFrame/Period()+1;
     datetime TimeArr[]; ArrayResize(TimeArr,PerINT);
     ArrayCopySeries(TimeArr,MODE_TIME,Symbol(),Period()); 
     for(i=0;i<PerINT+1;i++) {if (TimeArr[i]>=TimeArray[0]) {
 /********************************************************     
    Refresh buffers:         buffer[i] = buffer[0];
 ********************************************************/  
 /*
   FP_BuferUp[i]=FP_BuferUp[0];
   FP_BuferDn[i]=FP_BuferDn[0];
   NP_BuferUp[i]=NP_BuferUp[0];
   NP_BuferDn[i]=NP_BuferDn[0];
   HP_BuferUp[i]=HP_BuferUp[0];
   HP_BuferDn[i]=HP_BuferDn[0];


 } }
 
 

double zu =iCustom("GBPUSD",15,"3_Level_ZZ_Semafor",Period1,Period2,Period3,
                                      Dev_Step_1,Dev_Step_2,Dev_Step_3,
                                      Symbol_1_Kod,Symbol_2_Kod,Symbol_3_Kod,2,y);   
double zd =iCustom("GBPUSD",15,"3_Level_ZZ_Semafor",Period1,Period2,Period3,
                                      Dev_Step_1,Dev_Step_2,Dev_Step_3,
                                      Symbol_1_Kod,Symbol_2_Kod,Symbol_3_Kod,3,y);  
                                      
Comment( "zu=", DoubleToStr(zu, Digits),  "\n", "zd=", DoubleToStr(zd, Digits),  "\n" ) ;
 
*/

Comments

Markdown supported. Formatting help

Markdown Formatting Guide

Element Markdown Syntax
Heading # H1
## H2
### H3
Bold **bold text**
Italic *italicized text*
Link [title](https://www.example.com)
Image ![alt text](image.jpg)
Code `code`
Code Block ```
code block
```
Quote > blockquote
Unordered List - Item 1
- Item 2
Ordered List 1. First item
2. Second item
Horizontal Rule ---