Page 1 of 1

Is there an MT4 version of Chande's variable moving average?

Posted: Wed Mar 23, 2022 1:11 am
by xpf2003
I am looking for an MT4 version of Tushar Chande's variable moving average. A version of this implemented for TradingView is below.

I have tried using the search function on the website and also google but have not come across anything.

Code: Select all

//
// @author LazyBear 
// List of all my indicators: 
// https://docs.google.com/document/d/15AGCufJZ8CIUvwFJ9W-IKns88gkWOKBCvByMEvm5MLo/edit?usp=sharing
// 
study(title="Variable Moving Average [LazyBear]", shorttitle="VMA_LB", overlay=true)
src=close
l =input(6, title="VMA Length") 
std=input(false, title="Show Trend Direction")
bc=input(false, title="Color bars based on Trend")
k = 1.0/l
pdm = max((src - src[1]), 0)
mdm = max((src[1] - src), 0)
pdmS = ((1 - k)*nz(pdmS[1]) + k*pdm)
mdmS = ((1 - k)*nz(mdmS[1]) + k*mdm)
s = pdmS + mdmS
pdi = pdmS/s
mdi = mdmS/s
pdiS = ((1 - k)*nz(pdiS[1]) + k*pdi)
mdiS = ((1 - k)*nz(mdiS[1]) + k*mdi)
d = abs(pdiS - mdiS)
s1 = pdiS + mdiS
iS = ((1 - k)*nz(iS[1]) + k*d/s1)
hhv = highest(iS, l) 
llv = lowest(iS, l) 
d1 = hhv - llv
vI = (iS - llv)/d1
vma = (1 - k*vI)*nz(vma[1]) + k*vI*src
vmaC=(vma > vma[1]) ? green : (vma<vma[1]) ? red : (vma==vma[1]) ? blue : black 
plot(vma, color=std?vmaC:black, linewidth=3, title="VMA")
barcolor(bc?vmaC:na)

Re: Is there an MT4 version of Chande's variable moving average?

Posted: Wed Mar 23, 2022 9:58 am
by andrei-1
xpf2003 wrote: Wed Mar 23, 2022 1:11 am Tushar Chande's variable moving average.
VIDYA.mq4

Re: Is there an MT4 version of Chande's variable moving average?

Posted: Thu Mar 24, 2022 10:02 pm
by Jimmy
xpf2003 wrote: Wed Mar 23, 2022 1:11 am I am looking for an MT4 version of Tushar Chande's variable moving average. A version of this implemented for TradingView is below.

I have tried using the search function on the website and also google but have not come across anything.
Hi there mate, as Andrei said, VIDYA is Tushar Chande's variable moving average which you can find here: VIDYA.

Please also see this first post which compares Jurik Vs VIDYA (Chande's Variable Moving Average). You should consider using Jurik as it has less lag and better smoothing than VIDYA :thumbup:

Image

PS: If you would like to search for VIDYA files, you may use our guide on doing a Deep Search, here: How to Deep Search Forex-station.

Re: Is there an MT4 version of Chande's variable moving average?

Posted: Fri Mar 25, 2022 3:39 am
by mrtools
xpf2003 wrote: Wed Mar 23, 2022 1:11 am I am looking for an MT4 version of Tushar Chande's variable moving average. A version of this implemented for TradingView is below.

I have tried using the search function on the website and also google but have not come across anything.

Code: Select all

//
// @author LazyBear 
// List of all my indicators: 
// https://docs.google.com/document/d/15AGCufJZ8CIUvwFJ9W-IKns88gkWOKBCvByMEvm5MLo/edit?usp=sharing
// 
study(title="Variable Moving Average [LazyBear]", shorttitle="VMA_LB", overlay=true)
src=close
l =input(6, title="VMA Length") 
std=input(false, title="Show Trend Direction")
bc=input(false, title="Color bars based on Trend")
k = 1.0/l
pdm = max((src - src[1]), 0)
mdm = max((src[1] - src), 0)
pdmS = ((1 - k)*nz(pdmS[1]) + k*pdm)
mdmS = ((1 - k)*nz(mdmS[1]) + k*mdm)
s = pdmS + mdmS
pdi = pdmS/s
mdi = mdmS/s
pdiS = ((1 - k)*nz(pdiS[1]) + k*pdi)
mdiS = ((1 - k)*nz(mdiS[1]) + k*mdi)
d = abs(pdiS - mdiS)
s1 = pdiS + mdiS
iS = ((1 - k)*nz(iS[1]) + k*d/s1)
hhv = highest(iS, l) 
llv = lowest(iS, l) 
d1 = hhv - llv
vI = (iS - llv)/d1
vma = (1 - k*vI)*nz(vma[1]) + k*vI*src
vmaC=(vma > vma[1]) ? green : (vma<vma[1]) ? red : (vma==vma[1]) ? blue : black 
plot(vma, color=std?vmaC:black, linewidth=3, title="VMA")
barcolor(bc?vmaC:na)
That formula looks kinda close to the ADXvma.

Re: Is there an MT4 version of Chande's variable moving average?

Posted: Fri Mar 25, 2022 3:48 am
by xpf2003
mrtools wrote: Fri Mar 25, 2022 3:39 am That formula looks kinda close to the ADXvma.
Ok. Now that's confusing if MrTools thinks this does not look like VIDYA.

Re: Is there an MT4 version of Chande's variable moving average?

Posted: Fri Mar 25, 2022 4:47 am
by mrtools
xpf2003 wrote: Fri Mar 25, 2022 3:48 am Ok. Now that's confusing if MrTools thinks this does not look like VIDYA.
Was saying it looks similar to Adxvma not really sure what is the correct Vidya formula.