DivergenceLibrary "Divergence"
Calculates a divergence between 2 series
bullish(_src, _low, depth) Calculates bullish divergence
Parameters:
_src : Main series
_low : Comparison series (`low` is used if no argument is supplied)
depth : Fractal Depth (`2` is used if no argument is supplied)
Returns: 2 boolean values for regular and hidden divergence
bearish(_src, _high, depth) Calculates bearish divergence
Parameters:
_src : Main series
_high : Comparison series (`high` is used if no argument is supplied)
depth : Fractal Depth (`2` is used if no argument is supplied)
Returns: 2 boolean values for regular and hidden divergence
I created this library to plug and play divergences in any code.
You can create a divergence indicator from any series you like.
Fractals are used to pinpoint the edge of the series. The higher the depth, the slower the divergence updates get.
My Plain Stochastic Divergence uses the same calculation. Watch it in action.
Comparison
TEWY - Magic Strength Indicator (SI)Detail about this indicator
1. This indicator is used to identify the trend based on the momentum of the counter selected.
2. This indicator is calculated three different metrics for selected script and it's Parent/Main Index as NSE:NIFTY (default) and Sector Index. Keep in mind below point
a) Parent/Main index is set to default NSE:NIFTY, though there is option to provide your own custom parent index e.g. US30, US 100'
B) Sector Index is identified automatically for set to predefined stocks and rest ate set to default NIFTY 500. Again you have option to change it to your preference
3. I have used the rate of change and RSI of it to calculate momentum for script, it's parent index and sector index.
4. I would typically use this indicator to see momentum on the Monthly and Weekly first and daily timeframe to get proper entry.
5. Also please try to stay in the long position only unless you understand the consequences for shorting a stock . why? because the imminent nature of the market is to go upward only.
6. Please try to keep base inputs as defaults, though it allows you to change input parameters
Let's understand this indicator
• On the tor right corner you would see three different numbers. 1st number is SI of the underlying Ticker. 2nd number is SI for the Sector Index and 3rd is for Parent Index SI.
• If selected ticker is outperforming it's parent index the you see one green "▲" and if ticker is also outperforming it's sector index then you would see two green "▲▲". Same on the downside.
• I would only take long position if selected ticker is at least outperforming Parent index, that means at least one green "▲".
• I would take exit from the position if I see no more green "▲".
Always respect RISKS and follow stop loss. In market stop loss is the only friend of yours.
I have given a sample illustrational image below, which should help you understand this indicator.
Best of luck
Advanced Comparison ToolWith the new Pine Script features you can build pretty interesting scripts.
Here is my try to expand functionality of basic comparison tool you have in TradingView.
When you apply it on your chart you can select a bar when do you want to start comparing your instrument from.
In parameters you can specify up to 32 symbols to compare. You can also disable symbols and change color for them as well.
As a result you'll see a table with summary and line for every instrument you selected as if it started from the close of the selected bar.
Disclaimer.
Please remember that past performance may not be indicative of future results.
Due to various factors, including changing market conditions, the strategy may no longer perform as well as in historical backtesting.
This post and the script don’t provide any financial advice
LibraryPrivateUsage001This is a public library that include the functions explained below. The libraries are considered public domain code and permission is not required from the author if you reuse these functions in your open-source scripts
Volatility IndexThis indicator is based on Historical Volatility (HV) built-in indicator with minor tweaks to match the Bitcoin Volatility Index (from Bybt).
Also, you can select a symbol to compare its volatility with the volatility of the currently selected symbol.
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.
Combo Month-to-Month % ReturnA combined version of two already published indicators:
Combo Month-to-Month % Return (January - June)
Combo Month-to-Month % Return (July - December)
Allows to compare an asset's monthly returns over years.
Includes:
Customizable columns
Up to 20 columns per each chart
Customizable Min, Max, Mean, Median and Standard Deviation lines
Customizable labels
CH-I: Trend - Multi-Timeframe WatchlistWatchlists give only a flat perspective on changes in the market, as they show only the daily change of underlyings and give no comprehensible context to other underlyings and other timeframes to show the bigger picture.
With a cockpit showing price changes of different underlyings over several timeframes at the same time, a real understanding can be developed about shorter term momentum embedded into a longer term trend.
Look how major commodity currencies (in purple) have outrun other major currencies in recent months, but where the biggest losers in the last days as seen below. When now looking at the also displayed chart of the Norwegian Krone against the US Dollar, this gives more context, as the indication clearly shows, that commodity currencies in general have been rising for the last months and startet dropping recently.
By grouping related underlyings with the same kind of representation, it also becomes clear, in which of these sectors the action is gaining or losing momentum.
Here you can see how the major european markets (in green) are currently outperforming most other major markets with the major asian markets (in purple) being the laggards.
Another important benefit is the clear visibility of a shift in focus from one underlying or class of underlyings to another over time, which gives valuable insights into mode changes of differing markets to increase understanding of the current state of the relationships between different markets.
For more than half a year, mid and small caps have outperformed large caps in US equities, as much as Value caps have outperformed Growth caps. Here you see, how the outperformance of Value stocks has been maintained, but the focus shifted from smaller to bigger caps.
The indicator allows up to 20 individually selected ticker symbols classifiable into up to 6 separate groups with up to 12 different selectable time periods (including a custom time period) to be displayed.
The results can be displayed either only as a percentage change from start to end of the corresponding time period as well as additionally with highs and lows in the interval in a candlestick representation.
The output can be ordered by symbols as individually entered as well as by performance for a selectable time period.
For further convenience, a range of predefined sets of symbol is preconfigured to give insights into the development of markets for bonds, commodities, currencies, cryptos, equity markets and the economy without having to manually configure the corresponding symbols into the list of selectable symbols.
Additional details about Open, High, Low and Close values and the exact percentage changes as displayed as well as about selected symbols and allocated groups can be displayed by hovering the mouse over any time period or any symbol.
Date-selected Synch and Compare Script Module [yoxxx]This Script is a Convenience Script Module for calculations based or started on a fix time / date.
(In difference to bar_index-based where the reference point is shifting from bar to bar, thus is dynamic).
Purpose examples:
- Comparison by start date
- Time driven studies or strategies
- Measuring from Date of Interest
The script also contains a date input box with the feature of auto-converting the default time to local user time (a newer feature of Tradingview which too me a lot of research to find; so here integrated).
Last not least it the module gives you a ready to go example for multi security comparison on percentage scale with a free selectable start date.
Enjoy
Yoxxx
P.S:. For further notes look at the script code.
They are concerning usage and how avoiding some strange display issues.
MA Cross Ribbon + [RSI,StochRSI,VolOsc,RoC,Compare,Info Panel]
Draws all sorts of useful information directly onto the Chart
Moving Average Ribbon with configurable offsets
Allows you to easily visualize MA Crossovers
Easy to view in the Data Window
RSI Indicator (Overbought, Oversold, Healthy)
Stochastic RSI
Volume Oscillator (Bullish, Bearish, Healthy)
Rate of Change Indicator
Compare Symbol without adding a new scale (Symbol, Timeframe, Divider)
Moving the chart around won't ruin your comparison
Allows you to see the general sentiment of all your configured averages at a glance
100% Configurable
If there is anything you would like added please comment, It's very likely I will be adding more things to this.
Comparison (Malaysia Index & Sector)This is just a simple tool for convenient to compare and showing a clear image of all sector and index in Malaysia. They are just in one indicator. From this indicator, you can predict momentum of each sector in Malaysia, which is currently in bull or bear trend.
STRUCTURE
In the setting, the first line with the option of the following index (Malaysia Index) :
1. FBMKLCI
2. FTSEMYX:FBMSCAP
3. FTSEMYX:FBMACE
4. FTSEMYX:FBM70
5. FTSEMYX:FBMT100
6. FTSEMYX:FBMFLG
7. FTSEMYX:FBMEMAS
8. FTSEMYX:FA40
9. FTSEMYX:FBMMSCS
10. FTSEMYX:FBMAPMYR
11. FTSEMYX:FBMMSCAP
The rest of lines is all of the following sector (Malaysia Sector):
1. Technology
2. Telecommunication
3. Health
4. Consumer Product
5. Industrial Product
6. Construction
7. Property
8. Plantation
9. Utilities
10. Transportation
11. Energy
12. REIT
13. Finance
The last line (Line 15) is provided for other stock/index which is not available in option to manually fill.
All sector and index price are smoothen by Moving Average (MA). The default moving average is Relative Moving Average (RMA) which is used in Relative Strength Index ( RSI ) Oscillator. But the range is different from RSI , it is from -100 to 100 instead of 0 to 100. In the end, result and interpretation are just the same as RSI . Green area indicates oversold area, while red area is overbought.
Other choice of Moving Averages are available to change.
The problem of putting all together is the script may take longer to process. It is just for convenient use.
Bottom-Up or Top-Down Invest?
Performance ComparatorThis indicator allows to compare the performance (% change) of a given symbol with the larger market ( AMEX:SPY ) and/or with a custom symbol, which defaults to AMEX:XLK (an ETF tracking technology companies from the S&P 500).
The performance for the current symbol is displayed as a blue histogram, while performance for the AMEX:SPY and the custom symbol are respectively displayed as orange and white lines, making it easy to spot when the symbol outperformed the market.
Features:
Configurable time resolution (default: same as chart)
Comparison using change percentage or its EMA/WMA/SMA (default: EMA)
Configurable moving average length
Optionally hide AMEX:SPY or the custom symbol from the chart
Relative Normalized VolatilityThere are plenty of indicators that aim to measure the volatility (degree of variation) in the price of an instrument, the most well known being the average true range and the rolling standard deviation. Volatility indicators form the key components of most bands and trailing stops indicators, but can also be used to normalize oscillators, they are therefore extremely versatile.
Today proposed indicator aim to compare the estimated volatility of two instruments in order to provide various informations to the user, especially about risk and profitability.
CALCULATION
The relative normalized volatility (RNV) indicator is the ratio between the moving average of the absolute normalized price changes value of two securities, that is:
SMA(|Δ(a)/σ(a)|)
―――――――――――
SMA(|Δ(b)/σ(b)|)
Where a and b are two different securities (note that notation "Δ(x)" refer to the 1st difference of x, and the "||" notation is used to indicate absolute value, for example "|x|" means absolute value of x) .
INTERPRETATION
The indicator aim tell us which security is more volatile between a and b , with a value of the indicator greater than 1 indicating that a is on average more volatile than b over the last length period, while a value lower than 1 indicating that the security b is more on average volatile than a .
The indicator use the current symbol as a , while the second security b must be defined in the setting window (by default the S&P500). Risk and profitability are closely related to volatility, as larger price variations could potentially mean larger losses (but also larger gains), therefore a value of the indicator greater than 1 can indicate that it could be more risked (and profitable) to trade security a .
RNV using AMD (top) volatility against Intel (bottom) volatility.
RNV using EURUSD (top) volatility against USDJPY (bottom) volatility.
Larger values of length will make the indicator fluctuate less often around 1. You can also plot the logarithm of the ratio instead in order to have the indicator centered around 0, it will also help make values originally below 1 have more importance in the scale.
POSSIBLE ERRORS
If you compare different types of markets the indicator might return NaN values, this is because one market might be closed, for example if you compare AMD against BTCUSD with the indicator you will get NaN values. If you really need to compare two markets then increase your time frame, else use an histogram or area plot in order to have a cleaner plot.
CONCLUSION
An original indicator comparing the volatility between two securities has been presented. The choice of posting a volatility indicator has been made by my twitter followers, so if you want to decide which type of indicator i should do next make sure to check my twitter to see if there are polls available (i should do one after every posted indicator).
KLemurs DeviationMarket: Stocks and ETF's
This overlay shows the deviation of the exponential moving average of the mid candle price of the currently loaded chart, away from the exponential moving average of the S&P and DOW combined and averaged mid candle price. The top and bottom lines also give a visual perspective of what a certain percentage (default 1%) looks like on the current charts window. This may help with making quick decisions for things like setting trailing stop trades with a percentage. This can be used for stocks, ETF's, and index's and It may be useful in finding potential stocks or ETF's if you are interested in these kinds of deviations. Defaults are set for a dark screen but can be edited to your taste. It's optimized to be an overlay on the current chart window as opposed to being a separate window.
Percentage Lines (editable)
This is three lines. The upper line (default green) plots the set percentage (default 1%) above the current chart’s ema. The middle line (default white) plots the current chart’s ema. The lower line (default red) plots the set percentage (default 1%) below the current chart’s ema.
Deviation Band (editable)
This is the colored band on the overlay between the upper and lower percentage lines. The band’s fill color indicates the deviation of the current charts ema from the ema of the combined S&P and DOW’s ema as follows:
- Red (default) = Current Chart’s ema is descending and the S&P/DOW ema is descending OR the Current Chart’s ema is below (underperforming) the S&P/DOW ema.
- Orange (default) = The Current Chart and S&P/DOW ema’s are both either ascending or descending together.
- Green (default) = The Current Chart’s ema is ascending but the S&P/DOW ema is descending.
To Set Line Colors
BY default, the upper line color uses the same colors as the ascending band color and the lower line uses the same color as the descending band color. To set the line colors, see "plotColor", "plotColorUp", or" plotColorDown" in variable settings within the script or use the “Central Plot Line”, “Upper Plot Line, or “Lower Plot Line” in the input dialogue to change this.
To Set Band Colors
To set the band colors, see "plotColor", "plotColorUp", or "plotColorDown" in variable settings within the script or use the “Color0”, “Color1", or “Color2” in the input dialogue to change this.
To Set EMA Lookback Period
The ema lookback period defaults to 5. This is the number of candles back that the script will use to determine the ema. See “CCemaN” in variable settings within the script or use the “EMA Period” in the input dialogue to change this.
To Set Percentage
To set the percentage that plots the upper and lower lines, see "CCP" in variable settings within the script or use “Upper/Lower Bands Percentage” in the input dialogue to change this. The default is .01 (or 1%).
Any Security vs. Any Security Change Comparison [BigBitsIO]This script allows you to compare the percentage-based change in the price of any two securities on any given (and supported) timeframe on the chart. This can give you a very simple way to compare any two securities against one another.
Ex: If your base security gained 5%, and the other security gained 3% in a single day, the change comparison would show a green bar of 2% because your base security outgained your other security by 2%.
Features:
- 2 securities to compare. A base and other.
- Shortlist of default securities to choose from.
- Ability to override the default securities list and use any security supported by TradingView. You must use the correct security string to do so.
- Resolution is tied to whatever the current chart is using. This way the view of the indicator always reflects the correct resolution of the chart.
- If either market has a 0% change, it is considered likely closed during that period and will result in a change of 0%, as they shouldn't be compared at that time.
Current vs. Average price performance (daily and weekly)This indicator is to be used only by the values it gives back, don't use the lines .
In "current week days" choose number of days that already BEGAN this week (ex. on Wednesday type 3)
Green1 - Current Daily Range
Orange1 - Average Daily Range
Green2 - Current Weekly Range
Red1 - Average Weekly Range
Orange2 - Today's price movement compared to the average daily price movement (in percentage)
Red2 - This week price movement compared to the average weekly price movement (in percentage)
By these values you can check how price performed today and this week in comparison to the average daily and weekly values - you can check with some probability if the movement is already exhausted or price can do some more action.
Live Mini Terminal 7 : Major Cryptocurrencies Change DataThis script displays relative data changes occurring in the adjustable period and/or adaptive automatic period in U.S Dollar based Major Cryptocurrencies.
This script was inspired by the data terminals used by commercial traders.
Period selection can be set in the menu.
This script uses the adaptive period algorithm used by Autonomous LSTM and Relativity scripts.
Or you can set the period manually from the menu.
For more information about adaptive period:
This script works only for 1 day (1D) and 1 week (1W) time frames.
Since usage of Blockchain Data, the most efficient time frame is 1 week (1W) .
Features
Value changes on a percentage basis (%)
The Info Panel contains percentage-based blockchain data changes.
CRYPTOCURRENCIES
BTC : Bitcoin
ETH : Ethereum
XRP : Ripple
BCH : Bitcoin Cash
LTC : Litecoin
EOS : EOS
BNB : Binance Coin
XLM : Stellar
TRX : Tron
XTZ : Tezos
ADA : Cardano
INFO PANEL
Average Blockchain Size change data
API Blockchain Size change data
Miners Revenue change data
Hash Rate change data
Bitcoin Cost Per Transaction change data
Bitcoin Transaction Volume change data
Bitcoin Total Number of Transactions change data
USAGE
The script can be used as an indicator by putting it under the chart as shown above.
It is necessary to enlarge to see clearly.
Since it is not often looked at,
such use is the best method for healthy interpretation.
Best regards.
(14) Turning Point Volume VS-332Although dramatic increases in volume can accurately reflect the sentiment of changes in price, small changes do as well. Think of it this way. Every share sold or purchased is a vote for or against the current price action. If the price has gone up today and the volume also went up, compared to the previous days volume, the votes of the majority of the traders that produced this volume agreed with the sentiment that this price change represented. If the volume was suppressed on this price increase, that sentiment was not confirmed. This provides you with a very good window into the collective minds of traders allowing you to judge every candle, every indicator and every price action in a much more initiative and accurate way. The SDG Turning Point Volume indicator again utilizes a dot system to easily allow you to see in a glance if the volume is confirming the price action sentiment (green dot) or if it is discounting the price action (red dot.)
There are many situations where volume alone can indicate important inflection points in an equities direction. It may not even reverse direction, but an abrupt change in the rate of change, can be a very profitable entry point – if you can see it coming and act in advance of some or most of the traders making this market.
Access this Genie indicator for your Tradingview account, through our web site. (Links Below) This will provide you with additional educational information and reference articles, videos, input and setting options and trading strategies this indicator excels in.
BTC and USD volume overtime [XBT]Compares BTC volume vs USD volume overtime
Best used on 4hr timeframe. Not really some crazy alpha but good overview/statistic to keep track of.
(make sure to use on XBTUSD pair since it isnt using security calls to call the data)
Enjoy!
Correlation Volitility Bars [BVCC]This chart will allow you to compare the volatility of correlation of any other instrument to your current chart. When the comparison coin is selected, it will overlay your current bars with additional information that shows up/down correlation to your master chart as well the volatility of that correlation.
This can be used to compare other coins to BTC for a quick visual reference of if a coin moves with or against BTC movements. If the comparison coin moves up on the given bar, it is represented by a green histogram ABOVE of your current candle. If the comparison coin moves down, it is represented as a red histogram BELOW your current candle.
The height of the correlation candle represents the percentage that the comparison coin moved up or down. The longer the candle, the farther that coin moved.
The blue band represents a 'volatility reference'
-If your comparison coin stays within this band, then it is moving at an absolute rate which is less than the absolute rate of the master coin.
-If your comparison coin moves outside of this band, then it is moving at an absolute rate which is more than the absolute rate of the master coin.
A couple of example of how to read this;
*******Master Candle = Up | Comparison Candle = Up | Equal to Volatility Band********
This means that when the master went up, so did the comparison coin and they both moved equal amounts
******Master Candle = Up | Comparison Candle = Down | Outside Volatility Band*******
This means that when the master went up, the comparison coin went down in response and it's downward response was greater than the corresponding master up movement
******Master Candle = Up | Comparison Candle = Up | Outside Volatility Band*******
This means that when the master went up, the comparison candle responded by going up as well but made more % gains than the corresponding master candle.
Uses for this indicator would be research into the historical performance of how a specific coin reacts to BTC and whether it is a more or less profitable vehicle than BTC during that time period. If the price is consistently outside of the Volatility band then you can infer that this coin is hypersensitive to BTC movements. If the price is consistently within the bands, then you could infer that your comparison coin is relatively correlated or unfazed by BTC.
Percentage Change Comparison [BVCC]This script allows you to input 2 different coins and plot % changes against each other.
Look Back is adjustable to account for different time frame windows. Default is 1, so each line will be graphed on a 1:1 ratio with the candle period selected on the chart. raising this number to 24 will plot the change across every 24 candles and so on. It's pretty interesting to move the input dialogue window out of the way and change this number, watching how the % gain comparisons change in real time.
Default coins to compare are set to BTCUSD and ETHUSD @ coinbase.
Stoch + Stoch RSI [R1984]Simple comparison of stochastic based on price versus stochastic based on RSI.
Plan to add more features later like divergence indications, light/dark mode toggle, etc.
WT_BTC_Dow Jones_2019[wozdux]Comparison of two trading instruments using the indicator. Visual comparison often does not provide complete information. The scale and amplitude of the fluctuations of the two trading pairs are very different. Therefore, it is better to compare indicators from these pairs. I have used for this purpose, the speed indicator of price movement wt. The red line is the wt indicator from the trading instrument that is in the main window. The blue line is an indicator from the pair, which is written in the indicator settings. In addition, the calculation periods for each pair can be taken as the same or different. Often, trading pairs do not fluctuate synchronously, so it is necessary to select the periods of calculation of the wt indicator individually. In this example, Dow Jones and bitcoin were used.
-----------------------
Сравнение двух торговых инструментов с помощью индикатора. Визуальное сравнение часто не дает полной информации. Масштаб и амплитуда колебаний двух торговых пар бывают сильно различаются. Поэтому сравнивать лучше индикаторы от данных пар. Я использовала для этой цели индикатор скорости движения цены wt. Красная линия это индикатор wt от того торгового инструмента, который находится в главном окне. Синяя линия это индикатор от пары, которая прописывается в настройках индикатора. Кроме того, периоды вычислений для каждой пары можно брать как одинаковые, так и разные. Часто торговые пары колеблются не синхронно, поэтому стоит подбирать периоды вычислений индикатора WT индивидуально. В данном примере использовался Доу Джонс и биткоин.