This Amibroker AFL code plots lines against the static Gann square of nine values. The seed value is the last daily close and all gann levels spanning around 10% of that seed value will be plotted.
As of now, it does not ask for any parameter but those can be introduced, if needed.
Please note this is not a strategy on its own but will be useful for any strategy which involves these levels.
// Downloadeded From optionsdelta.in
_SECTION_BEGIN("Gann Square of Nine Levels");
TimeFrameSet(inDaily);
lastclose=LastValue(Ref(Close,-1));
TimeFrameRestore();
level1=lastclose*0.95;
level2=lastclose*1.05;
startnum = (sqrt(level1)-1);
gnum= int(startnum * startnum);
//Calculate levels for GANN Square of Nine within +- 5% of last daily close
level1=lastclose*0.95;
level2=lastclose*1.05;
while( gnum <= level2 )
{
if (gnum>level1)
Plot(gnum,"",colorWhite,styleDashed);
startnum = startnum + 0.125;
gnum= int(startnum * startnum);
}
_SECTION_END();