PROTECTED SOURCE SCRIPT
Aggiornato VN Stock Risk + RS Combined

Description
This script is a cycle-based risk and relative strength indicator designed for the Vietnam stock market.
It combines:
Market Risk (long-term cycle & trend extension)
Relative Strength (RS) versus VN-Index
The goal is to identify stocks that are not overheated and are outperforming the broader market.
How it works
The indicator calculates:
Risk score (0–1) using:
Deviation from long-term cycle SMA
Price distance from 40-week MA
Medium-term flow (20W / 40W MA)
Relative Strength (RS):
Stock price divided by VN-Index price
Compared to RS 40-week MA
How to use
Timeframe: Weekly only
Green zone: Low risk + RS above MA → accumulate / hold
Yellow zone: Mixed signals → wait
Red zone: High risk or weak RS → avoid / reduce exposure
Rule of thumb:
Buy stocks with lower risk than VN-Index and RS above its 40-week MA.
Intended use
Mid-to-long-term investing
Portfolio allocation
Avoiding market tops
❌ Not for day trading or scalping
This script is a cycle-based risk and relative strength indicator designed for the Vietnam stock market.
It combines:
Market Risk (long-term cycle & trend extension)
Relative Strength (RS) versus VN-Index
The goal is to identify stocks that are not overheated and are outperforming the broader market.
How it works
The indicator calculates:
Risk score (0–1) using:
Deviation from long-term cycle SMA
Price distance from 40-week MA
Medium-term flow (20W / 40W MA)
Relative Strength (RS):
Stock price divided by VN-Index price
Compared to RS 40-week MA
How to use
Timeframe: Weekly only
Green zone: Low risk + RS above MA → accumulate / hold
Yellow zone: Mixed signals → wait
Red zone: High risk or weak RS → avoid / reduce exposure
Rule of thumb:
Buy stocks with lower risk than VN-Index and RS above its 40-week MA.
Intended use
Mid-to-long-term investing
Portfolio allocation
Avoiding market tops
❌ Not for day trading or scalping
Note di rilascio
OverviewVN Stock Risk + RS Combined is a cycle-based risk indicator designed to help investors identify:
Low-risk accumulation zones
Neutral trend continuation phases
High-risk market tops and distribution areas
The indicator combines:
Cycle deviation risk (distance from long-term trend)
Trend extension & acceleration
Relative Strength (RS) versus a benchmark index (VNINDEX)
It is optimized for weekly timeframes and medium- to long-term investors.
Indicator Components
1. Cycle Risk (Primary Signal)
Risk is calculated using three normalized factors:
Deviation from 200-week SMA
Measures how extended price is relative to the long-term cycle.
Distance from 40-week trend
Captures medium-term overextension.
Trend acceleration (20W / 40W SMA)
Detects late-cycle momentum surges.
These components are weighted, with cycle deviation having the highest influence.
2. Market Context (Index Risk)
The indicator also calculates market risk using the benchmark index (VNINDEX):
When stock risk < index risk, the stock is relatively safer.
When stock risk > index risk, risk is elevated even if price is rising.
This prevents buying aggressively when the entire market is overheated.
3. Relative Strength (RS)
Relative Strength compares the asset to the benchmark:
RS above its 40-week average → Asset is outperforming the market
RS below its 40-week average → Asset is underperforming
RS is used as a filter, not as a standalone buy signal.
Color & Zone Interpretation
🟢 Green – Low Risk (Accumulation Zone)
Conditions:
Risk is low
Stock risk < market risk
RS is strong (outperforming)
How to act:
Ideal zone for DCA (Dollar Cost Averaging)
Suitable for building core positions
High risk-reward asymmetry
🟡 Yellow – Neutral Risk (Trend Continuation)
Conditions:
Risk is rising but still below high-risk threshold
Trend remains intact
How to act:
Hold existing positions
Add selectively on pullbacks
Avoid aggressive leverage
🔴 Red – High Risk (Distribution / Top Zone)
Conditions:
Risk ≥ High Risk threshold (default 0.8)
Market is overextended relative to long-term cycle
How to act:
Stop DCA
Reduce position size
Avoid new long-term entries
Focus on capital preservation
⚠️ Red does not mean “price must crash immediately”
It signals poor long-term risk-reward.
Best Practices
Recommended Settings
Timeframe: Weekly (W)
Cycle SMA: 200 weeks
High Risk Threshold: 0.8
Low Risk Threshold: 0.3
Ideal Use Cases
Long-term investing
Cycle-based asset allocation
Portfolio risk management
Market top / bottom context (not timing exact highs/lows)
What This Indicator Is NOT
❌ Not a short-term trading indicator
❌ Not a precise top or bottom timer
❌ Not meant for intraday use
It is a risk thermometer, not a price prediction tool.
Key Principle
Buy when risk is low.
Reduce exposure when risk is high.
Let price fluctuate — manage risk, not emotions.
Script protetto
Questo script è pubblicato come codice protetto. Tuttavia, è possibile utilizzarle liberamente e senza alcuna limitazione – ulteriori informazioni qui.
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 protetto
Questo script è pubblicato come codice protetto. Tuttavia, è possibile utilizzarle liberamente e senza alcuna limitazione – ulteriori informazioni qui.
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.