Support/Resistance v2 (ML) KmeanKmean with Standard Deviation Channel
1. Description of Kmean
Kmean (or K-means) is a popular clustering algorithm used to divide data into K groups based on their similarity. In the context of financial markets, Kmean can be applied to find the average price values over a specific period, allowing the identification of major trends and levels of support and resistance.
2. Application in Trading
In trading, Kmean is used to smooth out the price series and determine long-term trends. This helps traders make more informed decisions by avoiding noise and short-term fluctuations. Kmean can serve as a baseline around which other analytical tools, such as channels and bands, are constructed.
3. Description of Standard Deviation (stdev)
Standard deviation (stdev) is a statistical measure that indicates how much the values of data deviate from their mean value. In finance, standard deviation is often used to assess price volatility. A high standard deviation indicates strong price fluctuations, while a low standard deviation indicates stable movements.
4. Combining Kmean and Standard Deviation to Predict Short-Term Price Behavior
Combining Kmean and standard deviation creates a powerful tool for analyzing market conditions. Kmean shows the average price trend, while the standard deviation channels demonstrate the boundaries within which the price can fluctuate. This combination helps traders to:
Identify support and resistance levels.
Predict potential price reversals.
Assess risks and set stop-losses and take-profits.
Should you have any questions about code, please reach me at Tradingview directly.
Hope you find this script helpful!
Supportresistace
Volume Profile with Node Detection [LuxAlgo]The Volume Profile with Node Detection is a charting tool that allows visualizing the distribution of traded volume across specific price levels and highlights significant volume nodes or clusters of volume nodes that traders may find relevant in utilizing in their trading strategies.
🔶 USAGE
The volume profile component of the script serves as the foundation for node detection while encompassing all the essential features expected from a volume profile. See the sub-sections below for more detailed information about the indicator components and their usage.
🔹 Peak Volume Node Detection
A volume peak node is identified when the volume profile nodes for the N preceding and N succeeding nodes are lower than that of the evaluated one.
Displaying peak volume nodes along with their surrounding N nodes (Zones or Clusters) helps visualize the range, typically representing consolidation zones in the market. This feature enables traders to identify areas where trading activity has intensified, potentially signaling periods of price consolidation or indecision among market participants.
🔹 Trough Volume Node Detection
A volume trough node is identified when the volume profile nodes for the N preceding and N succeeding nodes are higher than that of the evaluated one.
🔹 Highest and Lowest Volume Nodes
Both the highest and lowest volume areas play significant roles in trading. The highest volume areas typically represent zones of strong price acceptance, where a significant amount of trading activity has occurred. On the other hand, the lowest volume areas signify price levels with minimal trading activity, often indicating zones of price rejection or areas where market participants have shown less interest.
🔹 Volume profile
Volume profile is calculated based on the volume of trades that occur at various price levels within a specified timeframe. It divides the price range into discrete price intervals, typically known as "price buckets" or "price bars," and then calculates the total volume of trades that occur at each price level within those intervals. This information is then presented graphically as a histogram or profile, where the height of each bar represents the volume of trades that occurred at that particular price level.
🔶 SETTINGS
🔹 Volume Nodes
Volume Peaks: Toggles the visibility of either the "Peaks" or "Clusters" on the chart, depending on the specified percentage for detection.
Node Detection Percent %: Specifies the percentage for the Volume Peaks calculation.
Volume Troughs: Toggles the visibility of either the "Troughs" or "Clusters" on the chart, depending on the specified percentage for detection.
Node Detection Percent %: Specifies the percentage for the Volume Troughs calculation.
Volume Node Threshold %: A threshold value specified as a percentage is utilized to detect peak/trough volume nodes. If a value is set, the detection will disregard volume node values lower than the specified threshold.
Highest Volume Nodes: Toggles the visibility of the highest nodes for the specified count.
Lowest Volume Nodes: Toggles the visibility of the lowest nodes for the specified count.
🔹 Volume Profile - Components
Volume Profile: Toggles the visibility of the volume profile with either classical display or gradient display.
Value Area Up / Down: Color customization option for the volume nodes within the value area of the profile.
Profile Up / Down Volume: Color customization option for the volume nodes outside of the value area of the profile.
Point of Control: Toggles the visibility of the point of control, allowing selection between "developing" or "regular" modes. Sets the color and width of the point of control line accordingly.
Value Area High (VAH): Toggles the visibility of the value area high level and allows customization of the line color.
Value Area Low (VAL): Toggles the visibility of the value area low level and allows customization of the line color.
Profile Price Labels: Toggles the visibility of the Profile Price Levels and allows customization of the text size of the levels.
🔹 Volume Profile - Display Settings
Profile Lookback Length: Specifies the length of the profile lookback period.
Value Area (%): Specifies the percentage for calculating the value area.
Profile Placement: Specify where to display the profile.
Profile Number of Rows: Specify the number of rows the profile will have.
Profile Width %: Adjusts the width of the rows in the profile relative to the profile range.
Profile Horizontal Offset: Adjusts the horizontal offset of the profile when it is selected to be displayed on the right side of the chart.
Value Area Background: Toggles the visibility of the value area background and allows customization of the fill color.
Profile Background: Toggles the visibility of the profile background and allows customization of the fill color.
🔶 RELATED SCRIPTS
Supply-Demand-Profiles
Liquidity-Sentiment-Profile
Thanks to our community for recommending this script. For more conceptual scripts and related content, we welcome you to explore by visiting >>> LuxAlgo-Scripts .
DIY Custom Strategy Builder [ZP] - v1DISCLAIMER:
This indicator as my first ever Tradingview indicator, has been developed for my personal trading analysis, consolidating various powerful indicators that I frequently use. A number of the embedded indicators within this tool are the creations of esteemed Pine Script developers from the TradingView community. In recognition of their contributions, the names of these developers will be prominently displayed alongside the respective indicator names. My selection of these indicators is rooted in my own experience and reflects those that have proven most effective for me. Please note that the past performance of any trading system or methodology is not necessarily indicative of future results. Always conduct your own research and due diligence before using any indicator or tool.
===========================================================================
Introducing the ultimate all-in-one DIY strategy builder indicator, With over 30+ famous indicators (some with custom configuration/settings) indicators included, you now have the power to mix and match to create your own custom strategy for shorter time or longer time frames depending on your trading style. Say goodbye to cluttered charts and manual/visual confirmation of multiple indicators and hello to endless possibilities with this indicator.
What it does
==================
This indicator basically help users to do 2 things:
1) Strategy Builder
With more than 30 indicators available, you can select any combination you prefer and the indicator will generate buy and sell signals accordingly. Alternative to the time-consuming process of manually confirming signals from multiple indicators! This indicator streamlines the process by automatically printing buy and sell signals based on your chosen combination of indicators. No more staring at the screen for hours on end, simply set up alerts and let the indicator do the work for you.
Available indicators that you can choose to build your strategy, are coded to seamlessly print the BUY and SELL signal upon confirmation of all selected indicators:
EMA Filter
2 EMA Cross
3 EMA Cross
Range Filter (Guikroth)
SuperTrend
Ichimoku Cloud
SuperIchi (LuxAlgo)
B-Xtrender (QuantTherapy)
Bull Bear Power Trend (Dreadblitz)
VWAP
BB Oscillator (Veryfid)
Trend Meter (Lij_MC)
Chandelier Exit (Everget)
CCI
Awesome Oscillator
DMI ( Adx )
Parabolic SAR
Waddah Attar Explosion (Shayankm)
Volatility Oscillator (Veryfid)
Damiani Volatility ( DV ) (RichardoSantos)
Stochastic
RSI
MACD
SSL Channel (ErwinBeckers)
Schaff Trend Cycle ( STC ) (LazyBear)
Chaikin Money Flow
Volume
Wolfpack Id (Darrellfischer1)
QQE Mod (Mihkhel00)
Hull Suite (Insilico)
Vortex Indicator
2) Overlay Indicators
Access the full potential of this indicator using the SWITCH BOARD section! Here, you have the ability to turn on and plot up to 14 of the included indicators on your chart. Simply select from the following options:
EMA
Support/Resistance (HeWhoMustNotBeNamed)
Supply/ Demand Zone ( SMC ) (Pmgjiv)
Parabolic SAR
Ichimoku Cloud
Superichi (LuxAlgo)
SuperTrend
Range Filter (Guikroth)
Average True Range (ATR)
VWAP
Schaff Trend Cycle ( STC ) (LazyBear)
PVSRA (TradersReality)
Liquidity Zone/Vector Candle Zone (TradersReality)
Market Sessions (Aurocks_AIF)
How it does it
==================
To explain how this indictor generate signal or does what it does, its best to put in points.
I have coded the strategy for each of the indicator, for some of the indicator you will see the option to choose strategy variation, these variants are either famous among the traders or its the ones I found more accurate based on my usage. By coding the strategy I will have the BUY and SELL signal generated by each indicator in the backend.
Next, the indicator will identify your selected LEADING INDICATOR and the CONFIRMATION INDICATOR(s).
On each candle close, the indicator will check if the selected LEADING INDICATOR generates signal (long or short).
Once the leading indicator generates the signal, then the indicator will scan each of the selected CONFIRMATION INDICATORS on candle close to check if any of the CONFIRMATION INDICATOR generated signal (long or short).
Until this point, all the process is happening in the backend, the indicator will print LONG or SHORT signal on the chart ONLY if LEADING INDICATOR and all the selected CONFIRMATION INDICATORS generates signal on candle close. example for long signal, the LEADING INDICATOR and all selected CONFIRMATION INDICATORS must print long signal.
The dashboard table will show your selected LEADING and CONFIRMATION INDICATORS and if LEADING or the CONFIRMATION INDICATORS have generated signal. Signal generated by LEADING and CONFIRMATION indicator whether long or short, is indicated by tick icon ✔. and if any of the selected CONFIRMATION or LEADING indicator does not generate signal on candle close, it will be indicated with cross symbol ✖.
how to use this indicator
==============================
Using the indicator is pretty simple, but it depends on your goal, whether you want to use it for overlaying the available indicators or using it to build your strategy or for both.
To use for Building your strategy: Select your LEADING INDICATOR, and then select your CONFIRMATION INDICATOR(s). if on candle close all the indicators generate signal, then this indicator will print SHORT or LONG signal on the chart for your entry. There are plenty of indicators you can use to build your strategy, some indicators are best for longer time frame setups while others are responsive indicators that are best for short time frame.
To use for overlaying the indicators: Open the setting of this indicator and scroll to the SWITCHBOARD section, from there you can select which indicator you want to plot on the chart.
For each of the listed indicators, you have the flexibility to customize the settings and configurations to suit your preferences. simply open indicator setting and scroll down, you will find configuration for each of the indicators used.
I will also release the Strategy Backtester for this indicator soon.
Filtered Volume Profile [ChartPrime]The "Filtered Volume Profile" is a powerful tool that offers insights into market activity. It's a technical analysis tool used to understand the behavior of financial markets. It uses a fixed range volume profile to provide a histogram representing how much volume occurred at distinct price levels.
Profile in action with various significant levels displayed
How to Use
The script is designed to analyze cumulative trading volumes in different price bins over a certain period, also known as `'lookback'`. This lookback period can be defined by the user and it represents the number of bars to look back for calculating levels of support and resistance.
The `'Smoothing'` input determines the degree to which the output is smoothed. Higher values lead to smoother results but may impede the responsiveness of the indicator to rapid changes in volatility.
The `'Peak Sensitivity'` input is used to adjust the sensitivity of the script's peak detection algorithm. Setting this to a lower value makes the algorithm more sensitive to local changes in trading volume and may result in "noisier" outputs.
The `'Peak Threshold'` input specifies the number of bins that the peak detection mechanism should account for. Larger numbers imply that more volume bins are taken into account, and the resultant peaks are based on wider intervals.
The `'Mean Score Length'` input is used for scaling the mean score range. This is particularly important in defining the length of lookback bars that will be used to calculate the average close price.
Sinc Filter
The application of the sinc-filter to the Filtered Volume Profile reduces the risk of viewing artefacts that may misrepresent the underlying market behavior. Sinc filtering is a high-quality and sharp filter that doesn't manifest any ringing effects, making it an optimal choice for such volume profiling.
Histogram
On the histogram, the volume profile is colored based on the balance of bullish to bearish volume. If a particular bar is more intense in color, it represents a larger than usual volume during a single price bar. This is a clear signal of a strong buying or selling pressure at a particular price level.
Threshold for Peaks
The `peak_thresh` input determines the number of bins the algorithm takes in account for the peak detection feature. The 'peak' represents the level where a significant amount of volume trading has occurred, and usually is of interest as an indicative of support or resistance level.
By increasing the `peak_thresh`, you're raising the bar for what the algorithm perceives as a peak. This could result in fewer, but more significant peaks being identified.
History of Volume Profiles and Evolution into Sinc Filtering
Volume profiling has a rich history in market analysis, dating back to the 1950s when Richard D. Wyckoff, a legendary trader, introduced the concept of volume studies. He understood the critical significance of volume and its relationship with market price movement. The core of Wyckoff's technical analysis suite was the relationship between prices and volume, often termed as "Effort vs Results".
Moving forward, in the early 1800s, the esteemed mathematician J. R. Carson made key improvements to the sinc function, which formed the basis for sinc filtering application in time series data. Following these contributions, trading studies continued to create and integrate more advanced statistical measures into market analysis.
This culminated in the 1980s with J. Peter Steidlmayer’s introduction of Market Profile. He suggested that markets were a function of continuous two-way auction processes thus introducing the concept of viewing markets in price/time continuum and price distribution forms. Steidlmayer's Market Profile was the first wide-scale operation of organized volume and price data.
However, despite the introduction of such features, challenges in the analysis persisted, especially due to noise that could misinform trading decisions. This gap has given rise to the need for smoothing functions to help eliminate the noise and better interpret the data. Among such techniques, the sinc filter has become widely recognized within the trading community.
The sinc filter, because of its properties of constructing a smooth passing through all data points precisely and its ability to eliminate high-frequency noise, has been considered a natural transition in the evolution of volume profile strategies. The superior ability of the sinc filter to reduce noise and shield against over-fitting makes it an ideal choice for smoothing purposes in trading scripts, particularly where volume profiling forms the crux of the market analysis strategy, such as in Filtered Volume Profile.
Moving ahead, the use of volume-based studies seems likely to remain a core part of technical analysis. As long as markets operate based on supply and demand principles, understanding volume will remain key to discerning the intent behind price movements. And with the incorporation of advanced methods like sinc filtering, the accuracy and insight provided by these methodologies will only improve.
Mean Score
The mean score in the Filtered Volume Profile script plays an important role in probabilistic inferences regarding future price direction. This score essentially characterizes the statistical likelihood of price trends based on historical data.
The mean score is calculated over a configurable `'Mean Score Length'`. This variable sets the window or the timeframe for calculation of the mean score of the closing prices.
Statistically, this score takes advantage of the concept of z-scores and probabilities associated with the t-distribution (a type of probability distribution that is symmetric and bell-shaped, just like the standard normal distribution, but has heavier tails).
The z-score represents how many standard deviations an element is from the mean. In this case, the "element" is the price level (Point of Control).
The mean score section of the script calculates standard errors for the root mean squared error (RMSE) and addresses the uncertainty in the prediction of the future value of a random variable.
The RMSE of a model prediction concerning observed values is used to measure the differences between values predicted by a model and the values observed.
The lower the RMSE, the better the model is able to predict. A zero RMSE means a perfect fit to the data. In essence, it's a measure of how concentrated the data is around the line of best fit.
Through the mean score, the script effectively predicts the likelihood of the future close price being above or below our identified price level.
Summary
Filtered Volume Profile is a comprehensive trading view indicator which utilizes volume profiling, peak detection, mean score computations, and sinc-filter smoothing, altogether providing the finer details of market behavior.
It offers a customizable look back period, smoothing options, and peak sensitivity setting along with a uniquely set peak threshold. The application of the Sinc Filter ensures a high level of accuracy and noise reduction in volume profiling, making this script a reliable tool for gaining market insights.
Furthermore, the use of mean score calculations provides probabilistic insights into price movements, thus providing traders with a statistically sound foundation for their trading decisions. As trading markets advance, the use of such methodologies plays a pivotal role in formulating effective trading strategies and the Filtered Volume Profile is a successful embodiment of such advancements in the field of market analysis.
SuperCloudSupercloud is a MA based Trend Representation. Its different from a normal MA Cloud. Cloud starts from '0' level and rise or fall based on price.
Supercloud is plotted based on the difference of the price movement between various MA's of different length. All MA's are plotted with reference to EMA 200. So when the MA's converge or Diverge or Bounce back we can still be in the Trend unless the Cloud goes below or above Zero Line.
works in all Timeframes.
Up Trend:
-> All MA's are Above Zero and Cloud color is complete green
-> A decrease in Cloud Volume indicates a weaker Momentum
Down Trend:
-> All MA's are Below Zero and Cloud color is complete red
-> A decrease in Cloud Volume indicates a weaker Momentum
Sideways:
-> A Mixed color indicates a Sideways moment.
Cloud Outlines:
1) The outer edge of Cloud shows the actual trend.
2) its based on MA-5, when price is above MA 5 or Below MA 5 a bright green and bright red outlines are plotted.
Buy Signals Confirmation:
upper Outer Cloud must be Bright Green
Cloud under must be fully Shaded Green
Alternatively EMA crossover can be used and confirmed.
Sell Signals Confirmation:
lower Outer Cloud must be Bright Red
Cloud under must be fully Shaded Red
Alternatively EMA cross under can be used and confirmed.
MACD
MACD is also plotted within the cloud.
Color ribbon is used to plot MACD
Histogram is not present. Instead use the width of the MACD Ribbon
Correspondingly Outer Cloud represents the Histogram.
Zero Line:
Zero line is actually EMA5 which is to be treated as EMA200 for our visual representation.
A sideway channel is plotted around Zero line.
When price reaches this sideways Zone price usually get rejections and starts moving side ways.
Trend is established only after price crosses the sideway band.
Sideway is calculated based on mintick of the Asset which varies. a min value equivalent to 10EMA or value 10 must be used for better usage.
SuperTrend Support & Resistance(My goal creating this indicator) : Provide a way to categorize and label key structures on multiple time frames so I can create a plan based on those observable facts.
The Underlying Concept / What is Momentum?
The Momentum shown is derived from a Mathematical Formula, SUPERTREND. When price closes above Supertrend Its bullish Momentum when its below Supertrend its Bearish Momentum. On the first bar bearish momentum is detected a resistance Level is made at the highest point of the previous bullish condition. On the first bar bullish momentum is detected a support Level is made at the lowest point of the previous bearish condition. As I become a better analyst I will find better techniques and this source code may become open-source, but as of now it remains protected. This indicator scans for bullish & bearish Momentum on the Timeframes selected by the user and when there is a shift in momentum on any of those time frames (price closes below or above SUPERTREND ) it notifies the trader with a Supply or Demand level with a unique color and Size to signify the severity of said level.
What is Severity?
Severity is How we differentiate the importance of different Highs and Lows. If Momentum is detected on a higher timeframe the Supply or Demand Level is updated. The Color and Size representing that higher timeframe will be shown. Demand and Supply Levels made by higher Timeframes are more SEVERE then a demand level made by a lower Timeframe.
Technical Inputs
- If you want to optimize the rate of signals to better fit your trading plan you would change the Factor input and ATR Length input. Increase factor and ATR Length to decrease the frequency of signals and decrease the Factor and ATR Length to increase the frequency of signals.
- to ensure the correct calculation of Support and Resistance levels change BAR_INDEX. BAR_INDEX creates a buffer at the start of the chart. For example: If you set BAR_INDEX to 300. The script will wait for 300 bars to elapse on the current chart before running. This allows the script more time to gather data. Which is needed in order for our dynamic lookback length to never return an error(Dynamic lookback length cant be negative or zero). The lower the timeframe the greater the amount of bars need. For Example if I open up a 30 sec chart I would enter 5000 as my BAR_INDEX since that will provide enough data to ensure the correct calculation of Support and Resistance levels.
Time Frame Inputs
- The indicator has 3 Time Frame Displays where you can choose how SEVERE You want the Supply and Demand Levels. For Example: 1min, 3min, 5min, 15 min Levels, 60 min levels Weekly Levels, etc.....The higher the Timeframe Selected the more SEVERE the Level.
- Use the Amount of time Frames input to increase or limit the amount of time frames that will be displayed onto the chart.
Display Inputs
- The toggle (Trend or Basic) option Lets the trend determine the colors of the Support and Resistance Levels or Basic where the color is strictly based on if its a high or a low ( Trend = HH,HL,LL,LH)
- Toggle options (Close) and (High & Low) creates Support and Resistance Levels using the Lowest close and Highest close or using the Lowest low and Highest high.
Toggle on both or toggle off both in order to use both these values when determining the trend of your chart. For Example this would mean (Price has to close higher then the highest high. Not only make a higher high or a
higher close) and the inverse (Price has to close lower then the lowest low. Not only make a lower low or a lower close)
How Trend Is being Determined ?
(Previous Supply Level > Current Supply Level ) if this statement is true then its s LH so the trend is bearish if this statement is false then its a HH so the trend is bullish
(Previous Demand Level > Current Demand Level ) if this statement is true then its a LL so the trend is bearish if this statement is false then its a HL so the trend is bullish
(Close > Current Supply Level ) if this statement is true technically price made a HH so the trend is bullish
(Close < Current Demand Level ) if this statement is true technically price made a LL so the trend is bearish
- Fully customize how you display and label Market Structure in specific timeframes. Line Length, Line Width, Line Style, Label Distance, Label Size, Label Background Size, and Background Color can all be customized.
- Lastly Is the Trend Chart. To Easily verify the current trend of any timeframes displayed by this indicator toggle on Chart On/Off . You also get the option to change the Chart Position and the size of the Trend Chart
*****The Current charts timeframe has to lower then a month to ensure correct calculation of Supply and Demand Levels*****
How it can be used ?
(Examples of Different ways you can use this indicator) : Easily categorize the severity of each and every Supply or Demand Level in the market (The higher the time frame the stronger the level)
: Quickly Determine the trend of any Timeframe
: Get a consistent view of a market and how different time frames are behaving but just use one chart.
: Take the discretion from hand drawing support and resistance lines out of your trading
: Find and categorize strong levels for potential breakouts
: Trend Analysis, Use multiple time frames to create a narrative based on observable facts from these time frames
: Different Targets to take money off the table
: Use labels to differentiate between different trend line setups
: Find Great places to move your stop loss too.
Best TradingView Strategy - For NASDAQ and DOW30 and other IndexThe script is totally based on momentum , volume and price. We have used :
1: Bollinger Band Squeezes to know when a breakout might happen.
2: Used Moving Averages(SMA and EMA) to know the direction.
3: The success Rate of this strategy is above 75% and if little price action is added it can easily surpass 90% success mark.
4: Do not worry about drawdowns , we have implemented trailing SL ,so you might see a little extra drawdown but in reality its pretty less.
5: I myself have tested this strategy for 41 days with a 250$ account and right now I have 2700$.