Navigation:Home > Content >

1-2-4!.mq4

Time: 2015-05-15 | Download file:1-2-4!.mq4

//+------------------------------------------------------------------+
//|                                        maloma 4 vicont 1-2-3.mq4 |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, maloma."

extern double Уровень_1=1.2937;//1.2937;
extern double Уровень_2=1.2725;//1.2630;
extern double Уровень_3=1.2874;//1.2829;

int start(){
 
 int time_1=0; int time_2=0; int time_3=0;
 int p1d=0; int p2d=0; int p3d=0;
 double Уровень_4=0; double Уровень_5=0; double Уровень_6=0; double Уровень_t=0;
 int time_4=0; int time_5=0; int time_6=0;
 int i=0; int j=0; int k=0;
 
 while (time_3==0){
  if (High[i] == Уровень_3) {time_3=i; p3d=1;}
  if (Low[i] == Уровень_3) {time_3=i; p3d=-1;}
  i++;}
 while (time_2==0){
  if (High[i] == Уровень_2) {time_2=i; p2d=1;}
  if (Low[i] == Уровень_2) {time_2=i; p2d=-1;}
  i++;}
 while (time_1==0){
  if (High[i] == Уровень_1) {time_1=i; p1d=1;}
  if (Low[i] == Уровень_1) {time_1=i; p1d=-1;}
  i++;}
 
 i=time_3-1;
 Уровень_4=Уровень_3-(Уровень_3-Уровень_2)*1.62;
 while (i>=0 && time_5=0 && time_6=Уровень_5)
        {// начало Если нашли точку 5
         Уровень_5=High[j];
         time_5=j;
         k=time_5-1;
         Уровень_t=Уровень_4-(Уровень_4-Уровень_5)/2;
         Уровень_6=Уровень_t-(Уровень_1-Уровень_t);
         while (k>=0)
          {// while start для поиска 6
           if (Low[k]<=Уровень_6)
            {// начало Если нашли точку 6
             Уровень_6=Low[k];
             time_6=k;
            }// конец Если нашли точку 6
           k--;
          }// while end для поиска 6
        }// конец Если нашли точку 5
       j--;
      }// while end для поиска 5
    }// конец Если нашли точку 4
   i--;
  }// while end для поиска 4
  
 if (ObjectFind("Point_6")==-1){
  ObjectCreate ("Point_6",OBJ_TEXT,0,Time[time_6],Уровень_6+50*Point*p2d,0,0,0,0);
  ObjectSetText("Point_6", "6", 14, "Times New Roman", Gold);}
 else {
  ObjectMove("Point_6", 0, Time[time_6],Уровень_6+50*Point*p2d);}  
  
 if (ObjectFind("Point_5")==-1){
  ObjectCreate ("Point_5",OBJ_TEXT,0,Time[time_5],Уровень_5+50*Point*p3d,0,0,0,0);
  ObjectSetText("Point_5", "5", 14, "Times New Roman", Gold);}
 else {
  ObjectMove("Point_5", 0, Time[time_5],Уровень_5+50*Point*p3d);}  

 if (ObjectFind("Point_4")==-1){
  ObjectCreate ("Point_4",OBJ_TEXT,0,Time[time_4],Уровень_4+50*Point*p2d,0,0,0,0);
  ObjectSetText("Point_4", "4", 14, "Times New Roman", Gold);}
 else {
  ObjectMove("Point_4", 0, Time[time_4],Уровень_4+50*Point*p2d);}  

 if (ObjectFind("Point_3")==-1){
  ObjectCreate ("Point_3",OBJ_TEXT,0,Time[time_3],Уровень_3+50*Point*p3d,0,0,0,0);
  ObjectSetText("Point_3", "3", 14, "Times New Roman", Gold);}
 else {
  ObjectMove("Point_3", 0, Time[time_3],Уровень_3+50*Point*p3d);}
 
 if (ObjectFind("Point_2")==-1){
  ObjectCreate ("Point_2",OBJ_TEXT,0,Time[time_2],Уровень_2+50*Point*p2d,0,0,0,0);
  ObjectSetText("Point_2", "2", 14, "Times New Roman", Gold);}
 else {
  ObjectMove("Point_2", 0, Time[time_2],Уровень_2+50*Point*p2d);}
 
 if (ObjectFind("Point_1")==-1){
  ObjectCreate ("Point_1",OBJ_TEXT,0,Time[time_1],Уровень_1+50*Point*p1d,0,0,0,0);
  ObjectSetText("Point_1", "1", 14, "Times New Roman", Gold);}
 else {
  ObjectMove("Point_1", 0, Time[time_1],Уровень_1+50*Point*p1d);}
  
 Comment("Уровень_1=",Уровень_1,"; time_1=",time_1,"\n",
         "Уровень_2=",Уровень_2,"; time_2=",time_2,"\n",
         "Уровень_3=",Уровень_3,"; time_3=",time_3,"\n",
         "Уровень_4=",Уровень_4,"; time_4=",time_4,"\n",
         "Уровень_5=",Уровень_5,"; time_5=",time_5,"\n",         
         "Уровень_6=",Уровень_6,"; time_6=",time_6);
 
 return (0);
}


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

Recommend