Skip to main content

Garman-Klass volatility estimator for Amibroker (AFL)

JaNa over 15 years ago Amibroker (AFL)

  • Rating:
    5 / 5 (Votes 1)
  • Tags:
    amibroker, exploration

http://formulapages.com/eq/402

Exploration outputs Garman-Klass volatility

Indicator / Formula

Copy & Paste Friendly
period = Param("lookback period",30,5,300,1);

TimeFrameSet(inDaily);
GKvol = sqrt(252/period*(0.5 * (ln(H/L))^2 - (2*ln(2)-1) * (ln(O/C))^2 ));
TimeFrameRestore();

Filter=1;
AddColumn(GKvol,"GKvol", 1.0, colorDefault, colorDefault,45);

1 comments

1. JaNa
over 15 years ago

Seems sum function is missing

Change GKvol with this one:
GKvol = sqrt(252/period * Sum((0.5 * (ln(H/L))^2 – (2*ln(2)-1) * (ln(O/C))^2 ), period));

Leave Comment

Please login here to leave a comment.