DominantCycleCollection of Dominant Cycle estimators. Length adaptation used in the Adaptive Moving Averages and the Adaptive Oscillators try to follow price movements and accelerate/decelerate accordingly (usually quite rapidly with a huge range). Cycle estimators, on the other hand, try to measure the cycle period of the current market, which does not reflect price movement or the rate of change (the rate of change may also differ depending on the cycle phase, but the cycle period itself usually changes slowly). This collection may become encyclopaedic, so if you have any working cycle estimator, drop me a line in the comments below. Suggestions are welcome. Currently included estimators are based on the work of John F. Ehlers
 mamaPeriod(src, dynLow, dynHigh)  MESA Adaptation - MAMA Cycle
  Parameters:
     src : Series to use
     dynLow : Lower bound for the dynamic length
     dynHigh : Upper bound for the dynamic length
  Returns: Calculated period
Based on MESA Adaptive Moving Average by John F. Ehlers
Performs Hilbert Transform Homodyne Discriminator cycle measurement
Unlike MAMA Alpha function (in LengthAdaptation library), this does not compute phase rate of change
Introduced in the September 2001 issue of Stocks and Commodities
Inspired by the @everget implementation: 
Inspired by the @anoojpatel implementation: 
 paPeriod(src, dynLow, dynHigh, preHP, preSS, preHP)  Pearson Autocorrelation
  Parameters:
     src : Series to use
     dynLow : Lower bound for the dynamic length
     dynHigh : Upper bound for the dynamic length
     preHP : Use High Pass prefilter (default)
     preSS : Use Super Smoother prefilter (default)
     preHP : Use Hann Windowing prefilter
  Returns: Calculated period
Based on Pearson Autocorrelation Periodogram by John F. Ehlers
Introduced in the September 2016 issue of Stocks and Commodities
Inspired by the @blackcat1402 implementation: 
Inspired by the @rumpypumpydumpy implementation: 
Corrected many errors, and made small speed optimizations, so this could be the best implementation to date (still slow, though, so may revisit in future)
High Pass and Super Smoother prefilters are used in the original implementation
 dftPeriod(src, dynLow, dynHigh, preHP, preSS, preHP)  Discrete Fourier Transform
  Parameters:
     src : Series to use
     dynLow : Lower bound for the dynamic length
     dynHigh : Upper bound for the dynamic length
     preHP : Use High Pass prefilter (default)
     preSS : Use Super Smoother prefilter (default)
     preHP : Use Hann Windowing prefilter
  Returns: Calculated period
Based on Spectrum from Discrete Fourier Transform by John F. Ehlers
Inspired by the @blackcat1402 implementation: 
High Pass, Super Smoother and Hann Windowing prefilters are used in the original implementation
 phasePeriod(src, dynLow, dynHigh, preHP, preSS, preHP)  Phase Accumulation
  Parameters:
     src : Series to use
     dynLow : Lower bound for the dynamic length
     dynHigh : Upper bound for the dynamic length
     preHP : Use High Pass prefilter (default)
     preSS : Use Super Smoother prefilter (default)
     preHP : Use Hamm Windowing prefilter
  Returns: Calculated period
Based on Dominant Cycle from Phase Accumulation by John F. Ehlers
High Pass and Super Smoother prefilters are used in the original implementation
 doAdapt(type, src, len, dynLow, dynHigh, chandeSDLen, chandeSmooth, chandePower, preHP, preSS, preHP)  Execute a particular Length Adaptation or Dominant Cycle Estimator from the list
  Parameters:
     type : Length Adaptation or Dominant Cycle Estimator type to use
     src : Series to use
     len : Reference lookback length
     dynLow : Lower bound for the dynamic length
     dynHigh : Upper bound for the dynamic length
     chandeSDLen : Lookback length of Standard deviation for Chande's Dynamic Length
     chandeSmooth : Smoothing length of Standard deviation for Chande's Dynamic Length
     chandePower : Exponent of the length adaptation for Chande's Dynamic Length (lower is smaller variation)
     preHP : Use High Pass prefilter for the Estimators that support it (default)
     preSS : Use Super Smoother prefilter for the Estimators that support it (default)
     preHP : Use Hann Windowing prefilter for the Estimators that support it
  Returns: Calculated period (float, not limited)
 doEstimate(type, src, dynLow, dynHigh, preHP, preSS, preHP)  Execute a particular Dominant Cycle Estimator from the list
  Parameters:
     type : Dominant Cycle Estimator type to use
     src : Series to use
     dynLow : Lower bound for the dynamic length
     dynHigh : Upper bound for the dynamic length
     preHP : Use High Pass prefilter for the Estimators that support it (default)
     preSS : Use Super Smoother prefilter for the Estimators that support it (default)
     preHP : Use Hann Windowing prefilter for the Estimators that support it
  Returns: Calculated period (float, not limited)
Pesquisar nos scripts por "accumulation"
Jake Bernstein - Moving Average ChannelWe all know that moving averages, in particular, moving averages of closing prices tend to be highly inaccurate indicators and frequently miss major tops and bottoms. In backtesting, they tend to be accurate some 30 to 40% of the time which is to my way of thinking unacceptable. On the contrary moving averages of opens versus closes for highs versus lows, when used properly avoid the drawbacks of closing moving averages, particularly when combined with a trigger. Shown above is my moving average channel method which uses the 57 SMA of Williams accumulation distribution as a setup or trigger. As shown by the arrows two consecutive price bars completely below the MA channel low and triggered by Williams below SMA constitutes a sell signal. Conversely, two consecutive price bars or more above the moving average channel high accompanied by Williams above its moving average constitutes a sell trigger. The moving average channel high, the red line is a 10 period Moving average of highs. The Moving average channel low, the green line is an 8 period Moving average of the low. There are at least a dozen applications of this methodology including its ability to spot trend changes, support, resistance, swing trades, market strength, market weakness, and more. I will post some of these additional uses of the moving average channel as they present themselves. Do note that in this chart there were two instances above the moving average channel high but these were not triggered by Williams AD and therefore the trend remains down for the duration of this chart. The methodology associated with my MAC is completely rules-based and works in any timeframe. Thank you my friend Larry Williams for developing your excellent version of accumulation-distribution 
Baekdoo multi OverSold OverBuy colored CandleHi forks,
I'm trader Baekdoosan who trading Equity from South Korea. This Baekdoo multi OverSold OverBuy colored candle will give you the idea of
multiple indicators in one shot with colored candle. Those indicators tell us that oversold or overbuy statistically. For the color, you can freely change
based on your comfort. For me, in Korea white candle has red color and black candle has blue color. So somewhat confusing for you. Anyway you can 
easily modify color in the script. Please refer this line.
barcolor(open<close and result_pos == 4 ? color.new(color.red, 0) : open<close and result_pos == 3 ? color.new(color.red, 25) : open<close and result_pos == 2 ? color.new(color.red, 50) : open<close and result_pos == 1? color.new(color.red, 75) : na)
you can see I put different transparency at color.new() function with color code. Let me divide and conquer to explain for up candle 
white candle and black candle.
1. White candle 
   with 4 oversold signal case with white candle tells us it is almost reached real bottom and try to rebound. In this case, I put vivid color (no transparency) on the candle. And all 4 signal case, I put text on "OverSold". It will not happen frequently. Then 2 approaches can be made. 
    (a) short term approach
         You can buy on this time. and you set stop loss with open price. This is mainly aimed for technical rebound.
    (b) long term approach
         You can accumulate based on your budget with 5 times dividing. At that day might not be the very bottom but those period will most probably real bottom. You can put more weight on latter buy. Let say, 1 : 1.25 : 1.5 : 1.75 : 2.5. So for example, if you have $8,000 to investigate then, buy $1,000 and then $1,250, $1,500, accordingly. If price rebound then don't adding weight on accumulation but with the first amount that you buy(i.e., $1,000 with above example). With this approach, you will not have much stress and you will get profit well. If this is grand bottom case, then you can HODL this long term. What you needs is stick to the plan. :)
   with 3 signals the color is less vivid, 2 signals is much less vivid, accordingly. 
