Navigation:Home > Content >

Box.mq4

Time: 2013-09-03 | Download file:Box.mq4

//+------------------------------------------------------------------+
//|                                                          Box.mq4 |
//|                                                                  |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright ""
#property link      ""

#property indicator_chart_window

extern int Complect=0;
extern int timeframe=0;
extern bool over=false;

extern bool backgr=false;
extern bool stopper=false;
extern bool save=false;

extern color point_col=Blue;
extern color vlines_col=Yellow;
extern color hlines_col=Yellow;
extern color colour1=FireBrick;
extern color colour2=Blue;
extern color colour3=MediumSpringGreen;

extern int vlines_style=0;
extern int hlines_style=0;
extern int style1=0;
extern int style2=0;
extern int style3=0;

extern int point_width=1;
extern int vlines_width=1;
extern int hlines_width=1;
extern int width1=1;
extern int width2=1;
extern int width3=1;

extern int fplace=34;
extern int splace=5;
extern bool by_time=false;
extern datetime point1_date=D'2007.07.24 00:00';
extern datetime point2_date=D'2007.08.16 00:00';

extern bool handycode=false;
extern int code=108;

extern bool delpoints=false;

datetime prevtime;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//----
   ObjectDelete("VLine1 Complect№"+Complect);
   ObjectDelete("VLine2 Complect№"+Complect);
   ObjectDelete("VLine3 Complect№"+Complect);
   ObjectDelete("VLine4 Complect№"+Complect);
   ObjectDelete("VLine5 Complect№"+Complect);
   ObjectDelete("HLine1 Complect№"+Complect);
   ObjectDelete("HLine2 Complect№"+Complect);
   ObjectDelete("HLine3 Complect№"+Complect);
   ObjectDelete("HLine4 Complect№"+Complect);
   ObjectDelete("HLine5 Complect№"+Complect);
   ObjectDelete("MainCrossLine1 Complect№"+Complect);
   ObjectDelete("MainCrossLine2 Complect№"+Complect);
   ObjectDelete("SubMainCross1Line1 Complect№"+Complect);
   ObjectDelete("SubMainCross1Line2 Complect№"+Complect);
   ObjectDelete("SubMainCross2Line1 Complect№"+Complect);
   ObjectDelete("SubMainCross2Line2 Complect№"+Complect);
   ObjectDelete("Diag1Line1 Complect№"+Complect);
   ObjectDelete("Diag1Line2 Complect№"+Complect);
   ObjectDelete("Diag1Line3 Complect№"+Complect);
   ObjectDelete("Diag1Line4 Complect№"+Complect);
   ObjectDelete("Diag2Line1 Complect№"+Complect);
   ObjectDelete("Diag2Line2 Complect№"+Complect);
   ObjectDelete("Diag2Line3 Complect№"+Complect);
   ObjectDelete("Diag2Line4 Complect№"+Complect);
   ObjectDelete("FirstCrossLine1 Complect№"+Complect);
   ObjectDelete("FirstCrossLine2 Complect№"+Complect);
   ObjectDelete("LastCrossLine1 Complect№"+Complect);
   ObjectDelete("LastCrossLine2 Complect№"+Complect);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   if(delpoints)
    {
     ObjectDelete("Point1 Complect№"+Complect);
     ObjectDelete("Point2 Complect№"+Complect);
    }
   ObjectDelete("VLine1 Complect№"+Complect);
   ObjectDelete("VLine2 Complect№"+Complect);
   ObjectDelete("VLine3 Complect№"+Complect);
   ObjectDelete("VLine4 Complect№"+Complect);
   ObjectDelete("VLine5 Complect№"+Complect);
   ObjectDelete("HLine1 Complect№"+Complect);
   ObjectDelete("HLine2 Complect№"+Complect);
   ObjectDelete("HLine3 Complect№"+Complect);
   ObjectDelete("HLine4 Complect№"+Complect);
   ObjectDelete("HLine5 Complect№"+Complect);
   ObjectDelete("MainCrossLine1 Complect№"+Complect);
   ObjectDelete("MainCrossLine2 Complect№"+Complect);
   ObjectDelete("SubMainCross1Line1 Complect№"+Complect);
   ObjectDelete("SubMainCross1Line2 Complect№"+Complect);
   ObjectDelete("SubMainCross2Line1 Complect№"+Complect);
   ObjectDelete("SubMainCross2Line2 Complect№"+Complect);
   ObjectDelete("Diag1Line1 Complect№"+Complect);
   ObjectDelete("Diag1Line2 Complect№"+Complect);
   ObjectDelete("Diag1Line3 Complect№"+Complect);
   ObjectDelete("Diag1Line4 Complect№"+Complect);
   ObjectDelete("Diag2Line1 Complect№"+Complect);
   ObjectDelete("Diag2Line2 Complect№"+Complect);
   ObjectDelete("Diag2Line3 Complect№"+Complect);
   ObjectDelete("Diag2Line4 Complect№"+Complect);
   ObjectDelete("FirstCrossLine1 Complect№"+Complect);
   ObjectDelete("FirstCrossLine2 Complect№"+Complect);
   ObjectDelete("LastCrossLine1 Complect№"+Complect);
   ObjectDelete("LastCrossLine2 Complect№"+Complect);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int error=GetLastError();
//----
   if(stopper)
    {
     if(prevtime == Time[0]) return(0);
     if(error!=4066) prevtime = Time[0];
    }
//----
   int iH, iL, P, nP1, nP2, nH, nL, nPoint2, nPoint1, i, time3, time4, time5;
   int pointcode;
   double period, scale;
   bool up;
   datetime Date1, Date2;
   string freeze="";
   if(save) freeze=" saved";
//----    
   if(vlines_style<0 || vlines_style>4) vlines_style=0;
   if(hlines_style<0 || hlines_style>4) hlines_style=0;
   if(style1<0 || style1>4) style1=0;
   if(style2<0 || style2>4) style2=0;
   if(style3<0 || style3>4) style3=0;
