PROTECTED SOURCE SCRIPT
Student Wyckoff Relative Strength

STUDENT WYCKOFF Relative Strength compares one instrument against another and plots their relative performance as a single line.
Instead of asking “is this chart going up or down?”, the script answers a more practical question: “is THIS asset doing better or worse than my benchmark?”
━━━━━━━━━━
1. Concept
━━━━━━━━━━
The indicator builds a classic relative strength (RS) line:
• Main symbol = the chart you attach the script to.
• Benchmark symbol = any symbol you choose in the settings (index, ETF, sector, another coin, etc.).
RS is calculated as:
RS = Price(main symbol) / Price(benchmark)
If RS is rising, your symbol outperforms the benchmark.
If RS is falling, your symbol underperforms the benchmark.
You can optionally normalize RS from the first bar (start at 1 or 100) to clearly see how many times the asset has outperformed or lagged behind over the visible history.
This is not a “buy/sell” indicator. It is a **context tool** for rotation, selection and Wyckoff-style comparative analysis.
━━━━━━━━━━
2. How the RS line is built
━━━━━━━━━━
Inputs:
• Source of main symbol – default is close, but you can choose any OHLC/HL2/typical price etc.
• Benchmark symbol – ticker used as reference (index, sector, futures, Bitcoin, stablecoin pair, etc.).
• Benchmark timeframe – by default the current chart timeframe is used, or you can force a different TF.
The script uses `request.security()` with `lookahead_off` and `gaps_off` to pull benchmark prices **without look-ahead**.
A small epsilon is used internally to avoid division by zero when the benchmark price is very close to 0.
Normalization options:
• Normalize RS from first bar – if enabled, the very first valid RS value becomes “1” (or 100), and all further values are expressed relative to this starting point.
• Multiply RS by 100 – purely cosmetic; makes it easier to read RS as a “percentage-like” scale.
━━━━━━━━━━
3. Smoothing and color logic
━━━━━━━━━━
To help read the trend of relative strength, the script calculates a simple moving average of the RS line:
• RS MA length – period of smoothing over the RS values.
• Show RS moving average – toggle to display or hide this line.
Color logic:
• When RS is above its own MA → the line is drawn with the “stronger” color.
• When RS is below its MA → the line uses the “weaker” color.
• When RS is close to its MA → neutral color.
Optional background shading:
• When RS > RS MA → background can be tinted softly green (phase of relative strength).
• When RS < RS MA → background can be tinted softly red (phase of relative weakness).
This makes it easy to read the **trend of strength** at a glance, without measuring every small swing.
━━━━━━━━━━
4. How to interpret it
━━━━━━━━━━
Basic reading rules:
• Rising RS line
– The main symbol is outperforming the benchmark.
– In Wyckoff terms, this can indicate a leader within its group, or a sign of accumulation relative to the market.
• Falling RS line
– The main symbol is underperforming the benchmark.
– Can point to laggards, distribution, or simply an asset that is “dead money” compared to alternatives.
• Flat or choppy RS line
– No clear edge versus the benchmark; performance is similar or rotating back and forth.
With normalization on:
• RS > 1 (or > 100) – the asset has grown more than the benchmark since the starting point.
• RS < 1 (or < 100) – it has grown less (or fallen more) than the benchmark over the same period.
The RS moving average and colored background highlight whether this outperformance/underperformance is a **temporary fluctuation** or a more sustained phase.
━━━━━━━━━━
5. Practical uses
━━━━━━━━━━
This indicator is useful for:
• **Selecting stronger assets inside a group**
– Compare individual stocks vs an index, sector, or industry ETF.
– Compare altcoins vs BTC, ETH, or a crypto index.
– Prefer charts where RS is in a sustained uptrend rather than just price going “up on its own”.
• **Monitoring sector and rotation flows**
– Attach the script to sector ETFs or major coins and switch the benchmark to a broad market index.
– See where capital is rotating: which areas are gaining or losing strength over time.
• **Supporting Wyckoff-style analysis**
– Use RS together with volume, structure, phases and trading ranges.
– A breakout or SOS with rising RS vs the market tells a different story than the same pattern with falling RS.
• **Portfolio review and risk decisions**
– When an asset shows a long period of relative weakness, it may be a candidate to reduce or replace.
– When RS turns up from a long weak phase, it can signal the start of potential leadership (not an entry by itself, but a reason to study the chart deeper).
━━━━━━━━━━
6. Notes and disclaimer
━━━━━━━━━━
• Works on any symbol and timeframe available on TradingView.
• The last bar can change in real time as new prices arrive; this is normal behaviour for all indicators that depend on current close.
• There are no built-in alerts or trading signals – this tool is meant to support your own analysis and trading plan.
This script is published for educational and analytical purposes only.
It does not constitute financial or investment advice and does not guarantee any performance. Always test your ideas, understand the logic of your tools and use proper risk management.
Instead of asking “is this chart going up or down?”, the script answers a more practical question: “is THIS asset doing better or worse than my benchmark?”
━━━━━━━━━━
1. Concept
━━━━━━━━━━
The indicator builds a classic relative strength (RS) line:
• Main symbol = the chart you attach the script to.
• Benchmark symbol = any symbol you choose in the settings (index, ETF, sector, another coin, etc.).
RS is calculated as:
RS = Price(main symbol) / Price(benchmark)
If RS is rising, your symbol outperforms the benchmark.
If RS is falling, your symbol underperforms the benchmark.
You can optionally normalize RS from the first bar (start at 1 or 100) to clearly see how many times the asset has outperformed or lagged behind over the visible history.
This is not a “buy/sell” indicator. It is a **context tool** for rotation, selection and Wyckoff-style comparative analysis.
━━━━━━━━━━
2. How the RS line is built
━━━━━━━━━━
Inputs:
• Source of main symbol – default is close, but you can choose any OHLC/HL2/typical price etc.
• Benchmark symbol – ticker used as reference (index, sector, futures, Bitcoin, stablecoin pair, etc.).
• Benchmark timeframe – by default the current chart timeframe is used, or you can force a different TF.
The script uses `request.security()` with `lookahead_off` and `gaps_off` to pull benchmark prices **without look-ahead**.
A small epsilon is used internally to avoid division by zero when the benchmark price is very close to 0.
Normalization options:
• Normalize RS from first bar – if enabled, the very first valid RS value becomes “1” (or 100), and all further values are expressed relative to this starting point.
• Multiply RS by 100 – purely cosmetic; makes it easier to read RS as a “percentage-like” scale.
━━━━━━━━━━
3. Smoothing and color logic
━━━━━━━━━━
To help read the trend of relative strength, the script calculates a simple moving average of the RS line:
• RS MA length – period of smoothing over the RS values.
• Show RS moving average – toggle to display or hide this line.
Color logic:
• When RS is above its own MA → the line is drawn with the “stronger” color.
• When RS is below its MA → the line uses the “weaker” color.
• When RS is close to its MA → neutral color.
Optional background shading:
• When RS > RS MA → background can be tinted softly green (phase of relative strength).
• When RS < RS MA → background can be tinted softly red (phase of relative weakness).
This makes it easy to read the **trend of strength** at a glance, without measuring every small swing.
━━━━━━━━━━
4. How to interpret it
━━━━━━━━━━
Basic reading rules:
• Rising RS line
– The main symbol is outperforming the benchmark.
– In Wyckoff terms, this can indicate a leader within its group, or a sign of accumulation relative to the market.
• Falling RS line
– The main symbol is underperforming the benchmark.
– Can point to laggards, distribution, or simply an asset that is “dead money” compared to alternatives.
• Flat or choppy RS line
– No clear edge versus the benchmark; performance is similar or rotating back and forth.
With normalization on:
• RS > 1 (or > 100) – the asset has grown more than the benchmark since the starting point.
• RS < 1 (or < 100) – it has grown less (or fallen more) than the benchmark over the same period.
The RS moving average and colored background highlight whether this outperformance/underperformance is a **temporary fluctuation** or a more sustained phase.
━━━━━━━━━━
5. Practical uses
━━━━━━━━━━
This indicator is useful for:
• **Selecting stronger assets inside a group**
– Compare individual stocks vs an index, sector, or industry ETF.
– Compare altcoins vs BTC, ETH, or a crypto index.
– Prefer charts where RS is in a sustained uptrend rather than just price going “up on its own”.
• **Monitoring sector and rotation flows**
– Attach the script to sector ETFs or major coins and switch the benchmark to a broad market index.
– See where capital is rotating: which areas are gaining or losing strength over time.
• **Supporting Wyckoff-style analysis**
– Use RS together with volume, structure, phases and trading ranges.
– A breakout or SOS with rising RS vs the market tells a different story than the same pattern with falling RS.
• **Portfolio review and risk decisions**
– When an asset shows a long period of relative weakness, it may be a candidate to reduce or replace.
– When RS turns up from a long weak phase, it can signal the start of potential leadership (not an entry by itself, but a reason to study the chart deeper).
━━━━━━━━━━
6. Notes and disclaimer
━━━━━━━━━━
• Works on any symbol and timeframe available on TradingView.
• The last bar can change in real time as new prices arrive; this is normal behaviour for all indicators that depend on current close.
• There are no built-in alerts or trading signals – this tool is meant to support your own analysis and trading plan.
This script is published for educational and analytical purposes only.
It does not constitute financial or investment advice and does not guarantee any performance. Always test your ideas, understand the logic of your tools and use proper risk management.
نص برمجي محمي
تم نشر هذا النص البرمجي كمصدر مغلق. ومع ذلك، يمكنك استخدامه بحرية ودون أي قيود - تعرف على المزيد هنا.
Уже 18 лет я торгую на рынках
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي محمي
تم نشر هذا النص البرمجي كمصدر مغلق. ومع ذلك، يمكنك استخدامه بحرية ودون أي قيود - تعرف على المزيد هنا.
Уже 18 лет я торгую на рынках
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.