[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AFL



PureBytes Links

Trading Reference Links

You should add a condition
COND=Sum(GapUp(),20)<=1;
to your buy rule
Buy=(Buyrule) AND COND;
using the existing built-in function.
You may define your own GAPUP function as
perc=X;//CALIBRATE PERCENTAGE
GAPUP=100*(O/REF(H,-1)-1)>=X;//YOUR OWN GAPUP DEFINITION
COND=Sum(GapUp(),20)<=1;
Buy=(Buyrule) AND COND;

DT

--- In amibroker@xxxx, "Harold Harper" <harold@xxxx> wrote:
> I can't seem to figure this one out:
> 
> I have a buy condition set but don't want it executed if, for 
> example, within the last twenty bars there's been two or more 
gapups 
> and/or gapdowns.
> 
> Thoughts?
> 
> Thanks in advance.
> 
> Harold Harper
> harold@xxxx






  • References:
    • AFL
      • From: Harold Harper