Skip to content

Instantly share code, notes, and snippets.

@marketcalls
Created April 24, 2020 11:28
Show Gist options
  • Save marketcalls/439fe588328da7362c6ec69ff81820a9 to your computer and use it in GitHub Desktop.
Save marketcalls/439fe588328da7362c6ec69ff81820a9 to your computer and use it in GitHub Desktop.
Simple Volatility Exploration - Amibroker AFL Code
//Simple Volatility Exploration
//Coded by Rajandran R ( www.marketcalls.in )
_SECTION_BEGIN("Simple Volatility Exploration");
Filter = 1;
PDC = TimeFrameGetPrice("C",inDaily,-1);
TC = TimeFrameGetPrice("C",inDaily,0);
c2c = TC - PDC;
TH = TimeFrameGetPrice("H",inDaily,0);
TL = TimeFrameGetPrice("L",inDaily,0);
h2l = TH-TL;
bcolor = IIf(ROC(C,1)<-3,colorred, IIf(ROC(C,1)<0,colorWhite,
IIf(ROC(C,1)>3,colorLime, colorWhite)));
fcolor = IIf(ROC(C,1)<-3,colorWhite, IIf(ROC(C,1)<0,colorblack,
IIf(ROC(C,1)>3,colorWhite, colorBlack)));
AddColumn(Close,"Close",1.2);
AddColumn(c2c,"Close to Close",1.2);
AddColumn(h2l,"High to Low",1.2);
AddColumn(ATR(10),"ATR(10)",1.2);
AddColumn(ROC(C,1),"Daily Returns %",1.2,fcolor,bcolor);
_SECTION_END();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment