Historical Volatility
ESPL has the capability to plot historical volatility on a chart using this
ESPL script:var i,period: integer;
begin
if ESPL=51 then begin
SetUser(ePosition,eChart); {plot on the chart}
SetUser(ePercent,true); {percent scale}
SetUser(ePlot1,True); {plot
1st array}
SetUser(eShow1,True); {show 1st
array}
period:=GetUser(eParm1); {read 1st parameter}
for i:=BarLeft to BarEnd do SetUser(1,Volatility(i,period),i);
end;
end;
Display a chart, and add user study #51 by clicking on the #1 button on the
study drop down panel. On the parameter form for the study, enter 20
as the 1st parameter for the number of periods. The study will
overlay the bar chart as a percent ranging from 0 to 100. Typical
historical volatility values plot in the 10 to 30 range.
All of the hard work is done by the new math function called
Volatility. You can read about this function in the ESPL help
documentation.
|