The Vet [TFO]In collaboration with @mickey1984 , "The Vet" was created to showcase various statistical measures of price.
The first core measurement utilizes the Defining Range (DR) concept on a weekly basis. For example, we might track the session from 09:30-10:30 on Mondays to get the DR high, DR low, IDR high, and IDR low. The DR high and low are the highest high and lowest low of the session, respectively, whereas the IDR high and low would be the highest candle body level (open or close) and lowest candle body level, respectively, during this window of time.
From this data, we use the IDR range (from IDR high to IDR low) to extrapolate several, custom projections of this range from its high and low so that we can collect data on how often these levels are hit, from the close of one DR session to the open of the next one.
This information is displayed in the Range Projection Table with a few main columns of information:
- The leftmost column indicates each level that is projected from the IDR range, where (+) indicates a projection above the range high, and (-) indicates a projection below the range low
- The "First Touch" column indicates how often price has reached these levels in the past at any point until the next weekly DR session
- The "Other Side Touch" column indicates how often price has reached a given level, then reversed to hit the opposing level of the same magnitude. For example, the above chart shows that if price hit the +1 projection, ~33% of instances also hit the -1 projection before the next weekly DR session. For this reason, the probabilities will be the same for projection levels of the same but opposite magnitude (+1 would be the same as -1, +3 would be the same as -3, etc.)
- The "Next Level Touch" column provides insight into how often price reaches the next greatest projection level. For example, in the above chart, the red box in the projection table is highlighting that once price hits the -2 projection, ~86% of instances reached the -3 projection before the next weekly DR session
- The last columns, "Within ADR" and "Within AWR" show if any of the projection levels are within the current Average Daily Range, or Average Weekly Range, respectively, which can both be enabled from the Average Range section
The next section, Distributions, primarily measures and displays the average price movements from specified intraday time windows. The option to Show Distribution Boxes will overlay a box showing each respective session's average range, while adjusting itself to encapsulate the price action of that session until the average range is met/exceeded. Users can choose to display the range average by Day of Week, or the Total average from all days. Values for average ranges can either be shown as point or percent values. We can also show a table to display this information about price's average ranges for each given session, and show labels displaying the current range vs its average.
The final section, Average Range, simply offers the ability to plot the Average Daily Range (ADR) and Average Weekly Range (AWR) of a specified length. An ADR of 10 for example would take the average of the last 10 days, from high to low, while an AWR of 10 would take the average of the last 10 weeks (if the current chart provides enough data to support this). Similarly, we can also show the Average Range Table to indicate what these ADR/AWR values are, what our current range is and how it compares to those values, as well as some simple statistics on how often these levels are hit. As an example, "Hit +/- ADR: 40%/35%" in this table would indicate that price has hit the upper ADR limit 40% of the time, and the lower limit 35% of the time, for the amount of data available on the current chart.
Distribution
ICT Power Of Three | Flux Charts💎 GENERAL OVERVIEW
Introducing our new ICT Power Of Three Indicator! This indicator is built around the ICT's "Power Of Three" strategy. This strategy makes use of these 3 key smart money concepts : Accumulation, Manipulation and Distribution. Each step is explained in detail within this write-up. For more information about the process, check the "HOW DOES IT WORK" section.
Features of the new ICT Power Of Three Indicator :
Implementation of ICT's Power Of Three Strategy
Different Algorithm Modes
Customizable Execution Settings
Customizable Backtesting Dashboard
Alerts for Buy, Sell, TP & SL Signals
📌 HOW DOES IT WORK ?
The "Power Of Three" comes from these three keywords "Accumulation, Manipulation and Distribution". Here is a brief explanation of each keyword :
Accumulation -> Accumulation phase is when the smart money accumulate their positions in a fixed range. This phase indicates price stability, generally meaning that the price constantly switches between up & down trend between a low and a high pivot point. When the indicator detects an accumulation zone, the Power Of Three strategy begins.
Manipulation -> When the smart money needs to increase their position sizes, they need retail traders' positions for liquidity. So, they manipulate the market into the opposite direction of their intended direction. This will result in retail traders opening positions the way that the smart money intended them to do, creating liquidity. After this step, the real move that the smart money intended begins.
Distribution -> This is when the real intention of the smart money comes into action. With the new liquidity thanks to the manipulation phase, the smart money add their positions towards the opposite direction of the retail mindset. The purpose of this indicator is to detect the accumulation and manipulation phases, and help the trader move towards the same direction as the smart money for their trades.
Detection Methods Of The Indicator :
Accumulation -> The indicator detects accumulation zones as explained step-by-step :
1. Draw two lines from the lowest point and the highest point of the latest X bars.
2. If the (high line - low line) is lower than Average True Range (ATR) * accumulationConstant
3. After the condition is validated, an accumulation zone is detected. The accumulation zone will be invalidated and manipulation phase will begin when the range is broken.
Manipulation -> If the accumulation range is broken, check if the current bar closes / wicks above the (high line + ATR * manipulationConstant) or below the (low line - ATR * manipulationConstant). If the condition is met, the indicator detects a manipulation zone.
Distribution -> The purpose of this indicator is to try to foresee the distribution zone, so instead of a detection, after the manipulation zone is detected the indicator automatically create a "shadow" distribution zone towards the opposite direction of the freshly detected manipulation zone. This shadow distribution zone comes with a take-profit and stop-loss layout, customizable by the trader in the settings.
The X bars, accumulationConstant and manipulationConstant are subject to change with the "Algorithm Mode" setting. Read the "Settings" section for more information.
This indicator follows these steps and inform you step by step by plotting them in your chart.
🚩UNIQUENESS
This indicator is an all-in-one suite for the ICT's Power Of Three concept. It's capable of plotting the strategy, giving signals, a backtesting dashboard and alerts feature. Different and customizable algorithm modes will help the trader fine-tune the indicator for the asset they are currently trading. The backtesting dashboard allows you to see how your settings perform in the current ticker. You can also set up alerts to get informed when the strategy is executable for different tickers.
⚙️SETTINGS
1. General Configuration
Algorithm Mode -> The indicator offers 3 different detection algorithm modes according to your needs. Here is the explanation of each mode.
a) Small Manipulation
This mode has the default bar length for the accumulation detection, but a lower manipulation constant, meaning that slighter imbalances in the price action can be detected as manipulation. This setting can be useful on tickers that have lower liquidity, thus can be manipulated easier.
b) Big Manipulation
This mode has the default bar length for the accumulation detection, but a higher manipulation constant, meaning that heavier imbalances on the price action are required in order to detect manipulation zones. This setting can be useful on tickers that have higher liquidity, thus can be manipulated harder.
c) Short Accumulation
This mode has a ~70% lower bar length requirement for accumulation zone detection, and the default manipulation constant. This setting can be useful on tickers that are highly volatile and do not enter accumulation phases too often.
Breakout Method -> If "Close" is selected, bar close price will be taken into calculation when Accumulation & Manipulation zone invalidation. If "Wick" is selected, a wick will be enough to validate the corresponding zone.
2. TP / SL
TP / SL Method -> If "Fixed" is selected, you can adjust the TP / SL ratios from the settings below. If "Dynamic" is selected, the TP / SL zones will be auto-determined by the algorithm.
Risk -> The risk you're willing to take if "Dynamic" TP / SL Method is selected. Higher risk usually means a better winrate at the cost of losing more if the strategy fails. This setting is has a crucial effect on the performance of the indicator, as different tickers may have different volatility so the indicator may have increased performance when this setting is correctly adjusted.
3. Visuals
Show Zones -> Enables / Disables rendering of Accumulation (yellow) and Manipulation (red) zones.
Frequency and Volume ProfileFREQUENCY & VOLUME PROFILE
⚪ OVERVIEW
The Frequency and Volume Profile indicator plots a frequency or volume profile based on the visible bars on the chart, providing insights into price levels with significant trading activity.
⚪ USAGE
● Market Structure Analysis:
Identify key price levels where significant trading activity occurred, which can act as support and resistance zones.
● Volume Analysis:
Use the volume mode to understand where the highest trading volumes have occurred, helping to confirm strong price levels.
● Trend Confirmation:
Analyze the distribution of trading activity to confirm or refute trends, mark important levels as support and resistance, aiding in making more informed trading decisions.
● Frequency Distribution:
In statistics, a frequency distribution is a list of the values that a variable takes in a sample. It is usually a list. Displayed as a histogram.
⚪ SETTINGS
Source: Select the price data to use for the profile calculation (default: hl2).
Move Profile: Set the number of bars to offset the profile from the current bar (default: 100).
Mode: Choose between "Frequency" and "Volume" for the profile calculation.
Profile Color: Customize the color of the profile lines.
Lookback Period: Uses 5000 bars for daily and higher timeframes, otherwise 10000 bars.
The Frequency Profile indicator is a powerful tool for visualizing price levels with significant trading activity, whether in terms of frequency or volume. Its dynamic calculation and customizable settings make it a versatile addition to any trading strategy.
Global Net Liquidity (TG fork)Worldwide net liquidity, with trend coloring.
Global Net Liquidity attempts to represent worldwide net liquidity, and is defined as: Fed + Japan + China + UK + ECB - RRP - TGA , Where the first five components are central bank assets.
On TradingView, the indicator can be reproduced with the following equations: Global Net Liquidity = FRED:WALCL + FRED:JPNASSETS * FX_IDC:JPYUSD + CNCBBS * FX_IDC:CNYUSD + GBCBBS * FX:GBPUSD + ECBASSETSW * FX:EURUSD + RRPONTSYD + WTREGEN
However, this indicator adds a moving average cloud, and margin coloring, which eases historical trend assessment at a glance.
This indicator can be seen as an alternative representation of the accumulation/distribution indicator (and hence the same terms can be used in this description).
The Moving Average Cloud is simply the filling between the moving average (by default an EMA) and the current value. This feature was inspired by D7R ACC/DIST closed-source indicator, kudos to D7R for making such neat visual indicators.
Usage instructions:
Blue is more likely a phase of accumulation because the current value is above its historical price as defined by the moving average,
red is when this is more likely a phase of distribution.
Yellow is when the difference is below the margin, so we consider it is insignificant and that the trend is undecided. This can be disabled by setting the margin to 0.
While the color indicates if it's more likely an accumulation (blue) or distribution (red) phase or undecided (yellow), the cloud's vertical size allows to assess the strength of this tendency and the horizontal size the momentum, so that the bigger the cloud, the stronger the accumulation (if cloud is blue) or distribution (if cloud is red).
Why is that so? This is because the cloud represents the difference between the current tendency and the moving averaged past one, so a bigger cloud represents a bigger departure from recently observed tendencies. In practice, when there is accumulation, a pump in price can be expected soon, or if it already happened then it means it is indeed supported by volume, whereas if distribution, either a dump is to be expected soon, or if it already happened it means it's supported by volume.
Or maybe not necessarily a dump, but if there is a move upward in price, but the indicator indicates a strong distribution, then it means that the price movement is not supported and may not be sustainable (reversal may happen at anytime), whereas if price is going upward AND there is an accumulation (blue coloring) then it is more sustainable. This can be used to adapt strategies accordingly (risk on/risk off depending on whether there is concordance of both price and accumulation/distribution).
This indicator also includes sentiment signals that can be used to trigger alarms.
This indicator is a remix of Dharmatech's, who authored the first this Global Net Liquidity equation, kudos to them! Please show them some love if you like this indicator!
TTP Big Whale ExplorerThe Big Whale Explorer is an indicator that looks into the ratio of large wallets deposits vs withdrawals.
Whales tend to sale their holding when they transfer their holdings into exchanges and they tend to hold when they withdraw.
In this overlay indicator you'll be able to see in an oscillator format the moves of large wallets.
The moves above 1.5 turn into red symbolising that they are starting to distribute. This can eventually have an impact in the price by causing anything from a mild pullback to a considerable crash depending on how much is being actually sold into the market.
Moves below 0.5 mean that the large whales are heavily accumulating and withdrawing. During these periods price could still pullback or even crash but eventually the accumulation can take prices to new highs.
Instructions:
1) Load INDEX:BTCUSD or BNC:BLX to get the most historic data as possible
2) use the daily timeframe
3) load the indicator into the chart
NormInvTargetSeekerNormInvTargetSeeker
The NormInvTargetSeeker is a trading tool designed to aid traders in identifying and capitalizing on Distribution and Accumulation zones, highlighting specific price levels that could serve as targets for future price movements. Although the indicator itself is not multi-timeframe, an effective trading strategy might involve signal validation across multiple timeframes.
🔶 USAGE
The indicator identifies Distribution and Accumulation zones, providing potential targets for future price moves.
Traders are encouraged to use these zones as profit targets or potential reversal points.
Confluence Zones
These zones are identified as regions where various factors or levels converge, signaling an increased probability of price reaction.
They can be used to reinforce signals or identify levels where price might encounter significant resistance or support.
🔹 Trading Strategy
First, identify a signal on your primary trading timeframe.
Manually check higher timeframes to ensure the signal aligns with them.
Use the identified zones, whether Distribution or Accumulation, as target zones for your trades.
🔶 Order Blocks
The NormInvTargetSeeker identifies "Order Blocks" by examining a specified number of consecutive candles with a specific condition: the current candle must completely engulf the previous candle. This means that both the high and low of the current candle are higher and lower, respectively, than the high and low of the previous candle, signifying a dominant move in the direction of the current candle.
🔹 Trading Strategy
Target Confirmation: Order Blocks can serve to confirm target points, providing additional validation for identified levels.
Market Insight: They offer crucial insights into whether "big hands" or institutional players are positioned as buyers or sellers in the market.
Traders can use Order Blocks as a means to validate targets or key price levels, observing if the price reacts significantly upon reaching these blocks.
They can also provide insights into the general market direction or underlying market strength by identifying where the major market players are placing their orders.
🔶 SETTINGS
The indicator allows users to adjust various parameters to customize the display and logic of the tool to fit their needs.
🔹 Display Settings
Users can customize the colors and displays of various zones and labels to match their preferences.
🔶 LICENSE AND CREDITS
This work is licensed under Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0). More information here: creativecommons.org
This indicator utilizes a TypeScript implementation of the Normal Inverse function as a reference, which can be found here : github.com
Special thanks to the authors of the referenced code for providing a foundation upon which this indicator was built.
🔶 UPDATES
Current Version: 1.0.0
For future updates, please check the comment section.
🔶 CONTACT
For any questions or suggestions, please feel free to contact @RickSimpson on TradingView.
Position Cost DistributionThe Position Cost Distribution indicator (also known as the Market Position Overview, Chip Distribution, or CYQ Algorithm) provides an estimate of how shares are distributed across different price levels. Visually, it resembles the Volume Profile indicator, though they rely on distinct computational approaches.
🟠 Principle
The Position Cost Distribution algorithm is based on the principle that a security's total shares outstanding usually remains constant, except under conditions like stock splits, reverse splits, or new share issuance. It views all trading activity as simply exchanging share positions between holders at different price points.
By analyzing daily trade volume and the prior day's distribution, the algorithm infers the resulting share distribution after each day. By tracking these inferred transpositions over time, the indicator builds up an aggregate view of the estimated share concentration at each price level. This provides insights into potential buying and selling pressure zones that could form support or resistance areas.
Together with the Volume Profile, the Position Cost Distribution gives traders multiple lenses for examining market structure from both a volume and positional standpoint. Both can help identify meaningful technical price levels.
🟠 Algorithm
The algorithm initializes by allocating all shares to the price range encompassed by the first bar displayed on the chart. Preferably, the chart window should include the stock's IPO date, allowing the model to distribute shares specifically to the IPO price.
For subsequent trading sessions, the indicator performs the following calculations:
1. The daily turnover ratio is calculated by dividing the bar's trading volume by total outstanding shares.
2. For each price level (bucket), the number of shares is reduced by the turnover amount to represent shares transferring from existing holders.
3. The bar's total volume is then added to buckets corresponding to that period's price range.
Currently, the model assumes each share has an equal probability of being exchanged, regardless of how long ago it was acquired or at what price. Potential optimizations could incorporate factors like making shares held longer face a smaller chance of transfer compared to more recently purchased shares.
────────────────────────────────────────────
中文介绍:该指标为“筹码分布”的一个 TradingView 实现 :)
Paytience DistributionPaytience Distribution Indicator User Guide
Overview:
The Paytience Distribution indicator is designed to visualize the distribution of any chosen data source. By default, it visualizes the distribution of a built-in Relative Strength Index (RSI). This guide provides details on its functionality and settings.
Distribution Explanation:
A distribution in statistics and data analysis represents the way values or a set of data are spread out or distributed over a range. The distribution can show where values are concentrated, values are absent or infrequent, or any other patterns. Visualizing distributions helps users understand underlying patterns and tendencies in the data.
Settings and Parameters:
Main Settings:
Window Size
- Description: This dictates the amount of data used to calculate the distribution.
- Options: A whole number (integer).
- Tooltip: A window size of 0 means it uses all the available data.
Scale
- Description: Adjusts the height of the distribution visualization.
- Options: Any integer between 20 and 499.
Round Source
- Description: Rounds the chosen data source to a specified number of decimal places.
- Options: Any whole number (integer).
Minimum Value
- Description: Specifies the minimum value you wish to account for in the distribution.
- Options: Any integer from 0 to 100.
- Tooltip: 0 being the lowest and 100 being the highest.
Smoothing
- Description: Applies a smoothing function to the distribution visualization to simplify its appearance.
- Options: Any integer between 1 and 20.
Include 0
- Description: Dictates whether zero should be included in the distribution visualization.
- Options: True (include) or False (exclude).
Standard Deviation
- Description: Enables the visualization of standard deviation, which measures the amount of variation or dispersion in the chosen data set.
- Tooltip: This is best suited for a source that has a vaguely Gaussian (bell-curved) distribution.
- Options: True (enable) or False (disable).
Color Options
- High Color and Low Color: Specifies colors for high and low data points.
- Standard Deviation Color: Designates a color for the standard deviation lines.
Example Settings:
Example Usage RSI
- Description: Enables the use of RSI as the data source.
- Options: True (enable) or False (disable).
RSI Length
- Description: Determines the period over which the RSI is calculated.
- Options: Any integer greater than 1.
Using an External Source:
To visualize the distribution of an external source:
Select the "Move to" option in the dropdown menu for the Paytience Distribution indicator on your chart.
Set it to the existing panel where your external data source is placed.
Navigate to "Pin to Scale" and pin the indicator to the same scale as your external source.
Indicator Logic and Functions:
Sinc Function: Used in signal processing, the sinc function ensures the elimination of aliasing effects.
Sinc Filter: A filtering mechanism which uses sinc function to provide estimates on the data.
Weighted Mean & Standard Deviation: These are statistical measures used to capture the central tendency and variability in the data, respectively.
Output and Visualization:
The indicator visualizes the distribution as a series of colored boxes, with the intensity of the color indicating the frequency of the data points in that range. Additionally, lines representing the standard deviation from the mean can be displayed if the "Standard Deviation" setting is enabled.
The example RSI, if enabled, is plotted along with its common threshold lines at 70 (upper) and 30 (lower).
Understanding the Paytience Distribution Indicator
1. What is a Distribution?
A distribution represents the spread of data points across different values, showing how frequently each value occurs. For instance, if you're looking at a stock's closing prices over a month, you may find that the stock closed most frequently around $100, occasionally around $105, and rarely around $110. Graphically visualizing this distribution can help you see the central tendencies, variability, and shape of your data distribution. This visualization can be essential in determining key trading points, understanding volatility, and getting an overview of the market sentiment.
2. The Rounding Mechanism
Every asset and dataset is unique. Some assets, especially cryptocurrencies or forex pairs, might have values that go up to many decimal places. Rounding these values is essential to generate a more readable and manageable distribution.
Why is Rounding Needed? If every unique value from a high-precision dataset was treated distinctly, the resulting distribution would be sparse and less informative. By rounding off, the values are grouped, making the distribution more consolidated and understandable.
Adjusting Rounding: The `Round Source` input allows users to determine the number of decimal places they'd like to consider. If you're working with an asset with many decimal places, adjust this setting to get a meaningful distribution. If the rounding is set too low for high precision assets, the distribution could lose its utility.
3. Standard Deviation and Oscillators
Standard deviation is a measure of the amount of variation or dispersion of a set of values. In the context of this indicator:
Use with Oscillators: When using oscillators like RSI, the standard deviation can provide insights into the oscillator's range. This means you can determine how much the oscillator typically deviates from its average value.
Setting Bounds: By understanding this deviation, traders can better set reasonable upper and lower bounds, identifying overbought or oversold conditions in relation to the oscillator's historical behavior.
4. Resampling
Resampling is the process of adjusting the time frame or value buckets of your data. In the context of this indicator, resampling ensures that the distribution is manageable and visually informative.
Resample Size vs. Window Size: The `Resample Resolution` dictates the number of bins or buckets the distribution will be divided into. On the other hand, the `Window Size` determines how much of the recent data will be considered. It's crucial to ensure that the resample size is smaller than the window size, or else the distribution will not accurately reflect the data's behavior.
Why Use Resampling? Especially for price-based sources, setting the window size around 500 (instead of 0) ensures that the distribution doesn't become too overloaded with data. When set to 0, the window size uses all available data, which may not always provide an actionable insight.
5. Uneven Sample Bins and Gaps
You might notice that the width of sample bins in the distribution is not uniform, and there can be gaps.
Reason for Uneven Widths: This happens because the indicator uses a 'resampled' distribution. The width represents the range of values in each bin, which might not be constant across bins. Some value ranges might have more data points, while others might have fewer.
Gaps in Distribution: Sometimes, there might be no data points in certain value ranges, leading to gaps in the distribution. These gaps are not flaws but indicate ranges where no values were observed.
In conclusion, the Paytience Distribution indicator offers a robust mechanism to visualize the distribution of data from various sources. By understanding its intricacies, users can make better-informed trading decisions based on the distribution and behavior of their chosen data source.
SimilarityMeasuresLibrary "SimilarityMeasures"
Similarity measures are statistical methods used to quantify the distance between different data sets
or strings. There are various types of similarity measures, including those that compare:
- data points (SSD, Euclidean, Manhattan, Minkowski, Chebyshev, Correlation, Cosine, Camberra, MAE, MSE, Lorentzian, Intersection, Penrose Shape, Meehl),
- strings (Edit(Levenshtein), Lee, Hamming, Jaro),
- probability distributions (Mahalanobis, Fidelity, Bhattacharyya, Hellinger),
- sets (Kumar Hassebrook, Jaccard, Sorensen, Chi Square).
---
These measures are used in various fields such as data analysis, machine learning, and pattern recognition. They
help to compare and analyze similarities and differences between different data sets or strings, which
can be useful for making predictions, classifications, and decisions.
---
References:
en.wikipedia.org
cran.r-project.org
numerics.mathdotnet.com
github.com
github.com
github.com
Encyclopedia of Distances, doi.org
ssd(p, q)
Sum of squared difference for N dimensions.
Parameters:
p (float ) : `array` Vector with first numeric distribution.
q (float ) : `array` Vector with second numeric distribution.
Returns: Measure of distance that calculates the squared euclidean distance.
euclidean(p, q)
Euclidean distance for N dimensions.
Parameters:
p (float ) : `array` Vector with first numeric distribution.
q (float ) : `array` Vector with second numeric distribution.
Returns: Measure of distance that calculates the straight-line (or Euclidean).
manhattan(p, q)
Manhattan distance for N dimensions.
Parameters:
p (float ) : `array` Vector with first numeric distribution.
q (float ) : `array` Vector with second numeric distribution.
Returns: Measure of absolute differences between both points.
minkowski(p, q, p_value)
Minkowsky Distance for N dimensions.
Parameters:
p (float ) : `array` Vector with first numeric distribution.
q (float ) : `array` Vector with second numeric distribution.
p_value (float) : `float` P value, default=1.0(1: manhatan, 2: euclidean), does not support chebychev.
Returns: Measure of similarity in the normed vector space.
chebyshev(p, q)
Chebyshev distance for N dimensions.
Parameters:
p (float ) : `array` Vector with first numeric distribution.
q (float ) : `array` Vector with second numeric distribution.
Returns: Measure of maximum absolute difference.
correlation(p, q)
Correlation distance for N dimensions.
Parameters:
p (float ) : `array` Vector with first numeric distribution.
q (float ) : `array` Vector with second numeric distribution.
Returns: Measure of maximum absolute difference.
cosine(p, q)
Cosine distance between provided vectors.
Parameters:
p (float ) : `array` 1D Vector.
q (float ) : `array` 1D Vector.
Returns: The Cosine distance between vectors `p` and `q`.
---
angiogenesis.dkfz.de
camberra(p, q)
Camberra distance for N dimensions.
Parameters:
p (float ) : `array` Vector with first numeric distribution.
q (float ) : `array` Vector with second numeric distribution.
Returns: Weighted measure of absolute differences between both points.
mae(p, q)
Mean absolute error is a normalized version of the sum of absolute difference (manhattan).
Parameters:
p (float ) : `array` Vector with first numeric distribution.
q (float ) : `array` Vector with second numeric distribution.
Returns: Mean absolute error of vectors `p` and `q`.
mse(p, q)
Mean squared error is a normalized version of the sum of squared difference.
Parameters:
p (float ) : `array` Vector with first numeric distribution.
q (float ) : `array` Vector with second numeric distribution.
Returns: Mean squared error of vectors `p` and `q`.
lorentzian(p, q)
Lorentzian distance between provided vectors.
Parameters:
p (float ) : `array` Vector with first numeric distribution.
q (float ) : `array` Vector with second numeric distribution.
Returns: Lorentzian distance of vectors `p` and `q`.
---
angiogenesis.dkfz.de
intersection(p, q)
Intersection distance between provided vectors.
Parameters:
p (float ) : `array` Vector with first numeric distribution.
q (float ) : `array` Vector with second numeric distribution.
Returns: Intersection distance of vectors `p` and `q`.
---
angiogenesis.dkfz.de
penrose(p, q)
Penrose Shape distance between provided vectors.
Parameters:
p (float ) : `array` Vector with first numeric distribution.
q (float ) : `array` Vector with second numeric distribution.
Returns: Penrose shape distance of vectors `p` and `q`.
---
angiogenesis.dkfz.de
meehl(p, q)
Meehl distance between provided vectors.
Parameters:
p (float ) : `array` Vector with first numeric distribution.
q (float ) : `array` Vector with second numeric distribution.
Returns: Meehl distance of vectors `p` and `q`.
---
angiogenesis.dkfz.de
edit(x, y)
Edit (aka Levenshtein) distance for indexed strings.
Parameters:
x (int ) : `array` Indexed array.
y (int ) : `array` Indexed array.
Returns: Number of deletions, insertions, or substitutions required to transform source string into target string.
---
generated description:
The Edit distance is a measure of similarity used to compare two strings. It is defined as the minimum number of
operations (insertions, deletions, or substitutions) required to transform one string into another. The operations
are performed on the characters of the strings, and the cost of each operation depends on the specific algorithm
used.
The Edit distance is widely used in various applications such as spell checking, text similarity, and machine
translation. It can also be used for other purposes like finding the closest match between two strings or
identifying the common prefixes or suffixes between them.
---
github.com
www.red-gate.com
planetcalc.com
lee(x, y, dsize)
Distance between two indexed strings of equal length.
Parameters:
x (int ) : `array` Indexed array.
y (int ) : `array` Indexed array.
dsize (int) : `int` Dictionary size.
Returns: Distance between two strings by accounting for dictionary size.
---
www.johndcook.com
hamming(x, y)
Distance between two indexed strings of equal length.
Parameters:
x (int ) : `array` Indexed array.
y (int ) : `array` Indexed array.
Returns: Length of different components on both sequences.
---
en.wikipedia.org
jaro(x, y)
Distance between two indexed strings.
Parameters:
x (int ) : `array` Indexed array.
y (int ) : `array` Indexed array.
Returns: Measure of two strings' similarity: the higher the value, the more similar the strings are.
The score is normalized such that `0` equates to no similarities and `1` is an exact match.
---
rosettacode.org
mahalanobis(p, q, VI)
Mahalanobis distance between two vectors with population inverse covariance matrix.
Parameters:
p (float ) : `array` 1D Vector.
q (float ) : `array` 1D Vector.
VI (matrix) : `matrix` Inverse of the covariance matrix.
Returns: The mahalanobis distance between vectors `p` and `q`.
---
people.revoledu.com
stat.ethz.ch
docs.scipy.org
fidelity(p, q)
Fidelity distance between provided vectors.
Parameters:
p (float ) : `array` 1D Vector.
q (float ) : `array` 1D Vector.
Returns: The Bhattacharyya Coefficient between vectors `p` and `q`.
---
en.wikipedia.org
bhattacharyya(p, q)
Bhattacharyya distance between provided vectors.
Parameters:
p (float ) : `array` 1D Vector.
q (float ) : `array` 1D Vector.
Returns: The Bhattacharyya distance between vectors `p` and `q`.
---
en.wikipedia.org
hellinger(p, q)
Hellinger distance between provided vectors.
Parameters:
p (float ) : `array` 1D Vector.
q (float ) : `array` 1D Vector.
Returns: The hellinger distance between vectors `p` and `q`.
---
en.wikipedia.org
jamesmccaffrey.wordpress.com
kumar_hassebrook(p, q)
Kumar Hassebrook distance between provided vectors.
Parameters:
p (float ) : `array` 1D Vector.
q (float ) : `array` 1D Vector.
Returns: The Kumar Hassebrook distance between vectors `p` and `q`.
---
github.com
jaccard(p, q)
Jaccard distance between provided vectors.
Parameters:
p (float ) : `array` 1D Vector.
q (float ) : `array` 1D Vector.
Returns: The Jaccard distance between vectors `p` and `q`.
---
github.com
sorensen(p, q)
Sorensen distance between provided vectors.
Parameters:
p (float ) : `array` 1D Vector.
q (float ) : `array` 1D Vector.
Returns: The Sorensen distance between vectors `p` and `q`.
---
people.revoledu.com
chi_square(p, q, eps)
Chi Square distance between provided vectors.
Parameters:
p (float ) : `array` 1D Vector.
q (float ) : `array` 1D Vector.
eps (float)
Returns: The Chi Square distance between vectors `p` and `q`.
---
uw.pressbooks.pub
stats.stackexchange.com
www.itl.nist.gov
kulczynsky(p, q, eps)
Kulczynsky distance between provided vectors.
Parameters:
p (float ) : `array` 1D Vector.
q (float ) : `array` 1D Vector.
eps (float)
Returns: The Kulczynsky distance between vectors `p` and `q`.
---
github.com
Normal Distribution CurveThis Normal Distribution Curve is designed to overlay a simple normal distribution curve on top of any TradingView indicator. This curve represents a probability distribution for a given dataset and can be used to gain insights into the likelihood of various data levels occurring within a specified range, providing traders and investors with a clear visualization of the distribution of values within a specific dataset. With the only inputs being the variable source and plot colour, I think this is by far the simplest and most intuitive iteration of any statistical analysis based indicator I've seen here!
Traders can quickly assess how data clusters around the mean in a bell curve and easily see the percentile frequency of the data; or perhaps with both and upper and lower peaks identify likely periods of upcoming volatility or mean reversion. Facilitating the identification of outliers was my main purpose when creating this tool, I believed fixed values for upper/lower bounds within most indicators are too static and do not dynamically fit the vastly different movements of all assets and timeframes - and being able to easily understand the spread of information simplifies the process of identifying key regions to take action.
The curve's tails, representing the extreme percentiles, can help identify outliers and potential areas of price reversal or trend acceleration. For example using the RSI which typically has static levels of 70 and 30, which will be breached considerably more on a less liquid or more volatile asset and therefore reduce the actionable effectiveness of the indicator, likewise for an asset with little to no directional volatility failing to ever reach this overbought/oversold areas. It makes considerably more sense to look for the top/bottom 5% or 10% levels of outlying data which are automatically calculated with this indicator, and may be a noticeable distance from the 70 and 30 values, as regions to be observing for your investing.
This normal distribution curve employs percentile linear interpolation to calculate the distribution. This interpolation technique considers the nearest data points and calculates the price values between them. This process ensures a smooth curve that accurately represents the probability distribution, even for percentiles not directly present in the original dataset; and applicable to any asset regardless of timeframe. The lookback period is set to a value of 5000 which should ensure ample data is taken into calculation and consideration without surpassing any TradingView constraints and limitations, for datasets smaller than this the indicator will adjust the length to just include all data. The labels providing the percentile and average levels can also be removed in the style tab if preferred.
Additionally, as an unplanned benefit is its applicability to the underlying price data as well as any derived indicators. Turning it into something comparable to a volume profile indicator but based on the time an assets price was within a specific range as opposed to the volume. This can therefore be used as a tool for identifying potential support and resistance zones, as well as areas that mark market inefficiencies as price rapidly accelerated through. This may then give a cleaner outlook as it eliminates the potential drawbacks of volume based profiles that maybe don't collate all exchange data or are misrepresented due to large unforeseen increases/decreases underlying capital inflows/outflows.
Thanks to @ALifeToMake, @Bjorgum, vgladkov on stackoverflow (and possibly some chatGPT!) for all the assistance in bringing this indicator to life. I really hope every user can find some use from this and help bring a unique and data driven perspective to their decision making. And make sure to please share any original implementaions of this tool too! If you've managed to apply this to the average price change once you've entered your position to better manage your trade management, or maybe overlaying on an implied volatility indicator to identify potential options arbitrage opportunities; let me know! And of course if anyone has any issues, questions, queries or requests please feel free to reach out! Thanks and enjoy.
Accumulation & Distribution - SimpleThis script is calculate volume weighted % change difference between up days and down days.
up days consider when price closed above (high+low+close)/3
down days consider when price closed below (high+low+close)/3
then this cumulative difference % is displayed using histogram with 2 ema.
this script is not provide the any trading signal but its help you to identify the power of buying or selling.
90 Minute Cycles + MTFCredit goes to LuxAlgo for the inspiration from 'Sessions' which allowed users to analyse specific price movements within a user defined period with tools such as trendline, mean and vwap.
Settings
Sessions
Enable Session: Allows to enable or disable all associated elements with a specific user set session.
Session Time: Opening and closing times of the user set session in the hh:mm format.
Range: Highlights the associated session range on the chart.
Ranges Settings
Range Area colour: Set each range to a specific colour.
Range Label: Shows the session label at the mid-point of the session interval.
Usage
By breaking 24hrs in quarters, starting with an Asian range of 18:00 NY time you can visualise the principles of Accumulation, Manipulation, Distribution and Rebalance. Know as AMD or PO3 (Power of Three), the principle is that the Manipulation phase will break above or below the Accumulation, before moving in an apposing direction and then rebalancing. This only works when there is a higher timeframe PD array or liquidity to support an apposing move.
Further to the daily quarters, each one can then be broken down again into 90min cycles. Again, each represents AMD, allowing the user an opportunity to watch for reversals during the 90min manipulation phase.
Note: Ensure the Asian Cycle always begins at 18:00 NY time.
The example shows that the 90min cycle occurs, followed by an apposing move away in price action
Here is the Daily cycle, highlighting the Manipulation phase.
Enjoy!
On-Balance Accumulation Distribution (Volume-Weighted)The On-Balance Accumulation Distribution (OBAD) indicator is designed to analyze the accumulation and distribution of assets based on volume-weighted price movements. The indicator helps traders identify periods of buying and selling pressure and assess the strength of market trends. By incorporating volume and price data, the OBAD indicator provides valuable insights into the flow of funds in the market.
To calculate the OBAD, the indicator multiplies the volume, price, and volume factor (user-defined) with the price change and aggregates the values over a specified length. This results in a histogram and a line plot representing the OBAD values. The OBAD signal line is derived by applying a simple moving average (SMA) to the OBAD values over a shorter period (9 by default). The crossover of the OBAD line and signal line can indicate potential entry or exit points.
The OBAD indicator utilizes coloration to enhance its visual representation and interpretation. The OBAD background is colored based on the relationship between the OBAD values and the OBAD signal line. When the OBAD values are above the signal line, the background is displayed in lime, suggesting a bullish accumulation scenario. Conversely, when the OBAD values are below the signal line, the background is colored fuchsia, indicating a bearish distribution pattern. The bar coloration is also applied to provide further visual cues, with lime representing bullish conditions and fuchsia denoting bearish conditions. When the OBAD signal line is above 0, it is colored green. Conversely, if the signal line is below 0, it is colored maroon.
The length parameter in the OBAD indicator determines the number of periods used in the calculation. Shorter lengths, such as 10 or 20, can make the indicator more responsive to recent price and volume changes, providing quicker signals. This can be beneficial for short-term traders or in fast-paced markets. Conversely, longer lengths, such as 50 or 100, smooth out the indicator and provide a broader view of accumulation and distribution over a more extended period. This may suit longer-term traders or when analyzing trends in less volatile markets. Traders should experiment with different lengths to find the optimal balance between responsiveness and smoothness that aligns with their trading goals.
The volume factor parameter allows traders to adjust the weighting of volume in the OBAD calculation. By modifying this factor, traders can emphasize the impact of volume on the indicator. Increasing the volume factor amplifies the influence of volume in the OBAD calculation, making it more sensitive to volume changes. This can be advantageous when volume is considered a significant driver of price movements, such as during news events or market catalysts. On the other hand, decreasing the volume factor reduces the impact of volume, making the indicator less sensitive to volume fluctuations. Traders can experiment with different volume factors to align the indicator's responsiveness with their analysis of volume patterns and its importance in their trading decisions.
The signal line period parameter determines the number of periods used to calculate the moving average of the OBAD values. Adjusting this parameter can help smooth out the indicator and filter out short-term noise or provide more timely signals. A shorter signal line period, such as 5 or 7, provides more sensitive and frequent crossovers with the OBAD values, potentially offering early entry or exit signals. This can be useful for traders seeking shorter-term trades or more agile trading strategies. Conversely, a longer signal line period, such as 9 or 14, smooths out the indicator and provides more stable signals. This may suit traders who prefer longer-term trends or a more conservative approach. Traders should consider their trading timeframe and the desired balance between responsiveness and stability when adjusting the signal line period.
The OBAD indicator can be applied in various trading strategies and scenarios. It helps traders identify potential trend reversals, confirm existing trends, and generate entry and exit signals. For example, when the OBAD histogram transitions from fuchsia to lime, it may suggest a shift from selling to buying pressure, signaling a potential buying opportunity. Traders can also use the OBAD indicator in conjunction with other technical analysis tools, such as trendlines or support/resistance levels, to confirm signals and make more informed trading decisions.
-- Trend Reversal Identification : The OBAD indicator can be useful in identifying potential trend reversals. When the OBAD values cross above the signal line after being below it, it may suggest a shift from bearish distribution to bullish accumulation. Conversely, when the OBAD values cross below the signal line after being above it, it may indicate a transition from bullish accumulation to bearish distribution. Traders can use these crossovers as potential signals to enter or exit trades in anticipation of a trend reversal.
-- Confirmation of Trend Strength : The OBAD indicator can act as a confirmation tool for assessing the strength of existing trends. When the OBAD values remain consistently above the signal line, it confirms the presence of strong bullish accumulation and validates the upward trend. Similarly, when the OBAD values stay consistently below the signal line, it confirms the presence of strong bearish distribution and validates the downward trend. Traders can use this confirmation to have more confidence in the prevailing trend and adjust their trading strategies accordingly.
-- Divergence Analysis : Divergence between the price and the OBAD indicator can provide valuable insights. Bullish divergence occurs when the price forms lower lows while the OBAD indicator forms higher lows, suggesting a potential trend reversal to the upside. Conversely, bearish divergence occurs when the price forms higher highs while the OBAD indicator forms lower highs, indicating a potential trend reversal to the downside. Traders can use these divergences as additional confirmation signals in their trading decisions.
-- Volume Analysis : The OBAD indicator incorporates volume data, making it particularly useful for volume analysis. Traders can analyze the relationship between OBAD values and volume levels to gauge the strength and validity of price movements. Higher OBAD values accompanied by higher volume can indicate strong accumulation or distribution, providing confirmation for potential trade setups. On the other hand, lower OBAD values accompanied by low volume may suggest a lack of participation and potentially signal caution in trading decisions.
It is important to note that the OBAD indicator, like any other technical indicator, has certain limitations. It relies on historical price and volume data, which may not always accurately reflect current market conditions or future price movements. Traders should exercise caution and use the OBAD indicator in conjunction with other analysis techniques and risk management strategies. Additionally, customization of the OBAD parameters, such as adjusting the length or volume factor, can provide flexibility to adapt the indicator to different market conditions and trading preferences.
Overall, the OBAD indicator serves as a valuable tool for traders to gauge the accumulation and distribution patterns in the market. Its calculation based on volume-weighted price movements and the coloration enhancements make it visually appealing and intuitive to interpret. By incorporating the OBAD indicator into trading strategies and considering its limitations, traders can potentially improve their decision-making process and enhance their trading outcomes.
RSI is in Normal Distribution?Does RSI Follow a Normal Distribution?
The value of RSI was converted to a value between 0~2, 2~4, ..., 98~100, and the number of samples was graphed.
The Z values are expressed so that the values corresponding to 30 and 70 of the RSI can be compared with the standard normal distribution.
Additionally, when using the RSI period correction function of the 'RSI Candle Advanced V2' indicator that I made before, it shows no change in standard deviation.
RSI는 정규분포를 따를까요
RSI의 값을 0~2, 2~4, ..., 98~100 사이 값으로 변환하고 그 표본 갯수를 그래프로 표현하였습니다.
Z 값은 RSI의 30, 70에 해당하는 값을 표준정규분포와 비교할 수 있도록 표현하였습니다.
추가적으로 제가 예전에 만들었던 'RSI Candle Advanced V2' 지표의 RSI 기간 보정 함수를 사용할 경우 표준편차의 변화가 없음을 보입니다.
RSI Accumulation/Distribution [M]Hello everyone,
After my long tests, I observed that the rate of change of direction of the price was high after the periods when the RSI spent a long time outside the band. As a result of my observations, I prepared this indicator.
This indicator shows you the accumulation and distribution areas that occur outside the rsi band.
There are 3 different levels available.
Level 1 = 5 Bars
Level 2 = 7 Bars
Level 3 = 9 Bars
For example, if the RSI spends more than 9 bars below the 30 level or above the 70 level, it will paint that area red. Levels can be changed from the indicator settings. The rsi is smoothed with simple moving average to reduce fake signals.
Using the RSI A/D indicator with different indicators or patterns will increase your success rate.
Examples:
True Accumulation/Distribution (TG fork)An accumulation/distribution indicator that works better against gaps and with trend coloring.
Accumulation/Distribution was developed by Marc Chaikin to provide insight into strength of a trend by measuring flow of buy and sell volume .
The fact that A/D only factors current period's range for calculating the volume multiplier causes problem with price gaps. They are ignored or even misinterpreted.
True Accumulation/Distribution solves the problem by using True Range instead of only relying on current period's high and low.
Most of the time, True A/D reverts to producing the same values as the original A/D. The difference between True A/D and original A/D can be better seen when a gap has occurred, True A/D has handles it better than Accumulation/Distribution which a bearish close in period's range cause it to misinterpret the strong buy pressure as sell volume
The Moving Average Cloud is simply the filling between the moving average and the True A/D. This feature was inspired by D7R ACC/DIST closed-source indicator, kudos to D7R for making such neat visual indicators (but unfortunately all closed source!).
This indicator was made to extend the original work by adding MTF support and a moving average cloud and coloring.
If you like this indicator, please show the original author RezzaHmt some love:
Real-time price distribution in candlesThis indicator splits the candle time into 30 units to indicate where the price was at each time.
In the case of a 1-hour time zone, 60 minutes / 30 = 2 minutes, so this display the location of the price every 2 minutes.
In case of 1 minute time zone, it is displayed every 2 seconds.
CAUTION
If a transaction does not occur, the display may be omitted.
You can change the color of the opening and closing prices and the size of the dots.
Trend Identifier StrategyTrend Identifier Strategy for 1D BTC.USD
The indicator smoothens a closely following moving average into a polynomial like plot and assumes 4 staged cycles based on the first and the second derivatives. This is an optimized strategy for long term buying and selling with a Sortino Ratio above 3. It is designed to be a more profitable alternative to HODLing. It can be combined with 'Accumulation/Distribution Bands & Signals' and 'Exponential Top and Bottom Finder'.
Money Flow LineWhat is this? The Money Flow Line (MFL) indicator is at its core a more even-tempered version of the Price-Volume-Trend (PVT). The primary difference is the usage of `hlc3` ((high + low + close) / 3) rather than `close` to use the "typical price" that it critical to the calculation of the Money Flow Index (MFI). Other similar indicators include the Accumulation Distribution Line (ADL) and the On Balance Volume (OBV) indicators. The purpose of all of these indicators is to attempt to measure the strength of the money flow by combining price and volume into a rolling measurement that can be compared over time to look for confirmations and divergences.
The indicator also includes an optional averaging (smoothing) line that can be enabled in the display settings. Enabling this smoothing line with a desired period allows for simpler trend comparisons and also allows the user to view how far the line has diverged from the mean. This creates an indicator very similar to Elder's Force Index (EFI), which is also a `close * volume` style indicator.
Why is this important? After an extreme movement or volume spike the MFI will "snap back" sharply as that bar eventually exits the set period. This produces a result that is meaningless and skews the indicator away from the market structure. Because of this behavior, range clamping, and the loss of comparative history I prefer to shy away from oscillator style indicators. The Money Flow Line instead gives you all of the history so you may compare and see the broader trend without sharp snaps in history based on an arbitrary period setting.
Why is this better? This produces a no-lag indicator that isn't subject to the harsh skewing produced by they Money Flow Index's period calculation. It doesn't lose history like MFI or EFI, is clear about the trend direction, and prefers a "typical price" (averaging the entire range of each bar) rather than whatever happens to be the closing price for a given bar.
How can I use it? The indicator is attempting to measure supply and demand in the markets. No indicator is perfect, but we can use all of the information we have available to make our best predictions. There are only 3 pieces of data the market gives us:
1. Price (action)
2. Volume
3. Time
The Money Flow Line combines all of these data points into a readable rolling data set that attempts to show subtle balance of power shifts based on changes in volume and "smart money" (or "big money") stepping in and out of the picture. Much like PVT, we look for the same things:
- Trend Identification: an up or down trend appears in the MFL
- Confirmations: the MFL agrees with price action in direction and magnitude
- Divergence: the MFL disagrees with price action, indicating a reversal may be coming soon
When applying the smoothing line we can also look for similar things we would with EFI. The primary case would be to look for the MFL to jump very far away from the mean (a high magnitude movement) which indicates that price may be reverting towards the mean soon (a "mean reversion"). On the other hand, it may indicate strength in the current price direction. All of these predictions depend heavily on price action and market structure. Good luck!
Trend IdentifierTrend Identifier for 1D BTC.USD
It smoothens a closely following moving average into a polynomial like plot.
And assumes 4 stage cycles based on the first and second derivatives.
Green: Bull / Exponential Rise
Yellow: Distribution
Red: Bear / Exponential Drop
Blue: Accumulation
Red --> Blue --> Green: indicates the start of a bull market
Green --> Yellow --> Red: indicates the start of a bear market
Green --> Yellow: Start of a distribution phase, take profits
Red --> Blue: Start of a accumulation phase, DCA
Sequence Distribution Reporta basic tool to retrieve statistics of the distribution of price range sequences.
Breakout Accumulation/DistributionBasic modification of my SFP Momentum Indicator showing accumulation/distribution patterns based on breakouts above previous anchor points.
Candles are colored based on whether accumulation or distribution was last.
Best if used at HTF then confirmed at LTF.
SFP MomentumCustom swing fail detector with levels and breakouts both major and minor plus colored candles based on SFP momentum.