Machine Learning: MFI Heat Map [YinYangAlgorithms]Overview:
MFI Heat Maps are a visually appealing way to display the values of 29 different MFIs at the same time while being able to make sense of it. Each plot within the Indicator represents a different MFI value. The higher you get up, the longer the length that was used for this MFI. This Indicator also features the use of Machine Learning to help balance the MFI levels. It doesn’t solely rely upon Machine Learning but instead incorporates a growing length MFI averaged with the Machine Learning MFI at any given index.
For instance, say we are calculating the 10th plot from the bottom, the MFI would be an average of:
MFI(source, 11)
Machine Learning MFI at Index of 10
We do it this way as they both help smooth each other out without relying solely on just one calculation method.
Due to plot limitations, you are capped at 28 Plot Amounts within this indicator, but that is still quite a bit of information you can glean from a Heat Map.
The Machine Learning used in this indicator is of the K-Nearest Neighbor (KNN). It uses a Fast and Slow MFI calculation then sorts through them over Machine Learning Length and calculates the differences between them. It then slices off KNN length to create our Max/Min Distances allotted. It adds the average between Fast and Slow MFIs to a Viable Distances array if their distances are within the KNN Min/Max distance. It then averages all distances in the Viable Distances array and returns the result.
The result of the KNN Function is saved to another ML Data array whose length is that of Plot Amount (Heat Map Size). This way each Index of the ML Data array can be indexed according to the Heat Map Size.
The Average of the ML Data array is the MFI line (white) that you’ll see plotted on the Indicator. There is also the SMA of the MFI Average (orange) which is likewise plotted. These plots allow you to visualize where the ML MFI is sitting and can potentially be useful for seeing when the MFI Average and SMA cross over and under each other.
We’ve heard many people talk highly of RSI, but sadly not too many even refer to MFI. MFI oftentimes may be overlooked, especially with new traders who may not even know what it is. Essentially MFI is an RSI but it also incorporates Volume into its calculations, which in our opinion leads to a more accurate reading; afterall, what is price movement without Volume.
Tutorial:
You may be thinking, this Indicator looks appealing to the eye, but how do I benefit from it trading wise?
Before we get into our visual examples, let's talk briefly about what makes Heat Maps in general a useful tool for trading. Heat Maps give us the ability to visualize and understand lots of data while removing the clutter. We can understand the data of 29 different MFIs without having to look at and decipher 29 different MFI plots. When you overlay too many MFI lines on top of each other, they can be very difficult to read and oftentimes end up actually hindering your Technical Analysis. For this reason, we have a simple solution to this problem; Heat Maps. This MFI Heat Map allows you to easily know (in a relative %) what the MFI level is for varying lengths. For Instance, the First (bottom) plot indexes an MFI of (K(0) (loop of Plot Amount) + Smoothing Length (default 1)) = 1. Since this is indexing (usually) a very low length, it will change much quicker. Whereas the Last (top) plot indexes an MFI of (K(27) (loop of Plot Amount) + Smoothing Length (default 1)) = 28. This is indexing a much higher length of MFI which results in the MFI the higher you go up in the Heat Map to move much slower.
Heat Maps give us the ability to see changes happening over multiple MFIs at the same time, which can be very useful for seeing shifts in MFI / Momentum. Remember, MFI incorporates Volume, so even if the price goes up a lot, if there was low volume, the MFI won’t move as much as an RSI would. However, likewise, if there is high volume but low price movement, the MFI will move slightly more than the RSI.
Heat Maps change color based on their MFI level. If the MFI is >= 90 it is HOT (red), if the MFI <= 9 it is COLD (teal, think of ICE). Green represents an MFI of 50-59 and Dark Blue represents an MFI of 40-49. Green and Dark blue are the most common colors as all the others are more ‘Extreme’ MFI levels.
Okay, time to get to the Examples :
Since there is so much going on in Heat Maps, we’ve decided to focus this tutorial to this specific area and talk about individual locations before talking about it as a whole.
If you refer to the example above where there are 2 white circles; these white circles are highlighting a key location you’ll be wanting to identify within your Heat Maps, many things are happening here:
The MFI crossed over the SMA (bullish).
The Heat Map started changing from mid/dark Blue (30-50 MFI) to Green (50-59 MFI) around the midline (the 50% dashed like).
The Lower levels of the Heat Map are turning Yellow/Orange/Red (60-100 MFI).
The Upper Levels of the Heat Map are still Light Blue - Green (10-50 MFI).
The 4 Key points above, all point towards potential Bullish Momentum changes. You’re likely wondering, but why? Let's discuss about each one in more specific detail:
1. The MFI crossed over the SMA (bullish): What this tells us is that the current MFI Average is now greater than its average over the last (default) 16 bars. This means there's been a large amount of Money Flow (Price and Volume) recently (subjectively based on the last (default) 16 average). This is one of the leading Bullish / Bearish signals you will see within this Indicator. You can enable Signals within the Settings and/or even add Alerts for when these crossings occur.
2. The Heat Map started changing from mid/dark Blue (30-50 MFI) to Green (50-59 MFI) around the midline (the 50% dashed like): This shows us that the index’s in the mid (if using all 28 heat map plots it would be at 14) has already received some of this momentum change. If you look at the second white circle (right), you’ll also notice the higher MFI plot indexes are also green. This is because since their length is long they still have some momentum and strength from the first white circle (left). Just because the first white circle failed in its bullish push, doesn’t mean it didn’t achieve momentum that would later on help to push the price up.
3. The Lower levels of the Heat Map are turning Yellow/Orange/Red (60-100 MFI): It occurred somewhat in the left white circle, but mainly in the right white circle. This shows us the MFI is very high on the lower lengths, this may lead to the current, middle and higher length MFIs following suit soon. Remember it has to work its way up, the higher levels can’t go red unless the lower levels go red first and the higher levels can also lag quite a bit behind and take awhile to catch up, this is normal, expected and meant to happen. Vice versa is also true with getting higher levels to go cold (light teal (think of ICE)).
4. The Upper Levels of the Heat Map are still Light Blue - Green (10-50 MFI): You might think at first that this is a bad thing, but it's not! Remember you want to be Fearful when others are Greedy and Greedy when others are Fearful! You don’t want to buy when the higher levels have a high MFI, you want to buy when you see the momentum pushing up in the lower MFI levels (getting yellow/orange/red in the low levels) while it is still Cold in the higher levels (BLUE OR GREEN, nothing higher than green as it is already slightly too high). There will be many times that it is Yellow or possibly Orange in the high levels and the bullish push still happens, but this is much more risky! The key to trading is to minimize risks while maximizing potential.
Hopefully now you’re getting an idea of how to spot potential bullish momentum changes, but what about bearish momentum changes? Technically they are the exact opposite, so we don’t need to go into as much detail, but lets still take a look at a few examples:
In the example above we marked the 3 times where it was displaying overly bullish characteristics. We marked the bullish momentum occurring with arrows. If you look closely at the start of the arrow to where it finishes, you’ll notice how the heat (HOT)(RED) works its way up from the lower levels to the higher levels. We then see the MFI to SMA cross under. In all 3 of these examples the heat made it all the way to the top of the chart. These are all very bearish signals that represent a bearish momentum movement that may occur soon.
Also, please note, the level the MFI is at DOES matter! That line isn’t there simply for you to see when there are crosses over and under. The MFI is considered to be Overbought when it is greater than 70 (the upper white dashed line, it is just formatted to be on a different scale cause there are 28 plots, but it represents 70). The MFI is considered to be Oversold when it is less than 30 (the lower white dashed line).
If we look to the left a little here where a big drop in price occurred shortly after our MFI and SMA crossed, would we have been able to identify it using the Heat Maps? Likely, No. There was some color change in the lower levels a few bars prior that went yellow/orange/red but before this cross happened they all went back to Dark Blue. In the middle section when the cross happened it was only Green and Yellow and in the upper section we are Blue. This would be a very risky trade to go on as the only real Bearish Indication was the MFI to SMA cross under. Remember, you want to reduce risk, you don’t want to simply trade on everytime the MFI and SMA cross each other or you’ll be getting yourself into many risky trades based on false signals.
Based on what you’ve learned above, can you see the signs that are indicating where this white circle may have potential for a bullish momentum change?
Now that we are more zoomed in, you may also be noticing there are colors to the price bars. This can be disabled in the settings, but just so you know what they mean, let’s zoom in a little more and talk about it.
We’ve condensed the Indicator a bit so you can see the bars better here. The colors that are displayed on these bars are the Heat Map value for your MFI (the white line in the Indicator). This way you can better see when the Price is Hot and Cold. As you may see while looking, the colors generally go from cold to hot when bullish momentum is happening and hot to cold when bearish momentum is happening. We don’t recommend solely looking at the bars as indicators to MFI momentum change, as seeing the Heat Map will give you much more data; however it can be nice to see the Heat Map projected on the bars rather than trying to eyeball it yourself or hover over each bar specifically to see their levels.
We will conclude our Tutorial here. Hopefully this has given you some insight to how useful Heat Maps can be and why it works well with a Machine Learning (KNN) Model applied to the MFI.
PLEASE NOTE: You can adjust the line width for the Heat Map within the settings. If you condense the Indicator a lot or have a small screen, likely use a length of 1-2. If you have it stretched out or a large screen, a length of 2-3 will work nice. You just don’t want to have the lines overlapping or it defeats the purpose of a Heat Map. Also, the bigger the linewidth, generally you’ll want to increase the Transparency within the Settings also as it can get quite bright and hurt your eyes over time.
Settings:
MFI:
Show MFI and SMA Crossing Signals: MFI and SMA Crossing is one of the leading Bullish and Bearish Signals in this Indicator. You can also add alerts for these signals.
Plot Amount: How many plots are used in this Heat Map. (2 - 28).
Source: The Source to use in all MFI calculations.
Smooth Initial MFI Length: How much to smooth the Fast and Slow MFI calculation by. 1 = No smoothing.
MFI SMA Length: What length we smooth the MFI Average over to get our MFI SMA.
Machine Learning:
Average MFI data by adding a lookback to the Source: While populating our Heat Map with the MFI's, should use use the Source each MFI Length increase or should we also lookback a Source each MFI Length Increase.
KNN Distance Requirement: To be a valid KNN, it needs to abide by a Distance calculation. Generally only Max is used, but you can change it if it suits your trading style better.
Machine Learning Length: How much ML data should we store? The longer the length generally the smoother the result; which may not be as accurate for something like a Heat Map, so keeping this relatively low may lead to more accurate results.
KNN Length: How many KNN are used in the slice to calculate max/min distance allowed.
Fast Length: Fast MFI length used in KNN to calculate distances by comparing its distance with the Slow MFI Length.
Slow Length: Slow MFI length used in KNN to calculate distances by comparing its distance with the Fast MFI Length.
Smoothing Length: When populating our Heat Map, at what length do we start our MFI calculations with (A Higher value with result in a slower and more smoothed MFI / Heat Map).
Colors:
Change Bar Color: Change bar colors to MFI Avg Color.
Heat Map Transparency: If there isn't any transparency it can be a little hard on the eyes. The Greater the Line Width, generally the more transparency you'll want for your eyes.
Line Width: Set how wide the Heat Map lines are
MFI 90-100 Color: Color when the MFI is between these levels.
MFI 80-89 Color: Color when the MFI is between these levels.
MFI 70-79 Color: Color when the MFI is between these levels.
MFI 60-69 Color: Color when the MFI is between these levels.
MFI 50-59 Color: Color when the MFI is between these levels.
MFI 40-49 Color: Color when the MFI is between these levels.
MFI 30-39 Color: Color when the MFI is between these levels.
MFI 20-29 Color: Color when the MFI is between these levels.
MFI 10-19 Color: Color when the MFI is between these levels.
MFI 0-100 Color: Color when the MFI is between these levels.
If you have any questions, comments, ideas or concerns please don't hesitate to contact us.
HAPPY TRADING!
Hacim
ZWAP (ZigZag Anchored VWAP) [Kioseff Trading]Hello!
Quick script showcasing the new polyline function for Pine Script!
Features
Up to 100 high/low pivot points auto anchored VWAP
Visible range auto anchored VWAP
Curved ZigZag (Adjustable!)
With the new polyline function, auto-anchored VWAP at specific price points is more viable.
When using line.new() only 500 lines can exist on the chart concurrently and, since VWAP is calculated on every update, a "proper" VWAP drawn using line.new() can extend 500 bars at most, to which no additional VWAP lines can be drawn after.
Of course, when using the plot() function a VWAP line will draw on every bar; however, this method isn't highly compatible with auto-anchoring VWAP lines.
However!
A polyline, from beginning to end irrespective of the number of coordinates used, constitutes 1 polyline; 100 can exist simultaneously with 10,000 xy coordinates per line.
The image above shows an attempt to draw the same auto-anchored VWAP lines using the line.new() function. Not an ideal outcome!
The image above shows the same attempt using the polyline.new() function!
Very nice (:
The image above shows the indicator auto anchoring to zig zag turning points.
Subsequent to a new anchoring, VWAP is calculated for the following bars - up to the current bar.
Thank you for checking this out; if you have any ideas to spice it up feel free to comment!
Volumetric Toolkit [LuxAlgo]The Volumetric Toolkit is a complete and comprehensive set of tools that display price action-related analysis methods from volume data.
A total of 4 features are included within the toolkit. Symbols that do not include volume data will not be supported by the script.
🔶 USAGE
The volumetric toolkit puts a heavy focus on price action, returning support/resistance levels, ranges, volume divergences...etc.
The main premise between each feature is that volume has a direct relationship with market participants level of interest over a specific symbol, and that this interest is not constant over time.
Each individual feature is detailed below.
🔹 Ranges Of Interest
The Ranges Of Interest construct a range from a surge of high liquidity in the market. This range is constructed from the price high and price low of the candle with the associated significant liquidity.
The returned extremities can be used as support and resistance, with breakouts often being accompanied by significant liquidity as well, suggesting potential trend continuations.
The length setting associated with this feature determines how sensitive the range detection algorithm is to volume, with higher values requiring more significant volume in order to display a new range.
🔹 Impulses
Impulses highlight times when volume makes a new higher high while the price makes a new higher high or lower low, suggesting increased market participation.
When this occurs when the price makes a new higher high the impulse is considered bullish (green), if the price makes a new lower low the impulse is bearish (red).
Impulses occurring within an established trend opposite to it (e.g a bearish impulse on an uptrend) might be indicative of reversals.
The length setting works similarly to the previously described ranges of interest, with higher values requiring longer-term volume higher high and price higher high/lower low, highlighting more significant impulse and potentially longer-term reversals.
🔹 Levels Of Interest
Levels of interest display price levels of significant trading activity, contrary to the range of interest only the closing price is taken into account, also volume peaks are used to detect significant trading activity.
Note that this feature is subject to backpainting, that is lines are set retrospectively.
Users can determine the amount of most recent levels to display on the chart. These can be used as classical support/resistances.
🔹 Volume Divergence
We define volume divergence as a decreased market participation while a trend is still developing.
More precisely volume divergences are highlighted if volume makes a lower high while price is making a new higher high/lower low.
This can be indicative of a lack of further participation in the current trend, indicating a potential reversal.
Using higher length values will return longer-term divergences.
Note that this feature is subject to backpainting, that is lines are set retrospectively.
🔶 SETTINGS
🔹 Ranges Of Interest
Show Ranges Of Interest: Display Ranges Of Interest.
Length: Ranges Of Interest sensitivity to volume.
🔹 Impulses
Show Impulses: Display Ranges Of Interest.
Length: Impulses sensitivity to volume.
🔹 Levels Of Interest
Show: Determine if Levels Of Interest are displayed, and how many from the most recent.
Length: Level detection sensitivity to volume.
🔹 Volume Divergences
Show Divergences: Determine if Volume Divergences are displayed.
Length: Period for the detection of price tops/bottoms and volume peaks.
Intraday Intensity Index [SyntaxGeek]Intraday Intensity Index
This is a volume-based technical indicator that integrates volume with a security’s price. Use this to follow how intraday highs and lows are moving with volume.
The Intraday Intensity Index was developed by Dave Bostian.
It is one of several indicators that can be used to follow how volume is influencing a security’s price. It provides a continuous volume-focused indicator by using a security’s most recent close, high and low in its calculation while also factoring in volume.
I've searched high and low for the correct implementation of this measure and I can only find it buried within old books or in PineScript's own ta.iii, but no one has provided it as a histogram indicator correctly.
The main difference I can find is that most are not restricting volumes influence to the denominator solely, which is how Dave designed it.
For illustration the correct implementation is:
(2 * close - high - low) / ((high - low) * volume)
Such a simple change but compare to many other indicators that claim to implement the measure and it's easy to see the difference.
I also provided a high/low mode that aims to ease comparison to Bollinger Bands which is something that John Bollinger references when utilizing III.
Setting III to 20 trend and high/low mode can present similar areas of extreme breaks to the high or low and may be great entries for trades but you must complete your own analysis.
Crypto Spot/Futures Dominance Indicator with AlertsFutures/Spot Dominance Indicator:
Overview:
The futures/spot dominance indicator is a versatile tool used by traders and analysts to assess the relative strength or dominance of the futures market in relation to the spot (or cash) market for a specific asset. It offers insights into market sentiment, potential arbitrage opportunities, and risk management while incorporating the VWAP indicator for added context.
How It Works:
This indicator automatically detects and adapts to the futures symbol applied to the chart, simplifying the setup for traders. However, it still necessitates manual input of the corresponding spot pair to ensure accuracy.
Automatic Futures Symbol Detection: The indicator starts by automatically detecting the futures symbol on the trading chart, eliminating the need for manual configuration. This ensures that the indicator is applied to the correct futures contract.
Manual Spot Pair Entry: To provide a reliable reference point for the comparison, traders must manually input the corresponding spot symbol via the indicator's inputs. For instance, if the indicator detects the BTCUSDT.P futures symbol, traders would manually enter the BTCUSDT spot symbol.
Gathering Data: The indicator collects historical price data for both the detected futures contract and the manually specified spot symbol. This data includes open, high, low, and close prices, as well as trading volume.
VWAP Calculation: To gain a deeper understanding of price trends and market dynamics, the indicator calculates the VWAP (Volume Weighted Average Price) for both the futures and spot markets. The VWAP places more weight on prices with higher trading volume, offering a weighted average that reflects market consensus.
Premium/Discount Calculation: By subtracting the VWAP of the spot market from the VWAP of the futures market, the indicator quantifies the premium or discount of the futures price concerning the spot price. A positive value indicates a premium, while a negative value suggests a discount.
Plotting: The premium/discount value is displayed as a line on the chart, often alongside moving averages or other smoothing techniques for improved trend analysis.
Alerts: In addition to its analysis capabilities, this indicator now includes alerts to enhance your trading experience. It alerts you in the following scenarios:
Premium Above Average: Notifies you when the premium crosses above the average line.
Premium Below Average: Alerts you when the premium crosses below the average line.
Premium Above Zero: Provides an alert when the premium crosses above the zero line.
Premium Below Zero: Generates an alert when the premium crosses below the zero line.
Benefits of the Futures/Spot Dominance Indicator:
Sentiment Analysis: Traders use the indicator to assess market sentiment. A futures premium might signify bullish sentiment, while a discount could indicate bearish sentiment.
Arbitrage Opportunities: Identifying price discrepancies between futures and spot markets can help traders spot arbitrage opportunities, where they can profit from price differentials.
Risk Management: The indicator assists in evaluating risks associated with futures positions, helping traders manage their exposure effectively.
Trend Confirmation: When used in conjunction with other technical indicators, futures/spot dominance, along with VWAP, can provide additional confirmation of price trends.
Hedging: Investors and corporations use this tool to gauge the effectiveness of hedging strategies based on futures contracts.
Speculative Trading: Traders and investors use the indicator to inform speculative positions, aligning their trades with perceived market strength or weakness.
Insightful Analysis: Futures/spot dominance analysis, enriched by VWAP data, offers insights into market behavior during specific events or changes in economic conditions.
In summary, the futures/spot dominance indicator, with its integration of VWAP and automatic futures symbol detection, provides traders and investors with a comprehensive tool to assess market dynamics. It aids in sentiment analysis, risk management, and trend confirmation while offering potential arbitrage opportunities. The newly added alerts enhance the indicator's functionality, providing timely notifications of key market events. However, it relies on manual input of the corresponding spot pair to ensure precise comparisons between futures and spot markets. It should be used alongside other analysis techniques for a well-rounded view of the market.
Price Volume DivergencePrice Volume Divergence (PVD) is designed to add extra confluence to volume analysis and mark potential reversals in the prevailing trend.
The script uses a simple correlation of price and volume over the predefined time horizon in "PVD Length".
If the correlation is positive (>0) the plotted line gets coloured blue.
If the correlation is negative (<0) the plotted line get coloured in red.
PVD should not be used on its own but in conjunction with other indicators!
YD_Volume_Alert"YD_Volume_Alert" is a simple alert based on the increasing volume.
Although it is a simple indicator, strategies to determine accumulation and distribution can be developed using this indicator, which will also be published as well.
📌 Usage, Details and Alert
Using this indicator is simple.
You can enter two scales, "Increased Percentage 1 (%)" and "Increased Percentage 2 (%)", with default values set to 200% and 500%.
Signals are displayed in green and red triangles at the bottom of the bar, also printed with the text "Increased Volume" and "Hugely increased Volume".
Alerts are provided as a combination of the chart's symbol and the set percentage. For example,
"BINANCE:BTCUSDT.P 's Volume : 200% increased."
===========================================================
"YD_Volume_Alert" 는 거래량 증가에 따른 얼러트를 제공하는 간단한 지표입니다.
간단한 지표이지만 위 지표를 이용하여 매집과 매도의 타이밍으로 이용하는 전략 또한 개발할 수 있으며, 이 역시도 퍼블리시 할 예정입니다.
📌 사용 예시와 알림 설정
지표를 사용하는 방법은 간단합니다.
"Increased Percentage 1 (%)" 과 "Increased Percentage 2 (%)" 두 가지의 배율을 입력할 수 있으며, 기본값은 200%와 500%로 설정되어 있습니다.
시그널은 바 하단에 초록색, 빨간색 삼각형으로 각각 표시되며, "Increased Volume"과 "Hugely increased Volume"이라는 텍스트가 함께 출력됩니다.
얼러트는 자신이 설정한 차트의 심볼과 설정한 퍼센티지의 조합으로 제공되며 예를 들면 다음과 같습니다.
"BINANCE:BTCUSDT.P 's Volume : 200% increased."
Price Volume Trend Crosses This script is a modified version of the Price Volume Trend ( PVT ) that uses a moving average of the PVT as a signal ( sig ) line.
The length of the signal line can be adjusted as needed by changing the "PVTC Signal Length" value inside the indicator settings menu.
"PVTC Signal Type" allows you to pick between EMA and SMA as the signal line.
Logic behind this script:
If PVT > sig it indicates an bullish environment and gets coloured with the UP color.
If PVT < sig it indicates a bearish environment and get coloured with the DOWN color.
Colors can be modified in the indicator settings menu.
Crosses can be highlighted by ticking the "Highlight Crosses" box in the indicator settings menu.
"Fill Gaps" fills the gap between PVT and sig with the prevailing trends color.
PVTC should not be used on its own but in conjunction with other indicators!
Anchored Moving Average By Market Mindset - Zero To EndlessAnchored Moving Average?
An anchored moving average (AMA) is created when you select a point on the chart and start calculating the moving average from there. Thus the moving average’s denominator is not fixed but cumulative and dynamic.
In this indicator, I've provided three different types of Anchored Moving Averages, viz., WMA, SMA and VWAP.
WMA is relevant if big moves are there.
SMA is relevant if volume data is not to be considered or if it is not available.
VWAP is the standard anchored MA, which is most commontly used. Is consider the volume data along with the price move.
In this indicator, Auto anchor is time based anchor. A trader can opt for Pivot Type Anchor or Volume Type Anchor or some higher resolution based anchor too. The length of the pivot lookback can also be changed by the user.
It can be used for intraday, swing trading and even for technical based investment purpose.
VWAP with CharacterizationThis indicator is a visual representation of the VWAP (Volume Weighted Average Price), it calculates the weighted average price based on trading volume. Essentially, it provides a measure of the average price at which an asset has traded during a given period, but with a particular focus on trading volume. In our case, the indicator calculates the VWAP for the current trading symbol, using a predefined simple moving average (SMA) with a period of 14. This volume-weighted moving average offers a clearer view of the behavior of the VWAP and, of consequence of market dynamics.
One of the distinctive features of this indicator is its ability to provide a more "linear" representation of the data. This means that the data is "smoothed" to remove noise, allowing you to more easily identify the direction of the market trend. This smoother representation is especially useful because the financial market can be subject to significant fluctuations and volatility, and this indicator can help get a more stable view of the trend.
The indicator also offers a visualization of the market trend in a very intuitive way. Using an evaluation of the highs and lows of the last 10 days, determine whether the market is in an uptrend, downtrend, or no trend at all. To make this evaluation even clearer and more immediate, the indicator line is colored dynamically. When the trend is bullish, the line is blue, while in case of a bearish trend, it takes on a distinctive color, such as pink. If the trend is not defined, the line will be colored differently, for example light yellow. This coloration gives traders an immediate visual indication of the prevailing trend, allowing them to make more informed decisions regarding trading operations.
One potential strategy involves watching candles when they cross the VWAP line strongly. If, for example, a candlestick breaks above the VWAP line, we may look for retest areas near key support levels to gauge a potential long entry. In other words, we would consider that the price may have the potential to rise further after breaking above the VWAP line, and we would look to enter a long position to take advantage of this opportunity.
On the other hand, if a candlestick crosses below the VWAP line, we might consider looking for retest areas near the VWAP line itself, which now serves as potential resistance. This could indicate a possible short entry opportunity, as the price may struggle to break above the resistance represented by the VWAP line after breaking it down. In this case, we would look to take advantage of the expected continuation of the downtrend.
In both cases, the idea is to exploit significant movements across the VWAP line as signals of potential reversal or continuation of the trend. This strategy can help identify key entry points based on price behavior relative to the VWAP line.
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 实现 :)
Smart Money IndicatorSmart Money Indicator
Overview:
The "Smart Money Indicator" is a custom Pine Script indicator designed to help traders identify potential instances of "smart money" or institutional activity in the financial markets. The concept of "smart money" suggests that institutional investors or sophisticated market participants may have an edge due to their access to resources, information, and analytical tools.
Indicator Features:
Volume Moving Average: The indicator calculates a simple moving average (SMA) of the trading volume over a specified length (default is 20 bars). This moving average serves as a baseline for evaluating current trading volume.
Smart Money Signals: The indicator plots green triangles below the price bars when the current trading volume is significantly higher (50% above) than the moving average. This is intended to highlight potential instances of "smart money" activity.
Dumb Money Signals: Conversely, the indicator plots red triangles above the price bars when the current trading volume is significantly lower (50% below) than the moving average. This is meant to indicate potential "dumb money" activity.
How to Use:
Traders can use this indicator to identify potential shifts in market sentiment driven by institutional activity. When the green "Smart Money" triangles appear, it may suggest increased institutional interest or significant trading volume, potentially signaling a noteworthy market event. Conversely, red "Dumb Money" triangles may indicate periods of reduced institutional activity.
Disclaimer:
It's important to note that this indicator is a simplified representation of the concept of "smart money" and should be used in conjunction with other technical and fundamental analysis tools. Trading decisions should not be based solely on this indicator, and thorough research and due diligence are essential before making trading or investment decisions.
Customization:
Traders can customize the indicator by adjusting the length of the volume moving average to match their trading preferences and strategies. Experimentation and fine-tuning may be necessary to optimize its performance for specific markets and timeframes.
YinYang RSI Volume Trend StrategyThere are many strategies that use RSI or Volume but very few that take advantage of how useful and important the two of them combined are. This strategy uses the Highs and Lows with Volume and RSI weighted calculations on top of them. You may be wondering how much of an impact Volume and RSI can have on the prices; the answer is a lot and we will discuss those with plenty of examples below, but first…
How does this strategy work?
It’s simple really, when the purchase source crosses above the inner low band (red) it creates a Buy or Long. This long has a Trailing Stop Loss band (the outer low band that's also red) that can be adjusted in the Settings. The Stop Loss is based on a % of the inner low band’s price and by default it is 0.1% lower than the inner band’s price. This Stop Loss is not only a stop loss but it can also act as a Purchase Available location.
You can get back into a trade after a stop loss / take profit has been hit when your Reset Purchase Availability After condition has been met. This can either be at Stop Loss, Entry or None.
It is advised to allow it to reset in case the stop loss was a fake out but the call was right. Sometimes it may trigger stop loss multiple times in a row, but you don’t lose much on stop loss and you gain lots when the call is right.
The Take Profit location is the basis line (white). Take Profit occurs when the Exit Source (close, open, high, low or other) crosses the basis line and then on a different bar the Exit Source crosses back over the basis line. For example, if it was a Long and the bar’s Exit Source closed above the basis line, and then 2 bars later its Exit Source closed below the basis line, Take Profit would occur. You can disable Take Profit in Settings, but it is very useful as many times the price will cross the Basis and then correct back rather than making it all the way to the opposing zone.
Longs:
If for instance your Long doesn’t need to Take Profit and instead reaches the top zone, it will close the position when it crosses above the inner top line (green).
Please note you can change the Exit Source too which is what source (close, open, high, low) it uses to end the trades.
The Shorts work the same way as the Long but just opposite, they start when the purchase source crosses under the inner upper band (green).
Shorts:
Shorts take profit when it crosses under the basis line and then crosses back.
Shorts will Stop loss when their outer upper band (green) is crossed with the Exit Source.
Short trades are completed and closed when its Exit Source crosses under the inner low red band.
So, now that you understand how the strategy works, let’s discuss why this strategy works and how it is profitable.
First we will discuss Volume as we deem it plays a much bigger role overall and in our strategy:
As I’m sure many of you know, Volume plays a huge factor in how much something moves, but it also plays a role in the strength of the movement. For instance, let’s look at two scenarios:
Bitcoin’s price goes up $1000 in 1 Day but the Volume was only 10 million
Bitcoin’s price goes up $200 in 1 Day but the Volume was 40 million
If you were to only look at the price, you’d say #1 was more important because the price moved x5 the amount as #2, but once you factor in the volume, you know this is not true. The reason why Volume plays such a huge role in Price movement is because it shows there is a large Limit Order battle going on. It means that both Bears and Bulls believe that price is a good time to Buy and Sell. This creates a strong Support and Resistance price point in this location. If we look at scenario #2, when there is high volume, especially if it is drastically larger than the average volume Bitcoin was displaying recently, what can we decipher from this? Well, the biggest take away is that the Bull’s won the battle, and that likely when that happens we will see bullish movement continuing to happen as most of the Bears Limit Orders have been fulfilled. Whereas with #2, when large price movement happens and Bitcoin goes up $1000 with low volume what can we deduce? The main takeaway is that Bull’s pressured the price up with Market Orders where they purchased the best available price, also what this means is there were very few people who were wanting to sell. This generally dictates that Whale Limit orders for Sells/Shorts are much higher up and theres room for movement, but it also means there is likely a whale that is ready to dump and crash it back down.
You may be wondering, what did this example have to do with YinYang RSI Volume Trend Strategy? Well the reason we’ve discussed this is because we use Volume multiple times to apply multiplications in our calculations to add large weight to the price when there is lots of volume (this is applied both positively and negatively). For instance, if the price drops a little and there is high volume, our strategy will move its bounds MUCH lower than the price actually dropped, and if there was low volume but the price dropped A LOT, our strategy will only move its bounds a little. We believe this reflects higher levels of price accuracy than just price alone based on the examples described above.
Don’t believe us?
Here is with Volume NOT factored in (VWMA = SMA and we remove our Volume Filter calculation):
Which produced -$2880 Profit
Here is with our Volume factored in:
Which produced $553,000 (55.3%)
As you can see, we wen’t from $-2800 profit with volume not factored to $553,000 with volume factored. That's quite a big difference! (Please note previous success does not predict future success we are simply displaying the $ amounts as example).
Now how about RSI and why does it matter in this strategy?
As I’m sure most of you are aware, RSI is one of the leading indicators used in trading. For this reason we figured it would only make sense to incorporate it into our calculations. We fiddled with RSI for quite awhile and sometimes what logically seems to be the right way to use it isn’t. Now, because of this, our RSI calculation is a little odd, but basically what we’re doing is we calculate the RSI, then turn it into a percentage (between 0-1) that can easily be multiplied to the price point we need. The price point we use is the difference between our high purchase zone and our low purchase zone. This allows us to see how much price movement there is between zones. We multiply our zone size with our RSI multiplication and we get the amount we will add +/- to our basis line (white line). This officially creates the NEW high and low purchase zones that we are actually using and displaying in our trades.
If you found that confusing, here are some examples to why it is an important calculation for this strategy:
Before RSI factored in:
Which produced 27.8% Profit
After RSI factored in:
Which produced 553% Profit
As you can see, the RSI makes not only the purchase zones more accurate, but it also greatly increases the profit the strategy is able to make. It also helps ensure an relatively linear profit slope so you know it is reliable with its trades.
This strategy can work on pretty much anything, but you should tweak the values a bit for each pair you are trading it with for best results.
We hope you can find some use out of this simple but effective strategy, if you have any questions, comments or concerns please let us know.
HAPPY TRADING!
Buy Sell Volume SeparateDescription:
The script is designed to provide traders with a unique and comprehensive analysis of trading volume dynamics. Unlike existing scripts, the script offers a distinct advantage by presenting both buy and sell volumes on separate scales, simplifying trading decisions.
Key Features:
1. Dual Volume Scales: The script provides two separate volume scales, one for buy volumes and another for sell volumes. This separation allows to easily distinguish between buying and selling pressure, aiding in more precise trade entries and exits.
2. Clear and Intuitive Chart: The script ensures that the chart it generates is clean and easy to understand. The buy and sell volumes are color-coded for clarity, and you can quickly identify significant volume spikes and trends.
How to Use:
1. Adding the Script: To use the script, simply add it to your TradingView chart.
2. Interpreting Buy and Sell Volumes: On the chart, you will see two separate volume scales—one for buy volumes and one for sell volumes. Green bars represent buying pressure, while red bars indicate selling pressure. Pay attention to the relative strengths and patterns of these bars to gauge market sentiment.
3. Informed Trading Decisions: Armed with insights into both buy and sell volumes, you can make more informed trading decisions. Look for divergences, patterns, or significant volume spikes to identify potential entry and exit points.
Volume Crossover StrategyThis script shows us the strength and acceleration of the trend, not the direction. ! . The indicator is built on the collision of two volumes (the collision of one-hour and four-hour volumes), where as a result one upward arrow shows us (acceleration, pressing the gas on the pedal), and the downward one shows deceleration (i.e. braking).
Recommendation: Be sure to attach:
a) any trend direction indicator (SMA, EMA), through which we will have an idea where the market is going and going:
b) volatility indicator
c) AD accumulation distribution (let's have a real picture, is there a buying or selling trend)
It is suitable for a one-hour timeframe
P.S. The script does not make any guarantee of profit, it is published only for the purpose of sharing my opinion about this strategy.
an hour ago
Comment:
The green signal is the start of the marathon, and the red signal is the end. For example, if the downward trend has ended (we can see it through the blue signal), it does not mean that the next marathon will necessarily be a reflected trend. It is not excluded that the next marathon will also develop on a downward trend...and therefore in the opposite case as well..
Supply Demand Profiles [LuxAlgo]The Supply Demand Profiles is a charting tool that measures the traded volume at all price levels on the market over a specified time period and highlights the relationship between the price of a given asset and the willingness of traders to either buy or sell it, in other words, highlights key concepts as significant supply & demand zones, the distribution of the traded volume, and market sentiment at specific price levels within a specified time period, allowing traders to reveal dominant and/or significant price levels and to analyze the trading activity of a particular user-selected range.
In other words, this tool highlights key concepts as significant supply & demand zones, the distribution of the traded volume, and market sentiment at specific price levels within a specified time period, allowing traders to reveal dominant and/or significant price levels and to analyze the trading activity of a particular user-selected range.
Besides having the tool as a combo tool, the uniqueness of this version of the tool compared to its early versions is its ability to benefit from different volume data sources and its ability to use a variety of different polarity methods, where polarity is a measure used to divide the total volume into either up volume (trades that moved the price up) or down volume (trades that moved the price down).
🔶 USAGE
Supply & demand zones are presented as horizontal zones across the selected range, hence adding the ability to visualize the price interaction with them
By default, the right side of the profile is the volume profile which highlights the distribution of the traded activity at different price levels, emphasizing the value area, the range of price levels in which the specified percentage of all volume was traded during the time period, and levels of significance, such as developing point of control line, value area high/low lines, and profile high/low labels
The left side of the profile is the sentiment profile which highlights the market sentiment at specific price levels
🔶 DETAILS
🔹 Volume data sources
The users have the option to select volume data sources as either 'volume' (regular volume) or 'volume delta', where volume represents all the recorded trades that occur at a given bar and volume delta is the difference between the buying and the selling volume, that is, the net demand at a given bar
🔹 Polarity methods
The users are able to choose the methods of how the tool to take into consideration the polarity of the bar (the direction of a bar, green (bullish) or red (bearish) bar) among a variety of different options, such as 'bar polarity', 'bar buying/selling pressure', 'intrabar (chart bars at a lower timeframe than the chart's) polarity', 'intrabar buying/selling pressure', and 'heikin ashi bar polarity'.
Finally, the interactive mode of the tool is activated, as such users can easily modify the intervals of their interest just by selecting the indicator and moving the points on the chart
🔶 SETTINGS
The script takes into account user-defined parameters and plots the profiles and zones
🔹 Calculation Settings
Volume Data Source and Polarity: This option is to set the desired volume data source and polarity method
Lower Timeframe Precision: This option is applicable in case any of the 'Intrabar (LTF)' options are selected, please check the tooltip for further details
Value Area Volume %: Specifies the percentage for the value area calculation
🔹 Presentation Settings
Supply & Demand Zones: Toggles the visibility of the supply & demand zones
Volume Profile: Toggles the visibility of the volume profile
Sentiment Profile: Toggles the visibility of the sentiment profile
🔹 Presentation, Others
Value Area High (VAH): Toggles the visibility of the VAH line and color customization option
Point of Control (POC): Toggles the visibility of the developing POC line and color customization option
Value Area Low (VAL): Toggles the visibility of the VAL line and color customization option
🔹 Supply & Demand, Others
Supply & Demand Threshold %: This option is used to set the threshold value to determine supply & demand zones
Supply/Demand Zones: Color customization option
🔹 Volume Profile, Others
Profile, Up/Down Volume: Color customization option
Value Area, Up/Down Volume: Color customization option
🔹 Sentiment Profile, Others
Sentiment, Bullish/Bearish: Color customization option
Value Area, Bullish/Bearish: Color customization option
🔹 Others
Number of Rows: Specify how many rows the profile will have
Placment: Specify where to display the profile
Profile Width %: Alters the width of the rows in the profile, relative to the profile range
Profile Price Levels: Toggles the visibility of the profile price levels
Profile Background, Color: Fills the background of the profile range
Value Area Background, Color: Fills the background of the value area range
Start Calculation/End Calculation: The tool is interactive, where the user may modify the range by selecting the indicator and moving the points on the chart or can set the start/end time using these options
🔶 RELATED SCRIPTS
Volume-Profile
Volume-Profile-Maps
Volume-Delta
Hoffman Heiken BiasThis indicator uses a couple of different things including the Hoffman moving averages applied with heiken ashi bar data and some volatility to help determine when the bias of the market has shifted for the timeframe you are looking at.
Kviatek - Multi Hour VWAPThis is an experimental script, that plots 24 VWAPs, each starting at a new hour and lasting for 24hours.
After using session anchored VWAPs i kept wondering if the price reacts to VWAPs that begin at periods lower than sessions.
Color of each VWAP changes upon crossovers of the following VWAP, giving us an understanding of trends and whether we're trading with the trend or against it.
By the nature of the script I recommend using it on low timeframes, 5 and 15-minute ones ideally.
Volume HeatMap With Profile [ChartPrime]The Volume Heatmap with Profile indicator is a tool designed to provide traders with a comprehensive view of market activity through customizable visualizations. This indicator goes beyond traditional volume analysis by offering a range of adjustable parameters and features that enhance analysis of volume and give a cleaner experience when analyzing it.
To get started click the start and end time for the profile.
Key Features:
Extended Calculation: This indicator extends its calculation to the last bar, ensuring that the user has insights into current market dynamics.
Point of Control (POC): Easily identify the price level at which the highest trading activity has occurred, helping the user pinpoint potential reversal points and significant support/resistance zones.
VWAP Point of Control: Display the Volume Weighted Average Price (VWAP) Point of Control, giving the user a clear reference for determining the average price traders are paying and potential price reversals.
Adjustable Colors for Heatmap: Change the heatmap colors to the users preference, allowing the user to match the indicator's appearance to their chart style and personal visual preferences.
Forecasted Zone: This feature allows traders to forecast areas of high activity by providing the option to adjust colors within this zone. This feature assists in identifying potential breakouts or areas where increased trading volume is anticipated.
Volume Profile: Customize the colors of the volume profile to make it distinct and easily distinguishable on the chart.
Adjustable Volume Levels: Specify the number volume levels that are most relevant to your trading strategy.
Adjustable Placement for Volume Profile: Position the volume profile on the chart. Whether the user prefers it on the left, right, or at the center of the chart, this indicator offers placement flexibility.
The ratio of bull vs bear volume is plotted on the outside of the range indicating how bullish or bearish price action is in a given range.
Tops & Bottoms by Volume [SS]Hey everyone,
Releasing this indicator that helps you time entries by alerting to potential tops and bottoms in the market.
Background to the indicator:
I was playing around with things that signalled reversals / tops and bottoms in SPSS and R using Pivot Points to mark tops and bottoms. Happened to come across a generally statistically significant relationship between sell to buy volume that was tracked over 10 to 50 candles back and pivot highs and pivot lows.
So I put it into a beta version of an indicator to see how it looked and was a bit surprised.
Since then, I have went back and narrowed down the details of what works/what doesn't work and this is the tentative result!
What it does / How to Use:
It tracks the cumulative buy vs sell volume. Buy volume is cumulated as close > open (or green candles) and sell is open > close (or red candles).
It then cumulates this over a user-defined period (defaulted to 14). It then looks back to see the highest vs lowest areas of sell and buy volume and makes determinations based on this relationship.
The relationship was determined by me using my own analysis and programmed into the indicators algorithm (using highest vs lowest function in pine).
It will plot areas of potential reversal to the upside as green on the histogram or red for a downside reversal. Once this becomes significant enough to signal an actual bottom or top, it will then change the SMA colour from white to green (for bottom) or red (for top).
Your entries generally should be once the SMA turns back to white. So from green to white, you would enter long or inverse for red to white (enter short).
Settings and Customizability:
Here are the key points to keep in mind if you are using this indicator:
Your lookback length should be between 10 to 50. I have left it open for you to modify it below and above this lookback period; however, this is the major periods deemed to be significant in identifying tops and bottoms. Thus, I advise against operating outside of those parameters.
You can toggle between smoothed look or historgram with SMA. The strength in this indicator comes from using the SMA and watching the SMA for signals of reversals, so if you want to filter out the background noise, you can simply look at the plotted SMA. If you want a more responsive indication of impending reversals, leave the smoothed option off and view the histogram in conjunction with the SMA.
The indicator will change the candle colour to red for bearish reversal and green to bullish reversal. This is based on the SMA. You can toggle this off and/or on as desired.
It is recommended to leave ETH (extended trading hours) turned off and RTH turned on.
Please read the instructions carefully.
If you require further assistance, I have posted a tutorial video.
Please be sure you are reading and/or watching carefully.
If you have questions, please feel free to post them below. But bear in mind I likely will not respond if it is already addressed in the description above (this happens often).
Also, feel free to leave your comments or suggestions below as well.
Thanks for checking this out. If you are interested in volume based trading, I suggest also checking out my Buyer to Seller volume indicator which cumulates total buying vs selling volume over a designated lookback period. Both of these used in conjunction are very powerful tools for volume based traders! ( Available here )
NOTE:
The boxes drawn in the chart are my own for demonstration purposes. I unfortunately cannot get the indicator to overlay the boxes on the chart in a separate viewing pane. That is why I opted to use the barcolor function to change the candle color instead :-).
Thanks again everyone and safe trades!
Volume Traded in Total Outstanding Shares with basic fundamentalThis indicator helps to find Volume Traded in Total Outstanding Shares with basic fundamental parameters like MCAP, EPS, PE, D2E and No. Equity shares.
Volume EntropyKey Components :
📍 Natural Logarithm Function : The script starts by employing a custom Taylor Series approximation for natural logarithms. This function serves to calculate entropy with higher accuracy than conventional methods, laying the foundation for further calculations.
📍 Entropy Calculation : The core of this indicator is its entropy function. It employs the custom natural log function to compute the randomness of the trading volume over a user-defined micro-pattern length, offering insights into market stability or volatility.
📍 Micro-Pattern Length : This is the parameter that sets the stage for the level of detail in the entropy calculation. Users can adjust it to suit different time frames or market conditions, thus customizing the indicator's sensitivity to randomness in trading volume.
Kviatek - Multi Day VWAPThis indicator plots VWAPs anchored to each day of the week.
VWAPs are considered "fair price" for both sellers and buyers and it's often times where the liquidity is found.
From my trading I noticed how often times price likes to come back to the daily VWAP from the previous week, especially at the beginning and end of each week.
For example, if we enter a long on Friday, last Friday's VWAP tends to act as a target for the price.
Another use for it is to get an understanding of how the trend develops throughout the week.
If the following day's VWAP is above the previous day's VWAP - we have a trend continuation.