TradingView
sjakk
24 יוני 2020 21:04

Relative Strength Auto Comparison 

Tesla, Inc.NASDAQ

תיאור

Relative Strength Comparison with automatic selection of relevant index

Added support for most european and north american exchanges.


הערות שחרור

Added SPX as a fallback index if no match found in table

הערות שחרור

- Updated table with Exchange / Comparative index to include forex exchanges Oanda, Saxo, Fxcm, forex.com, and ice data serv. Used the dollar basket as comparative index in these cases
- tweaked input settings, everything enabled by default

הערות שחרור

n/a

הערות שחרור

// Auto Comparative Relative Strength //

Features
*. Compares strength of a symbol (usually an Asset/equity/stock) to the strength of a comparative symbol (usually an index)
*. autoselect of relevant comparative index/symbol
- Primarly for stocks. Uses a Global index to compare other indexes or cfd's. and dollar basket if symbol is a forex instrument.
*. Override function to use as normal RS line with specified index/symbol
*. Override symbol is used as a fallback when no match is found in the autoselect table
*. Zero Cross oscillator, with a moving average cross
*. Debug panel, lists the syminfo data used to select indices. If' anyone discovers bugs or unexpected behavior, a screenshot of the debugpanel should help track down the problem.

Updates
- Bugfix with _DLY suffix in the exchange info if you recieve only free data / not paid for realtime from exchange
- Workaround for the Euronext exchanges, uses timezone to select index, (so euronext paris, uses the cac40)
- simple moving average for the change calculation, experimented with different weights and moving averages for the change calculation. Sma works good and reliably.
- overridesymbol doubles as fallback index
- Added India's national stock exchange matchet to the nifty.

Known issues
Need to fill the table of exchanges and indexes. Only North American, European and India Stock Exchanges added so far.
requires some research, or even better, local knowledge to match a prefered index to a stock exchange
suggestions are welcome: The debug panel should give information on the Exchange, Symbol and index used for comparison


הערות שחרור

Workaround/bugfix: syminfo.prefix only 8characters max? truncation of exchange names.

תגובות
justsri
Hi sir, it's a great indicator. Thank you.
justsri
I would like to know if there is any screener based on exchanges if it can filter the stocks which are under overbought greater than 0 and oversold less than 0.
sjakk
@justsri, afaik there is none on tradingview. First that comes to mind is investors.com (the IBD rating there, is probably partially a relative strength comparison between assets to asset or assets to index.)
YMMV
thvo1
Hi what is the 50 and 10 range? 10 is SMA and 50 SMA? can I change the range for day trade and also change to EMA?
sjakk
@thvo1, Hi, why not just try changing values and verify what happens and how it reponds?

tldr; A more responsive smoothing isn't always a good thing.
It's wise to remember, a filter is only the removal of data, for the purpose of removing noise, it is NOT additional data in it self.

50 is the sma of the self comparative (close[0] / sma(close, 50)) Changing the averaging method here is not included in the script as I believe it doesn't bring anything to the table. The same sma function and sma length is used as both numerator and denominator. You can shortening the period to less than 50 to make this more responsive and noisy. (the purpose of using sma here is to just smooth out the inherent problem with a simple offset RS "close / close[50]", a sharp response is actually undesirable)

The 10 is an ema(RSline, 10) the signal line plotted on the chart along the RS line. This could use any smoothing filter really, but to keep code easy and simple, I didn't feel like adding options.
As for daytrading, this is written with the daily and weekly chart in mind. and since this is relative to an index, it's more of an helping hand in understanding who are the leaders and laggards in the market.
ssumit_100
that's the only indicator which i use in chart...that speaks volumes.but i don't understand exactly what it means..if it's over zero does it mean within a given period the price change percentage of the ticker is greater than price change percentage of the base symbol?
עוד