MOVING AVRAGE AS SUPPORT SCREENER
Forums › ProRealTime English forum › ProScreener support › MOVING AVRAGE AS SUPPORT SCREENER
- This topic has 6 replies, 2 voices, and was last updated 1 year ago by ALBERT77.
-
-
02/27/2023 at 8:32 AM #210572
Sometimes moving averages can act as support and resistance. I am trying to write a screener that price just crossed over a moving average that acted as a resistance in the last 100 candles.
12345678910C1= ExponentialAverage[I](close)C2=CLOSE CROSSES OVER C1C3=summation[100]((CLOSE-C1)>0)=1C4=summation[100]((C1-CLOSE)< (0.005*CLOSE))=2FOR I= 20 TO 50 DOIF ( C2 AND C3 AND C4) THENPERIOD=IENDIFNEXTSCREENER(PERIOD AS "PERIOD")02/27/2023 at 11:36 AM #210589I haven’t look at your conditions, but in your loop, you should refer to your condition at the time of I:
12345678910C1= ExponentialAverage[I](close)C2=CLOSE CROSSES OVER C1C3=summation[100]((CLOSE-C1)>0)=1C4=summation[100]((C1-CLOSE)< (0.005*CLOSE))=2FOR I= 20 TO 50 DOIF ( C2[I] AND C3[I] AND C4[I]) THENPERIOD=IENDIFNEXTSCREENER(PERIOD AS "PERIOD")1 user thanked author for this post.
02/27/2023 at 11:57 AM #210592I think the code should be like this, considering you are looking for an EMA between periods 20 to 50 that act as a resistance:
12345678910FOR I= 20 TO 50 DOC1= ExponentialAverage[I](close)C2=CLOSE CROSSES OVER C1C3=summation[100]((CLOSE-C1)>0)=1C4=summation[100]((C1-CLOSE)< (0.005*CLOSE))=2IF ( C2 AND C3 AND C4) THENPERIOD=IENDIFNEXTSCREENER(PERIOD AS "PERIOD")The results will always be the longest period found, because the loop will go to the end.
1 user thanked author for this post.
02/27/2023 at 7:26 PM #210613Results are not correct.
for example , it screens CVS as a result with ema50 as answer, but last price is not crossing above ema50, in last candles there are other candles above ema50 while we want all below ema50 with one very close to it (with exception of last crossing candle)
02/28/2023 at 5:28 PM #210666Ok, let’s restart from scratch, what do you mean with:
that acted as a resistance in the last 100 candles
Please?
03/01/2023 at 2:05 AM #210692For example on the following stock (BBAI) EMA 54 acted as a resistance twice in the past similar to resistance lines , now in the pullback it is very close to it again and there is possibility to bounce back again. I am trying to write a screener to examine a range of moving averages for every stock and find any moving average that acted like this example.
03/01/2023 at 2:22 AM #210694 -
AuthorPosts
Find exclusive trading pro-tools on