//----   
   ObjectDelete("VLine1 Complect№"+Complect);
   ObjectDelete("VLine2 Complect№"+Complect);
   ObjectDelete("VLine3 Complect№"+Complect);
   ObjectDelete("VLine4 Complect№"+Complect);
   ObjectDelete("VLine5 Complect№"+Complect);
   ObjectDelete("HLine1 Complect№"+Complect);
   ObjectDelete("HLine2 Complect№"+Complect);
   ObjectDelete("HLine3 Complect№"+Complect);
   ObjectDelete("HLine4 Complect№"+Complect);
   ObjectDelete("HLine5 Complect№"+Complect);
   ObjectDelete("MainCrossLine1 Complect№"+Complect);
   ObjectDelete("MainCrossLine2 Complect№"+Complect);
   ObjectDelete("SubMainCross1Line1 Complect№"+Complect);
   ObjectDelete("SubMainCross1Line2 Complect№"+Complect);
   ObjectDelete("SubMainCross2Line1 Complect№"+Complect);
   ObjectDelete("SubMainCross2Line2 Complect№"+Complect);
   ObjectDelete("Diag1Line1 Complect№"+Complect);
   ObjectDelete("Diag1Line2 Complect№"+Complect);
   ObjectDelete("Diag1Line3 Complect№"+Complect);
   ObjectDelete("Diag1Line4 Complect№"+Complect);
   ObjectDelete("Diag2Line1 Complect№"+Complect);
   ObjectDelete("Diag2Line2 Complect№"+Complect);
   ObjectDelete("Diag2Line3 Complect№"+Complect);
   ObjectDelete("Diag2Line4 Complect№"+Complect);
   ObjectDelete("FirstCrossLine1 Complect№"+Complect);
   ObjectDelete("FirstCrossLine2 Complect№"+Complect);
   ObjectDelete("LastCrossLine1 Complect№"+Complect);
   ObjectDelete("LastCrossLine2 Complect№"+Complect);
//----
   switch (timeframe)
    {
      case 1:
         period = OBJ_PERIOD_M1;
         break;
      case 5:
         if(over) period = OBJ_PERIOD_M1 | OBJ_PERIOD_M5; else period = OBJ_PERIOD_M5;
         break;
      case 15:
         if(over) period = OBJ_PERIOD_M1 | OBJ_PERIOD_M5 | OBJ_PERIOD_M15; else period = OBJ_PERIOD_M15;
         break;
      case 30:
         if(over) period = OBJ_PERIOD_M1 | OBJ_PERIOD_M5 | OBJ_PERIOD_M15 | OBJ_PERIOD_M30; else period = OBJ_PERIOD_M30;
         break;      
      case 60:
         if(over) period = OBJ_PERIOD_M1 | OBJ_PERIOD_M5 | OBJ_PERIOD_M15 | OBJ_PERIOD_M30 | OBJ_PERIOD_H1; else period = OBJ_PERIOD_H1;
         break;
      case 240:
         if(over) period = OBJ_PERIOD_M1 | OBJ_PERIOD_M5 | OBJ_PERIOD_M15 | OBJ_PERIOD_M30 | OBJ_PERIOD_H1 | OBJ_PERIOD_H4; else period = OBJ_PERIOD_H4;
         break;
      case 1440:
         if(over) period = OBJ_PERIOD_M1 | OBJ_PERIOD_M5 | OBJ_PERIOD_M15 | OBJ_PERIOD_M30 | OBJ_PERIOD_H1 | OBJ_PERIOD_H4 | OBJ_PERIOD_D1; else period = OBJ_PERIOD_D1;
         break;
      case 10080:
         if(over) period = OBJ_PERIOD_M1 | OBJ_PERIOD_M5 | OBJ_PERIOD_M15 | OBJ_PERIOD_M30 | OBJ_PERIOD_H1 | OBJ_PERIOD_H4 | OBJ_PERIOD_D1 | OBJ_PERIOD_W1; else period = OBJ_PERIOD_W1;
         break;
      case 43200:
         period = OBJ_PERIOD_MN1;
         break;
      case 0:
         period = NULL;
         break;
      case -1:
         period = EMPTY;
         break;       
    }   
//---- 
   if(handycode) pointcode=code;
   else
    {
     switch (Complect)
      {
       case  0: pointcode = 139; break;
       case  1: pointcode = 140; break;
       case  2: pointcode = 141; break;
       case  3: pointcode = 142; break;
       case  4: pointcode = 143; break;
       case  5: pointcode = 144; break;
       case  6: pointcode = 145; break;
       case  7: pointcode = 146; break;
       case  8: pointcode = 147; break;
       case  9: pointcode = 148; break;
       case 10: pointcode = 149; break;
       case 11: pointcode = 128; break;
       case 12: pointcode = 129; break;
       case 13: pointcode = 130; break;
       case 14: pointcode = 131; break;
       case 15: pointcode = 132; break;
       case 16: pointcode = 133; break;
       case 17: pointcode = 134; break;
       case 18: pointcode = 135; break;
       case 19: pointcode = 136; break;
       case 20: pointcode = 137; break;
       case 21: pointcode = 138; break;
       default: pointcode = code;
      }
    }        
//----
   if(by_time) 
    {
     fplace=iBarShift(NULL,0,point1_date,false);
     splace=iBarShift(NULL,0,point2_date,false);
    }    
   if(ObjectFind("Point1 Complect№"+Complect)!=0) ObjectCreate("Point1 Complect№"+Complect, OBJ_ARROW, 0, Time[fplace], (High[fplace]+Low[fplace])/2);
   if(ObjectFind("Point2 Complect№"+Complect)!=0) ObjectCreate("Point2 Complect№"+Complect, OBJ_ARROW, 0, Time[splace], (High[splace]+Low[splace])/2);
//----   
   ObjectSet("Point1 Complect№"+Complect,OBJPROP_ARROWCODE,pointcode);
   ObjectSet("Point1 Complect№"+Complect,OBJPROP_COLOR,point_col);
   ObjectSet("Point1 Complect№"+Complect,OBJPROP_WIDTH,point_width);
   ObjectSet("Point1 Complect№"+Complect,OBJPROP_TIMEFRAMES,period);
//----   
   ObjectSet("Point2 Complect№"+Complect,OBJPROP_ARROWCODE,pointcode);
   ObjectSet("Point2 Complect№"+Complect,OBJPROP_COLOR,point_col);
   ObjectSet("Point2 Complect№"+Complect,OBJPROP_WIDTH,point_width);
   ObjectSet("Point2 Complect№"+Complect,OBJPROP_TIMEFRAMES,period);
//----    
   Date1=ObjectGet("Point1 Complect№"+Complect,OBJPROP_TIME1);
   Date2=ObjectGet("Point2 Complect№"+Complect,OBJPROP_TIME1);   
//----  
   nP1=iBarShift(NULL,0,Date1,false);
   nP2=iBarShift(NULL,0,Date2,false);
   if(nP1>nP2)
    {
     P=nP1;
     nP1=nP2;
     nP2=P;
    }
   nH=iHighest(NULL,0,MODE_HIGH,nP2-nP1+1,nP1);
   nL=iLowest(NULL,0,MODE_LOW,nP2-nP1+1,nP1);
   if(nL>nH) up=true;
   else if(nL=0) ObjectCreate("VLine3 Complect№"+Complect+freeze,OBJ_VLINE,0,Time[time3],1.00);
   else ObjectCreate("VLine3 Complect№"+Complect+freeze,OBJ_VLINE,0,Time[0]-time3*Period()*60,1.00);}
   ObjectSet("VLine3 Complect№"+Complect+freeze,OBJPROP_COLOR,vlines_col);
   ObjectSet("VLine3 Complect№"+Complect+freeze,OBJPROP_STYLE,vlines_style);
   ObjectSet("VLine3 Complect№"+Complect+freeze,OBJPROP_WIDTH,vlines_width);
   ObjectSet("VLine3 Complect№"+Complect+freeze,OBJPROP_BACK,backgr);
   ObjectSet("VLine3 Complect№"+Complect+freeze,OBJPROP_TIMEFRAMES,period);
