Vegas Indicator For MT5

Vegas Indicator For MT5

The Vegas Indicator For MT5 overlays several envelope indicators with fixed shifts. It also plots a fast and slow Moving Averages. An uptrend is indicated when the fast MA rises above the slow MA. During such phases, the envelope indicators above price may be used as profit booking levels for long trades.

Conversely, if the fast MA drops under the slow MA, a down trend is signaled. During such periods, the envelope indicators beneath price may be utilized as levels to book profits for open short positions. The Vegas indicator is applicable across any time scale chart.

FREE Vegas Indicator

Download the FREE Vegas Indicator for MT5.

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 Vegas Indicator For MT5

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

Parameters of the Vegas Indicator For MT5

The Vegas Indicator For MT5 has 7 parameters to configure.

input uint Step=10;
input Mode RiskModel=Mode_1;
input uint FastPeriod=100;
input uint SlowPeriod=169;
input ENUM_MA_METHOD   MAType=MODE_EMA;
input ENUM_APPLIED_PRICE   MAPrice=PRICE_CLOSE;
input int Shift=0;                          // Horizontal shift of the indicator in bars

Buffers of the Vegas Indicator For MT5

The Vegas Indicator For MT5 provides 8 buffers.

SetIndexBuffer(0,ExtLineBuffer1,INDICATOR_DATA);
SetIndexBuffer(1,ExtLineBuffer2,INDICATOR_DATA);
SetIndexBuffer(2,ExtLineBuffer3,INDICATOR_DATA);
SetIndexBuffer(3,ExtLineBuffer4,INDICATOR_DATA);
SetIndexBuffer(4,ExtLineBuffer5,INDICATOR_DATA);
SetIndexBuffer(5,ExtLineBuffer6,INDICATOR_DATA);
SetIndexBuffer(6,ExtLineBuffer7,INDICATOR_DATA);
SetIndexBuffer(7,ExtLineBuffer8,INDICATOR_DATA);

Main Parts Of The Code

int OnCalculate(const int rates_total,    // number of bars in history at the current tick
                const int prev_calculated,// amount of history in bars at the previous tick
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
//--- checking if the number of bars is enough for the calculation
   if(BarsCalculated(fMA_Handle) lt rates_total
      || BarsCalculated(sMA_Handle) lt rates_total
      || rates_total lt min_rates_total)
      return(RESET);
//--- declaration of variables with a floating point  
   double;
//--- declaration of integer variables
   int to_copy,limit,bar;
//--- calculation of the starting number limit for the bar recalculation loop
   if(prev_calculated gt rates_total || prev_calculated lt =0)// checking for the first start of calculation of an indicator
      limit=rates_total-min_rates_total-1; // starting index for the calculation of all bars
   else limit=rates_total-prev_calculated;  // starting index for the calculation of the new bars only
//--- copy newly appeared data in the arrays
   to_copy=limit+1;
   if(CopyBuffer(fMA_Handle,0,0,to_copy,ExtLineBuffer4) lt =0) return(RESET);
   if(CopyBuffer(sMA_Handle,0,0,to_copy,ExtLineBuffer5) lt =0) return(RESET);
//--- main calculation loop of the indicator
   for(bar=limit; bar gt =0 && !IsStopped(); bar--)
     {
      switch(RiskModel)
        {
         case  Mode_1:
            ExtLineBuffer3[bar]=ExtLineBuffer5[bar]+34*dRange;
            ExtLineBuffer2[bar]=ExtLineBuffer5[bar]+55*dRange;
            ExtLineBuffer1[bar]=ExtLineBuffer5[bar]+89*dRange;
            ExtLineBuffer6[bar]=ExtLineBuffer5[bar]-34*dRange;
            ExtLineBuffer7[bar]=ExtLineBuffer5[bar]-55*dRange;
            ExtLineBuffer8[bar]=ExtLineBuffer5[bar]-89*dRange;
            break;
         case  Mode_2:
            ExtLineBuffer3[bar]=ExtLineBuffer5[bar]+55*dRange;
            ExtLineBuffer2[bar]=ExtLineBuffer5[bar]+89*dRange;
            ExtLineBuffer1[bar]=ExtLineBuffer5[bar]+144*dRange;
            ExtLineBuffer6[bar]=ExtLineBuffer5[bar]-55*dRange;
            ExtLineBuffer7[bar]=ExtLineBuffer5[bar]-88*dRange;
            ExtLineBuffer8[bar]=ExtLineBuffer5[bar]-144*dRange;
            break;
         case  Mode_3:
            ExtLineBuffer3[bar]=ExtLineBuffer5[bar]+89*dRange;
            ExtLineBuffer2[bar]=ExtLineBuffer5[bar]+144*dRange;
            ExtLineBuffer1[bar]=ExtLineBuffer5[bar]+233*dRange;
            ExtLineBuffer6[bar]=ExtLineBuffer5[bar]-89*dRange;
            ExtLineBuffer7[bar]=ExtLineBuffer5[bar]-144*dRange;
            ExtLineBuffer8[bar]=ExtLineBuffer5[bar]-233*dRange;
            break;
         case  Mode_4:
            ExtLineBuffer3[bar]=ExtLineBuffer5[bar]+144*dRange;
            ExtLineBuffer2[bar]=ExtLineBuffer5[bar]+233*dRange;
            ExtLineBuffer1[bar]=ExtLineBuffer5[bar]+377*dRange;
            ExtLineBuffer6[bar]=ExtLineBuffer5[bar]-144*dRange;
            ExtLineBuffer7[bar]=ExtLineBuffer5[bar]-233*dRange;
            ExtLineBuffer8[bar]=ExtLineBuffer5[bar]-377*dRange;
            break;
        }
     }
//---     
   return(rates_total);
  }
//+------------------------------------------------------------------+

 

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:  

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.

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