2. Black candle
   The approaches are opposite to above. The signal will tells us for 4 overBuy signals, then vivid blue candle will be shown. Our strategy is distribute to sell. Please do not sell in one shot. As Newton said, "I can calculate the motions of the heavenly bodies, but not the madness of the people". Strong buy phase, we don't know how far will it go. But indicators will tell us it is quite overSold situation. So what I can suggest you is sell it 10% to 20% on resistance price, and put 50% of lower than certain support price. Remember, accumulation and distribution will always better than one shot trading if you want to survive long time on this war field. 
 
Hope this will help your trading on equity as well as crypto. I didn't try it on futures. Best of luck all of you. Gazua~!
CMT's ProGo indicatorThis is an experiment. I've never traded with it and won't tell you to. The nuances of how effective this is have yet to be seen.
Shoutout to @BillionaireLau, who very recently posted Larry William's original ProGo indicator. I hypothesized that a few minor changes to values and operations would allow for greater utility and responsiveness. I believe this has been achieved. What we're looking at here appears to offer a new means of spotting divergences. Have fun. To quote BillionaireLau regarding the nature of this indicator:
"ProGo, created by Larry William, (earlier than 2002), is a 2 line graph using daily data.
1. Professional Line (color orange) is a professional Accumulation/Distribution line is constructed by using the change from today's open to today's close.
2. The Public Line (color blue) is done by creating a public accumulation/distribution line that shows the change from yesterdays close to today's open.
The graph is an index of the previous close to open +/- values (public) and then taking a 14 day average which is plotted against a 14 day average of the +/- values of the open to close(pro).
Background color:
Green colored area is where "pro" line crossover   line, and the "pro" line is also positive."
William's ProGo indicatorProGo, created by Larry William, (earlier than 2002), is a 2 line graph using daily data.
1. Professional Line (color orange) is a professional Accumulation/Distribution line is constructed by using the change from today's open to today's close.
2. The Public Line (color blue) is done by creating a public accumulation/distribution line that shows the change from yesterdays close to today's open.
The graph is an index of the previous close to open +/- values (public) and then taking a 14 day average which is plotted against a 14 day average of the +/- values of the open to close(pro).
Background color:
Green colored area is where "pro" line crossover "amatuers" line, and the "pro" line is also positive. 
Created this for literature review. 
Combo Backtest 123 Reversal & Smoothed Williams ADThis is combo strategies for get a cumulative signal. 
 First strategy
 This System was created from the Book "How I Tripled My Money In The 
 Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
 The strategy buys at market, if close price is higher than the previous close 
 during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50. 
 The strategy sells at market, if close price is lower than the previous close price 
 during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
 Second strategy
 Accumulation is a term used to describe a market controlled by buyers;
 whereas distribution is defined by a market controlled by sellers.
 Williams recommends trading this indicator based on divergences:
  Distribution of the security is indicated when the security is making 
  a new high and the A/D indicator is failing to make a new high. Sell.
  Accumulation of the security is indicated when the security is making 
  a new low and the A/D indicator is failing to make a new low. Buy. 
 WARNING:
 - For purpose educate only
 - This script to change bars colors.
Function Square WaveThis is a script to draw a square wave on the chart, with an indicator for current price.
Markets undergoing Dow Jones or Wyckoff Accumulation/Distribution cycles tend to move in such waves, and if the period of the cycles are detected, a signal for accumulation/distribution phases can be created as an early warning.
Useful inputs:
- Average True Range as the wave height.
- Assumed Wave period as the wave duration.
I divided the current price wave by 2 to make the indicator more visually friendly.
GLHF
- DPT
Combo Backtest 123 Reversal & Klinger Volume Oscillator This is combo strategies for get a cumulative signal. 
 First strategy
 This System was created from the Book "How I Tripled My Money In The 
 Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
 The strategy buys at market, if close price is higher than the previous close 
 during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50. 
 The strategy sells at market, if close price is lower than the previous close price 
 during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
 Second strategy
 The Klinger Oscillator (KO) was developed by Stephen J. Klinger. Learning 
 from prior research on volume by such well-known technicians as Joseph Granville, 
 Larry Williams, and Marc Chaikin, Mr. Klinger set out to develop a volume-based 
 indicator to help in both short- and long-term analysis.
 The KO was developed with two seemingly opposite goals in mind: to be sensitive 
 enough to signal short-term tops and bottoms, yet accurate enough to reflect the 
 long-term flow of money into and out of a security.
 The KO is based on the following tenets:
 Price range (i.e. High - Low) is a measure of movement and volume is the force behind 
 the movement. The sum of High + Low + Close defines a trend. Accumulation occurs when 
 today's sum is greater than the previous day's. Conversely, distribution occurs when 
 today's sum is less than the previous day's. When the sums are equal, the existing trend 
 is maintained.
 Volume produces continuous intra-day changes in price reflecting buying and selling pressure. 
 The KO quantifies the difference between the number of shares being accumulated and distributed 
 each day as "volume force". A strong, rising volume force should accompany an uptrend and then 
 gradually contract over time during the latter stages of the uptrend and the early stages of 
 the following downtrend. This should be followed by a rising volume force reflecting some 
 accumulation before a bottom develops.
 WARNING:
 - For purpose educate only
 - This script to change bars colors.