//----      
   if(ObjectFind("VLine4 Complect№"+Complect+freeze)!=0){
   if(time4>=0) ObjectCreate("VLine4 Complect№"+Complect+freeze,OBJ_VLINE,0,Time[time4],1.00);
   else ObjectCreate("VLine4 Complect№"+Complect+freeze,OBJ_VLINE,0,Time[0]-time4*Period()*60,1.00);}
   ObjectSet("VLine4 Complect№"+Complect+freeze,OBJPROP_COLOR,vlines_col);
   ObjectSet("VLine4 Complect№"+Complect+freeze,OBJPROP_STYLE,vlines_style);
   ObjectSet("VLine4 Complect№"+Complect+freeze,OBJPROP_WIDTH,vlines_width);
   ObjectSet("VLine4 Complect№"+Complect+freeze,OBJPROP_BACK,backgr);
   ObjectSet("VLine4 Complect№"+Complect+freeze,OBJPROP_TIMEFRAMES,period);
//----      
   if(ObjectFind("VLine5 Complect№"+Complect+freeze)!=0){
   if(time5>=0) ObjectCreate("VLine5 Complect№"+Complect+freeze,OBJ_VLINE,0,Time[time5],1.00);
   else ObjectCreate("VLine5 Complect№"+Complect+freeze,OBJ_VLINE,0,Time[0]-time5*Period()*60,1.00);}
   ObjectSet("VLine5 Complect№"+Complect+freeze,OBJPROP_COLOR,vlines_col);
   ObjectSet("VLine5 Complect№"+Complect+freeze,OBJPROP_STYLE,vlines_style);
   ObjectSet("VLine5 Complect№"+Complect+freeze,OBJPROP_WIDTH,vlines_width);
   ObjectSet("VLine5 Complect№"+Complect+freeze,OBJPROP_BACK,backgr);
   ObjectSet("VLine5 Complect№"+Complect+freeze,OBJPROP_TIMEFRAMES,period);
