I am learning AFL by seeing examples and start to write my idea. I used to use excel to do my analysis, it's easier as u can manipulate and use VBA, but not efficient and fast enough. I really wanna learn. Please help.
I always like to know if the stock has continuously rise over 20-dayMoving average of Close? I can do it easily in excel, how can I do it in amibroker? in Explore? or in scan of the Analysis mode?
Rule:
1. if today C > MA(C,20), check previous day, if Ref(C,-1) > MA(Ref(C,-1),20), then +1, else 1, vice versa
2. the first day rise above or below moving average of 20day close, will results in 1, -1.
Date Close MA(C,20) C>MA20 Consecutive Days
1/31/2013 3.62 3.82 FALSE -1
1/30/2013 4 3.85 TRUE 2
1/29/2013 3.9 3.85 TRUE 1
1/28/2013 3.43 3.85 FALSE -4
1/25/2013 3.57 3.82 FALSE -3
1/24/2013 3.6 3.82 FALSE -2
1/23/2013 3.45 3.81 FALSE -1
1/22/2013 4.2 3.82 TRUE 16
1/21/2013 4.1 3.77 TRUE 15
1/18/2013 4 3.74 TRUE 14
1/17/2013 4 3.72 TRUE 13
1/16/2013 3.9 3.7 TRUE 12
1/15/2013 3.86 3.68 TRUE 11
1/14/2013 3.98 3.64 TRUE 10
1/11/2013 4.06 3.61 TRUE 9
1/10/2013 3.9 3.57 TRUE 8
1/9/2013 3.76 3.53 TRUE 7
1/8/2013 3.69 3.5 TRUE 6
1/7/2013 3.65 3.46 TRUE 5
1/4/2013 3.68 3.42 TRUE 4
1/3/2013 3.78 3.38 TRUE 3
1/2/2013 3.77 3.32 TRUE 2
12/31/2012 3.81 3.27 TRUE 1
I always like to know if the stock has continuously rise over 20-dayMoving average of Close? I can do it easily in excel, how can I do it in amibroker? in Explore? or in scan of the Analysis mode?
Rule:
1. if today C > MA(C,20), check previous day, if Ref(C,-1) > MA(Ref(C,-1),20), then +1, else 1, vice versa
2. the first day rise above or below moving average of 20day close, will results in 1, -1.
Date Close MA(C,20) C>MA20 Consecutive Days
1/31/2013 3.62 3.82 FALSE -1
1/30/2013 4 3.85 TRUE 2
1/29/2013 3.9 3.85 TRUE 1
1/28/2013 3.43 3.85 FALSE -4
1/25/2013 3.57 3.82 FALSE -3
1/24/2013 3.6 3.82 FALSE -2
1/23/2013 3.45 3.81 FALSE -1
1/22/2013 4.2 3.82 TRUE 16
1/21/2013 4.1 3.77 TRUE 15
1/18/2013 4 3.74 TRUE 14
1/17/2013 4 3.72 TRUE 13
1/16/2013 3.9 3.7 TRUE 12
1/15/2013 3.86 3.68 TRUE 11
1/14/2013 3.98 3.64 TRUE 10
1/11/2013 4.06 3.61 TRUE 9
1/10/2013 3.9 3.57 TRUE 8
1/9/2013 3.76 3.53 TRUE 7
1/8/2013 3.69 3.5 TRUE 6
1/7/2013 3.65 3.46 TRUE 5
1/4/2013 3.68 3.42 TRUE 4
1/3/2013 3.78 3.38 TRUE 3
1/2/2013 3.77 3.32 TRUE 2
12/31/2012 3.81 3.27 TRUE 1