Comparative Relative Strength - HongQuanTraderThis script is designed to enhance your trading strategy by comparing the current symbol with another comparative symbol. The goal is to trade a symbol only when its Relative Strength (RS) value surpasses the long moving average of the RS value, ensuring more informed and strategic trading decisions.
Default Mode
In the default mode, the RS value is calculated by simply dividing the base symbol by the comparative symbol:
RS_SIMPLE = baseSymbol / comparativeSymbol
Period Mode
When you enable the “use period” option, the script uses the RS_PERIOD equation. This mode is particularly useful for comparing multiple symbols against the same comparative symbol, with the output normalized around 1.0 for easier comparison:
RS_PERIOD = baseSymbol / baseSymbol / (comparativeSymbol / comparativeSymbol )
By leveraging these calculations, you can gain deeper insights into the relative performance of different symbols, allowing you to make more precise and confident trading decisions. Whether you’re comparing stocks, currencies, or any other assets, this script provides a robust framework for enhancing your trading strategy.
Comparative
Symbol CorrelationThe "Symbol Correlation" indicator calculates and displays the correlation between the chosen symbol's price and another selected source over a specified period. It also includes a moving average (SMA) of this correlation to provide a smoothed view of the relationship.
Why SMA and Table Display ?
The inclusion of SMA (Simple Moving Average) with adjustable length (SMA Length) enhances the indicator's utility by smoothing out short-term fluctuations in correlation, allowing for clearer trend identification. The SMA helps to visualize the underlying trend in correlation, making it easier to spot changes and patterns over time.
The table display of the correlation SMA value offers a concise summary of this trend. By showcasing the current correlation SMA alongside its historical values, traders can quickly gauge the relationship's strength relative to previous periods.
Interpreting the Indicator:
1. Correlation Values: The primary plot shows the raw correlation values between the symbol's price and the specified source. A value of 1 indicates a perfect positive correlation, -1 signifies a perfect negative correlation, and 0 suggests no linear relationship.
2. Correlation SMA: The SMA line represents the average correlation over a defined period (SMA Length). Rising SMA values indicate strengthening correlation trends, while declining values suggest weakening correlations.
3. Choosing SMA Length: Traders can adjust the SMA Length parameter to tailor the moving average to their specific analysis horizon. Shorter SMA lengths react quickly to price changes but may be more volatile, while longer SMA lengths smooth out noise but respond slower to recent changes.
In summary, the "Symbol Correlation" indicator is a valuable tool for assessing the evolving relationship between a symbol's price and an external source. Its use of SMA and tabular presentation facilitates a nuanced understanding of correlation trends, aiding traders in making informed decisions based on market dynamics.
Benchmark, Sector & Stock PerformanceA script to perform sectoral performance (using predefined exchange indices or custom indices) and a stock from that sector/industry.
This script allows to peg to a reference date and the returns of the stock, sector and the market benchmark are all calculated from that date as reference.
The thing to note:
If using a custom index, it needs to be defined manually and set in the indicator input box.
One also needs to manually type in the text of the custom (or predefined) index name. Otherwise default text will be displayed.
If any of the constituents of the custom index do not start from the selected reference date, then either the date should adjusted or the script starting later should be removed from the index.
There are 2 tables displayed. The one on top right, display the returns of the benchmark, sector and stock selected from the reference date. The one on bottom left displays the same from 52 Weeks ago. You can choose to normalize the performance of the stock and the sector benchmark with respect to the market benchmark and display performance tables.
A good way to do the analysis is to check if the sector or the stock is starting to breakout from the benchmark in terms of absolute returns. So say the sectors starts to outperform the benchmark, then we know that the sector constituents are stronger than the benchmark. And when the stock also starts to outperform the benchmark and the sector, then we know it is leading the strongest stocks of the market as well as its peers.
Correlation Coefficient: Visible Range Dynamic Average R -Correlation Coefficient with Dynamic Average R (shows R average for the visible chart only, changes as you zoom in or out)
-Label: Vis-Avg-R = Visable Average R
-the Correlation Coefficient function for Pearson's R is taken from "BA🐷 CC" indicator by @balipour (highly recommended; more thorough treatment of R and other stats, but without the dynamic average)
-I wrote this primarily to add a dynamic Average R, showing correlation for arbitrary start times/end times; whether it be the last month, last year, of some specific period from the past (backtest mode)
-I have been using this to get an idea of correlation regimes over time between Bonds vs Stocks (ZB1! vs ES1!).
-As you see from the above, most of 2022 has seen an unusually strong positive correlation between Bonds and Stocks
~~inputs:
-lookback length for calculation of R
-Backtest mode (true by default): displays Average R for ONLY the visible range displayed on any part of chart history (LHS to RHS of screen only)
-source for both Ticker and compared Asset (close, open, high, low, ohlc4.. etc)
~~some other assets worth comparing:
Aussie vs Gold; Aussie vs ES; Btc vs ES; Copper vs ES
Comparative Relative Strength for Crypto (USDT/USD)Comparative Relative Strength for Crypto (USDT/USD)
An adaption of the indicator as published by © bharatTrader->
Please visit the link for details as published by the original coder.
Configured for Crypto by presetting (per filter) for CIX100 usage - either in USDT (Kucoin) or USD (Capitolcom)
Comparative Strength [FT]This indicator calculates the comparative strength between 2 variables by subtracting them instead of division/ratio.
Example:
A is stronger than B, then if A-B, it would be positive because value A is bigger than B.
A is weaker than B, then when A-B, this would be negative because A is lower than B.
What it does:
It takes the difference of averages of variable A (ie: stock), and the same for variable B (ie: index), and then the result of those is substracted to get a value.
Why is this indicator useful ?
To visualise comparative values between 2 related variables. IE: stock-index, stock-commodities, forex-interest rates, forex-bond, forex-inflation.
DISCLAIMER: Nothing in this content should be interpreted as financial advice or a recommendation to buy or sell any sort of security, investment, currencies or assets.
Relative Strength Ratio Chart + Relative Volume Gradient CandlesThe purpose of the Comparative Relative Strength Ratio indicator is to provide a way of looking at a relative strength ratio as a candle graph instead of only a closing price line, as well as to provide relative volume gradient coloration on the ratio-generated candles, and additionally to plot moving averages of the CRS ratio that can help display shifting trends in relative strength.
This is different from my Relative Volume Gradient Paintbars indicator, as well as my Comparison Chart with Relative Volume Gradient Paintbars indicator, in that the first looks at the charted symbol itself, the second looks at an alternate symbol, and this third indicator looks at a ratio between the charted symbol and the alternate symbol.
The idea behind this indicator is to provide additional means of evaluating relative strength, such as comparing the moving averages of the comparative relative strength ratio graph to the charted stock symbol's own MAs in order to gauge strength, comparing the price action of the ratio to that of the individual stock and its index, and comparing the volume gradient signal between the ratio, the stock, and the index.
The unique volume features allow comparing volume as a percent of the index volume, as well as stock's candle range as a percent of the range of the index. So when the volume as a percentage of the index's overall volume becomes high, this can be made to highlight the candles.
Relative Strength Auto ComparisonRelative Strength Comparison with automatic selection of relevant index
Added support for most european and north american exchanges.
Relative Strength(RSMK) + Perks - Markos KatsanosIf you are desperately looking for a novel RSI, this isn't that. This is another lesser known novel species of indicator. Hot off the press, in multiple stunning color schemes, I present my version of "Relative Strength (RSMK)" employing PSv4.0, originally formulated by Markos Katsanos for TASC - March 2020 Traders Tips. This indicator is used to compare performance of an asset to a market index of your choosing. I included the S&P 500 index along side the Dow Jones and the NASDAQ indices selectively by an input() in "Settings". You may comparatively analyze other global market indices by adapting the code, if you are skilled enough in Pine to do so.
With this contribution to the Tradingview community, also included is MY twin algorithmic formulation of "Comparative Relative Strength" as a supplementary companion indicator. They are eerily similar, so I decided to include it. You may easily disable my algorithm within the indicator "Settings". I do hope you may find both of them useful. Configurations are displayed above in multiple scenarios that should be suitable for most traders.
As always, I have included advanced Pine programming techniques that conform to proper "Pine Etiquette". For those of you who are newcomers to Pine Script, this script may also help you understand advanced programming techniques in Pine and how they may be utilized in a most effective manner. Utilizing the "Power of Pine", I included the maximum amount of features I could surmise in an ultra small yet powerful package, being less than a 60 line implementation at initial release.
Unfortunately, there are so many Pine mastery techniques included, I don't have time to write about all of them. I will have to let you discover them for yourself, excluding the following Pine "Tricks and Tips" described next. Of notable mention with this release, I have "overwritten" the Pine built-in function ema(). You may overwrite other built-in functions too. If you weren't aware of this Pine capability, you now know! Just heed caution when doing so to ensure your replacement algorithms are 100% sound. My ema() will also accept a floating point number for the period having ultimate adjustability. Yep, you heard all of that properly. Pine is becoming more impressive than `impressive` was originally thought of...
Features List Includes:
Dark Background - Easily disabled in indicator Settings->Style for "Light" charts or with Pine commenting
AND much, much more... You have the source!
The comments section below is solely just for commenting and other remarks, ideas, compliments, etc... regarding only this indicator, not others. When available time provides itself, I will consider your inquiries, thoughts, and concepts presented below in the comments section, should you have any questions or comments regarding this indicator. When my indicators achieve more prevalent use by TV members, I may implement more ideas when they present themselves as worthy additions. As always, "Like" it if you simply just like it with a proper thumbs up, and also return to my scripts list occasionally for additional postings. Have a profitable future everyone!
Combo Backtest 123 Reversal & Comparative Relative Strength This is combo strategies for get a cumulative signal.
First strategy
This System was created from the Book "How I Tripled My Money In The
Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
The strategy buys at market, if close price is higher than the previous close
during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50.
The strategy sells at market, if close price is lower than the previous close price
during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
Second strategy
Comparative Relative Strength Strategy for ES
WARNING:
- For purpose educate only
- This script to change bars colors.
Combo Strategy 123 Reversal & Comparative Relative Strength This is combo strategies for get a cumulative signal.
First strategy
This System was created from the Book "How I Tripled My Money In The
Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
The strategy buys at market, if close price is higher than the previous close
during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50.
The strategy sells at market, if close price is lower than the previous close price
during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
Second strategy
Comparative Relative Strength Strategy for ES
WARNING:
- For purpose educate only
- This script to change bars colors.
Relative StrengthRelative strength is a ratio between two assets, most often a stock and a market average (index). This implementation uses the method described here and the second method described here to calculate its value: "To calculate the relative strength of a particular stock, divide the percentage change over some time period by the percentage change of a particular index over the same time period". This indicator oscillates around zero. If the value is greater than zero, the investment has been relatively strong during the selected period; if the value is less than zero, the investment has been relatively weak. The period and the comparative symbol can be set in the settings for the indicator (the defaults are 50 and SPX), there you can also find an option to turn on a moving average.