[blackcat] L2 Ehlers Phase Accumulator Cycle Period MeasurerLevel: 2
Background
John F. Ehlers introuced Phase Accumulation technique of cycle period measurement in his "Rocket Science for Traders" chapter 7. It is perhaps the easiest to comprehend. In this technique, John Ehlers measures the phase at each sample by taking the arctangent of the ratio of the Quadrature component to the In-phase component. A delta phase is generated by taking the difference of the phase between successive samples. At each sample Dr. Ehlers then looks backward, adding up the delta phases. When the sum of the delta phases reaches 360 degrees (2*pi in tradingview), we must have passed through one full cycle, on average. The process is repeated for each new sample. 
Function
blackcat L2 Ehlers Phase Accumulator Cycle Period Measurer is used to measure Dominant Cycle (DC). This is one of John Ehlers three major methods to measure DC. The Phase Accumulation method of cycle measurement always uses one full cycle’s worth of historical data. This is both an advantage and disadvantage. The advantage is the lag in obtaining the answer scales directly with the cycle period. That is, the measurement of a short cycle period has less lag than the measurement of a longer cycle period. However, the number of samples used in making the measurement means the averaging period is variable with cycle period. Longer averaging reduces the noise level compared to the signal. Therefore, shorter cycle periods necessarily have a higher output Signal-to-Noise Ratio (SNR).
Key Signal
Smooth --> 4 bar WMA w/ 1 bar lag
Detrender --> The amplitude response of a minimum-length HT can be improved by adjusting the filter coefficients by
trial and error. HT does not allow DC component at zero frequency for transformation. So, Detrender is used to remove DC component/ trend component.
Q1 --> Quadrature phase signal
I1 --> In-phase signal
Period --> Dominant Cycle in bars
Pros and Cons
100% John F. Ehlers definition translation of original work, even variable names are the same. This help readers who would like to use pine to read his book. If you had read his works, then you will be quite familiar with my code style.
Remarks
The 2nd script for Blackcat1402 John F. Ehlers Week publication.
Readme
In real life, I am a prolific inventor. I have successfully applied for more than 60 international and regional patents in the past 12 years. But in the past two years or so, I have tried to transfer my creativity to the development of trading strategies. Tradingview is the ideal platform for me. I am selecting and contributing some of the hundreds of scripts to publish in Tradingview community. Welcome everyone to interact with me to discuss these interesting pine scripts.
The scripts posted are categorized into 5 levels according to my efforts or manhours put into these works.
Level 1 : interesting script snippets or distinctive improvement from classic indicators or strategy. Level 1 scripts can usually appear in more complex indicators as a function module or element.
Level 2 : composite indicator/strategy. By selecting or combining several independent or dependent functions or sub indicators in proper way, the composite script exhibits a resonance phenomenon which can filter out noise or fake trading signal to enhance trading confidence level.
Level 3 : comprehensive indicator/strategy. They are simple trading systems based on my strategies. They are commonly containing several or all of entry signal, close signal, stop loss, take profit, re-entry, risk management, and position sizing techniques. Even some interesting fundamental and mass psychological aspects are incorporated.
Level 4 : script snippets or functions that do not disclose source code. Interesting element that can reveal market laws and work as raw material for indicators and strategies. If you find Level 1~2 scripts are helpful, Level 4 is a private version that took me far more efforts to develop.
Level 5 : indicator/strategy that do not disclose source code. private version of Level 3 script with my accumulated script processing skills or a large number of custom functions. I had a private function library built in past two years. Level 5 scripts use many of them to achieve private trading strategy.
MACD-X, More Than MACD by DGTMoving Average Convergence Divergence – MACD
 
The most popular indicator used in technical analysis, the moving average convergence divergence (MACD), created by Gerald Appel. MACD is a trend-following momentum indicator, designed to reveal changes in the strength, direction, momentum, and duration of a trend in a financial instrument’s price
 Historical evolution of MACD, 
 -	 Gerald Appel  created the MACD line, 
-	 Thomas Aspray  added the histogram feature to MACD 
-	 Giorgos E. Siligardos  created a leader of MACD
MACD employs two Moving Averages of varying lengths (which are lagging indicators) to identify trend direction and duration. Then, MACD takes the difference in values between those two Moving Averages (MACD Line) and an EMA of those Moving Averages (Signal Line) and plots that difference between the two lines as a histogram which oscillates above and below a center Zero Line. The histogram is used as a good indication of a security's momentum.
Mathematically expressed as;
   macd = ma(source,  fast_length) – ma(source, slow_length)
   signal = ma(macd, signal_length)
   histogram = macd – signal 
where exponential moving average (ema) is in common use as a moving average (ma)
   fast_length = 12
   slow_length = 26
   signal_length = 9
The MACD indicator is typically good for identifying three types of  basic signals ;
 Signal Line Crossovers
 A Signal Line Crossover is the most common signal produced by the MACD. On the occasions where the MACD Line crosses above or below the Signal Line, that can signify a potentially strong move. The standard interpretation of such an event is a recommendation to buy if the MACD line crosses up through the Signal Line (a "bullish" crossover), or to sell if it crosses down through the Signal Line (a "bearish" crossover). These events are taken as indications that the trend in the financial instrument is about to accelerate in the direction of the crossover.
 Zero Line Crossovers
 Zero Line Crossovers occur when the MACD Line crossed the Zero Line and either becomes positive (above 0) or negative (below 0). A change from positive to negative MACD is interpreted as "bearish", and from negative to positive as "bullish". Zero crossovers provide evidence of a change in the direction of a trend but less confirmation of its momentum than a signal line crossover
 Divergence 
Divergence is another signal created by the MACD. Simply, divergence occurs when the MACD and actual price are not in agreement. A "positive divergence" or "bullish divergence" occurs when the price makes a new low but the MACD does not confirm with a new low of its own. A "negative divergence" or "bearish divergence" occurs when the price makes a new high but the MACD does not confirm with a new high of its own. A divergence with respect to price may occur on the MACD line and/or the MACD Histogram
 Moving Average Crossovers , another hidden signal that MACD Indicator identifies 
Many traders will watch for a short-term moving average to cross above a longer-term moving average and use this to signal increasing upward momentum. This bullish crossover suggests that the price has recently been rising at a faster rate than it has in the past, so it is a common technical buy sign. Conversely, a short-term moving average crossing below a longer-term average is used to illustrate that the asset's price has been moving downward at a faster rate and that it may be a good time to sell. 
Moving Average Crossovers in reality is Zero Line Crossovers, the value of the MACD indicator is equal to zero each time the two moving averages cross over each other. For easy interpretation by trades,  Zero Line Crossovers are simply described as positive or negative MACD 
 False signals
 Like any forecasting algorithm, the MACD can generate false signals. A false positive, for example, would be a bullish crossover followed by a sudden decline in a financial instrument. A false negative would be a situation where there is bearish crossover, yet the financial instrument accelerated suddenly upwards
 What is “MACD-X” and Why it is “More Than MACD”  
 
In its simples form, MACD-X implements variety of  different calculation techniques  applied to obtain MACD Line, ability to use of variety of  different sources , including  Volume  related sources, and can be plotted along with MACD in the same window and all those features are available and presented within a single indicator, MACD-X
Different calculation techniques lead to different values for MACD Line, as will further discuss below, and as a consequence the signal line and the histogram values will differentiate accordingly. Mathematical calculation of both signal line and the histogram remain the same. 
 Main features of MACD-X ; 
 
1-	Introduces  different proven techniques applied on MACD calculation , such as  MACD-Histogram, MACD-Leader and MACD-Source, besides the traditional MACD (MACD-TRADITIONAL) 
•	 MACD-Traditional ,  by Gerald Appel 
It is the MACD that we know, stated as traditional just to avoid confusion with other techniques used with this study 
•	 MACD-Histogram ,  by Thomas Aspray 
The MACD-Histogram measures the distance between MACD and its signal line (the 9-day EMA of MACD). Aspray developed the MACD-Histogram to anticipate signal line crossovers in MACD. Because MACD uses moving averages and moving averages lag price, signal line crossovers can come late and affect the reward-to-risk ratio of a trade. Bullish or bearish divergences in the MACD-Histogram can alert chartists to an imminent signal line crossover in MACD
The MACD-Histogram represents the difference between MACD and its 9-day EMA, the signal line.  Mathematically, 
   macdx = macd - ma(macd, signal_length)
