SHI_Mod_vLine Indicator For MT4

SHI_Mod_vLine Indicator For MT4

The SHI_Mod_vLine Indicator For MT4 plots a channel and a vertical aqua colored line. The position of the channel depends on where the trader positions the vertical dotted aqua line. By default, the lines of the channel are red. There is also a red dotted centerline within the channel about which the price within the channel oscillates. The indicator is basically used for analyising the market at various points by moving the vertical line. If you move the vertical line, the channel is replotted. If a trader positions the aqua vertical line at the last candlestick, he or she can deduce the current market trend. The direction of the channel indicates the trend of the market. If the channel is pointing downwards, then there is a bearish trend and if it is pointing upwards, then there is a bullish trend. The two continuous lines of the channel act as support and resistance levels within which the market swings. If the channel is pointing downwards, long term traders could place a sell. If it is pointing upwards long term traders can place a buy. If a sell order is placed, the trader should close it when the price breakout through the upper line (bullish breakout. If a buy order is placed, the trader should close the trade if the price breakout through the lower line (bearish break out).

FREE SHI_Mod_vLine Indicator

Download the FREE SHI_Mod_vLine Indicator for MT4.

To receive my email 100% sure: 
Put my email on your whitelist!

 

Partially Automated Trading Besides Your Day Job

Alerts In Real-Time When Divergences Occur

My Recommended MT4/MT5 Broker

 

Installing the SHI_Mod_vLine Indicator For MT4

After you downloaded the indicator via the form above you need to unzip the zip-file. Then you need to copy the file SHI_Mod_vLine.mq4 into the folder MQL4\Indicators of your MT4 installation. After that please restart MT4 and then you will be able to see the indicator in the list of indicators.

Parameters of the SHI_Mod_vLine Indicator For MT4

The SHI_Mod_vLine Indicator For MT4 has 2 parameters to configure.

extern int       BarsForFract=0;
extern bool      DOT_Line_Ray=True;

Buffers of the SHI_Mod_vLine Indicator For MT4

The SHI_Mod_vLine Indicator For MT4 provides 2 buffers.

SetIndexBuffer(0,ExtMapBuffer1);
SetIndexBuffer(1,UpLabel);

Main Parts Of The Code

int start()
  {
   double iPP,Lab1Val,Lab2Val,Lab3Val;
   int MyBar,lastBarTime,h1,ii;
   string v1,fileFrame;
//----   
   ObjectCreate("MyBarLine",OBJ_VLINE,0,Time[1],High[1]);
   ObjectSet("MyBarLine",OBJPROP_COLOR,Aqua);
   ObjectSet("MyBarLine",OBJPROP_WIDTH,1);
   ObjectSet("MyBarLine",OBJPROP_STYLE,STYLE_DOT);
   //****************************************************************************************  
   //   ×òåíèå äàííûõ (ñòðîêà)  èç âíåøíåãî ôàéëà, ñôîðìèðîâàííîãî ïðîãðàììîé MetaClick,    
   //   ïóò¸ì òûêà â áàð (Z+LeftMouse) óêàçûâàþùåé âðåìÿ, äî êîòîðîãî ñòðîèòñÿ èíäèêàòîð.
   //   Èùåì íóæíûé íîìåð áàðà
   //**************************************************************************************** 
   /*   Âýòîé âåðñèè MetaClick íå èñïîëüçóåòñÿ
        switch (Period())  // Ôîðìèðîâàíèå ÷àñòè èìåíè âíåøíåãî ôàéëà
      {
      case PERIOD_M1:     fileFrame=",M1";break;
      case PERIOD_M5:     fileFrame=",M5";break;
      case PERIOD_M15:    fileFrame=",M15";break;
      case PERIOD_M30:    fileFrame=",M30";break;
      case PERIOD_H1:     fileFrame=",H1";break;
	   case PERIOD_H4:     fileFrame=",H4";break;
	   case PERIOD_D1:     fileFrame=",Daily";break;
	   case PERIOD_W1:     fileFrame=",Weekly";break;
	   case PERIOD_MN1:    fileFrame=",Monthly";break;   
      }
      fileNAME=Symbol()+fileFrame+".csv";
      h1=FileOpen(Symbol()+fileFrame+".csv",FILE_CSV,";");
      v1 = FileReadString(h1);
      FileClose(h1);
      Comment(v1);
      lastBarTime=StrToTime(v1);
      i=0;
      while (i lt =Bars-1 )
      {if (lastBarTime==Time[i])
         { MyBar=i;break;}
      i++;
      }
*/
//------- Çàêîí÷èëè èñêàòü ïîñëåäíèé áàð äëÿ ïîñòðîåíèÿ èíäèêàòîðà ------- 
   myTime=ObjectGet("MyBarLine",OBJPROP_TIME1);
   if(myTime gt Time[0] || myTime lt  Time[Bars-1])
   {ObjectDelete("MyBarLine"); Alert("SHI_Mod_vLine: TimeFrames are not correct");  return(0);  
   }
   myYear=TimeYear(myTime); myMonth=TimeMonth(myTime);myDay=TimeDay(myTime);
   myHour=TimeHour(myTime); myMinute=TimeMinute(myTime);
   // Äëÿ âîçìîæíîòè ïåðåêëþ÷åíèÿ òàéìôðåéìîâ ÎÄÍÎÃÎ È ÒÎÃÎ ÆÅ ÃÐÀÔÈÊÀ íàäî âûðîâíÿòü
   // âðåìÿ ðàñïîëîæåíèÿ âåðòèêàëüíîé ëèíèè íà ãðàíèöó ñòàðøåãî òàéìôðåéìà.
   if (Period()==PERIOD_MN1 || Period()==PERIOD_W1)
     {
     Alert("SHI_Mod_vLine can  t work with Weekly and Monthly charts");
     ObjectDelete("MyBarLine"); return(0);}
   switch(Period())  // 
     {
      case PERIOD_M1:     break;
      case PERIOD_M5:     myMinute=MathFloor(myMinute/5)*5; break;
      case PERIOD_M15:    myMinute=MathFloor(myMinute/15)*15; break;
      case PERIOD_M30:    myMinute=MathFloor(myMinute/30)*30; break;
      case PERIOD_H1:     myMinute=0; break;
      case PERIOD_H4:     myHour=MathFloor(myHour/4)*4; myMinute=0; break;
      case PERIOD_D1:     myHour=0; myMinute=0; break;
      case PERIOD_W1:     /*i=0; while(i lt =Bars-1) 
	                       {
	                          if (TimeYear(Time[i])==myYear && TimeMonth(Time[i])==myMonth &&
	                              myDay-TimeDay(Time[i]) lt =6 && myDay-TimeDay(Time[i]) gt =0)
	                              myDay=TimeDay(Time[i]);  break; 
	                          i++;  //Íåïðàâèëüíî!!
	                       }*/
         break;
      case PERIOD_MN1:    break;
     }
   ObjectDelete("MyBarLine");
   myTime=StrToTime(myYear + "." + myMonth + "." + myDay + " "  + myHour + ":" + myMinute);
   ObjectCreate("MyBarLine",OBJ_VLINE,0,myTime,High[0]);
   ObjectSet("MyBarLine",OBJPROP_COLOR,Aqua);
   ObjectSet("MyBarLine",OBJPROP_WIDTH,1);
   ObjectSet("MyBarLine",OBJPROP_STYLE,STYLE_DOT);
   //Îòëàäêà
   /*
   Alert(myYear + "." + myMonth + "." + myDay + " "  + myHour + ":" + myMinute);
   myYear=TimeYear(myTime); myMonth=TimeMonth(myTime);myDay=TimeDay(myTime);
   myHour=TimeHour(myTime); myMinute=TimeMinute(myTime);
   Alert(myYear + "." + myMonth + "." + myDay + " "  + myHour + ":" + myMinute);
   */
   //return(0);
   i=0;
   while(Time[i]!=myTime) {i++;}
   MyBar=i;
   ArrayInitialize(UpLabel,0.0);
   if (Bars lt MyBar+303) {Alert("Too little history");return(-1);}
   int    counted_bars=IndicatorCounted();
//---- 
   //if(Bars lt AllBars)  AllBars=Bars;                 //return(-1);
   //if(AllBars lt AB) {Comment("Ìàëî áàðîâ"); return(-1);}
   //Alert("MyBar=",MyBar);
   //if ((AllBars==0) || (Bars lt AllBars)) AB=Bars; else AB=AllBars; //AB-êîëè÷åñòâî îáñ÷èòûâàåìûõ áàðîâ
   if (BarsForFract gt 0)
      BFF=BarsForFract;
   else
     {
      switch(Period())
        {
         case 1: BFF=12; break;
         case 5: BFF=48; break;
         case 15: BFF=24; break;
         case 30: BFF=24; break;
         case 60: BFF=12; break;
         case 240: BFF=15; break;
         case 1440: BFF=10; break;
         case 10080: BFF=6; break;
         default: DelObj(); return(-1); break;
        }
     }
   CurrentBar=2+MyBar; //ñ÷èòàåì ñ òðåòüåãî áàðà, ÷òîáû ôðàêòàë "çàêðåïèëñÿ
   B1=-1; B2=-1; UpDown=0; flag=0;
   while(((B1==-1) || (B2==-1)) && (CurrentBar lt (AB+MyBar)))
     {
      //UpDown=1 çíà÷èò ïåðâûé ôðàêòàë íàéäåí ñâåðõó, UpDown=-1 çíà÷èò ïåðâûé ôðàêòàë
      //íàéäåí ñíèçó, UpDown=0 çíà÷èò ôðàêòàë åù¸ íå íàéäåí.
      //Â1 è Â2 - íîìåðà áàðîâ ñ ôðàêòàëàìè, ÷åðåç íèõ ñòðîèì îïîðíóþ ëèíèþ.
      //Ð1 è Ð2 - ñîîòâåòñòâåííî öåíû ÷åðåç êîòîðûå áóäåì ëèíèþ ïðîâîäèòü
      // if (CurrentBar==4 ) Alert("CurrentBar=",CurrentBar," ","BFF=",BFF);
      if((UpDown lt 1) && (CurrentBar==Lowest(Symbol(),Period(),MODE_LOW,BFF*2+1,CurrentBar-BFF)))
         // Âûðàæåíèå CurrentBar-BFF ìîæåò áûòü â äàí ñëó÷àå îòðèöàòåëüíûì. Íî âðîäå ðàáîòàåò
        {
         if(UpDown==0) { UpDown=-1; B1=CurrentBar; iB1=CurrentBar; P1=Low[B1];}
         else { B2=CurrentBar; iB2=CurrentBar; P2=Low[B2];}
        }
      if((UpDown gt -1) && (CurrentBar==Highest(Symbol(),Period(),MODE_HIGH,BFF*2+1,CurrentBar-BFF)))
        {
         if(UpDown==0) { UpDown=1; B1=CurrentBar; iB1=CurrentBar; P1=High[B1];}
         else { B2=CurrentBar; iB2=CurrentBar; P2=High[B2];}
        }
      CurrentBar++;
     }
   if((B1==-1) || (B2==-1)) {DelObj(); return(-1);} // Çíà÷èò íå íàøëè ôðàêòàëîâ ñðåäè 300 áàðîâ 8-)
   Step=(P2-P1)/(B2-B1);//Âû÷èñëèëè øàã, åñëè îí ïîëîæèòåëüíûé, òî êàíàë íèñõîäÿùèé
   P1=P1-(B1-MyBar)*Step; B1=0+MyBar;//ïåðåñòàâëÿåì öåíó è ïåðâûé áàð ê íóëþ (çíà÷åíèå îïîðíîé ëèíèè íà 0 áàðå)
   //À òåïåðü îïîðíóþ òî÷êó ïðîòèâîïîëîæíîé ëèíèè êàíàëà.
   ishift=0+MyBar; iprice=0;
   //Alert(UpDown);
   if(UpDown==1)
     {
      //  Èñïðàâëåíî!!  Îïîðíóþ òî÷êó áóäåì èñêàòü ÌÅÆÄÓ îáíàðóæåííûìè ôðàêòàëàìè,
      //  à íå ñ 0-ãî (MyBar) áàðà. iB1-ýòî íå èçìåíåííûé B1
      //PP=Low[2+MyBar]-(2)*Step;
      PP=Low[2+iB1]-(2)*Step;
      iPP=Low[2+iB1]-(2)*Step;
      ii=2+iB1;
      //for(i=3+MyBar;i lt =B2;i++) 
      for(i=3+iB1;i lt =B2;i++)
        {
         //if(Low[i] lt PP+Step*(i-MyBar)) { PP=Low[i]-(i-MyBar)*Step; ii=i;}
         if(Low[i] lt iPP+Step*(i-iB1))
            //PP-çíà÷åíèå ëèíèè íà ïîñëåäíåì áàðå
            // iPP-çíà÷åíèå ëèíèè íà áàðå iB1 -ïðàâûé ôðàêòàë
           {
            PP=Low[i]-(i-MyBar)*Step; ii=i;
            iPP=Low[i]-(i-iB1)*Step;
           }
        }
      //Alert(iB1,"  ",iB2,"  ",ii,"  ","Step=",Step,"  ","PP=",PP);
      //Lab1Val=(High[iB1]+5*Point); 	Lab2Val=(High[iB2]+5*Point); 	Lab3Val=(Low[ii]-5*Point);
      UpLabel[iB1]=High[iB1]+5*Point;
      UpLabel[iB2]=High[iB2]+5*Point;
      UpLabel[ii]=Low[ii]-5*Point;
      //Alert(iB1,"  ",ii,"  ",iB2,"  ","Step=",Step,"  ","PP=",PP,"  ","Lab1Val=",Lab1Val);
      if(Low[0+MyBar] lt PP) {ishift=0+MyBar; iprice=PP;}
      if(Low[1+MyBar] lt PP+Step) {ishift=1+MyBar; iprice=PP+Step;}
      if(High[0+MyBar] gt P1) {ishift=0+MyBar; iprice=P1;}
      if(High[1+MyBar] gt P1+Step) {ishift=1+MyBar; iprice=P1+Step;}
     }
   else  //òðåíä âíèç
     {
      PP=High[2+MyBar]-(2)*Step;
      iPP=High[2+iB1]-(2)*Step;
      ii=2+iB1;
      //for(i=3+MyBar;i lt =B2;i++) 
      for(i=3+iB1;i lt =B2;i++)
        {
           if(High[i] gt iPP+Step*(i-iB1)) { PP=High[i]-(i-MyBar)*Step;ii=i;
            iPP=High[i]-(i-iB1)*Step;
           } //èùåì çíà÷åíèå âåðõíåé ëèíèè íà 0 áàðå
        }
      //Lab1Val=(Low[iB1]-5*Point);Lab2Val=(Low[iB2]-5*Point);Lab3Val=(High[ii]+5*Point);
      UpLabel[iB1]=Low[iB1]-5*Point;
      UpLabel[iB2]=Low[iB2]-5*Point;
      UpLabel[ii]=High[ii]+5*Point;
      // Alert(iB1,"  ",iB2,"  ","ii=",ii,"  ","Step=",Step,"  ","PP=",PP,"  ",
      // "Lab1Val=",Lab1Val,"Lab3Val=",Lab3Val);
      // îïðåäåëÿåì, áûëî ëè ïåðåñå÷åíèå ëèíèé êàíàëà íà 0 èëè 1 áàðàõ(÷òîáû ñòàâèòü ïñèñó)
      if(Low[0+MyBar] lt P1) {ishift=0+MyBar; iprice=P1;}
      if(Low[1+MyBar] lt P1+Step) {ishift=1+MyBar; iprice=P1+Step;}
      if(High[0+MyBar] gt PP) {ishift=0+MyBar; iprice=PP;}
      if(High[1+MyBar] gt PP+Step) {ishift=1+MyBar; iprice=PP+Step;}
     }
   //Òåïåðü ïåðåñòàâèì êîíå÷íóþ öåíó è áàð íà ÀÂ, ÷òîáû ëèíèè êàíàëà ðèñîâàëèñü ïîäëèííåå
   P2=P1+AB*Step;
   T1=Time[B1]; T2=Time[AB+MyBar];
   //Åñëè íå áûëî ïåðåñå÷åíèÿ êàíàëà, òî 0, èíà÷å ñòàâèì ïñèñó.
   //if(iprice!=0) ExtMapBuffer1[ishift]=iprice;
   DelObj();
   // Alert("B1=",B1,"  ","B2=",AB+MyBar,"    ","AB=",AB,"  ","MyBar=",MyBar);
   //	Alert("T1=",T1,"  ","T2=",T2);
   //***************************************** Ðèñóåì ëèíèè êàíàëà ************************
   ObjectCreate("TL1",OBJ_TREND,0,T2,PP+Step*(AB),T1,PP);
   ObjectSet("TL1",OBJPROP_COLOR,Tomato);
   ObjectSet("TL1",OBJPROP_WIDTH,2);
   ObjectSet("TL1",OBJPROP_STYLE,STYLE_SOLID);
   ObjectSet("TL1",OBJPROP_RAY,False);
   ObjectCreate("TL2",OBJ_TREND,0,T2,P2,T1,P1);
   ObjectSet("TL2",OBJPROP_COLOR,Tomato);
   ObjectSet("TL2",OBJPROP_WIDTH,2);
   ObjectSet("TL2",OBJPROP_STYLE,STYLE_SOLID);
   ObjectSet("TL2",OBJPROP_RAY,False);
   ObjectCreate("MIDL",OBJ_TREND,0,T2,(P2+PP+Step*AB)/2,T1,(P1+PP)/2);
   ObjectSet("MIDL",OBJPROP_COLOR,Tomato);
   ObjectSet("MIDL",OBJPROP_WIDTH,1);
   ObjectSet("MIDL",OBJPROP_STYLE,STYLE_DOT);
   ObjectSet("MIDL",OBJPROP_RAY,DOT_Line_Ray);
   //*********************************** Ðèñóåì ïðîäîëæåíèå êàíàëà ************************
     if (MyBar gt 30) {Tf=Time[MyBar-30];
      PPf=PP-Step*30; P1f=P1-Step*30;
     }
     else          {Tf=Time[0];PPf=PP-Step*MyBar; P1f=P1-Step*MyBar;
     }
   ObjectCreate("TL1f",OBJ_TREND,0,T1,PP,Tf,PPf);
   ObjectSet("TL1f",OBJPROP_COLOR,Lime);
   ObjectSet("TL1f",OBJPROP_WIDTH,1);
   ObjectSet("TL1f",OBJPROP_STYLE,STYLE_DOT);
   ObjectSet("TL1f",OBJPROP_RAY,DOT_Line_Ray);
   ObjectCreate("TL2f",OBJ_TREND,0,T1,P1,Tf,P1f);
   ObjectSet("TL2f",OBJPROP_COLOR,Lime);
   ObjectSet("TL2f",OBJPROP_WIDTH,1);
   ObjectSet("TL2f",OBJPROP_STYLE,STYLE_DOT);
   ObjectSet("TL2f",OBJPROP_RAY,DOT_Line_Ray);
   //************************* Îòìå÷àåì êëèêíóòûé áàð  ************************************    
   /*if (MyBar gt 0)    
      {
      ObjectCreate("MyBarLine",OBJ_VLINE,0,Time[MyBar],High[MyBar]); 
      ObjectSet("MyBarLine",OBJPROP_COLOR,MediumOrchid); 
		ObjectSet("MyBarLine",OBJPROP_WIDTH,1); 
		ObjectSet("MyBarLine",OBJPROP_STYLE,STYLE_DOT); 
      }
   */
//----
   return(0);
  }
//+------------------------------------------------------------------+

 

About Me

I'm Mike Semlitsch the owner of PerfectTrendSystem.com. My trading career started in 2007. Since 2013 I have helped thousands of traders to take their trading to the next level. Many of them are now constantly profitable traders. 

The following performance was achieved by me while trading live in front of hundreds of my clients:

Connect With Me:  

Results From 5 Months!
This service starts soon! Be the first who get's notified when it begins!

This FREE Indicator Can Transform
Your Trading!

FREE Indicator + Telegram Group


Request the Ultimate Double Top/Bottom Indicator which is used by 10,000+ traders.