PROTECTED SOURCE SCRIPT
US Sentiment -invincible3

US Sentiment — invincible3 is a macro dashboard table that tracks key U.S. economic indicators (FRED + TradingView ECONOMICS series) and converts their latest changes into a simple bullish / bearish / neutral sentiment signal. It helps traders quickly understand whether the macro backdrop is improving or deteriorating — without switching between multiple charts.
🔶 USAGE
This indicator displays a table on your chart showing:
Category (Business, Consumer, Growth, Housing, Inflation, Labour, Monetary, Activity, Trade)
Indicator name
Updated date (latest available value on the selected macro timeframe)
Current value
Previous reference value
% Change with a directional arrow:
⬆ = positive / supportive change
⬇ = negative / risk-off change
→ = neutral (no change or insufficient data)
🔹 Sentiment Reading (Summary Row)
At the bottom, the script totals how many indicators are currently:
Positive sentiment (green count)
Negative sentiment (red count)
This gives an instant “macro bias snapshot” you can use as a context filter for:
USD pairs (DXY direction confirmation)
equities / indices (risk-on vs risk-off)
gold & bonds (inflation / rates pressure)
broader regime detection (growth improving vs slowing)
🔹 How to Use in Trading
Common ways to use the table:
Trend confirmation: If price is bullish and macro sentiment is broadly improving, you have stronger alignment.
Risk filter: Avoid trend trades when the table shows mixed or worsening conditions (many red arrows).
Event context: When CPI / NFP hits, the next macro update will often shift the table — useful for tracking regime shifts over weeks/months.
🔶 DETAILS
The table is built around a “change classification” model:
Data Fetch (multi-source)
Uses request.security() to load each macro series on your chosen macro timeframe (monthly recommended).
Smart Previous Value Selection
Some macro series repeat the same number for multiple periods or contain missing/zero values.
Instead of always using close[1], the script searches backwards (up to 6 bars) to find the most recent valid previous value that is non-zero and preferably different from the current value.
This reduces misleading “0% change” readings and makes the sentiment logic more reliable.
% Change Calculation
The script computes:
%𝐶ℎ𝑔=(𝐶𝑢𝑟𝑟𝑒𝑛𝑡−𝑃𝑟𝑒𝑣𝑖𝑜𝑢𝑠)/𝑃𝑟𝑒𝑣𝑖𝑜𝑢𝑠 x 100
Signal Logic (Higher vs Lower is Better)
Each indicator is tagged with a rule:
If higher_is_better = true, rising values are scored positive.
If higher_is_better = false, rising values are scored negative (example: inflation/rates).
So the same +% change can be “good” for one series but “bad” for another.
Neutral Handling
If change is unavailable or equals zero:
It prints → and does not count it as positive/negative.
🔶 SETTINGS
✅ Calc timeframe
Monthly (M) is recommended for macro signals.
You can use Weekly/Daily if you want more frequent updates, but many economic series are naturally monthly or quarterly.
✅ Table Position
Moves the table to any corner/center of the chart.
✅ Text Size
Adjust readability for different screen layouts.
⚠️ NOTES
“Updated” reflects the latest bar time for the selected macro timeframe, which is usually close to the release date but depends on the data provider/series.
If a series shows N/A, it may not be available on your TradingView plan or the ticker may differ across regions/data feeds.
🔶 USAGE
This indicator displays a table on your chart showing:
Category (Business, Consumer, Growth, Housing, Inflation, Labour, Monetary, Activity, Trade)
Indicator name
Updated date (latest available value on the selected macro timeframe)
Current value
Previous reference value
% Change with a directional arrow:
⬆ = positive / supportive change
⬇ = negative / risk-off change
→ = neutral (no change or insufficient data)
🔹 Sentiment Reading (Summary Row)
At the bottom, the script totals how many indicators are currently:
Positive sentiment (green count)
Negative sentiment (red count)
This gives an instant “macro bias snapshot” you can use as a context filter for:
USD pairs (DXY direction confirmation)
equities / indices (risk-on vs risk-off)
gold & bonds (inflation / rates pressure)
broader regime detection (growth improving vs slowing)
🔹 How to Use in Trading
Common ways to use the table:
Trend confirmation: If price is bullish and macro sentiment is broadly improving, you have stronger alignment.
Risk filter: Avoid trend trades when the table shows mixed or worsening conditions (many red arrows).
Event context: When CPI / NFP hits, the next macro update will often shift the table — useful for tracking regime shifts over weeks/months.
🔶 DETAILS
The table is built around a “change classification” model:
Data Fetch (multi-source)
Uses request.security() to load each macro series on your chosen macro timeframe (monthly recommended).
Smart Previous Value Selection
Some macro series repeat the same number for multiple periods or contain missing/zero values.
Instead of always using close[1], the script searches backwards (up to 6 bars) to find the most recent valid previous value that is non-zero and preferably different from the current value.
This reduces misleading “0% change” readings and makes the sentiment logic more reliable.
% Change Calculation
The script computes:
%𝐶ℎ𝑔=(𝐶𝑢𝑟𝑟𝑒𝑛𝑡−𝑃𝑟𝑒𝑣𝑖𝑜𝑢𝑠)/𝑃𝑟𝑒𝑣𝑖𝑜𝑢𝑠 x 100
Signal Logic (Higher vs Lower is Better)
Each indicator is tagged with a rule:
If higher_is_better = true, rising values are scored positive.
If higher_is_better = false, rising values are scored negative (example: inflation/rates).
So the same +% change can be “good” for one series but “bad” for another.
Neutral Handling
If change is unavailable or equals zero:
It prints → and does not count it as positive/negative.
🔶 SETTINGS
✅ Calc timeframe
Monthly (M) is recommended for macro signals.
You can use Weekly/Daily if you want more frequent updates, but many economic series are naturally monthly or quarterly.
✅ Table Position
Moves the table to any corner/center of the chart.
✅ Text Size
Adjust readability for different screen layouts.
⚠️ NOTES
“Updated” reflects the latest bar time for the selected macro timeframe, which is usually close to the release date but depends on the data provider/series.
If a series shows N/A, it may not be available on your TradingView plan or the ticker may differ across regions/data feeds.
보호된 스크립트입니다
이 스크립트는 비공개 소스로 게시됩니다. 하지만 이를 자유롭게 제한 없이 사용할 수 있습니다 – 자세한 내용은 여기에서 확인하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
보호된 스크립트입니다
이 스크립트는 비공개 소스로 게시됩니다. 하지만 이를 자유롭게 제한 없이 사용할 수 있습니다 – 자세한 내용은 여기에서 확인하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.