SFP MomentumCustom swing fail detector with levels and breakouts both major and minor plus colored candles based on SFP momentum.
Distribution
IBP_AccDistThis indicator plots distribution / accumulation.
Distribution is when price falls by 0.2% and volume is 1.25 times the 20 day average volume.
Opposite is accumulation.
If there are 5 distibution days in a span of 20 days then market direction is confirmed down.
William O Neils method. Parameters tweaked based on Indian markets and my experience.
Probability ConesA probability cone is an indicator that forecasts a statistical distribution from a set point in time into the future.
Features
Forecast a Standard or Laplace distribution.
Change the how many bars the cones will lookback and sample in their calculations.
Set how many bars to forecast the cones.
Let the cones follow price from a set number of bars back.
Anchor the cones and they will not update from their last location.
Show or hide any set of cones.
Change the deviation used of any cone's upper or lower line.
Change any line's color, style, or width.
Change or toggle the fill colors between any two cone lines.
Basic Interpretations
First, there is an assumption that the distribution starting from the cone's origin, based on the number of historical bars sampled, is likely to represent the distribution of future price.
Price typically hangs around the mean.
About 68% of price stays within the first deviation cones.
About 95% of price stays within the second deviation cones.
About 99.7% of price stays within the third deviation cones.
When price is between the first and second deviation cones, there is a higher probability for a reversal.
However, strong momentum while above or below the first deviation can indicate a trend where price maintains itself past the first deviation. For this reason it's recommended to use a momentum indicator alongside the cones.
There is no mean reversion assumption when price deviates. Price can continue to stay deviated.
It's recommended that the cones are placed at the beginning of calendar periods. Like the month, week, or day.
Be mindful when using the cones on various timeframes. As the lookback setting, which selects the number of bars back to load from the cone's origin, will load the number of bars back based on the current timeframe.
Second Deviation Strategy
How to react when price goes beyond the second deviation is contingent on your trading position.
If you are holding a losing trade and price has moved past the second deviation, it could be time to stop trading and exit.
If you are holding a winning trade and price has moved past the second deviation, it would be best to look at exit strategies to capitalize on the outperformance.
If price has moved beyond the second deviation and you hold no position, then do not open any new trades.
FunctionProbabilityDistributionSamplingLibrary "FunctionProbabilityDistributionSampling"
Methods for probability distribution sampling selection.
sample(probabilities) Computes a random selected index from a probability distribution.
Parameters:
probabilities : float array, probabilities of sample.
Returns: int.
ArrayGenerateLibrary "ArrayGenerate"
Functions to generate arrays.
sequence_int(start, end, step) returns a sequence of int numbers.
Parameters:
start : int, begining of sequence range.
end : int, end of sequence range.
step : int, step, default=1 .
Returns: int , array.
sequence_float(start, end, step) returns a sequence of float numbers.
Parameters:
start : float, begining of sequence range.
end : float, end of sequence range.
step : float, step, default=1.0 .
Returns: float , array.
sequence_from_series(src, length, shift, direction_forward) Creates a array from a series sample range.
Parameters:
src : series, any kind.
length : int, window period in bars to sample series.
shift : int, window period in bars to shift backwards the data sample, default=0.
direction_forward : bool, sample from start to end or end to start order, default=true.
Returns: float array
normal_distribution(size, mean, dev) Generate normal distribution random sample.
Parameters:
size : int, size of array
mean : float, mean of the sample, (default=0.0).
dev : float, deviation of the sample from the mean, (default=1.0).
Returns: float array.
log_spaced(length, start_exp, stop_exp) Generate a base 10 logarithmically spaced sample sequence.
Parameters:
length : int, length of the sequence.
start_exp : float, start exponent.
stop_exp : float, stop exponent.
Returns: float array.
linear_range(stop, start) Generate a linearly spaced sample vector within the inclusive interval (start, stop) and step 1.
Parameters:
stop : float, stop value.
start : float, start value, (default=0.0).
Returns: float array.
periodic_wave(length, sampling_rate, frequency, amplitude, phase, delay) Create a periodic wave.
Parameters:
length : int, the number of samples to generate.
sampling_rate : float, samples per time unit (Hz). Must be larger than twice the frequency to satisfy the Nyquist criterion.
frequency : float, frequency in periods per time unit (Hz).
amplitude : float, the length of the period when sampled at one sample per time unit. This is the interval of the periodic domain, a typical value is 1.0, or 2*Pi for angular functions.
phase : float, optional phase offset.
delay : int, optional delay, relative to the phase.
Returns: float array.
sinusoidal(length, sampling_rate, frequency, amplitude, mean, phase, delay) Create a Sine wave.
Parameters:
length : int, The number of samples to generate.
sampling_rate : float, Samples per time unit (Hz). Must be larger than twice the frequency to satisfy the Nyquist criterion.
frequency : float, Frequency in periods per time unit (Hz).
amplitude : float, The maximal reached peak.
mean : float, The mean, or DC part, of the signal.
phase : float, Optional phase offset.
delay : int, Optional delay, relative to the phase.
Returns: float array.
periodic_impulse(length, period, amplitude, delay) Create a periodic Kronecker Delta impulse sample array.
Parameters:
length : int, The number of samples to generate.
period : int, impulse sequence period.
amplitude : float, The maximal reached peak.
delay : int, Offset to the time axis. Zero or positive.
Returns: float array.
Function - Probability Chebyshev Inequalityfunction to calculate Chebyshev Inequality. wich can be used to compute the probability that we will diverge from what we expect to obtain.
reference:
- www.omnicalculator.com
- github.com
- statisticstopics.wordpress.com
- en.wikipedia.org
Outlier Detector with N-Sigma Confidence IntervalsA detrended series that oscilates around zero is obtained after first differencing a time series (i.e. subtracting the closing price for a candle from the one immediately before, for example). Hypothetically, assuming that every detrended closing price is independent of each other (what might not be true!), these values will follow a normal distribution with mean zero and unknown variance sigma squared (assuming equal variance, what is also probably not true as volatility changes over time for different pairs). After studentizing, they follow a Student's t-distribution, but as the sample size increases (back periods > 30, at least), they follow a standard normal distribution.
This script was developed for personal use and the idea is spotting candles that are at least 99% bigger than average (using N = 3) as they will cross the upper and lower confidence interval limits. N = 2 would roughly provide a 95% confidence interval.
Function - Entropy Gini Indexfunction to retrieve Gini Impurity / Gini Index.
reference:
- victorzhou.com
- en.wikipedia.org
test - event distributiondisplays the distribution of the outcome of a event over the last event.
similar to this script:
Gaps % Size DistributionThis tool is to visualize the distribution of gap % sizes, i.e. those things that I marked on the main chart. The tool uses the entire history of an instrument.
The detalization depends on the Binning Step parameter. The lower chart timeframe the lower that step should be.
Good luck.
Average Dollar VolumeDollar volume is simply the volume traded multiplied times the cost of the stock.
Dollar volume is an extremely important metric for finding stocks with enough liquidity for market makers to position themselves in. Market Liquidity is defined as market's feature whereby an individual or firm can quickly purchase or sell an asset without causing a drastic change in the asset's price. The key concept you want to understand is that these big instructions with billions of dollars need liquidity in a stock in order to even think about buying it, and therefore these institutions will demand a large dollar volume. A good dollar volume amount, that represents a pretty liquid name, is typically above 100 million $ average. Why are institutions important? Simple because they are the ones who make stocks move, and I mean really move. If you want to see large growth from a stock in a short amount of time, you need institutions wielding billions of dollars to be fighting one another to buy more shares. Institutions are the ones who make or break a stock, this is why we call them market makers.
My script calculates average dollar volume using four averages: the 50, the 30, the 20, and the 10 period. I use multiple averages in order to provide the accurate and up to date information to you. It then selects the minimum of these averages and divides this value by 1 million and displays this number to you.
TL;DR? If you want monster moves from your stocks, you need to pick names with average high liquidity(dollar volume >= $100 million). The number presented to you is in millions of whatever currency the name is traded in.
Up/Down Volume RatioUp/Down Volume Ratio is calculated by summing volume on days when it closes up and divide that total by the volume on days when the stock closed down.
High volume up days are typically a sign of accumulation(buying) by big players, while down days are signs of distribution(selling) by big market players. The Up Down volume ratio takes this assumption and turns it into a tangible number that's easier for the trader to understand. My formula is calculated using the past 50 periods, be warned it will not display a value for stocks with under 50 periods of trading history. This indicator is great for identify accumulation of growth stocks early on in their moves, most of the time you would like a growth stocks U/D value to be above 2, showing institutional sponsorship of a stock.
Up/Down Volume value interpretation:
U/D < 1 -> Bearish outlook, as sellers are in control
U/D = 1 -> Sellers and Buyers are equal
U/D > 1 -> Bullish outlook, as buyers are in control
U/D > 2 -> Bullish outlook, significant accumulation underway by market makers
U/D >= 3 -> MONSTER STOCK ALERT, market makers can not get enough of this stock and are ravenous to buy more
U/D values greater than 2 are rare and typically do not last very long, and U/D >= 3 are extremely rare one example I kind find of a stock's U/D peaking above 3 was Google back in 2005.
MAKE SURE TO HIT THE SETTINGS WHEEL AND CHECK THE BOX NEXT TO PLOT IN ORDER TO GET RID OF THE PLOTTED LINE.
Tradespot - S&R SuiteTradespot - S&R Suite
No configuration needed, works out the box
Dynamically created S&R lines & zones based on ongoing price action
Dynamically created fibonnaci retracement lines to create your trading range
Completely open to building a core trading strategy upon
Want to know more or have questions? Come join the Tradespot community, or send me a message on TradingView.
Volume Buzz 2.0Volume Buzz/Volume Run Rate as seen on TC2000 and MarketSmith respectively.
Basically, the volume buzz tells you what percentage over average(100 time period moving average) the volume traded was. You can use this indicator to more readily identify above-average trading volume and accumulation days on charts. The percentage will show up in the top left corner, make sure to click the settings button and uncheck the second box(left of plot) in order to get rid of the chart line.
Pictured above, a chart with the volume on the bottom along with the 50-day moving average applied to volume. As you can see in the top left it will tell you the "volume buzz" of that day, telling you what days were on above-average volume and how above-average those days were.
Accumulation and Distribution MomentumThis applies Chande Momentum to Accumulation and Distribution index as a means to changes.
Experimental oscillator.
Compare it to both Money Flows, Acc/Dis and Chande and you notice it has elements of all of them. Could potentially replace other volume based momentum indicators in your strategy.
It is a little more volatile, reaching from side to side, while having a tendency to lean towards the side that gets the most action over a longer period of time.
It also tends to reach and hang in oversold regions BEFORE a pump - something I noticed.
Could be used as an early warning sign as well as for overall trend analysis.
Z-HistogramIt is possible to approximate the underlying distribution of a random variable by using what is called an "Histogram". In order to construct an histogram one must first split the data into several intervals (also called bins) often of the same size and count the number of values falling within each intervals, the histogram plot is then constructed with the X axis representing the measured variable and the Y axis representing the frequency.
The proposed script aim to estimate the underlying distribution of a rolling z-score by constructing its histogram, here the histogram consist of 13 bins of width 0.5 rolling standard deviations. The length setting define the rolling z-score period, the window setting define the number of past data to be counted, finally using the "Total" option (true by default) will count all the rolling z-scores values since the first bar, in order to use the window setting make sure to uncheck the "Total" option.
DISPLAY
In order to see the entirety of the histogram make sure to double click on the indicator window and to have all the lower panels (text notes, pine editor...etc) hidden, finally make sure to zoom-in in order to see the frequency numbers displayed.
Z-Histogram on BTCUSD 15 min TF, the blue bins represent intervals situated over 0 while red bins represent intervals situated under 0. Here σ represent the X-axis in standard deviations, the histogram start with a bin situated at σ = -3 which count the number of times the rolling z-score was within -3 and -2.5, the histogram end with the bin situated at σ = 3 which count the number of time the rolling z-score was within 3 and 3.5.
It is also possible to look at the shape of the histogram without having the indicator window at full size.
INTERPREATION
An histogram can give really interesting information such as overall trend direction and strength. The direction can be measured by looking at the skewness of the histogram, with a negative skewness (the peak of the histogram situated at the right from the center) representing down-trending variations and positive skewness (the peak of the histogram situated at the left from the center) representing up-trending variations, while a symmetrical histogram could represent a ranging market. The farther away the peak of the histogram is situated from the center, the stronger the trend.
Another interesting characteristic is the tailedness of the histogram, which can give information about the cleanliness of the trend, for example a positive skew and high tailedness would represent a clean up-trend, as it could suggest less variations contrary to the main trend.
An histogram applied to the rolling z-score can give various useful information. As a recall the rolling z-score of the price measure the distance between the closing price and its moving average in term of rolling standard deviations, for example if the rolling z-score is equal to 2 it means that the closing price is currently 2 rolling standard deviations over its moving average.
Lets for example analyze the histogram using INTC 15 min tf with a window of 456 bars and rolling z-score of length = 100 in order to review longer term variations.
We can see from the histogram that the uptrend visible on the chart is represented by the bins situated over 0 having an overall higher frequency than the bins under 0, we can see that the closing price tended to stay between 1 and 1.5 rolling standard deviations over its period 100 moving average. Here bins under 0 accounts for retracements in the trend.
IN SUMMARY
An histogram can give various information regarding the price evolution of a security, the proposed script aim to plot the histogram of a rolling z-score. Now this script might not be too useful but it was fun to make, also it does not mean that an histogram is not an useful tool in the context of trading, the only thing required is a god implementation of it (like volume profiles for example)
In this post we have also reviewed some important statistical concepts such as distributions, z-score, skewness and tailedness, each being extremely important in the quantitative trading field.
Thx for reading !
A/D + 21/200EMASimple Accumulation & Distribution indicator with the 21 and 200EMA plotted on it. Might be a useful tool in your arsenal.
Bullish/Bearish Candle Series DistributionThe tool counts the number of consecutive bullish or bearish candles in a row and build a distribution of those series lengths. The entire history of an instrument is used.
Available modes:
Strict Bullish ( close > open )
Bullish ( close >= open )
Strict Bearish ( close <= open )
Bearish ( close < open )
Different chart types have different distributions:
Renko
Line Break
MATRIX Accumulation and DistributionDo your operations following the big players ....
Faça suas operações seguindo os grandes jogadores....
Chaikin Oscillator (ADL Oscillator) [UTS]The Chaikin Oscillator is basically an oscillator version of the Accumulation / Distribution Index, also known as ADL Indicator.
General Usage
The indicator runs both above and below zero, made to denote whether an asset is in a bullish (above zero) or bearish (below zero) trend.
It can be used to confirm trends, as well as spot possible trading signals due to divergences.
A benefit of the oscillator version is that it can produce LONG or SHORT signals on zero line cross.
Moving Averages
4 different Moving Averages are available:
EMA (Exponential Moving Average)
SMA (Simple Moving Average)
VWMA (Volume Weighted Moving Average)
WMA (Weighted Moving Average)
ADL - Accumulation Distribution Line [UTS]an underlying asset.
It is determined by the changes in price and volume. The volume acts as a weighting coefficient at the change of price — the higher the coefficient (the volume) is the greater the contribution of the price change (for this period of time) will be in the value of the indicator. The indicator is also known as Accumulation / Distribution Index.
Common known variants of this type of indicator are the On Balance Volume, Chaikin Oscillator or Chaikin Money Flow.
Based on www.metatrader5.com
MTF Accumulation/Distribution RasterChart (Spectrogram/HeatMap)As my first published indicator for year 2020, I present my revolutionary "MTF Accumulation/Distribution RasterChart" employing PSv4.0. This is probably a world's first all-in-one multi-timeframe, multi-algorithm heatmap indicator with multiple color schemes. I decided to release this multicator now, because it has been a year long journey for me to develop spectrogram technology with abilities John Ehlers didn't include with his original heatmaps. I would like to personally thank Dr. John Ehlers for inspiring me to ponder into the realm of heatmap technology and all it has to offer. Thank you! You're a divine inspiration to the algorithmic trading community and forever shall be.
Each of the algorithms use "volume" and "price" data in their calculations to provide a unique spectrogram for either algorithm chosen, hence the accumulation/distribution attributed to the title of this indicator. The MTF capabilities include seconds, minutes, and days. If the time frame settings are shorter in time than the current sampling interval, a warning will be appropriately displayed. Also, when volume data is not applicable to an asset, the indicator will become completely red. I included so many color scheming techniques I couldn't demonstrate all of them above. This indicator has what I would term as "predator" vision. For those of you who have seen these movies, you will understand what I have built.
The use of this indicator is just like any of my other RasterCharts or heatmap indicators found on the internet, except it has much more versatility. This indicator has so many uses, I really haven't discovered all of it's characteristics yet. Anyhow, this is one of my most beautiful indicators I have created so far, but I feel there is still more room for enhancements with a possibility of more sibling algorithms to incorporate later. Lastly, I couldn't have done this without the computing power/wizardry provided by ALL Tradingview staff. They deserve a HUGE and proper, THANK YOU!!! Happy New Year 2020 everyone...
Features List Includes:
MTF controls for seconds, minutes, and days
Multiple volume weighted algorithms to choose from
Gain control for algorithm #1
Adjustable horizontal rule to differentiate between more reactive aspects of turning point fluctuations in the lower portion of the chart (visible above)
Adjustable heatmap brightness control
Visual color scheme techniques (a few of many are displayed above)
Color inversion control
"NO VOLUME" detection (indicator becomes red)
This is not a freely available indicator, FYI. To witness my Pine poetry in action, properly negotiated requests for unlimited access, per indicator, may ONLY be obtained by direct contact with me using TV's "Private Chats" or by "Message" hidden in my member name above. 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!