OPEN-SOURCE SCRIPT
SunAlgo Wealth Builder | SMA20 + RSI20

Created by SunAlgo
This indicator is a swing trading strategy designed to help long-term investors and position traders grow wealth steadily by riding strong stock trends. It combines trend-following logic (SMA20) with a momentum confirmation filter (RSI20) to identify high-probability bullish entries and secure exits.
✅ Strategy Logic (Weekly Chart):
Entry Conditions:
Price crosses above the 20-week Simple Moving Average (SMA20) from below.
Then, RSI(20) crosses above 60, confirming bullish momentum.
A Buy signal is generated at the open of the candle where RSI > 60.
Exit Condition:
A Sell signal is triggered when the price closes below SMA20.
📈 Features:
Buy/Sell signals marked directly on the chart.
Labels display entry and exit prices, along with profit per share and % return.
Built specifically for weekly stock charts to avoid market noise and favor strong trends.
Plots the SMA20 for trend guidance and clarity.
💼 Ideal Use Case:
For stocks showing trend re-acceleration after pullbacks.
Works best on high-volume, fundamentally strong equities.
Suitable for long-term capital growth portfolios.
⚠️ Note:
This indicator is for educational and research purposes only. Always use proper risk management and trade with your own discretion.
🔗 Part of the growing SunAlgo Strategy Series — precision tools for disciplined wealth-building.
This indicator is a swing trading strategy designed to help long-term investors and position traders grow wealth steadily by riding strong stock trends. It combines trend-following logic (SMA20) with a momentum confirmation filter (RSI20) to identify high-probability bullish entries and secure exits.
✅ Strategy Logic (Weekly Chart):
Entry Conditions:
Price crosses above the 20-week Simple Moving Average (SMA20) from below.
Then, RSI(20) crosses above 60, confirming bullish momentum.
A Buy signal is generated at the open of the candle where RSI > 60.
Exit Condition:
A Sell signal is triggered when the price closes below SMA20.
📈 Features:
Buy/Sell signals marked directly on the chart.
Labels display entry and exit prices, along with profit per share and % return.
Built specifically for weekly stock charts to avoid market noise and favor strong trends.
Plots the SMA20 for trend guidance and clarity.
💼 Ideal Use Case:
For stocks showing trend re-acceleration after pullbacks.
Works best on high-volume, fundamentally strong equities.
Suitable for long-term capital growth portfolios.
⚠️ Note:
This indicator is for educational and research purposes only. Always use proper risk management and trade with your own discretion.
🔗 Part of the growing SunAlgo Strategy Series — precision tools for disciplined wealth-building.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.