Papercuts Dynamic EMA - Relative Parameter FunctionThe goal of this is to link two parameters of different known low and high values so one affects the other.
In this case, I want to link Relative Volume to the length of an EMA, so it responds faster in times of high volume.
As an animator I am used to linking values in this way with Maya using a set driven key, took some work to figure it out in pine.
Looking up this concept, it has a few names, Relative values, linear interpolation, or rescale values.
Thanks to pinecoders for writing the EMA funciton that can accept length variables!
Here's a quick look at the root function to link the two values.
f_relativeVal(_source, in_bot, in_top, out_bot, out_top) =>
// float _source: input signal
// float in_bot : minimum range of input signal.
// float in_top : maximum range of input signal.
// float out_bot : minimum range of output signal.
// float out_top : maximum range of output signal.
clampSrc = _source > in_top ? in_top : _source < in_bot ? in_bot : _source //claps source to create a controlled range
//relInput = (clampSrc - in_bot) / (in_top - in_bot) * 100
inDiffIncrement = (in_top - in_bot)
outDiffIncrement = (out_top - out_bot)
out_bot + (clampSrc - in_bot) * outDiffIncrement / inDiffIncrement // rescale input range to output range
Relative
Relative PerformanceThis indicator takes the Performance Table from @BeeHolder and converts it to a Relative Performance table so you can compare the current chart vs. an Index (or whatever other ticker you want) to see the relative performance of one vs. the other. I also added a cell for ADR, which is also the same value as "Monthly Volatility" in the stock screener. This can be useful when screening stocks based on performance and volatility.
Ehlers Relative Vigor Index [CC]The Relative Vigor Index was created by John Ehlers (Cybernetic Analysis For Stocks And Futures pg 58) and this is a momentum indicator that is similar to the Accumulation Distribution Oscillator created by Jim Waters and Larry Williams. He uses digital signal processing to smooth the indicator to provide clear buy and sell signals. The idea behind this indicator is that during uptrends, prices tend to close near the high and during downtrends, prices tend to close near the low. I have included strong buy and sell signals in addition to normal ones so strong signals are darker in color and normal ones are lighter in color. Buy when the line turns green and sell when it turns red. Usually the best signals I have found for this indicator is when the indicator is below the 0 line and turns green then it is usually a sign of a strong uptrend.
Let me know if there are any other scripts you would like to see me publish!
Volume Records + AlertContents
Overall Introduction
Settings menu parameters
Usage
How to use alerts
Limits
Overall Introduction
This indicator is a "volume analysis" tool for confirming the direction and strength of price trend and spotting trend reversals. This tool consists of two parts:
1- The colored graph is a custom volume oscillator which shows the relative changes in volume.
The darkening of the color of the bars is a sign of increasing volume.
2- Triangular labels that show trading volume records over different time periods based on the absolute values of the volume.
By creating an alert, you can be notified of new trading volume records. These records are:
Highest / lowest volume in one year,
Highest / lowest volume in six month
Highest / lowest volume in three month
Highest / lowest volume in one month
Highest / lowest volume in one week
Settings menu parameters
{Short Length} =>
The fast volume MA of the Volume Oscillator.
{Long Length} =>
The slow volume MA of the Volume Oscillator.
{Visual Parameters} =>
Parameters to personalize the appearance of the indicator.
{Alert Conditions Part 01: Highest Records ⏰ } =>
Parameters to customize the alert.
{Alert Conditions Part 02: Lowest Records ⏰ } =>
Parameters to customize the alert.
Usage
This indicator is a "volume analysis" tool for confirming the direction and strength of price trend and spotting trend reversals.
What Is Volume Analysis?
Volume analysis involves examining relative or absolute changes in an asset's trading volume in order to make inferences about future price movements.
A significant price increase along with a significant volume increase, for example, could be a credible sign of a continued bullish trend or a bullish reversal.
The gradual darkening of the bars is a sign of the strength of the trend.
Volume can be an indicator of market strength, as rising markets on increasing volume are typically viewed as strong and healthy.
How to use alerts
Note that by creating an alert, an instance of the indicator, with all your settings, will be activated on the site's server and alerts will be triggered by it.
After that, changing the indicator settings on the chart will no longer affect the alert.
Open the settings window and select the alert conditions as you wish
Click the Create Alert button (or press the A key while holding down the ALT key)
In the Condition section, select the name of the indicator.
Make the rest of the settings as you wish.
Finally, click on the Create button.
It's finished. After a few moments, your alert will be added to the Alerts menu.
Limits
The labels are displayed after the bars close.
Labels are displayed for the last 10,000 bars.
STDev % by Alejandro PThis is a simple indicator that expands the usability of Standard deviation into a universally usable indicator.
This indicator displays the volatility as standard deviation as a % of asset value, this allows using more standardized and comparable values across multiple instruments and asset classes.
Relative Strength 3D Indicator [CC]This is a custom indicator of mine loosely based on the work by James Garofallou (Stocks and Commodities Sep 2020 pg 14) and this is meant for medium to long term trend confirmations. The idea behind this indicator is to capture 3 different dimensions of trend strength. The first dimension captures the overall strength of the underlying stock vs the market (in this case the S&P 500). The second dimension captures the overall trend strength by assigning a scoring system so when all faster moving averages are stronger than slower moving averages then it gets the max points. The final dimension is the strength of the overall strength of everything so far. Buy when the indicator line turns green and sell when it turns red.
Let me know if there are any other indicators or scripts you would like to see me publish!
Ultimate RSIsThis RSI script includes everything you could want on an RSI. There are multiple timeframes which will give context to market movement, as well as a highlight feature to make it easier to visualize overbought and oversold stocks.
Tip: Uncheck the 4 plots with no color in them to remove the extra headers on the indicator.
Relative Volume - ETHEREUMRelative Volume indicator that pulls data from 9 different Ethereum exchanges. Please note that this indicator only works with ETH and will not use data from your current chart.
Includes the following exchanges:
BYBIT:ETHUSD
BITFINEX:ETHUSD
BITSTAMP:ETHUSD
INDEX:ETHUSD
COINBASE:ETHUSD
FTX:ETHUSD
PHEMEX:ETHUSD
BITTREX:ETHUSD
POLONIEX:ETHUSDT
Relative Volume - BITCOINRelative Volume indicator that pulls data from 9 different Bitcoin exchanges. Please note that this indicator only works with BTC and will not use data from your current chart.
Includes the following exchanges:
BYBIT:BTCUSD
BITFINEX:BTCUSD
BITSTAMP:BTCUSD
INDEX:BTCUSD
COINBASE:BTCUSD
FTX:BTCUSD
PHEMEX:BTCUSD
BITTREX:BTCUSD
POLONIEX:BTCUSDT
Relative VolatilityRelative volatility highlights large changes in price. This was designed to be used with my relative volume indicator so that traders can see the effect of volume on price action. It is also a good tool to analyse breakout patterns to identify best entry points and waves.
Above shows relative volatility and relative volume working together.
Volatility OscillatorThis tool displays relative volatility and directional trend. Excellent way to pickup diversions and reversals. Length can be lowered to 11 or 13 in settings to show price range.
Can be used to identify patterns such as parallel channels and likely direction of price action as pictured below.
Relative VolumeVolume can be a very useful tool if used correctly. Relative volume is designed to filter out the noise and highlight anomalies assisting traders in tracking institutional movements. This tool can be used to identify stop loss hunters and organized dumps. It uses a variety of moving averages to hide usual activity and features an LSMA line to show trend. Trend columns are shown to highlight activity and can be seen at bottom of the volume columns, this is done using ZLSMA and LSMA.
The above chart shows an example of 2 indicators being used on the 15 min chart. The bottom indicator is set to the 1 min chart. Traders can see a large dump on the 1 min chart as institutions wipe out any tight stop losses. Next they buy back in scooping up all those long positions.
This is an example layout using a split screen setup and multiple timeframes ranging from 1 min to 30 mins. This gives a clear indication of trends and make it easy to pickup on institutional behaviour. Tip: Double clicking indicator background will maximize RVOL to the split screen window.
Combo Backtest 123 Reversal & Relative Volatility Index 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
The RVI is a modified form of the relative strength index (RSI).
The original RSI calculation separates one-day net changes into
positive closes and negative closes, then smoothes the data and
normalizes the ratio on a scale of zero to 100 as the basis for the
formula. The RVI uses the same basic formula but substitutes the
10-day standard deviation of the closing prices for either the up
close or the down close. The goal is to create an indicator that
measures the general direction of volatility. The volatility is
being measured by the 10-days standard deviation of the closing prices.
WARNING:
- For purpose educate only
- This script to change bars colors.
Relative Difference Of Squares Oscillator [CC]The Relative Difference Of Squares Oscillator was created by Marco Alves (Stocks and Commodities Aug 2020 pg 10) and this is a heavily customized version of his indicator that works for single stocks instead of the entire market. I have included extra buy and sell signals to account for strong signals vs normal signals based on some user feedback I got. Buy when the line turns green and sell when it turns red. Keep in mind that this is a lagging indicator so good for trend confirmation.
Let me know if there are any other scripts you would like to see me publish!
Risk Position Sizing tool using Coefficient of VariationA way to manage portfolio risk using relative standard deviation, also known as coefficient of variation. This tool tells you how much of each stock in shares and in value to buy adjusted for their volatility risk for a given starting account capital. A problem many people have is how to diversify an account and adjusting it for the risk involved in each equity. Many would put in an equal amount of capital value into each share but is it really equal if some equities have more risk than others? A solution is to adjust the portfolio by giving less weight to those that are more volatile or risky. It's done by using a starting percent of the account, preferably a small percent of it, and buying up shares with that same amount for each equity. Each equity will also be divided by the COV to risk adjust the portfolio by giving less weight to the more volatile stocks. This is done until as much of the initial capital in the account as possible is spent.
COV is how far away the price is from the mean or average. The further the price is from the mean the more risk or volatility there is. It uses standard deviation in its calculation. The problem with SD and ATR is that they are not relative to the past or to other equities to compare to. An application where COV can be used is risk portfolio management formulas. This does not take into account correlation or other equation parts in some portfolio management formulas but only the risk or volatility, the default volatility length is mostly arbitrary, and the lower risk stocks may end up being the slowest in performance.
The text label will show how many shares will be bought and how much value each equity will have. At the end it will show the initial capital that was started off with, the total shares bought, the total value of all the shares, and the amount of capital left over. If the sources are not blank then they will be used, to blank them you will need to reset the settings to default otherwise they might still be read. If you want to add more than the given 10 equity spaces to the portfolio then you will need to add in the code manually and add it to the chart. The denominator is perhaps the important part in these types of risk position sizing tools, you can change to other things such as risk-reward ratio instead of volatility or change the volatility type, etc.
Coefficient of Variation - EMA and SMA StDevYet another way to try and measure volatility. An alternative to using ATR is Standard Deviation, it can be used to measure volatility or what is also known as risk. SD measures how dispersed or far away the data is from the mean. It's commonly seen in risk management formulas or portfolio diversification formulas. The problem however is that the numbers that ATR and SD give off from one equity might not be relative to others or its own past. For example, SPY can give a large number despite not being as volatile as other equities while others being compared to can have smaller volatility numbers and still be more volatile looking.
A solution I thought of is to use percentages that are relatable to different equities. I found out another name for this idea comes from statistics and is known as coefficient of variation, also known as relative standard deviation. This helps see the volatility as a percentage and not just a number that only relates to what is being seen at the moment. I put in a border line on the zero level to see where zero is at but also to edit in case there is such a thing as a percentage number that can be too high or too low for volatility to be looked at if needed. The average and standard deviation formulas can use either simple moving average or exponential moving average.
Super Momentum StrategyThis is a strategy utilizing multiple of Evergets RMI (thanks to him for permission to publish) and a Chance Momentum.
It buys when 4 of the RMIs are below their thresholds and sells when they are above. There is a 5th one I added last night that works in Reverse - buy when its above and sell when below, which should work better for pyramiding strats by using it at the right rate to set the overall trend.
Very basic sample below, I could have set it up better as my example but just want to publish.
RMI + Triple HMRSI + Double EVWRSI + TERSI + CMO StrategyThis is a strange experimental strategy WIP that I decided to upload an early version to share some of what I am working on. Just one script of a few.
It combines Chande Momentum with RMI and some weird ones I am experimenting with - Triple Hull MA RSI, Double Exponential + Volume Weighted RSI, Triple Exponential RSI. And to top it off, a final oscillator that combines the THMRSI with the RMI.
The main intention here, currently, is to test the usefulness of each on different timeframes and values. Currently it is considered to buy when all are below their threshold and sell when all are above, with the chande momentum crossing its line as the final confirmation.
For now there is no individual for each of the unique elements included. I am going to likely use this is a working house project to test other experimental indicators in the future.
It may be some of these are better suited for long term but I do think they have valid uses in checking short and long term momentum at the very least.
I copied the RMI from Everget.
RSI PlusRSI Plus:
☑️ Show the divergences.
☑️ Shows the approximate price of an RSI level (by default it is level 55 but it can be changed for any other level).
☑️ Shows the bulls and bears zones, in green when crossing level 50 up and red when crossing down.
☑️ Circle the highest and lowest levels as possible purchases and sales.
☑️ Includes a smoothed RSI.
RSI Plus:
☑️ Muestra las divergencias.
☑️ Muestra el precio aproximado de un nivel del RSI (por defecto viene el nivel 55 pero se lo puede cambiar por cualquier otro nivel).
☑️ Muestra la zonas de toros y osos, en verde cuando cruza hacia arriba el nivel 50 y rojo cuando cruza hacia abajo.
☑️ Marca con un circulo los niveles mas alto y mas bajos como posibles compras y ventas.
☑️ Incluye un RSI suavizado.
Relative Volume at Time█ OVERVIEW
This indicator calculates relative volume, which is the ratio of present volume over an average of past volume.
It offers two calculation modes, both using a time reference as an anchor.
█ CONCEPTS
Calculation modes
The simplest way to calculate relative volume is by using the ratio of a bar's volume over a simple moving average of the last n volume values.
This indicator uses one of two, more subtle ways to calculate both values of the relative volume ratio: current volume:past volume .
The two calculations modes are:
1 — Cumulate from Beginning of TF to Current Bar where:
current volume = the cumulative volume since the beginning of the timeframe unit, and
past volume = the mean of volume during that same relative period of time in the past n timeframe units.
2 — Point-to-Point Bars at Same Offset from Beginning of TF where:
current volume = the volume on a single chart bar, and
past volume = the mean of volume values from that same relative bar in time from the past n timeframe units.
Timeframe units
Timeframe units can be defined in three different ways:
1 — Using Auto-steps, where the timeframe unit automatically adjusts to the timeframe used on the chart:
— A 1 min timeframe unit will be used on 1sec charts,
— 1H will be used for charts at 1min and less,
— 1D will be used for other intraday chart timeframes,
— 1W will be used for 1D charts,
— 1M will be used for charts at less than 1M,
— 1Y will be used for charts at greater or equal than 1M.
2 — As a fixed timeframe that you define.
3 — By time of day (for intraday chart timeframes only), which you also define. If you use non-intraday chart timeframes in this mode, the indicator will switch to Auto-steps.
Relative Relativity
A relative volume value of 1.0 indicates that current volume is equal to the mean of past volume , but how can we determine what constitutes a high relative volume value?
The traditional way is to settle for an arbitrary threshold, with 2.0 often used to indicate that relative volume is worthy of attention.
We wanted to provide traders with a contextual method of calculating threshold values, so in addition to the conventional fixed threshold value,
this indicator includes two methods of calculating a threshold channel on past relative volume values:
1 — Using the standard deviation of relative volume over a fixed lookback.
2 — Using the highs/lows of relative volume over a variable lookback.
Channels calculated on relative volume provide meta-relativity, if you will, as they are relative values of relative volume.
█ FEATURES
Controls in the "Display" section of inputs determine what is visible in the indicator's pane. The next "Settings" section is where you configure the parameters used in the calculations. The "Column Coloring Conditions" section controls the color of the columns, which you will see in three of the five display modes available. Whether columns are plotted or not, the coloring conditions also determine when markers appear, if you have chosen to show the markers in the "Display" section. The presence of markers is what triggers the alerts configured on this indicator. Finally, the "Colors" section of inputs allows you to control the color of the indicator's visual components.
Display
Five display modes are available:
• Current Volume Columns : shows columns of current volume , with past volume displayed as an outlined column.
• Relative Volume Columns : shows relative volume as a column.
• Relative Volume Columns With Average : shows relative volume as a column, with the average of relative volume.
• Directional Relative Volume Average : shows a line calculated using the average of +/- values of relative volume.
The positive value of relative volume is used on up bars; its negative value on down bars.
• Relative Volume Average : shows the average of relative volume.
A Hull moving average is used to calculate the average used in the three last display modes.
You can also control the display of:
• The value or relative volume, when in the first three display modes. Only the last 500 values will be shown.
• Timeframe transitions, shown in the background.
• A reminder of the active timeframe unit, which appears to the right of the indicator's last bar.
• The threshold used, which can be a fixed value or a channel, as determined in the next "Settings" section of inputs.
• Up/Down markers, which appear on transitions of the color of the volume columns (determined by coloring conditions), which in turn control when alerts are triggered.
• Conditions of high volatility.
Settings
Use this section of inputs to change:
• Calculation mode : this is where you select one of this indicator's two calculation modes for current volume and past volume , as explained in the "Concepts" section.
• Past Volume Lookback in TF units : the quantity of timeframe units used in the calculation of past volume .
• Define Timeframes Units Using : the mode used to determine what one timeframe unit is. Note that when using a fixed timeframe, it must be higher than the chart's timeframe.
Also, note that time of day timeframe units only work on intraday chart timeframes.
• Threshold Mode : Five different modes can be selected:
— Fixed Value : You can define the value using the "Fixed Threshold" field below. The default value is 2.0.
— Standard Deviation Channel From Fixed Lookback : This is a channel calculated using the simple moving average of relative volume
(so not the Hull moving average used elsewhere in the indicator), plus/minus the standard deviation multiplied by a user-defined factor.
The lookback used is the value of the "Channel Lookback" field. Its default is 100.
— High/Low Channel From Beginning of TF : in this mode, the High/Low values reset at the beginning of each timeframe unit.
— High/Low Channel From Beginning of Past Volume Lookback : in this mode, the High/Low values start from the farthest point back where we are calculating past volume ,
which is determined by the combination of timeframe units and the "Past Volume Lookback in TF units" value.
— High/Low Channel From Fixed Lookback : In this mode the lookback is fixed. You can define the value using the "Channel Lookback" field. The default value is 100.
• Period of RelVol Moving Average : the period of the Hull moving average used in the "Directional Relative Volume Average" and the "Relative Volume Average".
• High Volatility is defined using fast and slow ATR periods, so this represents the volatility of price.
Volatility is considered to be high when the fast ATR value is greater than its slow value. Volatility can be used as a filter in the column coloring conditions.
Column Coloring Conditions
• Eight different conditions can be turned on or off to determine the color of the volume columns. All "ON" conditions must be met to determine a high/low state of relative volume,
or, in the case of directional relative volume, a bull/bear state.
• A volatility state can also be used to filter the conditions.
• When the coloring conditions and the filter do not allow for a high/low state to be determined, the neutral color is used.
• Transitions of the color of the volume columns determined by coloring conditions are used to plot the up/down markers, which in turn control when alerts are triggered.
Colors
• You can define your own colors for all of the oscillator's plots.
• The default colors will perform well on light or dark chart backgrounds.
Alerts
• An alert can be defined for the script. The alert will trigger whenever an up/down marker appears in the indicator's display.
The particular combination of coloring conditions and the display settings for up/down markers when you create the alert will determine which conditions trigger the alert.
After alerts are created, subsequent changes to the conditions controlling the display of markers will not affect existing alerts.
• By configuring the script's inputs in different ways before you create your alerts, you can create multiple, functionally distinct alerts from this script.
When creating multiple alerts, it is useful to include in the alert's message a reminder of the particular conditions you used for each alert.
• As is usually the case, alerts triggering "Once Per Bar Close" will prevent repainting.
Error messages
Error messages will appear at the end of the chart upon the following conditions:
• When the combination of the timeframe units used and the "Past Volume Lookback in TF units" value create a lookback that is greater than 5000 bars.
The lookback will then be recalculated to a value such that a runtime error does not occur.
• If the chart's timeframe is higher than the timeframe units. This error cannot occur when using Auto-steps to calculate timeframe units.
• If relative volume cannot be calculated, for example, when no volume data is available for the chart's symbol.
• When the threshold of relative volume is configured to be visible but the indicator's scale does not allow it to be visible (in "Current Volume Columns" display mode).
█ NOTES
For traders
The chart shown here uses the following display modes: "Current Volume Columns", "Relative Volume Columns With Average", "Directional Relative Volume Average" and "Relative Volume Average". The last one also shows the threshold channel in standard deviation mode, and the TF Unit reminder to the right, in red.
Volume, like price, is a value with a market-dependent scale. The only valid reference for volume being its past values, any improvement in the way past volume is calculated thus represents a potential opportunity to traders. Relative volume calculated as it is here can help traders extract useful information from markets in many circumstances, markets with cyclical volume such as Forex being one, obvious case. The relative nature of the values calculated by this indicator also make it a natural fit for cross-market and cross-sector analysis, or to identify behavioral changes in the different futures contracts of the same market. Relative volume can also be put to more exotic uses, such as in evaluating changes in the popularity of exchanges.
Relative volume alone has no directional bias. While higher relative volume values always indicate higher trading activity, that activity does not necessarily translate into significant price movement. In a tightly fought battle between buyers and sellers, you could theoretically have very large volume for many bars, with no change whatsoever in bid/ask prices. This of course, is unlikely to happen in reality, and so traders are justified in considering high relative volume values as indicating periods where more attention is required, because imbalances in the strength of buying/selling power during high-volume trading periods can amplify price variations, providing traders with the generally useful gift of volatility.
Be sure to give the "Directional Relative Volume Average" a try. Contrary to the always-positive ratio widely used in this indicator, the "Directional Relative Volume Average" produces a value able to determine a bullish/bearish bias for relative volume.
Note that realtime bars must be complete for the relative volume value to be confirmed. Values calculated on historical or elapsed realtime bars will not recalculate unless historical volume data changes.
Finally, as with all indicators using volume information, keep in mind that some exchanges/brokers supply different feeds for intraday and daily data, and the volume data on both feeds can sometimes vary quite a bit.
For coders
Our script was written using the PineCoders Coding Conventions for Pine .
The description was formatted using the techniques explained in the How We Write and Format Script Descriptions PineCoders publication.
Bits and pieces of code were lifted from the MTF Selection Framework and the MTF Oscillator Framework , also by PineCoders.
█ THANKS
Thanks to dgtrd for suggesting to add the channel using standard deviation.
Thanks to adolgov for helpful suggestions on calculations and visuals.
Look first. Then leap.
Exponential Regression Slope Annualized with R-squared HistogramMy other indicator shows the linear regression slope of the source. This one finds the exponential regression slope and optionally multiplies it by R-squared and optionally annualizes it. Multiplying by R-squared makes sure that the price movement was significant in order to avoid volatile movements that can throw off the slope value. Annualizing the exponential slope will let you see how much percentage you will make in a year if the price continues at its current pace.
The annualized number is the number of trading days in a year. This and the length might need adjusting for the extra bars that might be in futures or other markets. The number does not have to be a year. For example, it can be a month if you set the number to 20 or so trading days to find how much you would make in a month if price continues at its current pace, etc. This can also be used as an alternative to relative strength or rate of change.
Ehlers Adaptive Relative Vigor Index [CC]The Adaptive Relative Vigor Index was created by John Ehlers (Cybernetic Analysis For Stocks And Futures pgs 140-141) and it does a pretty good job of capturing the peaks and valleys of the underlying data. There are several ways to read this particular indicator so for long term trades then buy when it goes above 0 and sell when it falls below 0 or for shorter term trades then buy when the indicator line turns green and sell when it turns red.
Let me know if there are other indicators you would like to see me publish or if you want something custom done!
Relative StrengthA relative strength overlay, similar to that of IBD shown on Marketsmith.
The value is not from 0-100, it is compared with the Nasdaq x2 ETF, QLD. Therefore, if greater than zero it will give you a good indication that the stock has a very good relative strength.
Feel free to change the comparison ETF to one of your choosing.