Hello,
I have this code:
TimeFrame(Daily)
S1=Average[20](Close)
C1=Summation[10](S1<S1[1])=10
lengthRSI = 14 //RSI period
lengthStoch = 14 //Stochastic period
myRSI = RSI[lengthRSI](close)
MinRSI = lowest[lengthStoch](myrsi)
MaxRSI = highest[lengthStoch](myrsi)
StochRSI = ((myRSI-MinRSI) / (MaxRSI-MinRSI))*100
C2 = StochRSI[1] > 90
C3 = StochRSI < 85
C4 = Close > 5
C5 = Average[7](Volume) > 500000
C6 = S1 < 0.94 * S1[10]
SCREENER[C1 and C2 and C3 and C4 and C5 and C6](Volume as "Volume")
I would like to see only the assets that have a declining SMA20 between 5 and 10 days instead of the requirement that the SMA20 needs to be negative for at least 10 days.
Can you adjust the code for me? Thanks
gr Marco
Change C1 with:
C1=Summation[5](S1<S1[1])=5
Hi Nicolas,
Thanks, but i need it to be between 5 and 10 days. Now i also get results that are already longer then 10 days in downtrend.
gr Marco
C1= summation[5](S1<S1[1])=5 AND summation[11](S1<S1[1])<=10
- says S1<S1[1] happened 5 times most recently,
- and didn’t happen at least once:
-
- either the 11th time (so… ok 10 days max)
- or at least once before (so… ok less than 10 consecutive times)
JSParticipant
Veteran
Hi,
I think a summation only says something about how often something occurs and nothing about WHERE it occurs…
Suppose I have 11 elements and 10 meet a certain condition (and 1 does not), then you cannot say with certainty where that 1 element will occur, it can be the last element but also the first… In both cases, the summation is true…
Hi,
agreed if summation[11](S1<S1[1])<=10 is on its own, then it doesn’t say where is at least one missing occurrence, my bullet point (2.) above says the same thing.
When I combine it with “summation[5](S1<S1[1])=5 AND …”, then to have C1 true we need both summation subconditions to be true, and for this summation[5] subcondition to be true, it means none is missing in the latest 5 occurrences, so when C1 is true, both subconditions are true, necessarily the missing occurrence is between 6th and 11th. If it was in the latest 5, then the summation[5] subcondition would be false and C1 false with it.
JSParticipant
Veteran
Hi,
Actually, it wasn’t a response to your correct code but more of a personal brain wave that I wanted to share… 😉