Hi,
I heard there are some good AFL coders in this forum. Please someone help me in coding AFL for exploring stocks whose EMAs are converging. I started writing this AFL which tells whether today is the day of closest convergence (in the last 130 days). I am attaching a screenshot. I want to know if this be improved further. But what I really need is a similar AFL which works on weekly timeframe. Thanks.
a1 = abs( EMA(C,12) - EMA(C,26) );
a2 = abs( EMA(C,26)-EMA(C,39) );
a3 = abs( EMA(C,12)-EMA(C,39) );
SumOfGaps = (a1+a2+a3);
AvgOfEMAs = ( EMA(C,12) + EMA(C,26) + EMA(C,39) )/3 ;
Squeeze = (SumOfGaps/AvgOfEMAs)*100;
Filter = LLV(Squeeze, 130) == Squeeze;
AddColumn(C,"Price");
AddColumn(Squeeze, "Squeeze");
I heard there are some good AFL coders in this forum. Please someone help me in coding AFL for exploring stocks whose EMAs are converging. I started writing this AFL which tells whether today is the day of closest convergence (in the last 130 days). I am attaching a screenshot. I want to know if this be improved further. But what I really need is a similar AFL which works on weekly timeframe. Thanks.
a1 = abs( EMA(C,12) - EMA(C,26) );
a2 = abs( EMA(C,26)-EMA(C,39) );
a3 = abs( EMA(C,12)-EMA(C,39) );
SumOfGaps = (a1+a2+a3);
AvgOfEMAs = ( EMA(C,12) + EMA(C,26) + EMA(C,39) )/3 ;
Squeeze = (SumOfGaps/AvgOfEMAs)*100;
Filter = LLV(Squeeze, 130) == Squeeze;
AddColumn(C,"Price");
AddColumn(Squeeze, "Squeeze");
Attachments
-
25.3 KB Views: 68