Navigation´╝ÜHome > Content >

MoneyDeepLevels.mq4

Time: 2013-03-20 | Download file:MoneyDeepLevels.mq4

//+------------------------------------------------------------------+
//|                                              MoneyDeepLevels.mq4 |
//|                                  Coded By, Brooky Indicators.com |
//|  http://www.forexfactory.com/showthread.php?t=308230 MoneyDeep   |
//+------------------------------------------------------------------+

#property link      "www.Brooky-Indicators.com"

#property indicator_chart_window


extern color  CalcUpColor=DodgerBlue;
extern color  CalcDnColor=Red;
extern int    CalcSize=1;
extern int    CalcStyle=1;
extern color  ControlBarColor=Red;


extern double    ratio1 = 0.0125;
extern double    ratio2 = 0.025;
extern double    ratio3 = 0.033;
extern double    ratio4 = 0.0375;
extern double    ratio5 = 0.05;
extern double    ratio6 = 0.0625;
extern double    ratio7 = 0.06666;
extern double    ratio8 = 0.075;
extern double    ratio9 = 0.0875;
extern double    ratio10 = 0.10;

static double thelow,thehigh;
string txtUp1="U1",txtUp2="U2",txtUp3="U3",txtUp4="U4",txtUp5="U5",txtUp6="U6",txtUp7="U7",txtUp8="U8",txtUp9="U9",txtUp10="U10",txtUp11="U11";
string txtDn1="D1",txtDn2="D2",txtDn3="D3",txtDn4="D4",txtDn5="D5",txtDn6="D6",txtDn7="D7",txtDn8="D8",txtDn9="D9",txtDn10="D10",txtDn11="D11";

double Up1,Up2,Up3,Up4,Up5,Up6,Up7,Up8,Up9,Up10;
double Dn1,Dn2,Dn3,Dn4,Dn5,Dn6,Dn7,Dn8,Dn9,Dn10;



string ControlBar="ControlBar";
double price1,price2;
static datetime lowtime,hightime;
//---------------------------------------------+
int init()
  {

   return(0);
  }
//---------------------------------------------+
int deinit()
  {
   
   ObjectDelete(txtUp1);
   ObjectDelete(txtUp2);
   ObjectDelete(txtUp3);
   ObjectDelete(txtUp4);
   ObjectDelete(txtUp5);
   ObjectDelete(txtUp6);
   ObjectDelete(txtUp7);
   ObjectDelete(txtUp8);
   ObjectDelete(txtUp9);
   ObjectDelete(txtUp10);
   ObjectDelete(txtUp11);

   ObjectDelete(txtDn1);
   ObjectDelete(txtDn2);
   ObjectDelete(txtDn3);
   ObjectDelete(txtDn4);
   ObjectDelete(txtDn5);
   ObjectDelete(txtDn6);
   ObjectDelete(txtDn7);
   ObjectDelete(txtDn8);
   ObjectDelete(txtDn9);
   ObjectDelete(txtDn10);
   ObjectDelete(txtDn11);
      
   Comment("");
   return(0);
  }
//---------------------------------------------+