Aspray's contribution served as a way to anticipate (and therefore cut down on lag) possible MACD crossovers which are a fundamental part of the indicator.
Here come a question, what if repeat the same calculations once more (macdh2 = macdh - ma(macdh, signal_length), will it be even better, this question will remain to be tested  
•	 MACD-Leader ,  by Giorgos E. Siligardos, PhD 
MACD  Leader has the ability to lead MACD at critical situations. Almost all smoothing methods encounter in technical analysis are based on a relative-weighted sum of past prices, and the Leader is no exception. The concealed weights of MACD Leader are such that more relative weight is used in the more recent prices than the respective weights used by the components of MACD. In effect, the Leader expresses more changes in average price dynamics for the recent price movement than MACD, thus eventually leading MACD, especially when significant trend changes are about to take place. 
Siligardos creates two less-laggard moving averages indicators in its formula using the same periods as follows
   Indicator1 = ma(source, fast_length) + ma(source - ma(source, fast_length), fast_length)
   Indicator2 = ma(source, slow_length) + ma(source - ma(source, slow_length), slow_length)
and then take the difference:
   Indicator1 - Indicator2
The result is a new MACD  Leader indicator
   macdx = macd + ma(source - fast_ma, fast_length) - ma(source - slow_ma, slow_length)
•	 MACD-Source ,  a custom experimental interpretation of mine , 
MACD Source, presents an application of MACD that evaluates Source/MA Ratio, relatively with less lag,  as a basis for MACD Line, also can be expressed as source convergence/divergence to its moving average. Among the various techniques for removing the lag between price and moving average (MA) of the price, one in particular stands out: the addition to the moving average of a portion of the difference between the price and MA. MACD Source, is based on signal length mean of the difference between Source and average value of shot length and long length moving average  of the source (Source/MA Ratio), where the source is actual value and hence no lag and relatively less lag with the average value of moving average  of the source . Mathematically expressed as,
macdx = ma(source - avg( ma(source, fast_length), ma(source, slow_length) ), signal_length)
MACD Source provides relatively early crossovers comparing to MACD and better momentum direction indications, assuming the lengths are set to same values   
For further details, you are invited to check the following two studies, where the first seeds were sown of the MACD-Source idea 
 Price Distance to its Moving Averages  study, adapts the idea of “Prices high above the moving average (MA) or low below it are likely to be remedied in the future by a reverse price movement", presented in an article by Denis Alajbeg, Zoran Bubas and Dina Vasic published in International Journal of Economics, Commerce and Management
First MACD like interpretation comes with the second study named as “ P-MACD ”, where P stands for price,  P-MACD study attempts to display relationship between Price and its 20 and 200-period moving average.   Calculations with P-MACD were based on price distance (convergence/divergence) to its  200-period moving average, and moving average  convergence/divergence of 20-period moving average to 200-period moving average of price. 
Now as explained above,  MACD Source  is a one adapted with traditional MACD, where Source stands for Price, Volume Indicator etc, any source applicable with MACD concept 
2-	Allows  usage of variety of different sources, including Volume related  indicators 
The most common usage of Source for MACD calculation is close value of the financial instruments price. As an experimental approach, this study will allow source to be selected as one of the following series;
•	Current Close Price (close)
•	Average of High, Low, and Close Price (hlc3)
•	On Balance Volume (obv)
•	Accumulation Distribution (accdist)
•	Price Volume Trend (pvt)
Where, 
-Current Close Price and Average of High, Low, and Close Price are price actions of the financial instrument 
- Accumulation Distribution  is a volume based indicator designed to measure underlying supply and demand
- On Balance Volume (OBV) ,  is a momentum indicator that measures positive and negative volume flow
- Price Volume Trend (PVT)  is a momentum based indicator used to measure money flow
3-	Can  be plotted along with MACD  in the same window using the same scaling
Default setting of MACD-X will display MACD-Source with Current Close Price as a source and traditional MACD can be plotted eighter as a companion of MACD-X or can be selected to be plotted alone. 
Applying both will add ability to compare, or use as a confirmation of one other 
In case, traditional MACD Is plotted along with MACD-X to avoid misinterpreting,  the lines plotted, the area between MACD-X Line and Signal-X Line is highlighted automatically, even if the highlight option not selected. Otherwise highlight will be applied only if that option selected
4-	 4C  Histogram
Histogram is plotted with four colors to emphasize the momentum and direction 
5-	Customizable   
Additional to ability of selecting Calculation Method,  Source, plotting along with MACD, there are few other option that allows users to customize the MACD-X indicator 
 Lengths  are configurable, default values are set as 12, 26, 9 respectively for fast, slow and smoothing length. Setting lengths to 8,21,5  respectively Is worth checking, slower length moving averages will lead to less lag and earlier reaction to price actions but yet requires a caution and back testing  before applying 
 Highlight  the area between MACD-X Line and Signal-X Line, with colors emphasising the direction 
 Label  can be added to display Calculation Method, Source and Length  settings, the aim of this label is to server only as a reminder to trades to be aware of settings while they are occupied with charts, analysis etc. 
Here comes another question, which is of more importance having the reminder or having the indicators with multi timeframe feature? Build-in Multi Time Frame features of Pine is not supported when labels and lines introduced in the script, there are other methods but brings complexity. To be studied further, this version will be with labels for time being.  
 Epilogue
 
MACD-X is an alternative variant of MACD, the insight/signals provided by MACD are also applicable to MACD-X with early and clear warnings for the changes in the trend. 
If MACD is essential to your analysis, then it is my guess that after using the MACD-X for a while and familiarizing yourself with its unique character and personality, you will make it an inseparable companion to other indicators in your charts. 
The various signals generated by MACD/MACD-X are easily interpreted and very few indicators in technical analysis have proved to be more reliable than the MACD, and this relatively simple indicator can quickly be incorporated into any short-term trading strategy
 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 constitutes professional and/or financial advice. You alone 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
RedK_Supply/Demand Volume Viewer v1Background
============
VolumeViewer is a volume indicator, that offers a simple way to estimate the movement and balance (or lack of) of supply & demand volume based on the shape of the price bar. i put this together few years ago and i have a version of this published for another platform under different names (Directional Volume, BetterVolume) in case you come across them
what is V.Viewer
=====================
The idea here is to find a "simple proxy" for estimating the demand or supply portions of a volume bar - these 2 forces have the potential to affect the current price trend so we want an easy way to track them - or to understand if a stock is in accumulation or distribution - we want to do this without having access to Level II or bid/ask data, and without having to get into the complexity of exploring the lower timeframe price & volume data 
- to achieve that, we depend on a simple assumption, that the volume associated with an up move is "demand" and the volume associated with a down move is "Supply".  so we basically extrapolate these supply and demand values based on how the bar looks like - a full "green" price bar / candle will be considered 100% demand, and a full "red" price bar will be considered 100% supply - a bar that opens and closes at the same level will be 50/50 split between supply & demand. 
- you may say this is a "too simple" of an assumption to make, but believe me, it works :) at least at the basic scenario we need here: i'm just exploring the volume movement and finding key levels - and it provides a good improvement compared to the classic way we see volume on a chart - which is still available here in VolumeViewer.
in all cases, i consider this to be work in progress, so i'd welcome any ideas to improve (without getting too complicated) - there's already a host of great volume-based indicators that will do the multi timeframe drill down, but that's not my scope here.
Technical Jargon & calculation
===========================
1. first we calculate a score % for the volume portion that is considered demand based on the bar shape 
skip this part if it sounds too technical =>   if you're into coding indicators, you would probably know there are couple of different concepts for that algorithm - for example, the one used in Balance Of Power formula - which i'm a big fan of - but the one i use here is different. (how?) this is my own, ant it simply applies double weight for the "wick" parts of a price bar compared to the "body of the bar" -- i did some side-by-side comparison in past and decided this one works better. you can change it in the code if you like
 
