Help needed for simple AFL

#1
I am new to Amibroker. I want to code the following: Current Bar's Close should be greater than the HHV of prev 10 Bars. I tried:
_SECTION_BEGIN("C10B");
Buy = High > Ref(HHV(Close,10),-1);
Sell = Low < Ref(LLV(Close,10),-1);
Buy OR Sell;
_SECTION_END();

However, it doesn't work. Any suggestions? Thanx for ur help.
 
#4
Dear Kenneth,
I was able to do what I wanted to do:

_SECTION_BEGIN("C10B");
Buy=Cross(C,HHV(Ref(H,-1),10));
Sell=Cross(C,LLV(Ref(L,-1),10));

pricefield = ParamField("Price Field", 2);
Color = ParamColor("color",colorRed);
style = ParamStyle("style",styleLine,maskAll);
arrows = ParamToggle("Display arrows", "No|Yes",0);
Plot(pricefield,"C10BS",Color,style);
if(arrows)
{
PlotShapes(Buy*shapeUpArrow+Sell*shapeDownArrow,IIf(Buy,colorGreen,colorRed) );
}
_SECTION_END();

Of course, this wouldn't have been possible without your pointers. Thanks!!
 

Similar threads