int start()
  {
 
 price1=0;
 price2=0;         
     
if(ObjectFind(ControlBar)!=0)
{


      ObjectCreate(ControlBar,OBJ_TREND,0,Time[1],Close[1],Time[1],Close[1]-((High[1]-Low[1])*2));      
      ObjectSet(ControlBar, OBJPROP_COLOR,ControlBarColor);
      ObjectSet(ControlBar, OBJPROP_WIDTH ,2);      
      ObjectSet(ControlBar, OBJPROP_RAY ,False);

}

//-------------
if(ObjectFind(ControlBar)==0)
{

   price1=ObjectGet(ControlBar, OBJPROP_PRICE1);
   price2=ObjectGet(ControlBar, OBJPROP_PRICE2);
  
  thelow=MathMin(price1,price2);
  thehigh=MathMax(price1,price2);
  if(thelow==price1)lowtime=ObjectGet(ControlBar, OBJPROP_TIME1);else  lowtime=ObjectGet(ControlBar, OBJPROP_TIME2);
  if(thehigh==price2)hightime=ObjectGet(ControlBar, OBJPROP_TIME2);else  hightime=ObjectGet(ControlBar, OBJPROP_TIME1);
}

//---lines
if(ObjectFind(txtUp1)!=0)
{
      ObjectCreate(txtUp1,OBJ_HLINE,0,Time[0],thelow);      
      ObjectSet(txtUp1, OBJPROP_COLOR,CalcUpColor);
      ObjectSet(txtUp1, OBJPROP_WIDTH ,1);      
      ObjectSet(txtUp1, OBJPROP_RAY ,True);    

}  
if(ObjectFind(txtUp1)==0)
{
ObjectSet(txtUp1,  OBJPROP_PRICE1,thelow);

}
//---- 
if(ObjectFind(txtUp2)!=0)
{
      ObjectCreate(txtUp2,OBJ_HLINE,0,Time[0],thelow+(ratio1*thelow));      
      ObjectSet(txtUp2, OBJPROP_COLOR,CalcUpColor);
      ObjectSet(txtUp2, OBJPROP_WIDTH ,1);      
      ObjectSet(txtUp2, OBJPROP_RAY ,True);    

}  
if(ObjectFind(txtUp2)==0)
{
ObjectSet(txtUp2,  OBJPROP_PRICE1,thelow+(ratio1*thelow));

}
//---- 
if(ObjectFind(txtUp3)!=0)
{
      ObjectCreate(txtUp3,OBJ_HLINE,0,Time[0],thelow+(ratio2*thelow));      
      ObjectSet(txtUp3, OBJPROP_COLOR,CalcUpColor);
      ObjectSet(txtUp3, OBJPROP_WIDTH ,1);      
      ObjectSet(txtUp3, OBJPROP_RAY ,True);    

}  
if(ObjectFind(txtUp3)==0)
{
ObjectSet(txtUp3,  OBJPROP_PRICE1,thelow+(ratio2*thelow));

}
//---- 
if(ObjectFind(txtUp4)!=0)
{
      ObjectCreate(txtUp4,OBJ_HLINE,0,Time[0],thelow+(ratio3*thelow));      
      ObjectSet(txtUp4, OBJPROP_COLOR,CalcUpColor);
      ObjectSet(txtUp4, OBJPROP_WIDTH ,1);      
      ObjectSet(txtUp4, OBJPROP_RAY ,True);    

}  
if(ObjectFind(txtUp4)==0)
{
ObjectSet(txtUp4,  OBJPROP_PRICE1,thelow+(ratio3*thelow));

}
//---- 
if(ObjectFind(txtUp5)!=0)
{
      ObjectCreate(txtUp5,OBJ_HLINE,0,Time[0],thelow+(ratio4*thelow));      
      ObjectSet(txtUp5, OBJPROP_COLOR,CalcUpColor);
      ObjectSet(txtUp5, OBJPROP_WIDTH ,1);      
      ObjectSet(txtUp5, OBJPROP_RAY ,True);    

}  
if(ObjectFind(txtUp5)==0)
{
ObjectSet(txtUp5,  OBJPROP_PRICE1,thelow+(ratio4*thelow));

}
//---- 
if(ObjectFind(txtUp6)!=0)
{
      ObjectCreate(txtUp6,OBJ_HLINE,0,Time[0],thelow+(ratio5*thelow));      
      ObjectSet(txtUp6, OBJPROP_COLOR,CalcUpColor);
      ObjectSet(txtUp6, OBJPROP_WIDTH ,1);      
      ObjectSet(txtUp6, OBJPROP_RAY ,True);    

}  
if(ObjectFind(txtUp6)==0)
{
ObjectSet(txtUp6,  OBJPROP_PRICE1,thelow+(ratio5*thelow));

}
//---- 
if(ObjectFind(txtUp6)!=0)
{
      ObjectCreate(txtUp6,OBJ_HLINE,0,Time[0],thelow+(ratio5*thelow));      
      ObjectSet(txtUp6, OBJPROP_COLOR,CalcUpColor);
      ObjectSet(txtUp6, OBJPROP_WIDTH ,1);      
      ObjectSet(txtUp6, OBJPROP_RAY ,True);    

}  
if(ObjectFind(txtUp6)==0)
{
ObjectSet(txtUp6,  OBJPROP_PRICE1,thelow+(ratio5*thelow));

}
//---- 
if(ObjectFind(txtUp7)!=0)
{
      ObjectCreate(txtUp7,OBJ_HLINE,0,Time[0],thelow+(ratio6*thelow));      
      ObjectSet(txtUp7, OBJPROP_COLOR,CalcUpColor);
      ObjectSet(txtUp7, OBJPROP_WIDTH ,1);      
      ObjectSet(txtUp7, OBJPROP_RAY ,True);    

}  
if(ObjectFind(txtUp7)==0)
{
ObjectSet(txtUp7,  OBJPROP_PRICE1,thelow+(ratio6*thelow));

}
//---- 
if(ObjectFind(txtUp8)!=0)
{
      ObjectCreate(txtUp8,OBJ_HLINE,0,Time[0],thelow+(ratio7*thelow));      
      ObjectSet(txtUp8, OBJPROP_COLOR,CalcUpColor);
      ObjectSet(txtUp8, OBJPROP_WIDTH ,1);      
      ObjectSet(txtUp8, OBJPROP_RAY ,True);    

}  
if(ObjectFind(txtUp8)==0)
{
ObjectSet(txtUp8,  OBJPROP_PRICE1,thelow+(ratio7*thelow));

}
//----     
 if(ObjectFind(txtUp9)!=0)
{
      ObjectCreate(txtUp9,OBJ_HLINE,0,Time[0],thelow+(ratio8*thelow));      
      ObjectSet(txtUp9, OBJPROP_COLOR,CalcUpColor);
      ObjectSet(txtUp9, OBJPROP_WIDTH ,1);      
      ObjectSet(txtUp9, OBJPROP_RAY ,True);    

}  
if(ObjectFind(txtUp9)==0)
{
ObjectSet(txtUp9,  OBJPROP_PRICE1,thelow+(ratio8*thelow));

}     
//----     
 if(ObjectFind(txtUp10)!=0)
{
      ObjectCreate(txtUp10,OBJ_HLINE,0,Time[0],thelow+(ratio9*thelow));      
      ObjectSet(txtUp10, OBJPROP_COLOR,CalcUpColor);
      ObjectSet(txtUp10, OBJPROP_WIDTH ,1);      
      ObjectSet(txtUp10, OBJPROP_RAY ,True);    

}  
if(ObjectFind(txtUp10)==0)
{
ObjectSet(txtUp10,  OBJPROP_PRICE1,thelow+(ratio9*thelow));

}     
//----     
 if(ObjectFind(txtUp11)!=0)
{
      ObjectCreate(txtUp11,OBJ_HLINE,0,Time[0],thelow+(ratio10*thelow));      
      ObjectSet(txtUp11, OBJPROP_COLOR,CalcUpColor);
      ObjectSet(txtUp11, OBJPROP_WIDTH ,1);      
      ObjectSet(txtUp11, OBJPROP_RAY ,True);    

}  
if(ObjectFind(txtUp11)==0)
{
ObjectSet(txtUp11,  OBJPROP_PRICE1,thelow+(ratio10*thelow));

} 
//-------------------------------Dn Levels
if(ObjectFind(txtDn1)!=0)
{
      ObjectCreate(txtDn1,OBJ_HLINE,0,Time[0],thehigh);      
      ObjectSet(txtDn1, OBJPROP_COLOR,CalcDnColor);
      ObjectSet(txtDn1, OBJPROP_WIDTH ,1);      
      ObjectSet(txtDn1, OBJPROP_RAY ,True);    

}  
if(ObjectFind(txtDn1)==0)
{
ObjectSet(txtDn1,  OBJPROP_PRICE1,thehigh);

}
//---- 
if(ObjectFind(txtDn2)!=0)
{
      ObjectCreate(txtDn2,OBJ_HLINE,0,Time[0],thehigh-(ratio1*thehigh));      
      ObjectSet(txtDn2, OBJPROP_COLOR,CalcDnColor);
      ObjectSet(txtDn2, OBJPROP_WIDTH ,1);      
      ObjectSet(txtDn2, OBJPROP_RAY ,True);    

}  
if(ObjectFind(txtDn2)==0)
{
ObjectSet(txtDn2,  OBJPROP_PRICE1,thehigh-(ratio1*thehigh));

}
//---- 
if(ObjectFind(txtDn3)!=0)
{
      ObjectCreate(txtDn3,OBJ_HLINE,0,Time[0],thehigh-(ratio2*thehigh));      
      ObjectSet(txtDn3, OBJPROP_COLOR,CalcDnColor);
      ObjectSet(txtDn3, OBJPROP_WIDTH ,1);      
      ObjectSet(txtDn3, OBJPROP_RAY ,True);    

}  
if(ObjectFind(txtDn3)==0)
{
ObjectSet(txtDn3,  OBJPROP_PRICE1,thehigh-(ratio2*thehigh));

}
//---- 
if(ObjectFind(txtDn4)!=0)
{
      ObjectCreate(txtDn4,OBJ_HLINE,0,Time[0],thehigh-(ratio3*thehigh));      
      ObjectSet(txtDn4, OBJPROP_COLOR,CalcDnColor);
      ObjectSet(txtDn4, OBJPROP_WIDTH ,1);      
      ObjectSet(txtDn4, OBJPROP_RAY ,True);    

}  
if(ObjectFind(txtDn4)==0)
{
ObjectSet(txtDn4,  OBJPROP_PRICE1,thehigh-(ratio3*thehigh));

}
//---- 
if(ObjectFind(txtDn5)!=0)
{
      ObjectCreate(txtDn5,OBJ_HLINE,0,Time[0],thehigh-(ratio4*thehigh));      
      ObjectSet(txtDn5, OBJPROP_COLOR,CalcDnColor);
      ObjectSet(txtDn5, OBJPROP_WIDTH ,1);      
      ObjectSet(txtDn5, OBJPROP_RAY ,True);    

}  
if(ObjectFind(txtDn5)==0)
{
ObjectSet(txtDn5,  OBJPROP_PRICE1,thehigh-(ratio4*thehigh));

}
//---- 
if(ObjectFind(txtDn6)!=0)
{
      ObjectCreate(txtDn6,OBJ_HLINE,0,Time[0],thehigh-(ratio5*thehigh));      
      ObjectSet(txtDn6, OBJPROP_COLOR,CalcDnColor);
      ObjectSet(txtDn6, OBJPROP_WIDTH ,1);      
      ObjectSet(txtDn6, OBJPROP_RAY ,True);    

}  
if(ObjectFind(txtDn6)==0)
{
ObjectSet(txtDn6,  OBJPROP_PRICE1,thehigh-(ratio5*thehigh));

}
//---- 
if(ObjectFind(txtDn7)!=0)
{
      ObjectCreate(txtDn7,OBJ_HLINE,0,Time[0],thehigh-(ratio6*thehigh));      
      ObjectSet(txtDn7, OBJPROP_COLOR,CalcDnColor);
      ObjectSet(txtDn7, OBJPROP_WIDTH ,1);      
      ObjectSet(txtDn7, OBJPROP_RAY ,True);    

}  
if(ObjectFind(txtDn7)==0)
{
ObjectSet(txtDn7,  OBJPROP_PRICE1,thehigh-(ratio6*thehigh));

}
//---- 
if(ObjectFind(txtDn8)!=0)
{
      ObjectCreate(txtDn8,OBJ_HLINE,0,Time[0],thehigh-(ratio7*thehigh));      
      ObjectSet(txtDn8, OBJPROP_COLOR,CalcDnColor);
      ObjectSet(txtDn8, OBJPROP_WIDTH ,1);      
      ObjectSet(txtDn8, OBJPROP_RAY ,True);    

}  
if(ObjectFind(txtDn8)==0)
{
ObjectSet(txtDn8,  OBJPROP_PRICE1,thehigh-(ratio7*thehigh));

}
//---- 
     
 if(ObjectFind(txtDn9)!=0)
{
      ObjectCreate(txtDn9,OBJ_HLINE,0,Time[0],thehigh-(ratio8*thehigh));      
      ObjectSet(txtDn9, OBJPROP_COLOR,CalcDnColor);
      ObjectSet(txtDn9, OBJPROP_WIDTH ,1);      
      ObjectSet(txtDn9, OBJPROP_RAY ,True);    

}  
if(ObjectFind(txtDn9)==0)
{
ObjectSet(txtDn9,  OBJPROP_PRICE1,thehigh-(ratio8*thehigh));

}     
//----     
 if(ObjectFind(txtDn10)!=0)
{
      ObjectCreate(txtDn10,OBJ_HLINE,0,Time[0],thehigh-(ratio9*thehigh));      
      ObjectSet(txtDn10, OBJPROP_COLOR,CalcDnColor);
      ObjectSet(txtDn10, OBJPROP_WIDTH ,1);      
      ObjectSet(txtDn10, OBJPROP_RAY ,True);    

}  
if(ObjectFind(txtDn10)==0)
{
ObjectSet(txtDn10,  OBJPROP_PRICE1,thehigh-(ratio9*thehigh));

}     
//----     
 if(ObjectFind(txtDn11)!=0)
{
      ObjectCreate(txtDn11,OBJ_HLINE,0,Time[0],thehigh-(ratio10*thehigh));      
      ObjectSet(txtDn11, OBJPROP_COLOR,CalcDnColor);
      ObjectSet(txtDn11, OBJPROP_WIDTH ,1);      
      ObjectSet(txtDn11, OBJPROP_RAY ,True);    

}  
if(ObjectFind(txtDn11)==0)
{
ObjectSet(txtDn11,  OBJPROP_PRICE1,thehigh-(ratio10*thehigh));

} 
Comment("\n Coded By Brooky-Indicators.com for MoneyDeep");
   return(0);
  }

Recommend