2. after calculating the Bull vs Bears portion of volume, we take a moving average of both for the length you set, to come up with what we consider to be the Demand vs Supply - as usual, i use a weighted moving average (WMA) here.
3. the balance or net volume between these 2 lines is calculated, then we apply a final smoothing and that's the main plot we will get
4. being a very visual person, i did my best to build up the visuals in the correct order - then also to ensure the "study title" bar is properly organized and is simple and useful (Full Volume, Supply, Demand, Net Volume). 
- i wish there was a way in Pine to hide a value that i still need to visually plot but don't want it showing its value on the study title bar, but couldn't find it. so the last plot value is repeated twice.
How to use
===========
- V.Viewer is set up to show the simplified view by default for simplicity. so when you first add it to a chart, you will get only the supply vs demand view you can see in the middle pane in the above chart
- Optional / detailed mode: go into the settings, and expose all other plots, you will be able to add the classic volume histogram, and the Supply / Demand lines - note these 2 lines will be overlay-ed on top of each other - this provides an easy way to see who is in control - especially if you change the display of these 2 lines into "area" style. This is what is showing in the lower pane in the above chart.
** Exploring Key Price Levels
- the premise is, at spots where there's big lack of balance, that's where to expect to find key price levels (support / resistance) and these price levels will come into play in future so can be used to set entry / exit targets for our trades - see the example in the AAPL chart where you can easily locate these "balance or reversal levels" using the tops/bottoms/zero-crossings from the Net Volume line
** Use for longer-term Price Analysis 
- we can also use this simple indicator to gain more insights (at a high level) of the price in terms of accumulation vs distribution and if the sellers or buyers are in control - for example, in the above AAPL chart, V.Viewer tells us that buyers have been in control since October 19 - even during the recent drop, demand continued to be in play - compare that to DIS chart below for the same period, where it shows that the market was dumping DIS thru the weakness. DIS was bleeding red most of the time
Final thoughts
=============
- V.Viewer is an attempt to enhance the way we see and use Volume by leveraging the shape of the price bar to estimate volume supply & demand - and the Net between the 2
- it will work for stocks and other instruments as long as there's volume data
- note that V.Viewer does not track trend. each bar is taken in isolation of prior bars - the price may be going down and V.Viewer is showing supply going up (absorption scenario?) - so i suggest you do not use it to make decisions without consulting other trend / momentum indicators - of course this is a possible improvement idea, or can be implemented in another indicator, add in trend somehow, or maybe think of making this a +100 / -100 Oscillator .. feel free to play with these thoughts 
- all thoughts welcome - if this is useful to you in your trading, please share with other trades here to learn from each other
- the code is commented - please feel free to use it as you like, or build things on top of it - but please continue to credit the author of this code :)
good luck!
- 
stock gain% vs index gain %This shows the relative strength or weakness of a stock vs an index on any given candle price movement.
Negative stock candle and relative strength shows accumulation 
Positive stock candle and relative weakness shows distribution
accumulation will plot an 'A'
distribution will plot a 'D'
MCI and VCI - Modified CCI FormulasFor private peeps only
- Takes a modified version of the CCI formula into 2 parts
VCI - Volume Channel Index (Yellow Histogram)
 - Measures accurate accumulation and distribution levels and times 
MCI - Modified Channel Index
 - Measures (when compared to VCI) levels where clearly buys are interested vs not interested.
Example: 
If VCI > MCI 
 - Shows buyer's are more than interested in buying, you've either hit a bottom or heavy resistance
if MCI > VCI
 - Show's buyer's aren't interested and will most likely result in a dump/lower price
Great for monitoring accumulation and distribution, these auto buy and sells look for the transition points over 0, works on EVERY commodity/stock/FOREX/Crypto
Results are from trading 1 BTC x25 leveraging. Not all trades will get in if put in at limit, but it does survive with profits after the massive 0.075 fee (results shown are after fees)
Chaikin MF% (CMFP) w. Alerts, Bells & Whistles [LucF]This is Chaikin’s Money Flow indicator on a 0-100 scale with buy/sell signals, alerts and other bells & whistles.
It includes:
- a fast EMA (16 periods by default),
- a slow MA (64 periods by default),
- histograms,
- 3 different sorts of crosses,
- big swings identification,
- buy/sell signals on CMFP crossing back from outside user-defined levels,
- buy/sell signals on the slow MA pivots above/below user-defined levels,
- alerts on big swings and buy/sells.
This indicator started with @LazyBear code (VAPI) at:
@cI8DH then changed the scale to 0-100, which I find very useful:
I then added the rest.
The chart above shows both clean and busy versions of the indicator.
Note that the default length is 10 rather than the commonly used 20. I use CMFP in conjunction with VFI and like the fact that it is faster than VFI. The default inputs show the way I normally use this indicator, with the slow MA shown in histogram mode. I find it gives good context to the signal line. Crosses between the two are often useful.
The buy/sell signals aren’t the main attraction of this indicator, and nothing to write home about. Like the big swing markers, I think it’s more realistic to view them as pointers to potentially interesting areas on charts. Their nature makes them more suited to identifying reversals. They certainly aren’t reliable enough to turn this study into a strategy and I normally don’t use them. The levels pre-defined for the buy/sell signals on CMFP are most useful on short intervals. The buy/sell signals on the slow MA pivots work on a more complete range of intervals. Optimization for your specific instruments and intervals will improve their reliability.
As usual when defining alerts, be sure you already have defined proper inputs and that you are on the intended interval, as they will be used when triggering alerts.
Klinger Volume Oscillator (KVO) Backtest The Klinger Oscillator (KO) was developed by Stephen J. Klinger. Learning 
 from prior research on volume by such well-known technicians as Joseph Granville, 
 Larry Williams, and Marc Chaikin, Mr. Klinger set out to develop a volume-based 
 indicator to help in both short- and long-term analysis.
 The KO was developed with two seemingly opposite goals in mind: to be sensitive 
 enough to signal short-term tops and bottoms, yet accurate enough to reflect the 
 long-term flow of money into and out of a security.
 The KO is based on the following tenets:
 Price range (i.e. High - Low) is a measure of movement and volume is the force behind 
 the movement. The sum of High + Low + Close defines a trend. Accumulation occurs when 
 today's sum is greater than the previous day's. Conversely, distribution occurs when 
 today's sum is less than the previous day's. When the sums are equal, the existing trend 
 is maintained.
 Volume produces continuous intra-day changes in price reflecting buying and selling pressure. 
 The KO quantifies the difference between the number of shares being accumulated and distributed 
 each day as "volume force". A strong, rising volume force should accompany an uptrend and then 
 gradually contract over time during the latter stages of the uptrend and the early stages of 
 the following downtrend. This should be followed by a rising volume force reflecting some 
 accumulation before a bottom develops.
 You can change long to short in the Input Settings
 Please, use it only for learning or paper trading. 
