OPEN-SOURCE SCRIPT
MA20 & MA50 Rising

MA20 & MA50 Rising Scanner
Detects when both the 20-period and 50-period simple moving averages turn upward on the most recent bar. Designed as a lightweight screener column for TradingView’s watchlists.
Overview
This indicator plots a binary flag (0 or 1) per symbol, where
- 1 means SMA(20) > SMA(20)[1] and SMA(50) > SMA(50)[1]
- 0 means one or both moving averages did not rise
Add it as a custom column in your watchlist to instantly surface stocks with both short- and medium-term trend acceleration.
How It Works
- Calculates ma20 = simple moving average of the last 20 closes
- Calculates ma50 = simple moving average of the last 50 closes
- Compares each with its prior value (ma20[1] and ma50[1])
- Sets flag to 1 only when both are higher than yesterday’s values
When you filter your watchlist for flag == 1, you see only symbols whose 20- and 50-period SMAs both rose on the latest bar.
Detects when both the 20-period and 50-period simple moving averages turn upward on the most recent bar. Designed as a lightweight screener column for TradingView’s watchlists.
Overview
This indicator plots a binary flag (0 or 1) per symbol, where
- 1 means SMA(20) > SMA(20)[1] and SMA(50) > SMA(50)[1]
- 0 means one or both moving averages did not rise
Add it as a custom column in your watchlist to instantly surface stocks with both short- and medium-term trend acceleration.
How It Works
- Calculates ma20 = simple moving average of the last 20 closes
- Calculates ma50 = simple moving average of the last 50 closes
- Compares each with its prior value (ma20[1] and ma50[1])
- Sets flag to 1 only when both are higher than yesterday’s values
When you filter your watchlist for flag == 1, you see only symbols whose 20- and 50-period SMAs both rose on the latest bar.
オープンソーススクリプト
TradingViewの精神に則り、この作者はスクリプトのソースコードを公開しているので、その内容を理解し検証することができます。作者に感謝です!無料でお使いいただけますが、このコードを投稿に再利用する際にはハウスルールに従うものとします。
免責事項
これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、この作者はスクリプトのソースコードを公開しているので、その内容を理解し検証することができます。作者に感謝です!無料でお使いいただけますが、このコードを投稿に再利用する際にはハウスルールに従うものとします。
免責事項
これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。