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.
Script de código aberto
No verdadeiro espirito do TradingView, o autor desse script o publicou como código aberto, para que os traders possam entendê-lo e verificá-lo. Parabéns ao autor Você pode usá-lo gratuitamente, mas a reutilização desse código em publicações e regida pelas Regras da Casa.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.
Script de código aberto
No verdadeiro espirito do TradingView, o autor desse script o publicou como código aberto, para que os traders possam entendê-lo e verificá-lo. Parabéns ao autor Você pode usá-lo gratuitamente, mas a reutilização desse código em publicações e regida pelas Regras da Casa.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.