Hi,
A while ago you created this screener:
timeframe(weekly)
EMA21=ExponentialAverage[21](Close)
C1=Summation[30](Close>EMA21)=30
ATRpercent=100*(AverageTrueRange[14](close))/close
c2 = ATRpercent>=3.5
c3 = volume[1]>1000000
c4 = close> 5
test = c1 AND C2 AND C3 and c4
screener[test]
It shows all the stocks that have been above the EMA21 week for at least 30 weeks.
Could you add the following:
During the time that the stock is above the EMA21 the price should have touched the EMA21 at least 2 times (close obviously needs to be above EMA 21 all the time)
Thanks a lot
Gr Marco
timeframe(weekly)
EMA21=ExponentialAverage[21](Close)
C1=Summation[30](Close>EMA21)=30
ATRpercent=100*(AverageTrueRange[14](close))/close
c2 = ATRpercent>=3.5
c3 = volume[1]>1000000
c4 = close> 5
c5= summation[30](low<EMA21)>=2
test = c1 and c2 and c3 and c4 and c5
screener[test]
Hi @js,
Could you help me with this one? Thanks
gr Marco
What kind of issue was there with the code proposed above?
I don’t mind if you didn’t like my code proposal and/or if you prefer someone else to volunteer free time to assist (and JS is a good choice, we consider him very capable and very helpful), but at least, for the next guy if not for me, feedback on what kind of error you had with the code proposed would surely be welcome before proposing something else?
Hi,
There was no problem with the code. I only want the following to be added:
During the time that the stock is above the EMA21 the price should have touched the EMA21 at least 2 times (close obviously needs to be above EMA 21 all the time)
Thanks a lot
gr Marco
JSParticipant
Veteran
Hi Marco,
The condition you want to add is already in the code under c5…
C5=Summation[30](Low<EMA21)>=2
Loosely translated: over the last 30 weeks, the “Low” has closed below the EMA21 at least twice… (only the Low and not the Close)