The majority of ways for measuring Moving Averages cannot compensate for sideways moving prices versus trending markets and often generate a lot of false signals. Longer-term moving averages are slow to react to reversals in trend when prices move up and down over a long period of time. A Variable Moving Average regulates its sensitivity and lets it function better in any market conditions by using automatic regulation of the smoothing constant.
The Variable Moving Average is also known as the VIDYA Indicator. But this version is a modified concept of the VIDYA.
The Variable Moving Average was developed by Tushar S. Chande and first presented in his March, 1992 article in Technical Analysis of Stocks & Commodities magazine, in which a standard deviation was used as the Volatility Index. In his October, 1995 article in the same magazine, Chande modified the VIDYA to use his own Chande Momentum Oscillator (CMO) as the Volatility Index, the VMA code below is the result of this modification.
//PRC_Variable Moving Average | indicator //14.12.2016 //Nicolas @ www.prorealcode.com //Sharing ProRealTime knowledge //converted and adapted from Pinescript version // --- parameters src=customclose //l = 6 if barindex>l then k = 1.0/l pdm = max((src - src), 0) mdm = max((src - src), 0) pdmS = ((1 - k)*(pdmS) + k*pdm) mdmS = ((1 - k)*(mdmS) + k*mdm) s = pdmS + mdmS pdi = pdmS/s mdi = mdmS/s pdiS = ((1 - k)*(pdiS) + k*pdi) mdiS = ((1 - k)*(mdiS) + k*mdi) d = abs(pdiS - mdiS) s1 = pdiS + mdiS iS = ((1 - k)*(iS) + k*d/s1) hhv = highest[l](iS) llv = lowest[l](iS) d1 = hhv - llv vI = (iS - llv)/d1 vma = (1 - k*vI)*(vma) + k*vI*src endif RETURN VMA
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.ProRealTime ITF files and other attachments :