I need help in coding the Historical Annual Volatility and the Intraday Annual Volatility in AmiBroker. The formula for the same is mentioned below,

**Historical Annual Volatility :**

HAV Returns = Log( Current Close / Previous Close);

HAV Current Daily Volatility = SQRT(( 0.94 * (HAV Previous Daily Volatility^2)) + ( 0.06 * (HAV Returns^2)));

(The first ‘HAV Previous Daily Volatility’ can be Zero.)

Historical Annual Volatility = HAV Current Daily Volatility * SQRT( 365);

**Intraday Annual Volatility :**

IAV Returns = Log( Current High / Current Low);

IAV Current Daily Volatility = SQRT(( 0.94 * (IAV Previous Daily Volatility^2)) + ( 0.06 * (IAV Returns^2)));

(The first ‘IAV Previous Daily Volatility’ can be Zero.)

Intraday Annual Volatility = IAV Current Daily Volatility * SQRT( 365);

Thnx.