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);
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);
No comments:
Post a Comment