Klinger Volume Oscillator (KVO) Strategy The Klinger Oscillator (KO) was developed by Stephen J. Klinger. Learning 
 from prior research on volume by such well-known technicians as Joseph Granville, 
 Larry Williams, and Marc Chaikin, Mr. Klinger set out to develop a volume-based 
 indicator to help in both short- and long-term analysis.
 The KO was developed with two seemingly opposite goals in mind: to be sensitive 
 enough to signal short-term tops and bottoms, yet accurate enough to reflect the 
 long-term flow of money into and out of a security.
 The KO is based on the following tenets:
 Price range (i.e. High - Low) is a measure of movement and volume is the force behind 
 the movement. The sum of High + Low + Close defines a trend. Accumulation occurs when 
 today's sum is greater than the previous day's. Conversely, distribution occurs when 
 today's sum is less than the previous day's. When the sums are equal, the existing trend 
 is maintained.
 Volume produces continuous intra-day changes in price reflecting buying and selling pressure. 
 The KO quantifies the difference between the number of shares being accumulated and distributed 
 each day as "volume force". A strong, rising volume force should accompany an uptrend and then 
 gradually contract over time during the latter stages of the uptrend and the early stages of 
 the following downtrend. This should be followed by a rising volume force reflecting some 
 accumulation before a bottom develops.
 WARNING:
 This script to change bars colors.
Volume-Price Shift Box (Lite Version)Description 
This indicator is a clean and intuitive visual tool designed to help traders quickly assess the current balance of bullish and bearish forces in the market.
It combines volume, price movement, VWAP, and OBV dynamics into a compact on-chart table that updates in real time.
This version focuses on the core logic and visualization of momentum and volume shifts, making it ideal for traders who want actionable insight without complex configuration.
 How It Works 
The script measures the combined strength of multiple market components:
 
 VWAP trend indicates price bias relative to fair value.
 OBV (On-Balance Volume) tracks volume flow to confirm or contradict price movement.
 Volume ratio compares current volume to its recent average.
 Momentum evaluates directional price movement over a configurable lookback period.
 Accumulation / Distribution (A/D) Line estimates buying or selling pressure within each candle:
↑ — A/D is rising (buying pressure is increasing)
↑↑ — A/D is rising faster than before (acceleration of buying)
↓ — A/D is falling (selling pressure is increasing)
↓↓ — A/D is falling faster than before (acceleration of selling)
 
Each of these components contributes to an overall shift score.
Depending on this score, the box displays:
🟢 Bullish Shift — strong upward alignment
🔴 Bearish Shift — downward alignment
⚪ Neutral — mixed or indecisive conditions
 Key Features 
 
 Compact on-chart information box with color-coded parameters
 Combined volume-price relationship model
 Configurable lookback and sensitivity controls
 Real-time shift strength and trend duration tracking
 Adjustable EMA/SMA smoothing for all averages
 Lightweight design optimized for clarity
 
 Inputs Overview 
 
 Box Position / Size – Place and scale the on-chart info box
 Lookback Period – Number of bars used for calculations
 VWAP Lookback – Period for VWAP distance smoothing
 Shift Sensitivity – Adjusts reaction strength of bullish/bearish shifts
 Neutral Zone Threshold – Defines when the market is considered neutral
 EMA or SMA – Choose exponential or simple moving averages
 Component Weights – Set the influence of VWAP, OBV, Volume, and Momentum on the shift score
 Display Toggles – Enable or disable metrics shown in the box (Strength, Volume, VWAP, Duration, OBV)
 
 How to Use 
 
 Apply the indicator to any symbol and timeframe.
 Observe the box on the chart — it updates dynamically.
 Look for transitions between Neutral → Bullish or Neutral → Bearish shifts.
 Combine with your existing price action or confirmation tools (e.g., support/resistance, trendlines).
 Use the “Strength” and “Duration” values to assess consistency and momentum quality.
 
 (This indicator is not a buy/sell signal generator — it is designed as a contextual analysis and confirmation tool.) 
 How It Helps 
 
 Merges several key volume and price metrics into a single view
 Highlights transitions in market control between buyers and sellers
 Reduces clutter by presenting only relevant context data
 Works on any market and timeframe, from scalping to swing trading
 
⚠️Disclaimer:
This script is provided for educational and informational purposes only. It is not financial advice and should not be considered a recommendation to buy, sell, or hold any financial instrument. Trading involves significant risk of loss and is not suitable for every investor. Users should perform their own due diligence and consult with a licensed financial advisor before making any trading decisions. The author does not guarantee any profits or results from using this script, and assumes no liability for any losses incurred. Use this script at your own risk.
Retail vs Banker Net Positions – Symmetry BreakRetail vs Banker Net Positions – Symmetry Break (Institution Focus) 
 Description: 
This advanced indicator is a volume-proxy-based positioning tool that separates institutional vs. retail behavior using bar structure, trend-following logic, and statistical analysis. It identifies net position flows over time, detects institutional aggression spikes, and highlights symmetry breaks—those moments when institutional action diverges sharply from retail behavior. Designed for intraday to swing traders, this is a powerful tool for gauging smart money activity and retail exhaustion.
 What It Does: 
Separates Volume into Two Groups:
 Institutional Proxy:  Volume on large bars in trend direction
 Retail Proxy:  Volume on small or counter-trend bars
 Calculates Net Positions (%): 
Smooths cumulative buying vs. selling behavior for each group over time.
 Highlights Symmetry Breaks: 
Alerts when institutions make statistically abnormal moves while retail is quiet or doing the opposite.
 Detects Extremes in Institutional Activity: 
Flags major tops/bottoms in institutional positioning using swing pivots or rolling windows.
 Retail Sentiment Flips: 
Marks when the retail line crosses the zero line (e.g., flipping from net short to net long).
  How to Use It: 
 Interpreting the Two Lines: 
Aqua/Orange Line (Institutional Proxy):
Rising above zero = Net buying bias
Falling below zero = Net selling bias
Lime/Red Line (Retail Proxy):
Green = Retail buying; Red = Retail selling
Watch for crosses of zero for sentiment shifts
 Spotting Symmetry Breaks: 
Pink Circle or Background Highlight =
Institutions made a sharp, outsized move while retail was:
Quiet (low ROC), or
Moving in the opposite direction
These often precede explosive directional moves or stop hunts.
 Institutional Extremes: 
