Hi friends,
I am just trying to write a few simple Amibroker formulas to get a feel of how AFL works.
I was trying to scan signals for the following logic:
2 higher highs and 2 higher lows
one inside bar
close > 20 ma > 50 ma
for some reason, i am getting no buy signals.
when i replaced 'close > 20 ma > 50 ma' with ma crossover, I was getting a few signals.
I think it has got something to do with 'close > 20 ma > 50 ma' , but I can't figure out what it is.
Can someone please help me with this???
Thank You.
Code:
lowlogic = Ref(Low,-1)>Ref(Low,-2);
highlogic = Ref(High,-1)>Ref(High,-2);
logic1 = Close> lastValue(EMA(C,20))>lastValue(EMA(C,50));
iblow = Low>Ref(Low,-1);
ibhigh = High<Ref(High,-1);
Buy = lowlogic AND highlogic AND logic1 AND iblow AND ibhigh;
I am just trying to write a few simple Amibroker formulas to get a feel of how AFL works.
I was trying to scan signals for the following logic:
2 higher highs and 2 higher lows
one inside bar
close > 20 ma > 50 ma
for some reason, i am getting no buy signals.
when i replaced 'close > 20 ma > 50 ma' with ma crossover, I was getting a few signals.
I think it has got something to do with 'close > 20 ma > 50 ma' , but I can't figure out what it is.
Can someone please help me with this???
Thank You.
Code:
lowlogic = Ref(Low,-1)>Ref(Low,-2);
highlogic = Ref(High,-1)>Ref(High,-2);
logic1 = Close> lastValue(EMA(C,20))>lastValue(EMA(C,50));
iblow = Low>Ref(Low,-1);
ibhigh = High<Ref(High,-1);
Buy = lowlogic AND highlogic AND logic1 AND iblow AND ibhigh;