VWMA Indicator For MT4
Table Of Contents:
- VWMA Indicator For MT4
- Installing the VWMA Indicator For MT4
- Parameters of the VWMA Indicator For MT4
- Buffers of the VWMA Indicator For MT4
- Main Parts Of The Code
The VWMA Indicator For MT4 plots a Moving Average curve that gives greater weight-age to price bars that generate greater volumes. As a result, when volume is stronger, the Volume Weighted Moving Average (VWMA) follows price more closely, and when volume declines, it tends to resemble a Simple Moving Average. Trading signals generated by the VWMA Indicator For MT4 are listed below: 1. Discovering New Trends - When the VWMA switches above/below a Simple Moving Average, it implies a bullish/bearish move is on the horizon. 2. Identifying Current Trends - When the VWMA remains sandwiched between price and Simple Moving Average, it signals that a trend is in place. 3. Locating End of a Trend - When the distance between the VWMA and Simple Moving Average tightens, it often tends to act as an early signal of a trend entering its final stage.
Installing the VWMA 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 Volume_Weighted_MA.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 VWMA Indicator For MT4
The VWMA Indicator For MT4 has 2 parameters to configure.
extern int Period_MA=21; extern int Price_MA=PRICE_MEDIAN;
Buffers of the VWMA Indicator For MT4
The VWMA Indicator For MT4 provides 1 buffers.
SetIndexBuffer(0,MABuffer);
Main Parts Of The Code
int start() { int limit; int j,i; double sum; double Price; int counted_bars=IndicatorCounted(); if(counted_bars lt 0) return(-1); if(counted_bars gt 0) counted_bars--; limit=Bars-counted_bars; if(counted_bars==0) limit-=Period_MA; for(i=0; i lt limit; i++) { sum=0; Price=0; for(j=i;j lt i+Period_MA;j++){Vol[j-i]=Volume[j];sum+=Vol[j-i];} for(j=0;j lt Period_MA;j++)Vol[j]/=sum; for(j=i;j lt i+Period_MA;j++) { Price+=get_price(j,Price_MA)*Vol[j-i]; } MABuffer[i]=Price; } return(0); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ double get_price(int num,int applied_price) { switch(applied_price) { case PRICE_CLOSE : return(Close[num]); case PRICE_OPEN : return(Open[num]); case PRICE_HIGH : return(High[num]); case PRICE_LOW : return(Low[num]); case PRICE_MEDIAN : return((High[num]+Low[num])/2); case PRICE_TYPICAL : return((High[num]+Low[num]+Close[num])/3); case PRICE_WEIGHTED : return((High[num]+Low[num]+Close[num]+Close[num])/4); default : return((High[num]+Low[num])/2); } } //+------------------------------------------------------------------+