VIDYA by Tushar Chande and Kroll is also known as Variable moving average .
Is this the one u are looking for ? Is it the same ?
Is this the one u are looking for ? Is it the same ?
VIDYA is an acronym of Variable Index DYnamic Average. The VIDYA is an exponential moving average that automatically adjusts the smoothing weight based on the volatility of the data series. The more volatile the data is, the more weight is given to the more recent values. The VIDYA solves a problem with most moving averages. In times of low volatility, such as when the price is trending, the moving average time period should be shorter to be sensitive to the inevitable break in the trend. Whereas, in more volatile non-trending times, the moving average time period should be longer to filter out the choppiness
//Vidya Afl
// Vidya
Length=21;
Smooth=5;
Change = C - Ref( C, -1 );
SU = Sum( C - Ref( C, -1 ) > 0, Length );
SD = Sum( C - Ref( C, -1 ) < 0, Length );
CMO = 100 * ( SU - SD ) / ( SU + SD );
AbsCMO=( abs(CMO) )/100;
SC=2/(Smooth+1);
VIDYA=AMA( C, SC*AbsCMO );
Plot( Close, "Price", 4, 64 );
Plot( VIDYA, "Vidya", 5 );
The length of the MA can be changed as per needs
// Vidya
Length=21;
Smooth=5;
Change = C - Ref( C, -1 );
SU = Sum( C - Ref( C, -1 ) > 0, Length );
SD = Sum( C - Ref( C, -1 ) < 0, Length );
CMO = 100 * ( SU - SD ) / ( SU + SD );
AbsCMO=( abs(CMO) )/100;
SC=2/(Smooth+1);
VIDYA=AMA( C, SC*AbsCMO );
Plot( Close, "Price", 4, 64 );
Plot( VIDYA, "Vidya", 5 );
The length of the MA can be changed as per needs
This isn't a proper afl: may have to be corrected to get it to display properly. Did not see a point trying to fix the afl when it was easier to calculate in Excel.
I have only used it in the daily timeframe on nifty with very good results. I don't use it any longer.
For intraday, you could multiply the wt. by a factor to get the MA to respond better. Hope this helps.
I have only used it in the daily timeframe on nifty with very good results. I don't use it any longer.
PHP:
myMA[0]=C[0];
for(i=1;i<BarCount;i++){
wt=abs(C[i-1]-myMA[i-1])/C[i-1];
myMA=myMA[i-1]+wt*(C-myMA[i-1]);
}
Plot(myMA,"",colorRed);
@anubhai... maybe its time u gave VMA another look...
@NoviceT... thanks for the info on Vidya...