//----
   if(up)
    {
     if(ObjectFind("HLine1 Complect№"+Complect+freeze)!=0)     
     ObjectCreate("HLine1 Complect№"+Complect+freeze,OBJ_HLINE,0,Time[nPoint2],Low[nPoint2]);
//----      
     if(ObjectFind("HLine2 Complect№"+Complect+freeze)!=0)     
     ObjectCreate("HLine2 Complect№"+Complect+freeze,OBJ_HLINE,0,Time[nPoint2],Low[nPoint2]+(High[nPoint1]-Low[nPoint2])/4);
//----      
     if(ObjectFind("HLine3 Complect№"+Complect+freeze)!=0)     
     ObjectCreate("HLine3 Complect№"+Complect+freeze,OBJ_HLINE,0,Time[nPoint2],(High[nPoint1]+Low[nPoint2])/2);
//----      
     if(ObjectFind("HLine4 Complect№"+Complect+freeze)!=0)     
     ObjectCreate("HLine4 Complect№"+Complect+freeze,OBJ_HLINE,0,Time[nPoint2],High[nPoint1]-(High[nPoint1]-Low[nPoint2])/4);
//----       
     if(ObjectFind("HLine5 Complect№"+Complect+freeze)!=0)   
     ObjectCreate("HLine5 Complect№"+Complect+freeze,OBJ_HLINE,0,Time[nPoint1],High[nPoint1]);
//----
     if(ObjectFind("MainCrossLine1 Complect№"+Complect+freeze)!=0){
     if(time5>=0) ObjectCreate("MainCrossLine1 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],Low[nPoint2],Time[time5],High[nPoint1]);
     else ObjectCreate("MainCrossLine1 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],Low[nPoint2],Time[0]-time5*Period()*60,High[nPoint1]);}
//----     
     if(ObjectFind("MainCrossLine2 Complect№"+Complect+freeze)!=0){
     if(time5>=0) ObjectCreate("MainCrossLine2 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],High[nPoint1],Time[time5],Low[nPoint2]);
     else ObjectCreate("MainCrossLine2 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],High[nPoint1],Time[0]-time5*Period()*60,Low[nPoint2]);}
//----
     if(ObjectFind("SubMainCross1Line1 Complect№"+Complect+freeze)!=0){
     if(time3>=0) ObjectCreate("SubMainCross1Line1 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],Low[nPoint2],Time[time3],High[nPoint1]);
     else ObjectCreate("SubMainCross1Line1 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],Low[nPoint2],Time[0]-time3*Period()*60,High[nPoint1]);}
//----     
     if(ObjectFind("SubMainCross1Line2 Complect№"+Complect+freeze)!=0){
     if(time3>=0) ObjectCreate("SubMainCross1Line2 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],High[nPoint1],Time[time3],Low[nPoint2]);
     else ObjectCreate("SubMainCross1Line2 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],High[nPoint1],Time[0]-time3*Period()*60,Low[nPoint2]);}
//----
     if(ObjectFind("SubMainCross2Line1 Complect№"+Complect+freeze)!=0){
     ObjectCreate("SubMainCross2Line1 Complect№"+Complect+freeze,OBJ_TREND,0,0,0,0,0);
     if(time3>=0) ObjectSet("SubMainCross2Line1 Complect№"+Complect+freeze,OBJPROP_TIME1,Time[time3]);
     else ObjectSet("SubMainCross2Line1 Complect№"+Complect+freeze,OBJPROP_TIME1,Time[0]-time3*Period()*60);
     ObjectSet("SubMainCross2Line1 Complect№"+Complect+freeze,OBJPROP_PRICE1,Low[nPoint2]);
     if(time5>=0) ObjectSet("SubMainCross2Line1 Complect№"+Complect+freeze,OBJPROP_TIME2,Time[time5]);
     else ObjectSet("SubMainCross2Line1 Complect№"+Complect+freeze,OBJPROP_TIME2,Time[0]-time5*Period()*60);
     ObjectSet("SubMainCross2Line1 Complect№"+Complect+freeze,OBJPROP_PRICE2,High[nPoint1]);}
//----     
     if(ObjectFind("SubMainCross2Line2 Complect№"+Complect+freeze)!=0){
     ObjectCreate("SubMainCross2Line2 Complect№"+Complect+freeze,OBJ_TREND,0,0,0,0,0);
     if(time3>=0) ObjectSet("SubMainCross2Line2 Complect№"+Complect+freeze,OBJPROP_TIME1,Time[time3]);
     else ObjectSet("SubMainCross2Line2 Complect№"+Complect+freeze,OBJPROP_TIME1,Time[0]-time3*Period()*60);
     ObjectSet("SubMainCross2Line2 Complect№"+Complect+freeze,OBJPROP_PRICE1,High[nPoint1]);
     if(time5>=0) ObjectSet("SubMainCross2Line2 Complect№"+Complect+freeze,OBJPROP_TIME2,Time[time5]);
     else ObjectSet("SubMainCross2Line2 Complect№"+Complect+freeze,OBJPROP_TIME2,Time[0]-time5*Period()*60);
     ObjectSet("SubMainCross2Line2 Complect№"+Complect+freeze,OBJPROP_PRICE2,Low[nPoint2]);}
//----
     if(ObjectFind("Diag1Line1 Complect№"+Complect+freeze)!=0){
     if(time5>=0) ObjectCreate("Diag1Line1 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],Low[nPoint2],Time[time5],Low[nPoint2]+(High[nPoint1]-Low[nPoint2])/4);
     else ObjectCreate("Diag1Line1 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],Low[nPoint2],Time[0]-time5*Period()*60,Low[nPoint2]+(High[nPoint1]-Low[nPoint2])/4);}
//----     
     if(ObjectFind("Diag1Line2 Complect№"+Complect+freeze)!=0){
     if(time5>=0) ObjectCreate("Diag1Line2 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],Low[nPoint2],Time[time5],(Low[nPoint2]+High[nPoint1])/2);
     else ObjectCreate("Diag1Line2 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],Low[nPoint2],Time[0]-time5*Period()*60,(Low[nPoint2]+High[nPoint1])/2);}
//----     
     if(ObjectFind("Diag1Line3 Complect№"+Complect+freeze)!=0){
     if(time5>=0) ObjectCreate("Diag1Line3 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],High[nPoint1],Time[time5],(Low[nPoint2]+High[nPoint1])/2);
     else ObjectCreate("Diag1Line3 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],High[nPoint1],Time[0]-time5*Period()*60,(Low[nPoint2]+High[nPoint1])/2);}
//----     
     if(ObjectFind("Diag1Line4 Complect№"+Complect+freeze)!=0){
     if(time5>=0) ObjectCreate("Diag1Line4 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],High[nPoint1],Time[time5],High[nPoint1]-(High[nPoint1]-Low[nPoint2])/4);
     else ObjectCreate("Diag1Line4 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],High[nPoint1],Time[0]-time5*Period()*60,High[nPoint1]-(High[nPoint1]-Low[nPoint2])/4);}
//----
     if(ObjectFind("Diag2Line1 Complect№"+Complect+freeze)!=0){
     if(time5>=0) ObjectCreate("Diag2Line1 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],Low[nPoint2]+(High[nPoint1]-Low[nPoint2])/4,Time[time5],Low[nPoint2]);
     else ObjectCreate("Diag2Line1 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],Low[nPoint2]+(High[nPoint1]-Low[nPoint2])/4,Time[0]-time5*Period()*60,Low[nPoint2]);}
//----     
     if(ObjectFind("Diag2Line2 Complect№"+Complect+freeze)!=0){
     if(time5>=0) ObjectCreate("Diag2Line2 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],(Low[nPoint2]+High[nPoint1])/2,Time[time5],Low[nPoint2]);
     else ObjectCreate("Diag2Line2 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],(Low[nPoint2]+High[nPoint1])/2,Time[0]-time5*Period()*60,Low[nPoint2]);}
//----     
     if(ObjectFind("Diag2Line3 Complect№"+Complect+freeze)!=0){
     if(time5>=0) ObjectCreate("Diag2Line3 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],(Low[nPoint2]+High[nPoint1])/2,Time[time5],High[nPoint1]);
     else ObjectCreate("Diag2Line3 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],(Low[nPoint2]+High[nPoint1])/2,Time[0]-time5*Period()*60,High[nPoint1]);}
//----     
     if(ObjectFind("Diag2Line4 Complect№"+Complect+freeze)!=0){
     if(time5>=0) ObjectCreate("Diag2Line4 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],High[nPoint1]-(High[nPoint1]-Low[nPoint2])/4,Time[time5],High[nPoint1]);
     else ObjectCreate("Diag2Line4 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],High[nPoint1]-(High[nPoint1]-Low[nPoint2])/4,Time[0]-time5*Period()*60,High[nPoint1]);}
//----     
     if(ObjectFind("FirstCrossLine1 Complect№"+Complect+freeze)!=0)
     ObjectCreate("FirstCrossLine1 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],Low[nPoint2],Time[nPoint1],High[nPoint1]);
//----     
     if(ObjectFind("FirstCrossLine2 Complect№"+Complect+freeze)!=0)
     ObjectCreate("FirstCrossLine2 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],High[nPoint1],Time[nPoint1],Low[nPoint2]);
//----
     if(ObjectFind("LastCrossLine1 Complect№"+Complect+freeze)!=0){
     ObjectCreate("LastCrossLine1 Complect№"+Complect+freeze,OBJ_TREND,0,0,0,0,0);
     if(time4>=0) ObjectSet("LastCrossLine1 Complect№"+Complect+freeze,OBJPROP_TIME1,Time[time4]);
     else ObjectSet("LastCrossLine1 Complect№"+Complect+freeze,OBJPROP_TIME1,Time[0]-time4*Period()*60);
     ObjectSet("LastCrossLine1 Complect№"+Complect+freeze,OBJPROP_PRICE1,Low[nPoint2]);
     if(time5>=0) ObjectSet("LastCrossLine1 Complect№"+Complect+freeze,OBJPROP_TIME2,Time[time5]);
     else ObjectSet("LastCrossLine1 Complect№"+Complect+freeze,OBJPROP_TIME2,Time[0]-time5*Period()*60);
     ObjectSet("LastCrossLine1 Complect№"+Complect+freeze,OBJPROP_PRICE2,High[nPoint1]);}
//----     
     if(ObjectFind("LastCrossLine2 Complect№"+Complect+freeze)!=0){
     ObjectCreate("LastCrossLine2 Complect№"+Complect+freeze,OBJ_TREND,0,0,0,0,0);
     if(time4>=0) ObjectSet("LastCrossLine2 Complect№"+Complect+freeze,OBJPROP_TIME1,Time[time4]);
     else ObjectSet("LastCrossLine2 Complect№"+Complect+freeze,OBJPROP_TIME1,Time[0]-time4*Period()*60);
     ObjectSet("LastCrossLine2 Complect№"+Complect+freeze,OBJPROP_PRICE1,High[nPoint1]);
     if(time5>=0) ObjectSet("LastCrossLine2 Complect№"+Complect+freeze,OBJPROP_TIME2,Time[time5]);
     else ObjectSet("LastCrossLine2 Complect№"+Complect+freeze,OBJPROP_TIME2,Time[0]-time5*Period()*60);
     ObjectSet("LastCrossLine2 Complect№"+Complect+freeze,OBJPROP_PRICE2,Low[nPoint2]);}     
    }
//----    
   else
    {
     if(ObjectFind("HLine1 Complect№"+Complect+freeze)!=0)     
     ObjectCreate("HLine1 Complect№"+Complect+freeze,OBJ_HLINE,0,Time[nPoint2],High[nPoint2]);
//----      
     if(ObjectFind("HLine2 Complect№"+Complect+freeze)!=0)     
     ObjectCreate("HLine2 Complect№"+Complect+freeze,OBJ_HLINE,0,Time[nPoint2],High[nPoint2]-(High[nPoint2]-Low[nPoint1])/4);
//----      
     if(ObjectFind("HLine3 Complect№"+Complect+freeze)!=0)     
     ObjectCreate("HLine3 Complect№"+Complect+freeze,OBJ_HLINE,0,Time[nPoint2],(High[nPoint2]+Low[nPoint1])/2);
//----      
     if(ObjectFind("HLine4 Complect№"+Complect+freeze)!=0)     
     ObjectCreate("HLine4 Complect№"+Complect+freeze,OBJ_HLINE,0,Time[nPoint2],Low[nPoint1]+(High[nPoint2]-Low[nPoint1])/4);
//----       
     if(ObjectFind("HLine5 Complect№"+Complect+freeze)!=0)
     ObjectCreate("HLine5 Complect№"+Complect+freeze,OBJ_HLINE,0,Time[nPoint1],Low[nPoint1]);
//----
     if(ObjectFind("MainCrossLine1 Complect№"+Complect+freeze)!=0){
     if(time5>=0) ObjectCreate("MainCrossLine1 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],High[nPoint2],Time[time5],Low[nPoint1]);
     else ObjectCreate("MainCrossLine1 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],High[nPoint2],Time[0]-time5*Period()*60,Low[nPoint1]);}
//----     
     if(ObjectFind("MainCrossLine2 Complect№"+Complect+freeze)!=0){
     if(time5>=0) ObjectCreate("MainCrossLine2 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],Low[nPoint1],Time[time5],High[nPoint2]);
     else ObjectCreate("MainCrossLine2 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],Low[nPoint1],Time[0]-time5*Period()*60,High[nPoint2]);}
//----
     if(ObjectFind("SubMainCross1Line1 Complect№"+Complect+freeze)!=0){
     if(time3>=0) ObjectCreate("SubMainCross1Line1 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],High[nPoint2],Time[time3],Low[nPoint1]);
     else ObjectCreate("SubMainCross1Line1 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],High[nPoint2],Time[0]-time3*Period()*60,Low[nPoint1]);}
//----     
     if(ObjectFind("SubMainCross1Line2 Complect№"+Complect+freeze)!=0){
     if(time3>=0) ObjectCreate("SubMainCross1Line2 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],Low[nPoint1],Time[time3],High[nPoint2]);
     else ObjectCreate("SubMainCross1Line2 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],Low[nPoint1],Time[0]-time3*Period()*60,High[nPoint2]);}
//----
     if(ObjectFind("SubMainCross2Line1 Complect№"+Complect+freeze)!=0){
     ObjectCreate("SubMainCross2Line1 Complect№"+Complect+freeze,OBJ_TREND,0,0,0,0,0);
     if(time3>=0) ObjectSet("SubMainCross2Line1 Complect№"+Complect+freeze,OBJPROP_TIME1,Time[time3]);
     else ObjectSet("SubMainCross2Line1 Complect№"+Complect+freeze,OBJPROP_TIME1,Time[0]-time3*Period()*60);
     ObjectSet("SubMainCross2Line1 Complect№"+Complect+freeze,OBJPROP_PRICE1,High[nPoint2]);
     if(time5>=0) ObjectSet("SubMainCross2Line1 Complect№"+Complect+freeze,OBJPROP_TIME2,Time[time5]);
     else ObjectSet("SubMainCross2Line1 Complect№"+Complect+freeze,OBJPROP_TIME2,Time[0]-time5*Period()*60);
     ObjectSet("SubMainCross2Line1 Complect№"+Complect+freeze,OBJPROP_PRICE2,Low[nPoint1]);}
//----     
     if(ObjectFind("SubMainCross2Line2 Complect№"+Complect+freeze)!=0){
     ObjectCreate("SubMainCross2Line2 Complect№"+Complect+freeze,OBJ_TREND,0,0,0,0,0);
     if(time3>=0) ObjectSet("SubMainCross2Line2 Complect№"+Complect+freeze,OBJPROP_TIME1,Time[time3]);
     else ObjectSet("SubMainCross2Line2 Complect№"+Complect+freeze,OBJPROP_TIME1,Time[0]-time3*Period()*60);
     ObjectSet("SubMainCross2Line2 Complect№"+Complect+freeze,OBJPROP_PRICE1,Low[nPoint1]);
     if(time5>=0) ObjectSet("SubMainCross2Line2 Complect№"+Complect+freeze,OBJPROP_TIME2,Time[time5]);
     else ObjectSet("SubMainCross2Line2 Complect№"+Complect+freeze,OBJPROP_TIME2,Time[0]-time5*Period()*60);
     ObjectSet("SubMainCross2Line2 Complect№"+Complect+freeze,OBJPROP_PRICE2,High[nPoint2]);}
//----
     if(ObjectFind("Diag1Line1 Complect№"+Complect+freeze)!=0){
     if(time5>=0) ObjectCreate("Diag1Line1 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],High[nPoint2],Time[time5],High[nPoint2]-(High[nPoint2]-Low[nPoint1])/4);
     else ObjectCreate("Diag1Line1 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],High[nPoint2],Time[0]-time5*Period()*60,High[nPoint2]-(High[nPoint2]-Low[nPoint1])/4);}
//----     
     if(ObjectFind("Diag1Line2 Complect№"+Complect+freeze)!=0){
     if(time5>=0) ObjectCreate("Diag1Line2 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],High[nPoint2],Time[time5],(High[nPoint2]+Low[nPoint1])/2);
     else ObjectCreate("Diag1Line2 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],High[nPoint2],Time[0]-time5*Period()*60,(High[nPoint2]+Low[nPoint1])/2);}
//----     
     if(ObjectFind("Diag1Line3 Complect№"+Complect+freeze)!=0){
     if(time5>=0) ObjectCreate("Diag1Line3 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],Low[nPoint1],Time[time5],(High[nPoint2]+Low[nPoint1])/2);
     else ObjectCreate("Diag1Line3 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],Low[nPoint1],Time[0]-time5*Period()*60,(High[nPoint2]+Low[nPoint1])/2);}
//----     
     if(ObjectFind("Diag1Line4 Complect№"+Complect+freeze)!=0){
     if(time5>=0) ObjectCreate("Diag1Line4 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],Low[nPoint1],Time[time5],Low[nPoint1]+(High[nPoint2]-Low[nPoint1])/4);
     else ObjectCreate("Diag1Line4 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],Low[nPoint1],Time[0]-time5*Period()*60,Low[nPoint1]+(High[nPoint2]-Low[nPoint1])/4);}
//----
     if(ObjectFind("Diag2Line1 Complect№"+Complect+freeze)!=0){
     if(time5>=0) ObjectCreate("Diag2Line1 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],High[nPoint2]-(High[nPoint2]-Low[nPoint1])/4,Time[time5],High[nPoint2]);
     else ObjectCreate("Diag2Line1 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],High[nPoint2]-(High[nPoint2]-Low[nPoint1])/4,Time[0]-time5*Period()*60,High[nPoint2]);}
//----     
     if(ObjectFind("Diag2Line2 Complect№"+Complect+freeze)!=0){
     if(time5>=0) ObjectCreate("Diag2Line2 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],(High[nPoint2]+Low[nPoint1])/2,Time[time5],High[nPoint2]);
     else ObjectCreate("Diag2Line2 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],(High[nPoint2]+Low[nPoint1])/2,Time[0]-time5*Period()*60,High[nPoint2]);}
//----     
     if(ObjectFind("Diag2Line3 Complect№"+Complect+freeze)!=0){
     if(time5>=0) ObjectCreate("Diag2Line3 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],(High[nPoint2]+Low[nPoint1])/2,Time[time5],Low[nPoint1]);
     else ObjectCreate("Diag2Line3 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],(High[nPoint2]+Low[nPoint1])/2,Time[0]-time5*Period()*60,Low[nPoint1]);}
//----     
     if(ObjectFind("Diag2Line4 Complect№"+Complect+freeze)!=0){
     if(time5>=0) ObjectCreate("Diag2Line4 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],Low[nPoint1]+(High[nPoint2]-Low[nPoint1])/4,Time[time5],Low[nPoint1]);
     else ObjectCreate("Diag2Line4 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],Low[nPoint1]+(High[nPoint2]-Low[nPoint1])/4,Time[0]-time5*Period()*60,Low[nPoint1]);}
//----     
     if(ObjectFind("FirstCrossLine1 Complect№"+Complect+freeze)!=0)
     ObjectCreate("FirstCrossLine1 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],High[nPoint2],Time[nPoint1],Low[nPoint1]);
//----     
     if(ObjectFind("FirstCrossLine2 Complect№"+Complect+freeze)!=0)
     ObjectCreate("FirstCrossLine2 Complect№"+Complect+freeze,OBJ_TREND,0,Time[nPoint2],Low[nPoint1],Time[nPoint1],High[nPoint2]);
//----
     if(ObjectFind("LastCrossLine1 Complect№"+Complect+freeze)!=0){
     ObjectCreate("LastCrossLine1 Complect№"+Complect+freeze,OBJ_TREND,0,0,0,0,0);
     if(time4>=0) ObjectSet("LastCrossLine1 Complect№"+Complect+freeze,OBJPROP_TIME1,Time[time4]);
     else ObjectSet("LastCrossLine1 Complect№"+Complect+freeze,OBJPROP_TIME1,Time[0]-time4*Period()*60);
     ObjectSet("LastCrossLine1 Complect№"+Complect+freeze,OBJPROP_PRICE1,High[nPoint2]);
     if(time5>=0) ObjectSet("LastCrossLine1 Complect№"+Complect+freeze,OBJPROP_TIME2,Time[time5]);
     else ObjectSet("LastCrossLine1 Complect№"+Complect+freeze,OBJPROP_TIME2,Time[0]-time5*Period()*60);
     ObjectSet("LastCrossLine1 Complect№"+Complect+freeze,OBJPROP_PRICE2,Low[nPoint1]);}
//----     
     if(ObjectFind("LastCrossLine2 Complect№"+Complect+freeze)!=0){
     ObjectCreate("LastCrossLine2 Complect№"+Complect+freeze,OBJ_TREND,0,0,0,0,0);
     if(time4>=0) ObjectSet("LastCrossLine2 Complect№"+Complect+freeze,OBJPROP_TIME1,Time[time4]);
     else ObjectSet("LastCrossLine2 Complect№"+Complect+freeze,OBJPROP_TIME1,Time[0]-time4*Period()*60);
     ObjectSet("LastCrossLine2 Complect№"+Complect+freeze,OBJPROP_PRICE1,Low[nPoint1]);
     if(time5>=0) ObjectSet("LastCrossLine2 Complect№"+Complect+freeze,OBJPROP_TIME2,Time[time5]);
     else ObjectSet("LastCrossLine2 Complect№"+Complect+freeze,OBJPROP_TIME2,Time[0]-time5*Period()*60);
     ObjectSet("LastCrossLine2 Complect№"+Complect+freeze,OBJPROP_PRICE2,High[nPoint2]);}          
    }                 
//----
   ObjectSet("HLine1 Complect№"+Complect+freeze,OBJPROP_COLOR,hlines_col);
   ObjectSet("HLine1 Complect№"+Complect+freeze,OBJPROP_STYLE,hlines_style);
   ObjectSet("HLine1 Complect№"+Complect+freeze,OBJPROP_WIDTH,hlines_width);
   ObjectSet("HLine1 Complect№"+Complect+freeze,OBJPROP_BACK,backgr);
   ObjectSet("HLine1 Complect№"+Complect+freeze,OBJPROP_TIMEFRAMES,period);
//----   
   ObjectSet("HLine2 Complect№"+Complect+freeze,OBJPROP_COLOR,hlines_col);
   ObjectSet("HLine2 Complect№"+Complect+freeze,OBJPROP_STYLE,hlines_style);
   ObjectSet("HLine2 Complect№"+Complect+freeze,OBJPROP_WIDTH,hlines_width);
   ObjectSet("HLine2 Complect№"+Complect+freeze,OBJPROP_BACK,backgr);
   ObjectSet("HLine2 Complect№"+Complect+freeze,OBJPROP_TIMEFRAMES,period);
//----   
   ObjectSet("HLine3 Complect№"+Complect+freeze,OBJPROP_COLOR,hlines_col);
   ObjectSet("HLine3 Complect№"+Complect+freeze,OBJPROP_STYLE,hlines_style);
   ObjectSet("HLine3 Complect№"+Complect+freeze,OBJPROP_WIDTH,hlines_width);
   ObjectSet("HLine3 Complect№"+Complect+freeze,OBJPROP_BACK,backgr);
   ObjectSet("HLine3 Complect№"+Complect+freeze,OBJPROP_TIMEFRAMES,period); 
//----   
   ObjectSet("HLine4 Complect№"+Complect+freeze,OBJPROP_COLOR,hlines_col);
   ObjectSet("HLine4 Complect№"+Complect+freeze,OBJPROP_STYLE,hlines_style);
   ObjectSet("HLine4 Complect№"+Complect+freeze,OBJPROP_WIDTH,hlines_width);
   ObjectSet("HLine4 Complect№"+Complect+freeze,OBJPROP_BACK,backgr);
   ObjectSet("HLine4 Complect№"+Complect+freeze,OBJPROP_TIMEFRAMES,period); 
//----   
   ObjectSet("HLine5 Complect№"+Complect+freeze,OBJPROP_COLOR,hlines_col);
   ObjectSet("HLine5 Complect№"+Complect+freeze,OBJPROP_STYLE,hlines_style);
   ObjectSet("HLine5 Complect№"+Complect+freeze,OBJPROP_WIDTH,hlines_width);
   ObjectSet("HLine5 Complect№"+Complect+freeze,OBJPROP_BACK,backgr);
   ObjectSet("HLine5 Complect№"+Complect+freeze,OBJPROP_TIMEFRAMES,period);
//----   
   ObjectSet("MainCrossLine1 Complect№"+Complect+freeze,OBJPROP_COLOR,colour1);
   ObjectSet("MainCrossLine1 Complect№"+Complect+freeze,OBJPROP_STYLE,style1);
   ObjectSet("MainCrossLine1 Complect№"+Complect+freeze,OBJPROP_WIDTH,width1);
   ObjectSet("MainCrossLine1 Complect№"+Complect+freeze,OBJPROP_RAY,false);
   ObjectSet("MainCrossLine1 Complect№"+Complect+freeze,OBJPROP_BACK,backgr);
   ObjectSet("MainCrossLine1 Complect№"+Complect+freeze,OBJPROP_TIMEFRAMES,period);
//----   
   ObjectSet("MainCrossLine2 Complect№"+Complect+freeze,OBJPROP_COLOR,colour1);
   ObjectSet("MainCrossLine2 Complect№"+Complect+freeze,OBJPROP_STYLE,style1);
   ObjectSet("MainCrossLine2 Complect№"+Complect+freeze,OBJPROP_WIDTH,width1);
   ObjectSet("MainCrossLine2 Complect№"+Complect+freeze,OBJPROP_RAY,false);
   ObjectSet("MainCrossLine2 Complect№"+Complect+freeze,OBJPROP_BACK,backgr);
   ObjectSet("MainCrossLine2 Complect№"+Complect+freeze,OBJPROP_TIMEFRAMES,period);
//----   
   ObjectSet("SubMainCross1Line1 Complect№"+Complect+freeze,OBJPROP_COLOR,colour2);
   ObjectSet("SubMainCross1Line1 Complect№"+Complect+freeze,OBJPROP_STYLE,style2);
   ObjectSet("SubMainCross1Line1 Complect№"+Complect+freeze,OBJPROP_WIDTH,width2);
   ObjectSet("SubMainCross1Line1 Complect№"+Complect+freeze,OBJPROP_RAY,false);
   ObjectSet("SubMainCross1Line1 Complect№"+Complect+freeze,OBJPROP_BACK,backgr);
   ObjectSet("SubMainCross1Line1 Complect№"+Complect+freeze,OBJPROP_TIMEFRAMES,period);
//----   
   ObjectSet("SubMainCross1Line2 Complect№"+Complect+freeze,OBJPROP_COLOR,colour2);
   ObjectSet("SubMainCross1Line2 Complect№"+Complect+freeze,OBJPROP_STYLE,style2);
   ObjectSet("SubMainCross1Line2 Complect№"+Complect+freeze,OBJPROP_WIDTH,width2);
   ObjectSet("SubMainCross1Line2 Complect№"+Complect+freeze,OBJPROP_RAY,false);
   ObjectSet("SubMainCross1Line2 Complect№"+Complect+freeze,OBJPROP_BACK,backgr);
   ObjectSet("SubMainCross1Line2 Complect№"+Complect+freeze,OBJPROP_TIMEFRAMES,period);
//----   
   ObjectSet("SubMainCross2Line1 Complect№"+Complect+freeze,OBJPROP_COLOR,colour2);
   ObjectSet("SubMainCross2Line1 Complect№"+Complect+freeze,OBJPROP_STYLE,style2);
   ObjectSet("SubMainCross2Line1 Complect№"+Complect+freeze,OBJPROP_WIDTH,width2);
   ObjectSet("SubMainCross2Line1 Complect№"+Complect+freeze,OBJPROP_RAY,false);
   ObjectSet("SubMainCross2Line1 Complect№"+Complect+freeze,OBJPROP_BACK,backgr);
   ObjectSet("SubMainCross2Line1 Complect№"+Complect+freeze,OBJPROP_TIMEFRAMES,period); 
//----   
   ObjectSet("SubMainCross2Line2 Complect№"+Complect+freeze,OBJPROP_COLOR,colour2);
   ObjectSet("SubMainCross2Line2 Complect№"+Complect+freeze,OBJPROP_STYLE,style2);
   ObjectSet("SubMainCross2Line2 Complect№"+Complect+freeze,OBJPROP_WIDTH,width2);
   ObjectSet("SubMainCross2Line2 Complect№"+Complect+freeze,OBJPROP_RAY,false);
   ObjectSet("SubMainCross2Line2 Complect№"+Complect+freeze,OBJPROP_BACK,backgr);
   ObjectSet("SubMainCross2Line2 Complect№"+Complect+freeze,OBJPROP_TIMEFRAMES,period);
//----   
   ObjectSet("Diag1Line1 Complect№"+Complect+freeze,OBJPROP_COLOR,colour3);
   ObjectSet("Diag1Line1 Complect№"+Complect+freeze,OBJPROP_STYLE,style3);
   ObjectSet("Diag1Line1 Complect№"+Complect+freeze,OBJPROP_WIDTH,width3);
   ObjectSet("Diag1Line1 Complect№"+Complect+freeze,OBJPROP_RAY,false);
   ObjectSet("Diag1Line1 Complect№"+Complect+freeze,OBJPROP_BACK,backgr);
   ObjectSet("Diag1Line1 Complect№"+Complect+freeze,OBJPROP_TIMEFRAMES,period); 
//----   
   ObjectSet("Diag1Line2 Complect№"+Complect+freeze,OBJPROP_COLOR,colour2);
   ObjectSet("Diag1Line2 Complect№"+Complect+freeze,OBJPROP_STYLE,style2);
   ObjectSet("Diag1Line2 Complect№"+Complect+freeze,OBJPROP_WIDTH,width2);
   ObjectSet("Diag1Line2 Complect№"+Complect+freeze,OBJPROP_RAY,false);
   ObjectSet("Diag1Line2 Complect№"+Complect+freeze,OBJPROP_BACK,backgr);
   ObjectSet("Diag1Line2 Complect№"+Complect+freeze,OBJPROP_TIMEFRAMES,period);
//----   
   ObjectSet("Diag1Line3 Complect№"+Complect+freeze,OBJPROP_COLOR,colour2);
   ObjectSet("Diag1Line3 Complect№"+Complect+freeze,OBJPROP_STYLE,style2);
   ObjectSet("Diag1Line3 Complect№"+Complect+freeze,OBJPROP_WIDTH,width2);
   ObjectSet("Diag1Line3 Complect№"+Complect+freeze,OBJPROP_RAY,false);
   ObjectSet("Diag1Line3 Complect№"+Complect+freeze,OBJPROP_BACK,backgr);
   ObjectSet("Diag1Line3 Complect№"+Complect+freeze,OBJPROP_TIMEFRAMES,period);
//----   
   ObjectSet("Diag1Line4 Complect№"+Complect+freeze,OBJPROP_COLOR,colour3);
   ObjectSet("Diag1Line4 Complect№"+Complect+freeze,OBJPROP_STYLE,style3);
   ObjectSet("Diag1Line4 Complect№"+Complect+freeze,OBJPROP_WIDTH,width3);
   ObjectSet("Diag1Line4 Complect№"+Complect+freeze,OBJPROP_RAY,false);
   ObjectSet("Diag1Line4 Complect№"+Complect+freeze,OBJPROP_BACK,backgr);
   ObjectSet("Diag1Line4 Complect№"+Complect+freeze,OBJPROP_TIMEFRAMES,period); 
//----   
   ObjectSet("Diag2Line1 Complect№"+Complect+freeze,OBJPROP_COLOR,colour3);
   ObjectSet("Diag2Line1 Complect№"+Complect+freeze,OBJPROP_STYLE,style3);
   ObjectSet("Diag2Line1 Complect№"+Complect+freeze,OBJPROP_WIDTH,width3);
   ObjectSet("Diag2Line1 Complect№"+Complect+freeze,OBJPROP_RAY,false);
   ObjectSet("Diag2Line1 Complect№"+Complect+freeze,OBJPROP_BACK,backgr);
   ObjectSet("Diag2Line1 Complect№"+Complect+freeze,OBJPROP_TIMEFRAMES,period);
//----   
   ObjectSet("Diag2Line2 Complect№"+Complect+freeze,OBJPROP_COLOR,colour2);
   ObjectSet("Diag2Line2 Complect№"+Complect+freeze,OBJPROP_STYLE,style2);
   ObjectSet("Diag2Line2 Complect№"+Complect+freeze,OBJPROP_WIDTH,width2);
   ObjectSet("Diag2Line2 Complect№"+Complect+freeze,OBJPROP_RAY,false);
   ObjectSet("Diag2Line2 Complect№"+Complect+freeze,OBJPROP_BACK,backgr);
   ObjectSet("Diag2Line2 Complect№"+Complect+freeze,OBJPROP_TIMEFRAMES,period);
//----   
   ObjectSet("Diag2Line3 Complect№"+Complect+freeze,OBJPROP_COLOR,colour2);
   ObjectSet("Diag2Line3 Complect№"+Complect+freeze,OBJPROP_STYLE,style2);
   ObjectSet("Diag2Line3 Complect№"+Complect+freeze,OBJPROP_WIDTH,width2);
   ObjectSet("Diag2Line3 Complect№"+Complect+freeze,OBJPROP_RAY,false);
   ObjectSet("Diag2Line3 Complect№"+Complect+freeze,OBJPROP_BACK,backgr);
   ObjectSet("Diag2Line3 Complect№"+Complect+freeze,OBJPROP_TIMEFRAMES,period); 
//----   
   ObjectSet("Diag2Line4 Complect№"+Complect+freeze,OBJPROP_COLOR,colour3);
   ObjectSet("Diag2Line4 Complect№"+Complect+freeze,OBJPROP_STYLE,style3);
   ObjectSet("Diag2Line4 Complect№"+Complect+freeze,OBJPROP_WIDTH,width3);
   ObjectSet("Diag2Line4 Complect№"+Complect+freeze,OBJPROP_RAY,false);
   ObjectSet("Diag2Line4 Complect№"+Complect+freeze,OBJPROP_BACK,backgr);
   ObjectSet("Diag2Line4 Complect№"+Complect+freeze,OBJPROP_TIMEFRAMES,period);             
//----
   ObjectSet("FirstCrossLine1 Complect№"+Complect+freeze,OBJPROP_COLOR,colour3);
   ObjectSet("FirstCrossLine1 Complect№"+Complect+freeze,OBJPROP_STYLE,style3);
   ObjectSet("FirstCrossLine1 Complect№"+Complect+freeze,OBJPROP_WIDTH,width3);
   ObjectSet("FirstCrossLine1 Complect№"+Complect+freeze,OBJPROP_RAY,false);
   ObjectSet("FirstCrossLine1 Complect№"+Complect+freeze,OBJPROP_BACK,backgr);
   ObjectSet("FirstCrossLine1 Complect№"+Complect+freeze,OBJPROP_TIMEFRAMES,period);
//----   
   ObjectSet("FirstCrossLine2 Complect№"+Complect+freeze,OBJPROP_COLOR,colour3);
   ObjectSet("FirstCrossLine2 Complect№"+Complect+freeze,OBJPROP_STYLE,style3);
   ObjectSet("FirstCrossLine2 Complect№"+Complect+freeze,OBJPROP_WIDTH,width3);
   ObjectSet("FirstCrossLine2 Complect№"+Complect+freeze,OBJPROP_RAY,false);
   ObjectSet("FirstCrossLine2 Complect№"+Complect+freeze,OBJPROP_BACK,backgr);
   ObjectSet("FirstCrossLine2 Complect№"+Complect+freeze,OBJPROP_TIMEFRAMES,period);
//----   
   ObjectSet("LastCrossLine1 Complect№"+Complect+freeze,OBJPROP_COLOR,colour3);
   ObjectSet("LastCrossLine1 Complect№"+Complect+freeze,OBJPROP_STYLE,style3);
   ObjectSet("LastCrossLine1 Complect№"+Complect+freeze,OBJPROP_WIDTH,width3);
   ObjectSet("LastCrossLine1 Complect№"+Complect+freeze,OBJPROP_RAY,false);
   ObjectSet("LastCrossLine1 Complect№"+Complect+freeze,OBJPROP_BACK,backgr);
   ObjectSet("LastCrossLine1 Complect№"+Complect+freeze,OBJPROP_TIMEFRAMES,period); 
//----   
   ObjectSet("LastCrossLine2 Complect№"+Complect+freeze,OBJPROP_COLOR,colour3);
   ObjectSet("LastCrossLine2 Complect№"+Complect+freeze,OBJPROP_STYLE,style3);
   ObjectSet("LastCrossLine2 Complect№"+Complect+freeze,OBJPROP_WIDTH,width3);
   ObjectSet("LastCrossLine2 Complect№"+Complect+freeze,OBJPROP_RAY,false);
   ObjectSet("LastCrossLine2 Complect№"+Complect+freeze,OBJPROP_BACK,backgr);
   ObjectSet("LastCrossLine2 Complect№"+Complect+freeze,OBJPROP_TIMEFRAMES,period);   
//----
   return(0);
  }
//+------------------------------------------------------------------+

Recommend