Hi, I am trying to setup a simple screener to identify stocks in both a ST and LT uptrend.
It is pretty simple but I am getting results that are not correct. I have tried a number of variations of the code and the current one has the LT trend calculation as the screener. The screener (LT trend calc, which is the EMA144/EMA233) gives me a figure of greater than one but when I look at some of the results the EMA233 is clearly above the EMA144 which would result in a screener calcuation of less then 1 but that is not the result given.
See attached eg for Alderan resources (AL8). Of the 43 results, at least 6 are incorrect.
ST/LT MA trend
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
REM Calculate a exp moving average over the last 21 days
ema21=ExponentialAverage[21](close)
REM Calculate a exp moving average over the last 34 days
ema34=ExponentialAverage[34](close)
REM Calculate a exp moving average over the last 144 days
ema144=ExponentialAverage[144](close)
REM Calculate a exp moving average over the last 233 days