Auto Volume Spread Analysis (VSA) [TANHEF]Auto Volume Spread Analysis (visible volume and spread bars auto-scaled): Understanding Market Intentions through the Interpretation of Volume and Price Movements.
All the sections below contain the same descriptions as my other indicator "Volume Spread Analysis" with the exception of 'Auto Scaling'.
█ Auto-Scaling
This indicator auto-scales spread bars to match the visible volume bars, unlike the previous "Volume Spread Analysis " version which limited the number of visible spread bars to a fixed count. The auto-scaling feature allows for easier navigation through historical data, enabling both more historical spread bars to be viewed and more historical VSA pattern labels being displayed without requiring using the bar replay tool. Please note that this indicator’s auto-scaling feature recalculates the visible bars on the chart, causing the indicator to reload whenever the chart is moved.
Auto-scaled spread bars have two display options (set via 'Spread Bars Method' setting):
Lines: a bar lookback limit of 500 bars.
Polylines: no bar lookback limit as only plotted on visible bars on chart, which uses multiple polylines are used.
█ Simple Explanation:
The Volume Spread Analysis (VSA) indicator is a comprehensive tool that helps traders identify key market patterns and trends based on volume and spread data. This indicator highlights significant VSA patterns and provides insights into market behavior through color-coded volume/spread bars and identification of bars indicating strength, weakness, and neutrality between buyers and sellers. It also includes powerful volume and spread forecasting capabilities.
█ Laws of Volume Spread Analysis (VSA):
The origin of VSA begins with Richard Wyckoff, a pivotal figure in its development. Wyckoff made significant contributions to trading theory, including the formulation of three basic laws:
The Law of Supply and Demand: This fundamental law states that supply and demand balance each other over time. High demand and low supply lead to rising prices until demand falls to a level where supply can meet it. Conversely, low demand and high supply cause prices to fall until demand increases enough to absorb the excess supply.
The Law of Cause and Effect: This law assumes that a 'cause' will result in an 'effect' proportional to the 'cause'. A strong 'cause' will lead to a strong trend (effect), while a weak 'cause' will lead to a weak trend.
The Law of Effort vs. Result: This law asserts that the result should reflect the effort exerted. In trading terms, a large volume should result in a significant price move (spread). If the spread is small, the volume should also be small. Any deviation from this pattern is considered an anomaly.
█ Volume and Spread Analysis Bars:
Display: Volume and spread bars that consist of color coded levels, with the spread bars scaled to match the volume bars. A displayable table (Legend) of bar colors and levels can give context and clarify to each volume/spread bar.
Calculation: Levels are calculated using multipliers applied to moving averages to represent key levels based on historical data: low, normal, high, ultra. This method smooths out short-term fluctuations and focuses on longer-term trends.
Low Level: Indicates reduced volatility and market interest.
Normal Level: Reflects typical market activity and volatility.
High Level: Indicates increased activity and volatility.
Ultra Level: Identifies extreme levels of activity and volatility.
This illustrates the appearance of Volume and Spread bars when scaled and plotted together:
█ Forecasting Capabilities:
Display: Forecasted volume and spread levels using predictive models.
Calculation: Volume and Spread prediction calculations differ as volume is linear and spread is non-linear.
Volume Forecast (Linear Forecasting): Predicts future volume based on current volume rate and bar time till close.
Spread Forecast (Non-Linear Dynamic Forecasting): Predicts future spread using a dynamic multiplier, less near midpoint (consolidation) and more near low or high (trending), reflecting non-linear expansion.
Moving Averages: In forecasting, moving averages utilize forecasted levels instead of actual levels to ensure the correct level is forecasted (low, normal, high, or ultra).
The following compares forecasted volume with actual resulting volume, highlighting the power of early identifying increased volume through forecasted levels:
█ VSA Patterns:
Criteria and descriptions for each VSA pattern are available as tooltips beside them within the indicator’s settings. These tooltips provide explanations of potential developments based on the volume and spread data.
Signs of Strength (🟢): Patterns indicating strong buying pressure and potential market upturns.
Down Thrust
Selling Climax
No Effort ➤ Bearish Result
Bearish Effort ➤ No Result
Inverse Down Thrust
Failed Selling Climax
Bull Outside Reversal
End of Falling Market (Bag Holder)
Pseudo Down Thrust
No Supply
Signs of Weakness (🔴): Patterns indicating strong selling pressure and potential market downturns.
Up Thrust
Buying Climax
No Effort ➤ Bullish Result
Bullish Effort ➤ No Result
Inverse Up Thrust
Failed Buying Climax
Bear Outside Reversal
End of Rising Market (Bag Seller)
Pseudo Up Thrust
No Demand
Neutral Patterns (🔵): Patterns indicating market indecision and potential for continuation or reversal.
Quiet Doji
Balanced Doji
Strong Doji
Quiet Spinning Top
Balanced Spinning Top
Strong Spinning Top
Quiet High Wave
Balanced High Wave
Strong High Wave
Consolidation
Bar Patterns (🟡): Common candlestick patterns that offer insights into market sentiment. These are required in some VSA patterns and can also be displayed independently.
Bull Pin Bar
Bear Pin Bar
Doji
Spinning Top
High Wave
Consolidation
This demonstrates the acronym and descriptive options for displaying bar patterns, with the ability to hover over text to reveal the descriptive text along with what type of pattern:
█ Alerts:
VSA Pattern Alerts: Notifications for identified VSA patterns at bar close.
Volume and Spread Alerts: Alerts for confirmed and forecasted volume/spread levels (Low, High, Ultra).
Forecasted Volume and Spread Alerts: Alerts for forecasted volume/spread levels (High, Ultra) include a minimum percent time elapsed input to reduce false early signals by ensuring sufficient bar time has passed.
█ Inputs and Settings:
Indicator Bar Color: Select color schemes for bars (Normal, Detail, Levels).
Indicator Moving Average Color: Select schemes for bars (Fill, Lines, None).
Price Bar Colors: Options to color price bars based on VSA patterns and volume levels.
Legend: Display a table of bar colors and levels for context and clarity of volume/spread bars.
Forecast: Configure forecast display and prediction details for volume and spread.
Average Multipliers: Define multipliers for different levels (Low, High, Ultra) to refine the analysis.
Moving Average: Set volume and spread moving average settings.
VSA: Select the VSA patterns to be calculated and displayed (Strength, Weakness, Neutral).
Bar Patterns: Criteria for bar patterns used in VSA (Doji, Bull Pin Bar, Bear Pin Bar, Spinning Top, Consolidation, High Wave).
Colors: Set exact colors used for indicator bars, indicator moving averages, and price bars.
More Display Options: Specify how VSA pattern text is displayed (Acronym, Descriptive), positioning, and sizes.
Alerts: Configure alerts for VSA patterns, volume, and spread levels, including forecasted levels.
█ Usage:
The Volume Spread Analysis indicator is a helpful tool for leveraging volume spread analysis to make informed trading decisions. It offers comprehensive visual and textual cues on the chart, making it easier to identify market conditions, potential reversals, and continuations. Whether analyzing historical data or forecasting future trends, this indicator provides insights into the underlying factors driving market movements.
Visible
Hide Active Candle [SteinG]Hide Active Candle
An essential tool for disciplined traders seeking to avoid making hasty decisions based on active bars that have not yet closed.
Have you ever found yourself eagerly anticipating an entry, only to be tempted by an active candle that starts to pull away? Or perhaps you've been caught in a trade where an active candle pushes against you, stirring unease and uncertainty. Fear not, for we have a solution!
"Hide Active Candle" is a simple Pine Script indicator designed to ghost the active bar on your chart, reinforcing the importance of patiently waiting for its closure before making any trading decisions. By masking the active candle, this indicator serves as a constant reminder to exercise caution and to base your actions on solid, confirmed information.
To make the most of this powerful tool, ensure that you are using a candlestick chart, as this script operates optimally within that framework. Follow these simple steps to get started:
1. Right-click on your chart and select "Settings..."
2. From the drop-down menu, choose "Symbol" under the "Chart Settings" section.
3. Disable every item in the list to fully utilize the capabilities of "Hide Active Candle."
But wait, there's more! We understand that each trader has unique preferences and requirements. That's why we've included customizable settings within the script to tailor it to your specific needs. You have the option to adjust the following parameters:
- Countdown seconds left : Specify the number of seconds before the bar closes when the current candle becomes visible.
- Bull candle color : Select the color that represents bullish candles on your chart.
- Bear candle color : Choose the color that indicates bearish candles.
- Equal candle color : Define the color for Doji star candles.
- Theme : Opt for a dark or light theme, as the active candle mask will be based on your chosen theme.
- Custom hidden color : Personalize the mask color according to your preferences.
By fine-tuning these settings, you can create a trading environment that perfectly suits your style and enhances your decision-making process.
VisibleChart█ OVERVIEW
This library is a Pine programmer’s tool containing functions that return values calculated from the range of visible bars on the chart.
This is now possible in Pine Script™ thanks to the recently-released chart.left_visible_bar_time and chart.right_visible_bar_time built-ins, which return the opening time of the leftmost and rightmost bars on the chart. These values update as traders scroll or zoom their charts, which gives way to a class of indicators that can dynamically recalculate and draw visuals on visible bars only, as users scroll or zoom their charts. We hope this library's functions help you make the most of the world of possibilities these new built-ins provide for Pine scripts.
For an example of a script using this library, have a look at the Chart VWAP indicator.
█ CONCEPTS
Chart properties
The new chart.left_visible_bar_time and chart.right_visible_bar_time variables return the opening time of the leftmost and rightmost bars on the chart. They are only two of many new built-ins in the `chart.*` namespace. See this blog post for more information, or look them up by typing "chart." in the Pine Script™ Reference Manual .
Dynamic recalculation of scripts on visible bars
Any script using chart.left_visible_bar_time or chart.right_visible_bar_time acquires a unique property, which triggers its recalculation when traders scroll or zoom their charts in such a way that the range of visible bars on the chart changes. This library's functions use the two recent built-ins to derive various values from the range of visible bars.
Designing your scripts for dynamic recalculation
For the library's functions to work correctly, they must be called on every bar. For reliable results, assign their results to global variables and then use the variables locally where needed — not the raw function calls.
Some functions like `barIsVisible()` or `open()` will return a value starting on the leftmost visible bar. Others such as `high()` or `low()` will also return a value starting on the leftmost visible bar, but their correct value can only be known on the rightmost visible bar, after all visible bars have been analyzed by the script.
You can plot values as the script executes on visible bars, but efficient code will, when possible, create resource-intensive labels, lines or tables only once in the global scope using var , and then use the setter functions to modify their properties on the last bar only. The example code included in this library uses this method.
Keep in mind that when your script uses chart.left_visible_bar_time or chart.right_visible_bar_time , your script will recalculate on all bars each time the user scrolls or zooms their chart. To provide script users with the best experience you should strive to keep calculations to a minimum and use efficient code so that traders are not always waiting for your script to recalculate every time they scroll or zoom their chart.
Another aspect to consider is the fact that the rightmost visible bar will not always be the last bar in the dataset. When script users scroll back in time, a large portion of the time series the script calculates on may be situated after the rightmost visible bar. We can never assume the rightmost visible bar is also the last bar of the time series. Use `barIsVisible()` to restrict calculations to visible bars, but also consider that your script can continue to execute past them.
Look first. Then leap.
█ FUNCTIONS
The library contains the following functions:
barIsVisible()
Condition to determine if a given bar is within the users visible time range.
Returns: (bool) True if the the calling bar is between the `chart.left_visible_bar_time` and the `chart.right_visible_bar_time`.
high()
Determines the value of the highest `high` in visible bars.
Returns: (float) The maximum high value of visible chart bars.
highBarIndex()
Determines the `bar_index` of the highest `high` in visible bars.
Returns: (int) The `bar_index` of the `high()`.
highBarTime()
Determines the bar time of the highest `high` in visible bars.
Returns: (int) The `time` of the `high()`.
low()
Determines the value of the lowest `low` in visible bars.
Returns: (float) The minimum low value of visible chart bars.
lowBarIndex()
Determines the `bar_index` of the lowest `low` in visible bars.
Returns: (int) The `bar_index` of the `low()`.
lowBarTime()
Determines the bar time of the lowest `low` in visible bars.
Returns: (int) The `time` of the `low()`.
open()
Determines the value of the opening price in the visible chart time range.
Returns: (float) The `open` of the leftmost visible chart bar.
close()
Determines the value of the closing price in the visible chart time range.
Returns: (float) The `close` of the rightmost visible chart bar.
leftBarIndex()
Determines the `bar_index` of the leftmost visible chart bar.
Returns: (int) A `bar_index`.
rightBarIndex()
Determines the `bar_index` of the rightmost visible chart bar.
Returns: (int) A `bar_index`
bars()
Determines the number of visible chart bars.
Returns: (int) The number of bars.
volume()
Determines the sum of volume of all visible chart bars.
Returns: (float) The cumulative sum of volume.
ohlcv()
Determines the open, high, low, close, and volume sum of the visible bar time range.
Returns: ( ) A tuple of the OHLCV values for the visible chart bars. Example: open is chart left, high is the highest visible high, etc.
chartYPct(pct)
Determines a price level as a percentage of the visible bar price range, which depends on the chart's top/bottom margins in "Settings/Appearance".
Parameters:
pct : (series float) Percentage of the visible price range (50 is 50%). Negative values are allowed.
Returns: (float) A price level equal to the `pct` of the price range between the high and low of visible chart bars. Example: 50 is halfway between the visible high and low.
chartXTimePct(pct)
Determines a time as a percentage of the visible bar time range.
Parameters:
pct : (series float) Percentage of the visible time range (50 is 50%). Negative values are allowed.
Returns: (float) A time in UNIX format equal to the `pct` of the time range from the `chart.left_visible_bar_time` to the `chart.right_visible_bar_time`. Example: 50 is halfway from the leftmost visible bar to the rightmost.
chartXIndexPct(pct)
Determines a `bar_index` as a percentage of the visible bar time range.
Parameters:
pct : (series float) Percentage of the visible time range (50 is 50%). Negative values are allowed.
Returns: (float) A time in UNIX format equal to the `pct` of the time range from the `chart.left_visible_bar_time` to the `chart.right_visible_bar_time`. Example: 50 is halfway from the leftmost visible bar to the rightmost.
whenVisible(src, whenCond, length)
Creates an array containing the `length` last `src` values where `whenCond` is true for visible chart bars.
Parameters:
src : (series int/float) The source of the values to be included.
whenCond : (series bool) The condition determining which values are included. Optional. The default is `true`.
length : (simple int) The number of last values to return. Optional. The default is all values.
Returns: (float ) The array ID of the accumulated `src` values.
avg(src)
Gathers values of the source over visible chart bars and averages them.
Parameters:
src : (series int/float) The source of the values to be averaged. Optional. Default is `close`.
Returns: (float) A cumulative average of values for the visible time range.
median(src)
Calculates the median of a source over visible chart bars.
Parameters:
src : (series int/float) The source of the values. Optional. Default is `close`.
Returns: (float) The median of the `src` for the visible time range.
vVwap(src)
Calculates a volume-weighted average for visible chart bars.
Parameters:
src : (series int/float) Source used for the VWAP calculation. Optional. Default is `hlc3`.
Returns: (float) The VWAP for the visible time range.
Market Profile Visible RangeSup TV, 2 important points .
1) surprisingly, it's the first MP Visible Range script on TV;
2) This one doesn't use any bagging/binning*, instead each row represents the time spent on the actual minimal price steps (aka ticks).
The script will be further extended with usual market profile related functionally in future updates. At this point we have:
- Profile itself (each row represents how many bars touch the given price);
- Mode of the profile (called POC)**;
* Still it will be introduced in future when I will find / design the proper aggregating technique. It is vital for processing very wide price ranges (for example, 500 days on ES futures).
** The script correctly calculates POC by finding all the modes in the data & choosing the closest one to data's midrange.
For this kind of technical instrument finally it was more convenient to use Pine Script 5 (btw it's my first Pine 5).
Basically this script is a side-effect of another R&D I'm doing, the stuff is useful tho so let's go.
By choosing length we both specify the amount of data to be processed & the profile's location screen-wise. It's pretty cool and & useful, on my screen it's always almost touching the left side and still always visible.
The code is heavily commented in order to be understood fast, nothing fantastic, just a lil patience required this time.
Rationale
Market & volume profiles are well known concepts, lotta info available, the most important point of all that is that MP is just another way of visualizing data that lets you notice things you don't usually notice on sequential charts. From my side I can only add that it's better to use your own brain for thinking and reconsidering using volume profile in all the cases, especially on decentralized markets (unless you're aggregating ALL the volume data from everywhere, including options, OTC etc).
Here is it, for you
Volume Profile and Volume Indicator by DGTVolume Profile (also known as Price by Volume) is an charting study that displays trading activity over a specified time period at specific price levels. It is plotted as a horizontal histogram on the finacial isntrumnet's chart that highlights the trader's interest at specific price levels.
The histogram is used by traders to predict areas of support and resistance. Price levels where the traded volume is high could be assumed as support and resistance levels.
Price may experience difficulty moving above or below areas with large bars. Usually there is a great deal of activity on both the buy and sell side and the market stays at that price level for a great deal of time
It is advised to use volume profile in conjunction with other forms of technical analysis to maximize the odds of success
Light version of Volume Profile is added to Price Action - Support & Resistance by DGT
Price Action - Support & Resistance by DGTSᴜᴘᴘᴏʀᴛ ᴀɴᴅ Rᴇꜱɪꜱᴛᴀɴᴄᴇ , is undoubtedly one of the key concepts of technical analysis
█ Sᴜᴘᴘᴏʀᴛ ᴀɴᴅ Rᴇꜱɪꜱᴛᴀɴᴄᴇ Dᴇꜰɪɴɪᴛɪᴏɴ
Support and Resistance terms are used by traders to refer to price levels on charts that tend to act as barriers, preventing the price of an financial instrument from getting pushed in a certain direction.
A support level is a price level where buyers are more aggressive than sellers. This means that the price is more likely to "bounce" off this level rather than break through it. However, once the price has breached this level it is likely to continue falling until meeting another support level.
A resistance level is the opposite of a support level. It is where the price tends to find resistance as it rises. Again, this means that the price is more likely to "bounce" off this level rather than break through it. However, once the price has breached this level it is likely to continue rising until meeting another resistance level.
A previous support level will sometimes become a resistance level when the price attempts to move back up, and conversely, a resistance level will become a support level as the price temporarily falls back.
█ Iᴅᴇɴᴛɪꜰʏɪɴɢ Sᴜᴘᴘᴏʀᴛ ᴀɴᴅ Rᴇꜱɪꜱᴛᴀɴᴄᴇ
Support and resistance can come in various forms, and the concept is more difficult to master than it first appears. Identification of key support and resistance levels is an essential ingredient to successful technical analysis.
If the price stalls and reverses in the same price area on minimum of two different occasions, then a horizontal line is drawn to show that the market is struggling to move past that area. Those areas are static barriers, one of the most popular forms of support/resistance and are highlighted with horizontal lines.
Repeated test , the more often a support/resistance level is "tested" over an extended period of time (touched and bounced off by price), the more significance is given to that specific level
High volume , the more buying and selling that has occurred at a particular price level, the stronger the support or resistance level is likely to be
Market psychology , plays a major role as traders and investors remember the past and react to changing conditions to anticipate future market movement.
Psychological levels , is a price level that significantly affects the price of an underlying financial instrument. Typically, near round numbers often serve as support and resistance
The following support and resistance related topics are beyond the scope of this study, so they will be mentioned roughly only as a reference for support and resistance concept
Trendlines , Support and resistance levels in trends are dynamic. Throughout an uptrend, levels of support tend to look like a trendline, usually clustering around higher lows. As the price rises, the price where buyers consider the stock to be “too cheap” also changes, which creates new support levels on the way up. The same is also true for resistance levels. In an uptrend, a stock is continuously breaking through perceived resistance levels and making new highs
Moving Averages , is a constantly changing line that smooths out past price data while also allowing the trader to identify support and resistance. In the example Notice how the price of the asset finds support at the moving average when the trend is up, and how it acts as resistance when the trend is down
The Fibonacci Retracement/Extension tool , is a favorite among many short-term traders because it clearly identifies levels of potential support and resistance
Pivot Point Calculations , is another common technical analysis technique, where pivot point is calculated based on the high, low, and closing prices of previous trading session/day and support & resistance levels are projected based on the pivot point, different calculation techniques are available, as presented in this example of an pivot point indicator : PVTvX by DGT
█ Tʀᴀᴅɪɴɢ Bᴀꜱᴇᴅ ᴏɴ Sᴜᴘᴘᴏʀᴛ ᴀɴᴅ Rᴇꜱɪꜱᴛᴀɴᴄᴇ
Once an area or "zone" of support or resistance has been identified, those price levels can serve as potential entry or exit points because, as a price reaches a point of support or resistance, it will do one of two things—bounce back away from the support or resistance level (trading ranges), or violate the price level and continue in its direction (trading breakouts) —until it hits the next support or resistance level
The basic trading method for using support and resistance is to buy near support in uptrends or the parts of ranges or chart patterns where prices are moving up and to sell/sell short near resistance in downtrends or the parts of ranges and chart patterns where prices are moving down. Buying near support or selling near resistance can pay off, but there is no assurance that the support or resistance will hold. Therefore, consider waiting for some confirmation that the market is still respecting that area
Trading breakouts, a breakout is a potential trading opportunity that occurs when an asset's price moves above a resistance level or moves below a support level on increasing volume. The first step in trading breakouts is to identify current price trend patterns along with support and resistance levels in order to plan possible entry and exit points. Once the asset trades beyond the price barrier, volatility tends to increase and prices usually trend in the breakout's direction. Breakouts are such an important trading strategy since these setups are the starting point for future volatility increases, large price swings and, in many circumstances, major price trends. When trading breakouts, it is important to consider the underlying asset's support and resistance levels. The more times an asset price has touched these areas, the more valid these levels are and the more important they become. At the same time, the longer these support and resistance levels have been in play, the better the outcome when the asset price finally breaks out. Asset prices will often move slightly further than we expect them to. This doesn't happen all the time, but when it does it is called a false breakout. Therefore it is important to consider waiting for some confirmation while trading breakouts. It’s also popular for traders to sell 50% of their positions at the resistance level, and hold the rest in anticipation of a breakout above resistance
█ Pʀɪᴄᴇ Aᴄᴛɪᴏɴ - Sᴜᴘᴘᴏʀᴛ & Rᴇꜱɪꜱᴛᴀɴᴄᴇ ʙʏ DGT Sᴛᴜᴅʏ
This experimental study attempts to identify the support and resistance levels. Assumes a simple logic to discover moments where the price is rising or falling consecutively for minimum 3 bars with the condition volume increases on each bar and the last bar’s volume should be bigger than the long term volume moving average. A line will be drawn at the end of the move (highest or lowest, depending on the move direction), the line will be drawn at minimum on the 3rd bar and if condition holds for other consecutive bars the line will switch to 4th, 5th etc bar.
Lines will not be deleted so the historical ones will remain and will emphasis the levels significance when they overlap in feature. Strong levels are more likely to hold and cause the price to move in the other direction, whereas the minor levels may only cause the price to pause and keep moving in the same direction. Determining future levels of support and resistance can drastically improve the returns of a short-term investing strategy
Bar colors will be painted based on the volume of the specific bar to its long term volume moving average. This will help identifying the support and resistance levels significance and emphasis the sings of breakouts
Finally, Volume spikes will be marked on top of the price chart. A high volume usually indicates more interest in the security and the presence of institutional traders. However, a rapidly rising price in an uptrend accompanied by a huge volume may be a sign of exhaustion. Traders usually look for breaks of support and resistance to enter positions. When security break critical levels without volume , you should consider the breakout suspect and prime for a reversal off the highs/lows. Volume spikes are often the result of news-driven events. Volume spike will often lead to sharp reversals since the moves are unsustainable due to the imbalance of supply and demand
A good example with many support and resistance concepts observed on a stock chart and detected by the study
Settings:
Length of volume moving average, where volume moving average is used to detect support and resistance levels, is used as reference to compare with threshold values for volume spikes and colors of the bars
Hint, to get more historical lines scrolling chart to left will enable visualization of them. Please note they may appear to much all 500 line limit is used 😉
Special thanks to @HEMANT Telegram user, for his observations and suggestions
Disclaimer:
Trading success is all about following your trading strategy and the indicators should fit within your trading strategy, and not to be traded upon solely
The script is for informational and educational purposes only. Use of the script does not constitute professional and/or financial advice. You alone have the sole responsibility of evaluating the script output and risks associated with the use of the script. In exchange for using the script, you agree not to hold dgtrd TradingView user liable for any possible claim for damages arising from any decision you make based on use of the script