|
allan nathan
2012-09-21 16:55:07
1
|
|
Best Answer
try this for functions
VectorD close = cFunctions.Close;
VectorD logchange = TA.Log(close/TA.Ref(close,1));
VectorD sdlogchange = TA.Stddev(logchange,50);
VectorD HisVol = sdlogchange*100*TA.Sqrt(252);
result = HisVol;
OR
//result = cFunctions.CompileFormula("logchange=log(close/Ref(close,1));
//sdlogchange=stddev(logchange,50);
//HisVol=sdlogchange*100*sqrt(252);").
//GetVectorDouble("HisVol");
for formula try this,but change daye=50
Days = Param("Days", 21, 21);
logchange=log(close/Ref(close,1));
sdlogchange=stddev(logchange,21);
HisVol=sdlogchange*100*sqrt(252);
Plot(HisVol,"HVol",colorBlue,ChartLine);
|
|