Price crosses over SMA
Forums › ProRealTime English forum › ProScreener support › Price crosses over SMA
- This topic has 11 replies, 4 voices, and was last updated 6 months ago by IronyCheese.
-
-
03/26/2024 at 1:06 PM #23047303/26/2024 at 1:26 PM #230478
Hello Here you have:
1234sma = average[50](close)n = barssince(close crosses over sma)screener[n<10]If you also want the price to be above the average, you just have to change the last line with this one:
screener[n<10 and close > sma]
03/26/2024 at 1:27 PM #23048003/26/2024 at 1:28 PM #230481Two is better than one! 🙂
03/26/2024 at 1:33 PM #23048203/26/2024 at 2:20 PM #23049103/26/2024 at 3:39 PM #230503it is starting to drive me crazy 🙂
1234567SMA200 = average[200](close)n200 = barssince(close crosses over SMA200)priceCrossedSMA200 = n200 < 3priceAboveSMA200 = low > SMA200CondSMA200 = (priceCrossedSMA200 and priceAboveSMA200)SCREENER[CondSMA200] (volume)here is the script I wrote based on your ideas. It includes stocks where the price did not cross the SMA200 in the last 3 days. I dont get why. Any idea ?
03/26/2024 at 4:15 PM #230508It works, but to avoid those stocks that have never crossed the sma200 we can add this
n200>=0
:1234567SMA200 = average[200](close)n200 = barssince(close crosses over SMA200)priceCrossedSMA200 = n200 < 3 and n200 >= 0priceAboveSMA200 = low > SMA200CondSMA200 = (priceCrossedSMA200 and priceAboveSMA200)screener[CondSMA200]1 user thanked author for this post.
03/26/2024 at 9:55 PM #23052403/26/2024 at 9:59 PM #23052503/27/2024 at 11:44 AM #230563Hello
I would create a line parallel to the sma200 at X distance. From there I would proceed the same as in previous screener but now the reference average would be the parallel to the sma.
To ensure that the price comes from crossing down the sma200 offset without having crossed down the sma200 then we can control the barindex of each situation.1234567891011121314sma = average[50](close)smadist = sma + 2/100*sman = barssince(close crosses over smadist)if close crosses under sma then$crossSMA[0]=barindexendifif close crosses under smadist then$crossSMAdist[0]=barindexendifsetup = n>=0 and n<5 and $crossSMA[0]<$crossSMAdist[0] and close > smadistscreener[setup]05/21/2024 at 4:08 PM #232888Did you investigate how to rank these stocks by the number of days they have spent over their SMA200 or something else?
-
AuthorPosts
Find exclusive trading pro-tools on