OPEN-SOURCE SCRIPT

Barras de resiliencia contra el mercado

134
Relative strength vs market indicator
🎯 main goal:
To visually detect when a stock shows relative strength against the S&P 500, especially on down days in the market. The indicator helps identify stocks that:

Go up while the SP500 goes down

Fall less than the SP500

🟩 solid green bar (upward)
Condition: SP500 closes negative, your stock closes positive.

Color: solid green

Meaning: strong relative strength. The stock goes up while the market drops.

Example:

SP500: -1.2%

Stock: +1.5%

Difference: +2.7% → green bar going up

🟧 light orange bar (upward)
Condition: SP500 closes negative, your stock also drops, but less than the SP500.

Color: light orange

Meaning: resilience. Still a down day, but the stock shows relative strength.

Example:

SP500: -2.0%

Stock: -0.5%

Difference: +1.5% → light orange bar going up

🟥 red bar (downward)
Condition: SP500 closes negative, your stock drops more than the index.

Color: solid red

Meaning: clear weakness. The stock is underperforming in a weak market.

Example:

SP500: -0.8%
Stock: -2.0%
Difference: -1.2% → red bar going down

🟩 light green bar (upward)
Condition: SP500 closes positive, your stock outperforms the index (goes up more).

Color: light green (50% opacity)
Meaning: relative strength in a strong market. Not as critical, but still positive.
Example:
SP500: +0.5%
Stock: +1.5%
Difference: +1.0% → light green bar going up

🟩 light green bar (downward)
Condition: SP500 closes positive, but your stock underperforms (gains less or even drops).

Color: light green (50% opacity)

Meaning: underperformance on a strong day. The stock lags the index.

Example 1:

SP500: +1.8%
Stock: +0.5%
Difference: -1.3% → light green bar going down
Example 2:
SP500: +1.0%
Stock: -0.5%
Difference: -1.5% → light green bar going down

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.