OPEN-SOURCE SCRIPT
Vital Wave 20-50

Simplicity is almost always the most effective approach, and here I’m giving you a trend-following system that exploits the bullish bias of traditional markets and their trending nature, with very basic rules.
Rules (long entries only)
• Market entry: When the EMA 20 crosses above the EMA 50 (from below)
• Main market exit: When the EMA 20 crosses below the EMA 50 (from above)
• Fixed Stop Loss: Placed at the price level of the Lower Bollinger Band at the moment the trade is entered.
In my strategy, the primary exit is when the EMA 20 crosses below the EMA 50. However, this crossover can sometimes take a while to occur, and in the meantime the price may have already dropped significantly. The Stop Loss based on the Lower Bollinger Band is designed to limit losses in case the market moves sharply against the position without giving the bearish crossover signal in time. Having two exit conditions makes the strategy much more robust in terms of risk management.
Risk Management:
• Initial capital: $10,000
• Position size: 10% of available capital per trade
• Commissions: 0.1% on traded volume
• Stop Loss: Based on the Lower Bollinger Band
• Take Profit / Exit: When EMA 20 crosses below EMA 50
Recommended Markets:
XAUUSD (OANDA) (Daily)
Period: January 3, 1833 – November 23, 2025
Total Profit & Loss: +$6,030.62 USD (+57.57%)
Maximum Drawdown: $541.53 USD (3.83%)
Total Trades: 136
Winning Trades (Win Rate): 36.03% (49/136)
Profit Factor: 2.483
XAUUSD (OANDA) (12-hour)
Period: March 19, 2006 – November 23, 2025
Total Profit & Loss: +$1,209.56 USD (+11.89%)
Maximum Drawdown: $384.58 USD (3.61%)
Total Trades: 97
Winning Trades (Win Rate): 35.05% (34/97)
Profit Factor: 1.676
XAUUSD (OANDA) (8-hour)
Period: March 19, 2006 – November 23, 2025
Total Profit & Loss: +$1,179.36 USD (+11.81%)
Maximum Drawdown: $246.88 USD (2.32%)
Total Trades: 147
Winning Trades (Win Rate): 31.97% (47/147)
Profit Factor: 1.626
Tesla (NASDAQ) (4-hour)
Period: June 29, 2010 – November 23, 2025
Total Profit & Loss (Absolute): +$11,687.90 USD (+116.88%)
Maximum Drawdown: $922.05 USD (6.50%)
Total Trades: 68
Winning Trades (Win Rate): 39.71% (27/68)
Profit Factor: 4.156
Tesla (NASDAQ) (3-hour)
Total Profit & Loss: +$11,522.33 USD (+115.22%)
Maximum Drawdown: $1,247.60 USD (8.80%)
Total Trades: 114
Winning Trades: 33.33% (38/114)
Profit Factor: 2.811
Additional Recommendations
(These assets have shown good trending behavior with the same strategy across multiple timeframes):
•NVDA (15 min, 30 min, 1h, 2h, 3h, 4h, 6h, 8h, 12h, Daily)
•NFLX (1h, 2h, 3h, 4h, 6h, 8h, 12h, Daily)
•MA (1h, 2h, 3h, 4h, 6h, 8h, 12h, Daily)
•META (1h, 2h, 3h, 4h, 6h, 8h, 12h, Daily)
•AAPL (1h, 2h, 3h, 4h, 6h, 8h, 12h, Daily)
•SPY (12h, Daily)
About the Code
The user can modify:
• EMA periods (20 and 50 by default)
• Bollinger Bands length (20 periods)
• Standard deviation (2.0)
Visualization
• EMA 20: Blue line
• EMA 50: Red line
• Green background when EMA20 > EMA50 (bullish trend)
• Red background when EMA20 < EMA50 (bearish trend)
Important Note:
We can significantly increase the profit factor and overall profitability by risking a fixed percentage per trade instead of a fixed amount. This would prevent losses from fluctuating with changes in volatility.
This could be implemented by reducing position size or adjusting leverage based on the volatility percentage required for each trade, but I’m not sure if this is fully possible in Pine Script. In my other script, “Golden Cross 50/200 EMA,” I go deeper into this topic and provide examples.
I hope you enjoy this contribution. Best regards!
Rules (long entries only)
• Market entry: When the EMA 20 crosses above the EMA 50 (from below)
• Main market exit: When the EMA 20 crosses below the EMA 50 (from above)
• Fixed Stop Loss: Placed at the price level of the Lower Bollinger Band at the moment the trade is entered.
In my strategy, the primary exit is when the EMA 20 crosses below the EMA 50. However, this crossover can sometimes take a while to occur, and in the meantime the price may have already dropped significantly. The Stop Loss based on the Lower Bollinger Band is designed to limit losses in case the market moves sharply against the position without giving the bearish crossover signal in time. Having two exit conditions makes the strategy much more robust in terms of risk management.
Risk Management:
• Initial capital: $10,000
• Position size: 10% of available capital per trade
• Commissions: 0.1% on traded volume
• Stop Loss: Based on the Lower Bollinger Band
• Take Profit / Exit: When EMA 20 crosses below EMA 50
Recommended Markets:
XAUUSD (OANDA) (Daily)
Period: January 3, 1833 – November 23, 2025
Total Profit & Loss: +$6,030.62 USD (+57.57%)
Maximum Drawdown: $541.53 USD (3.83%)
Total Trades: 136
Winning Trades (Win Rate): 36.03% (49/136)
Profit Factor: 2.483
XAUUSD (OANDA) (12-hour)
Period: March 19, 2006 – November 23, 2025
Total Profit & Loss: +$1,209.56 USD (+11.89%)
Maximum Drawdown: $384.58 USD (3.61%)
Total Trades: 97
Winning Trades (Win Rate): 35.05% (34/97)
Profit Factor: 1.676
XAUUSD (OANDA) (8-hour)
Period: March 19, 2006 – November 23, 2025
Total Profit & Loss: +$1,179.36 USD (+11.81%)
Maximum Drawdown: $246.88 USD (2.32%)
Total Trades: 147
Winning Trades (Win Rate): 31.97% (47/147)
Profit Factor: 1.626
Tesla (NASDAQ) (4-hour)
Period: June 29, 2010 – November 23, 2025
Total Profit & Loss (Absolute): +$11,687.90 USD (+116.88%)
Maximum Drawdown: $922.05 USD (6.50%)
Total Trades: 68
Winning Trades (Win Rate): 39.71% (27/68)
Profit Factor: 4.156
Tesla (NASDAQ) (3-hour)
Total Profit & Loss: +$11,522.33 USD (+115.22%)
Maximum Drawdown: $1,247.60 USD (8.80%)
Total Trades: 114
Winning Trades: 33.33% (38/114)
Profit Factor: 2.811
Additional Recommendations
(These assets have shown good trending behavior with the same strategy across multiple timeframes):
•NVDA (15 min, 30 min, 1h, 2h, 3h, 4h, 6h, 8h, 12h, Daily)
•NFLX (1h, 2h, 3h, 4h, 6h, 8h, 12h, Daily)
•MA (1h, 2h, 3h, 4h, 6h, 8h, 12h, Daily)
•META (1h, 2h, 3h, 4h, 6h, 8h, 12h, Daily)
•AAPL (1h, 2h, 3h, 4h, 6h, 8h, 12h, Daily)
•SPY (12h, Daily)
About the Code
The user can modify:
• EMA periods (20 and 50 by default)
• Bollinger Bands length (20 periods)
• Standard deviation (2.0)
Visualization
• EMA 20: Blue line
• EMA 50: Red line
• Green background when EMA20 > EMA50 (bullish trend)
• Red background when EMA20 < EMA50 (bearish trend)
Important Note:
We can significantly increase the profit factor and overall profitability by risking a fixed percentage per trade instead of a fixed amount. This would prevent losses from fluctuating with changes in volatility.
This could be implemented by reducing position size or adjusting leverage based on the volatility percentage required for each trade, but I’m not sure if this is fully possible in Pine Script. In my other script, “Golden Cross 50/200 EMA,” I go deeper into this topic and provide examples.
I hope you enjoy this contribution. Best regards!
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
📖Revista El Especulador:
drive.google.com/file/d/1Fs8l9xSpZIy5haCb5l0HWzgeAanOifs_/view?usp=drivesdk
👉t.me/ElEspeculador96 (Telegram)
drive.google.com/file/d/1Fs8l9xSpZIy5haCb5l0HWzgeAanOifs_/view?usp=drivesdk
👉t.me/ElEspeculador96 (Telegram)
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
📖Revista El Especulador:
drive.google.com/file/d/1Fs8l9xSpZIy5haCb5l0HWzgeAanOifs_/view?usp=drivesdk
👉t.me/ElEspeculador96 (Telegram)
drive.google.com/file/d/1Fs8l9xSpZIy5haCb5l0HWzgeAanOifs_/view?usp=drivesdk
👉t.me/ElEspeculador96 (Telegram)
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.