Marked with aqua (top) or orange (bottom) dots
Based on swing pivot logic or rolling highs/lows in institutional positioning
Optional filter: Only show extremes that coincide with a symmetry break
 Settings You Can Tune: 
Lookback lengths for trend, z-scores, smoothing
Z-Score thresholds to control sensitivity
Retail quiet filters to reduce false positives
Cool-down timer to avoid rapid repeat signals
Toggle visual aids like shading, markers, and threshold lines
 Alerts Included: 
-Retail flips (green/red)
- Institutional symmetry breaks
- Institutional extreme tops/bottoms
  Strategy Tip: 
Use this indicator to track institutional accumulation or distribution phases and catch asymmetric inflection points where the "smart money" acts decisively. Confluence with price structure or FVGs (Fair Value Gaps) can further enhance signal quality.
CK Trading RSIRSI with colour-coded areas for accumulation, BUY, take profit and SELL zones. Ideally, it can be used on the 8-hour chart over a longer period of time.
Volume Sentiment Breakout Channels [AlgoAlpha]🟠 OVERVIEW 
This tool visualizes breakout zones based on  volume sentiment within dynamic price channels . It identifies high-impact consolidation areas, quantifies buy/sell dominance inside those zones, and then displays real-time shifts in sentiment strength. When the market breaks above or below these sentiment-weighted channels, traders can interpret the event as a change in conviction, not just a technical breakout.
🟠 CONCEPTS 
The script builds on two layers of logic:
 
   Channel Detection : A volatility-based algorithm locates price compression areas using normalized highs and lows over a defined lookback. These “boxes” mark accumulation or distribution ranges.
   Volume Sentiment Profiling : Each channel is internally divided into small bins, where volume is aggregated and signed by candle direction. This produces a granular sentiment map showing which levels are dominated by buyers or sellers.
 
When a breakout occurs, the script clears the previous box and forms a new one, letting traders visually track transitions between phases of control. The colored gradients and text updates continuously reflect the internal bias—green for net-buying, red for net-selling—so you can see conviction strength at a glance.
🟠 FEATURES 
 
  Volume-weighted sentiment map inside each box, with gradient color intensity proportional to participation.
  
  Dynamic text display of current and overall sentiment within each channel.
  
  Real-time trail lines to show active bullish/bearish trend extensions after breakout.
  
 
🟠 USAGE 
 
   Setup : Add the script to your chart and enable  Strong Closes Only  if you prefer cleaner breakouts. Use shorter normalization length (e.g., 50–80) for fast markets; longer (100–200) for smoother transitions.
   Read Signals : Transparent boxes mark active sentiment channels. Green gradients show buy-side dominance, red shows sell-side. The middle dashed line is the equilibrium of the channel. “▲” appears when price breaks upward, “▼” when it breaks downward.
  
   Understanding Sentiment : The sentiment profile can be used to show the probability of the price moving up or down at respective price levels.
  
 
