Slideshow

Cheap Web Hosting Sites

Social Icons

'

Tuesday, May 10, 2011

AFL to find 2 -Month High,Low

This AFL finds the Highest and the Lowest value of a ticker in the last 2 months.




a=LastValue(Month())-2;
 
b=Month()!=Ref(Month(),-1);
bi=BarIndex();
d=LastValue(ValueWhen(Month()==a AND b,bi,1));
e=BarCount-d;
f=LastValue(HHV(H,e));
ff=ValueWhen(H==f,bi);
z=LastValue(LLV(L,e));
zz=ValueWhen(L==z,bi);
 
GfxSetBkColor
GfxSetTextColor
GfxTextOut
GfxTextOut(" 2 months Low value= "+z,400,150);
(" 2 months High value= "+f,400,130);
(colorBlue);
(colorBlack);

0 Comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...