Macros Kill Zones Fusionadas (:20 - :40) / :50 - :10)Tiempo y precio ICT
Macros :20 - :40 representa el momento en que el algoritmo institucional confirma dirección y ejecuta desplazamiento tras inducir la liquidez de apertura.
Macros :50 - :10 es la fase de manipulación o acumulación previa al desplazamiento principal.
Time and Price in ICT
Macros :20 - :40 represent the moment when the institutional algorithm confirms direction and executes the displacement after inducing opening liquidity.
Macros :50 - :10 mark the manipulation or accumulation phase that occurs before the main displacement.
Price Action Brooks ProPrice Action Brooks Pro (PABP) - Professional Trading Indicator
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 OVERVIEW
Price Action Brooks Pro (PABP) is a professional-grade TradingView indicator developed based on Al Brooks' Price Action trading methodology. It integrates decades of Al Brooks' trading experience and price action analysis techniques into a comprehensive technical analysis tool, helping traders accurately interpret market structure and identify trading opportunities.
• Applicable Markets: Stocks, Futures, Forex, Cryptocurrencies
• Timeframes: 1-minute to Daily (5-minute chart recommended)
• Theoretical Foundation: Al Brooks Price Action Trading Method
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎯 CORE FEATURES
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1️⃣ INTELLIGENT GAP DETECTION SYSTEM
Automatically identifies and marks three critical types of gaps in the market.
TRADITIONAL GAP
• Detects complete price gaps between bars
• Upward gap: Current bar's low > Previous bar's high
• Downward gap: Current bar's high < Previous bar's low
• Hollow border design - doesn't obscure price action
• Color coding: Upward gaps (light green), Downward gaps (light pink)
• Adjustable border: 1-5 pixel width options
TAIL GAP
• Detects price gaps between bar wicks/shadows
• Analyzes across 3 bars for precision
• Identifies hidden market structure
BODY GAP
• Focuses only on gaps between bar bodies (open/close)
• Filters out wick noise
• Disabled by default, enable as needed
Trading Significance:
• Gaps signal strong momentum
• Gap fills provide trading opportunities
• Consecutive gaps indicate trend continuation
✓ Independent alert system for all gap types
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2️⃣ RTH BAR COUNT (Trading Session Counter)
Intelligent counting system designed for US stock intraday trading.
FEATURES
• RTH Only Display: Regular Trading Hours (09:30-15:00 EST)
• 5-Minute Chart Optimized: Displays every 3 bars (15-minute intervals)
• Daily Auto-Reset: Counting starts from 1 each trading day
SMART COLOR CODING
• 🔴 Red (Bars 18 & 48): Critical turning moments (1.5h & 4h)
• 🔵 Sky Blue (Multiples of 12): Hourly markers (12, 24, 36...)
• 🟢 Light Green (Bar 6): Half-hour marker (30 minutes)
• ⚫ Gray (Others): Regular 15-minute interval markers
Al Brooks Time Theory:
• Bar 18 (90 min): First 90 minutes determine daily trend
• Bar 48 (4 hours): Important afternoon turning point
• Hourly markers: Track institutional trading rhythm
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
3️⃣ FOUR-LINE EMA SYSTEM
Professional-grade configurable moving average system.
DEFAULT CONFIGURATION
• EMA 20: Short-term trend (Al Brooks' most important MA)
• EMA 50: Medium-short term reference
• EMA 100: Medium-long term confirmation
• EMA 200: Long-term trend and bull/bear dividing line
FLEXIBLE CUSTOMIZATION
Each EMA can be independently configured:
• On/Off toggle
• Data source selection (close/high/low/open, etc.)
• Custom period length
• Offset adjustment
• Color and transparency
COLOR SCHEME
• EMA 20: Dark brown, opaque (most important)
• EMA 50/100/200: Blue-purple gradient, 70% transparent
TRADING APPLICATIONS
• Bullish Alignment: Price > 20 > 50 > 100 > 200
• Bearish Alignment: 200 > 100 > 50 > 20 > Price
• EMA Confluence: All within <1% = major move precursor
Al Brooks Quote:
"The EMA 20 is the most important moving average. Almost all trading decisions should reference it."
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4️⃣ PREVIOUS VALUES (Key Prior Price Levels)
Automatically marks important price levels that often act as support/resistance.
THREE INDEPENDENT CONFIGURATIONS
Each group configurable for:
• Timeframe (1D/60min/15min, etc.)
• Price source (close/high/low/open/CurrentOpen, etc.)
• Line style and color
• Display duration (Today/TimeFrame/All)
SMART OPEN PRICE LABELS ⭐
• Auto-displays "Open" label when CurrentOpen selected
• Label color matches line color
• Customizable label size
TYPICAL SETUP
• 1st Line: Previous close (Support/Resistance)
• 2nd Line: Previous high (Breakout target)
• 3rd Line: Previous low (Support level)
Al Brooks Magnet Price Theory:
• Previous open: Price frequently tests opening price
• Previous high/low: Strongest support/resistance
• Breakout confirmation: Breaking prior levels = trend continuation
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
5️⃣ INSIDE & OUTSIDE BAR PATTERN RECOGNITION
Automatically detects core candlestick patterns from Al Brooks' theory.
ii PATTERN (Consecutive Inside Bars)
• Current bar contained within previous bar
• Two or more consecutive
• Labels: ii, iii, iiii (auto-accumulates)
• High-probability breakout setup
• Stop loss: Outside both bars
Trading Significance:
"Inside bars are one of the most reliable breakout setups, especially three or more consecutive inside bars." - Al Brooks
OO PATTERN (Consecutive Outside Bars)
• Current bar engulfs previous bar
• Two or more consecutive
• Labels: oo, ooo (auto-accumulates)
• Indicates indecision or volatility increase
ioi PATTERN (Inside-Outside-Inside)
• Three-bar combination: Inside → Outside → Inside
• Auto-detected and labeled
• Tug-of-war pattern
• Breakout direction often very strong
SMART LABEL SYSTEM
• Auto-accumulation counting
• Dynamic label updates
• Customizable size and color
• Positioned above bars
✓ Independent alerts for all patterns
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💡 USE CASES
INTRADAY TRADING
✓ Bar Count (timing rhythm)
✓ Traditional Gap (strong signals)
✓ EMA 20 + 50 (quick trend)
✓ ii/ioi Patterns (breakout points)
SWING TRADING
✓ Previous Values (key levels)
✓ EMA 20 + 50 + 100 (trend analysis)
✓ Gaps (trend confirmation)
✓ iii Patterns (entry timing)
TREND FOLLOWING
✓ All four EMAs (alignment analysis)
✓ Gaps (continuation signals)
✓ Previous Values (targets)
BREAKOUT TRADING
✓ iii Pattern (high-reliability setup)
✓ Previous Values (targets)
✓ EMA 20 (trend direction)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎨 DESIGN FEATURES
PROFESSIONAL COLOR SCHEME
• Gaps: Hollow borders + light colors
• Bar Count: Smart multi-color coding
• EMAs: Gradient colors + transparency hierarchy
• Previous Values: Customizable + smart labels
CLEAR VISUAL HIERARCHY
• Important elements: Opaque (EMA 20, bar count)
• Reference elements: Semi-transparent (other EMAs, gaps)
• Hollow design: Doesn't obscure price action
USER-FRIENDLY INTERFACE
• Clear functional grouping
• Inline layout saves space
• All colors and sizes customizable
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📚 AL BROOKS THEORY CORE
READING PRICE ACTION
"Don't try to predict the market, read what the market is telling you."
PABP converts core concepts into visual tools:
• Trend Assessment: EMA system
• Time Rhythm: Bar Count
• Market Structure: Gap analysis
• Trade Setups: Inside/Outside Bars
• Support/Resistance: Previous Values
PROBABILITY THINKING
• ii pattern: Medium probability
• iii pattern: High probability
• iii + EMA 20 support: Very high probability
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚙️ TECHNICAL SPECIFICATIONS
• Pine Script Version: v6
• Maximum Objects: 500 lines, 500 labels, 500 boxes
• Alert Functions: 8 independent alerts
• Supported Timeframes: All (5-min recommended for Bar Count)
• Compatibility: All TradingView plans, Mobile & Desktop
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🚀 RECOMMENDED INITIAL SETTINGS
GAPS
• Traditional Gap: ✓
• Tail Gap: ✓
• Border Width: 2
BAR COUNT
• Use Bar Count: ✓
• Label Size: Normal
EMA
• EMA 20: ✓
• EMA 50: ✓
• EMA 100: ✓
• EMA 200: ✓
PREVIOUS VALUES
• 1st: close (Previous close)
• 2nd: high (Previous high)
• 3rd: low (Previous low)
INSIDE & OUTSIDE BAR
• All patterns: ✓
• Label Size: Large
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🌟 WHY CHOOSE PABP?
✅ Solid Theoretical Foundation
Based on Al Brooks' decades of trading experience
✅ Complete Professional Features
Systematizes complex price action analysis
✅ Highly Customizable
Every feature adjustable to personal style
✅ Excellent Performance
Optimized code ensures smooth experience
✅ Continuous Updates
Constantly improving based on feedback
✅ Suitable for All Levels
Benefits beginners to professionals
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📖 RECOMMENDED LEARNING
Al Brooks Books:
• "Trading Price Action Trends"
• "Trading Price Action Trading Ranges"
• "Trading Price Action Reversals"
Learning Path:
1. Understand basic candlestick patterns
2. Learn EMA applications
3. Master market structure analysis
4. Develop trading system
5. Continuous practice and optimization
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠️ RISK DISCLOSURE
IMPORTANT NOTICE:
• For educational and informational purposes only
• Does not constitute investment advice
• Past performance doesn't guarantee future results
• Trading involves risk and may result in capital loss
• Trade according to your risk tolerance
• Test thoroughly in demo account first
RESPONSIBLE TRADING:
• Always use stop losses
• Control position sizes reasonably
• Don't overtrade
• Continuous learning and improvement
• Keep trading journal
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📜 COPYRIGHT
Price Action Brooks Pro (PABP)
Author: © JimmC98
License: Mozilla Public License 2.0
Pine Script Version: v6
Acknowledgments:
Thanks to Dr. Al Brooks for his contributions to price action trading. This indicator is developed based on his theories.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Experience professional-grade price action analysis now!
"The best traders read price action, not indicators. But when indicators help you read price action better, use them." - Al Brooks
Previous D/W/M HLOCHey traders,
Here's a simple Multi-Timeframe indicator that essentially turns time and price into a box. It'll take the previous high, low, opening price, or closing price from one of the three timeframes of your choice (day, week, or month). For whatever reason I can't get the opening price to function consistently so if you find improvements feel free to let me know, this will help traders who prefer to use opening price over closing price.
Naturally this form of charting is classical and nature and some key figures you could use to study its usage are
- Richard W. Schabacker (1930s)
- Edwards & Magee (1948)
- Peter Brandt
- Stacey Burke (more on the intraday side - typically our preference)
It's usage put plainly:
- Quantifying Accumulation or Distribution
- Revealing Energy Build-Up (Compression)
- Framing Breakouts and False Breakouts
- Structuring Time
- Identifying opportunities to trade a daily, weekly, or monthly range. 






















