Custom Buy/Sell Pattern BuilderAre you tired of using trading indicators that only let you follow fixed, pre-designed rules? Do you wish you could build your own “Buy” or “Sell” signals, experiment with your own ideas, or see instantly if your unique pattern works—without learning coding or hiring a developer?
The Custom Buy/Sell Pattern Builder is designed for YOU.
This TradingView indicator lets ANY trader—even a complete beginner—define exactly what kind of price and volume conditions should create a BUY or SELL label on any chart, in any market, at any timeframe.
You don’t need to know programming. You don’t need to know the definition of a hammer, doji, volume spike, or Engulfing pattern.
With a few clicks and easy dropdown choices, you can:
Make your own rules for buying or selling
Choose how many candles your pattern should look at
Decide if you want the biggest body, the lowest volume, the biggest movement, or any combination you can imagine
The result?
You’ll see clear “BUY” or “SELL” labels automatically show up on your chart whenever the exact rule YOU built matches current price action.
No more guessing. No more forced strategies. Just pure control and visual feedback!
Why Is This Powerful?
Traditional indicators (like MACD, RSI, or even classic candlestick scanners) work the same for everyone—and only as their inventors defined.
But every trader, and every market, is unique.
What if you could say:
“Show me a ‘SELL’ every time the newest candle is bigger than the one before, but with LESS volume, while the bar before that had an even smaller body—but more volume than all others?”
With this tool, it’s EASY!
You simply pick which candle you want to compare (most recent, previous, etc), what to compare (body or volume—body means the candle’s “thickness”, from open to close), choose “greater than”, “less than”, or “equal to”, and set a multiplier if you want (like “half as much”, “twice as big”, etc).
After this, if any bar on the chart fits all your rules, it will mark it as a BUY or SELL, depending on your selection.
This means—
Beginners can start experimenting with their intuition or small ideas, without tech hurdles
Experienced traders can visualize and fine-tune any possible logic, before they commit to backtesting or automating a real strategy
Every “what if” or “I wonder” setup is just 2–3 clicks away
How Does It Work? Simple Steps
1. Choose Your Signal Type
“Buy” or “Sell”
This tells the indicator whether to mark the qualifying bars with a green “BUY” or red “SELL” label
2. Pick How Many Candles To Use
“Pattern Candle Count” input (2, 3, or 4)
Example: If you use 4, the pattern will be applied to the most recent 4 candles at every step
3. Define Your Pattern With Inputs
For each candle (from newest “0” to oldest “3”), you can set:
Body Condition (example: “is this candle’s body bigger/smaller/equal to another?”)
Pick which candle to compare against
Pick “>”, “<”, “>=”, “<=”, or “=”
Set a multiplier if needed (like “0.5” to mean “half as big as” or “2” for “twice as big as”)
Volume Condition (exact same choices, but based on trading volume—not the candle’s price body)
For example:
“Candle0 Body > Candle2 Body”
means “the latest candle’s real-body (open–close) is bigger than the one two bars ago.”
“Candle1 Volume <= Candle2 Volume”
means “the previous candle’s volume is less than or equal to the volume of the bar two periods ago.”
You can leave a comparison blank if you don’t want to use it for a particular candle.
What Happens After You Set Your Rules?
Every bar on your chart is checked for your logic:
If ALL body AND volume conditions are true (for each candle you specified),
AND
The signal side (“Buy” or “Sell”) matches your dropdown,
Then a green “BUY” or red “SELL” label will show right on the bar, so you can visually spot exactly where your logic works!
Practical Example:
Suppose you want an entry setup that is:
“Sell whenever the newest candle’s body is bigger than two bars ago, body before that is bigger than three bars ago, AND the newest candle’s volume is less than or equal to two bars ago, AND the candle three bars ago’s volume is less than or equal to half the candle two bars ago’s volume.”
You’d set:
Pattern Candle Count: 4
Side: Sell
Candle0 Body Ref#: 2, Op: >, Mult: 1
Candle1 Body Ref#: 3, Op: >, Mult: 1
Candle0 Vol Ref#: 2, Op: <=, Mult: 1
Candle3 Vol Ref#: 2, Op: <=, Mult: 0.5
And the script will find all “SELL” bars on your chart matching these conditions.
Inputs Section: What Does Each Setting Do?
Let’s break down each input in the indicator’s Settings one by one, so even if you’re new, you’ll understand exactly how to use it!
1. Pattern Candle Count (2–4)
What is it?
This sets how many candles in a row you want your rule to look at.
Example:
“4” means your rules are based on the most recent candle and the 3 before it.
“2” means you are only comparing the current and previous candles.
Tip:
Beginners often use 4 to spot stronger patterns, but you can experiment!
2. Signal Side
What is it?
Choose “Buy” or “Sell”. The word you pick here decides which colored label (green for Buy, red for Sell) appears if your pattern matches.
Example:
Want to spot where “Sell” is likely? Pick “Sell”.
Change to “Buy” if you want bullish signals instead.
3. Body & Volume Comparison Settings (per Candle)
For each candle (#0 is newest/current, #3 is oldest in your pattern window):
Body Comparison
Candle# Body Ref#
Choose which other candle you want to compare this one’s body to.
“0” = newest, “1” = previous, “2” = two bars ago, “3” = three bars ago
Candle# Body Op (Operator; >, <, >=, <=, =)
How do you want to compare?
“>” means “greater than” (is bigger than)
“<” means “less than” (is smaller than)
“=” means “equal to”
Candle# Body Mult (Multiplier)
If you want relative comparisons. For example, with Mult=1:
“Candle0 body > Candle2 body x 1” means just “0 is larger than 2.”
“Candle0 body > Candle2 body x 2” means “0 is more than double 2.”
Volume Comparison
Candle# Vol Ref# / Op / Mult
Exact same logic as body, but works on the “Volume” of each candle (how much was traded during that bar).
How to Set Up a Rule (Step by Step Example)
Say you want to mark a Sell every time:
The most recent candle’s real body is BIGGER than the candle 2 bars ago;
The previous candle’s body is also BIGGER than the candle 3 bars ago;
The current candle’s volume is LESS than or equal to the volume of candle 2;
The previous candle’s volume is LESS than or equal to candle 2’s volume;
The candle 3 bars ago’s volume is LESS than or equal to HALF candle 2’s volume.
You’d set:
Pattern Candle Count: 4
Side: "Sell"
Candle0 Body Ref#: 2, Op: “>”, Mult: 1
Candle1 Body Ref#: 3, Op: “>”, Mult: 1
Candle0 Vol Ref#: 2, Op: “<=”, Mult: 1
Candle1 Vol Ref#: 2, Op: “<=”, Mult: 1
Candle3 Vol Ref#: 2, Op: “<=”, Mult: 0.5
All other comparisons (operators) can be left blank if you don’t want to use them!
When these rules are met, a bright red “SELL” label will appear right above the bar matching all your conditions.
Practical Tips & FAQ for Beginners
What does “body” mean?
It’s the “true range” of the candle: the difference between open and close. This ignores wicks for simple setups.
What does “volume” mean?
This is the total trading activity during that candle/bar. Many traders believe that patterns with different volume “meaning” (such as low-volume up bars, or high-volume down bars) signal a meaningful change.
What if nothing shows on chart?
It just means your current rules are rarely or never matched! Try making your comparisons simpler (maybe just 2-body and 2-volume conditions to start).
You can always hit “Reset Settings” to go back to default.
Can I use this for both buying and selling?
YES! You can detect both bullish (Buy) and bearish (Sell) custom conditions; just switch “Signal Side.”
Do I need to know coding?
Not at all! Everything is in simple input panels.
Creative Use Cases, Example Recipes & Troubleshooting
Creative Ways to Use
Spotting Reversals
Example:
Buy when: the newest candle body is LARGER than the previous 3 bars, but ALL volumes are lower than their neighbors.
Why? Sometimes, a big candle with surprisingly low volume after a sequence of small bars can signal a reversal.
Finding Exhaustion Moves
Example:
Sell when: the current bar body is twice as big as two bars ago, but volume is half.
Why? A very big candle with very little volume compared to similar bars may show the move is “running out of steam.”
Custom “Breakout + Confirmation” Patterns
Example:
Buy when:
Candle 0’s body is greater than Candle 2’s by at least 1.5x,
Candle 0’s volume is greater than Candle 1 and Candle 2,
Candle 1’s volume is less than Candle 0.
Why? This could catch strong breakouts but filter out noisy moves.
Multi-bar Bias/Squeeze Filter
Use “Pattern Candle Count: 4”
Set all 4 volume conditions to “<” and each reference to the previous candle.
Now, a BUY or SELL only marks when each bar is “dryer”/less active than the last — a classic squeeze or low-volatility buildup.
Troubleshooting Guide
“I don’t see any Buy/Sell label; is something broken?”
Most likely, your rules are too strict or rare! Try using only two comparisons and leave other “Op” inputs blank as a test.
Double-check you have enough candles on the chart: you need at least as many bars as your pattern count.
“Why does a label appear but not where I expect?”
Remember, the script checks your rules for every NEW candle. The candle “0” is always the most recent, then “1” is one bar back, etc.
Check the color and type chosen: “Signal Side” must be “Buy” for green, “Sell” for red.
“What if I want a more complex pattern?”
Stack conditions! You can demand the body/volume of each candle in your window meet a different rule or all follow the same rule in sequence.
Mini Glossary — For Newcomers
Candle/Bar: Each bar on the chart, shows price movement during a fixed time (e.g., one minute, one hour, one day).
Body: The colored (or filled) part of the candle — the open-to-close price range.
Volume: How much of the asset was actually traded that candle/bar.
Reference Index: When you pick “2” as a reference, it means “the candle two bars ago in the pattern window.”
Operator (“Op”): The math symbol used to compare (>, <, =, etc).
Signal Side: Whether you want to highlight bullish (“Buy”) or bearish (“Sell”) bars.
Tips for Getting More Value
Start Simple—try just one or two conditions at first. See what lights up. Slowly add more logic as you get comfortable.
Watch the chart live as you change settings. The labels update instantly—this makes strategy design fast and visual!
Try flipping your ideas: If a certain pattern doesn’t work for buys, try reversing the direction for possible “sell” setups.
Remember: There is NO wrong idea. This indicator is only limited by your creativity—it’s a “strategy playground.”
Example Quick-Start Recipes
Classic Sell:
4 candles, side = Sell
Candle0 Body > Candle2; Candle1 Body > Candle3
Candle0 Vol <= Candle2; Candle1 Vol <= Candle2; Candle3 Vol <= Candle2 × 0.5
Simple Buy After Pause:
3 candles, side = Buy
Candle0 Body > Candle1; Candle0 Vol > Candle1
All other Ops blank
Low-Volume Pullback for Entry:
4 candles, side = Buy
Candle0 Body > Candle2
Candle0 Vol < Candle1; Candle1 Vol < Candle2; Candle2 Vol < Candle3
Final Words
Think of this as your “pattern lab.” No code, no guesswork—just experiment, see what the market actually gives, and design your own visual rulebook.
If you’re stuck, reset the script to defaults—it’s always safe to start again!
If you want more ready-made “recipes” for different strategies/styles, just ask and I’ll send some more setups for you.
Happy building—and may your edge always be YOUR edge!
Chartpatternanalysis
Identify Rally, Base & Drop CandleThis Pine Script indicator identifies and labels rally, base, and drop candles on your chart, aiding traders in recognizing key price action phases. Rally candles represent periods of upward price momentum, typically characterized by strong bullish movement. Base candles indicate consolidation or sideways movement, suggesting a temporary pause in the trend. Drop candles signify downward price momentum, often accompanied by strong bearish movement. By identifying these distinct candle types, traders can gain insights into the market's current phase and potential future price movements.
Key Features:
Identifies rally, base, and drop candles based on customizable criteria such as body percentage.
Labels each candle type for easy visualization and interpretation.
Helps traders identify trend continuation or potential reversal points.
Compatible with various timeframes and trading instruments.
Customizable parameters allow traders to adjust the sensitivity of the identification process to suit their trading strategies.
Usage Instructions:
Apply the indicator to your chart.
Configure the settings according to your preferences
Observe the labeled candles on the chart to identify rally, base, and drop phases.
Consider additional analysis and risk management strategies to confirm trading decisions and manage risk effectively.
Disclaimer: This indicator is provided for informational and educational purposes only. It is not intended as financial advice or trading recommendations. Trading involves risks, and it's essential to conduct thorough research and practice proper risk management techniques.
Dip & Rip Patterns - The Quant Science🇺🇸
GENERAL OVERVIEW
This indicator detects Dip and Rip patterns by quickly highlighting them on the chart.
These patterns have become popular during the pandemic period mainly in the stock, ETF and cryptocurrency markets on which traders use two interesting strategies:
Buy The Dip
Sell The Rip
Before going into the merits of this technical indicator, let's understand what these two patterns mean and what they identify precisely.
Rip (Rise In Price) : wants to identify a market condition in which the price rises rapidly, for example from $100 to $110 in a few minutes or hours.
Dip (Drop In Price) : wants to identify a market condition in which the price drops rapidly, for example from $100 to $90 in a few minutes or hours.
HOW TO USE
For a better user experience, we recommend choosing a neutral colour for the candles while analysing with this indicator. You can quickly change the colour in Chart Settings > Symbol > Candles .
Depending on the configuration set by the user, the indicator will show Dip (Dip In Price) patterns in red and Rip (Rise In Price) patterns in green.
When the pattern forms, a circle will be displayed and a vertical line will be coloured on the chart along with the body of the candle. The user will then be able to quickly and easily track the configured market conditions.
In this example, we decided to use a 4H timeframe on the BTC/USDT pair (Binance).
Set in the user interface:
Period: 20
Dip (%): -25
Rip (%): 20
Price falls by 25% or more in 80 hours (Dip Pattern).
Price rise by 25% or more in 80 hours (Rip Pattern).
The user can easily configure the parameters via the user interface in the Inputs section (A) and change the indicator design in the Properties section (B).
🇮🇹
PANORAMICA GENERALE
Questo indicatore rileva i Dip e Rip patterns evidenziandoli velocemente sul grafico.
Questi patterns sono diventati famosi durante il periodo pandemico principalmente nel mercato delle azioni, ETF e Criptovalute su cui i trader utilizzano due interessanti strategie:
Buy The Dip
Sell The Rip
Prima di entrare nel merito di questo indicatore tecnico, comprendiamo il significato di questi due pattern e cosa identificano precisamente.
Rip (Rise In Price) : vuole identificare una condizione di mercato in cui il prezzo sale rapidamente, per esempio passando da 100$ a 110$ in pochi minuti o poche ore.
Dip (Drop In Price) : vuole identificare una condizione di mercato in cui il prezzo cala rapidamente, per esempio passando da 100$ a 90$ in pochi minuti o poche ore.
UTILIZZO
Per una migliore esperienza utente consigliamo di scegliere un colore neutro per le candele mentre si analizza con questo indicatore. Puoi cambiare velocemente il colore in Chart Settings > Symbol > Candles .
In base alla configurazione impostata dall'utente l'indicatore mostrerà in rosso i pattern Dip (Dip In Price) e in verde i pattern Rip (Rise In Price).
Quando il pattern si forma verrà visualizzato un cerchio e una linea verticale sul grafico che sarà colorata insieme al corpo della candela. L'utente quindi potrà tracciare facilmente e velocemente le condizioni di mercato configurate.
In questo esempio abbiamo deciso di utilizzare un timeframe 4H con l'obbiettivo di ricercare i patterns sul pair BTC/USDT (Binance).
Impostiamo nell'interfaccia utente:
Period: 20
Dip (%): -25
Rip (%): 20
Il prezzo diminuisce del 25% o più in 80 ore (Dip Pattern).
Il prezzo aumenta del 25% o più in 80 ore (Rip Pattern).
L' utente può configurare facilmente i parametri attraverso l'interfaccia utente nella sezione Inputs (A) e modificare il design dell'indicatore nella sezione Properties (B).
Candles In Row (Expo)█ Overview
The Candles In Row (Expo) indicator is a powerful tool designed to track and visualize sequences of consecutive candlesticks in a price chart. Whether you're looking to gauge momentum or determine the prevailing trend, this indicator offers versatile functionality tailored to the needs of active traders. The Candles In Row indicator can be an integral part of a multi-timeframe trading strategy, allowing traders to understand market momentum, and set trading bias. By recognizing the patterns and likelihood of future price movements, traders can make more informed decisions and align their trades with the overall market direction.
█ How to use
The indicator enhances traders' understanding of the consecutive candle patterns, helping them to uncover trends and momentum. Consecutive candles in the same direction may indicate a strong trend. The Candles In Row indicator can be an essential tool for traders employing a multiple timeframes strategy.
Analyzing a Higher Timeframe:
Understanding Momentum: By analyzing consecutive green or red candles in a higher timeframe, traders can identify the prevailing momentum in the market. A series of green candles would suggest an upward trend, while a series of red candles would indicate a downward trend.
Predicting Next Candle: The indicator's predictive feature calculates the likelihood of the next candle being green or red based on historical patterns. This probability helps traders gauge the potential continuation of the trend.
Setting the Trading Bias: If the likelihood of the next candle being green is high, the trader may decide to focus on long (buy) opportunities. Conversely, if the likelihood of the next candle being red is high, the trader may look for short (sell) opportunities.
In this example, we are using the Heikin Ashi candles.
Moving to a Lower Timeframe:
Finding Entry Points: Once the trading bias is set based on the higher timeframe analysis, traders can switch to a lower timeframe to look for entry points in the direction of the bias. For example, if the higher timeframe suggests a high likelihood of a green candle, traders may look for buy opportunities in the lower timeframe.
Combining Timeframes for a Comprehensive Strategy:
Confirmation and Alignment: By analyzing the higher timeframe and confirming the direction in the lower timeframe, traders can ensure that they are trading in alignment with the broader trend.
Avoiding False Signals: By using a higher timeframe to set the trading bias and a lower timeframe to find entries, traders can avoid false signals and whipsaws that might be present in a single timeframe analysis.
█ Settings
Price Input Selection: Choose between regular open and close prices or Heikin Ashi candles as the basis for calculation.
Data Window Control: Decide between displaying the full data window or only the active data. You can also enable a counter that keeps track of the number of candles.
Alert Configuration: Set the desired number and color of consecutive candles that must occur in a row to trigger an alert.
Table Display Customization: Customize the location and size of the display table according to your preferences.
-----------------
Disclaimer
The information contained in my Scripts/Indicators/Ideas/Algos/Systems does not constitute financial advice or a solicitation to buy or sell any securities of any type. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
My Scripts/Indicators/Ideas/Algos/Systems are only for educational purposes!
Pattern Forecast (Expo)█ Overview
The Pattern Forecast indicator is a technical analysis tool that scans historical price data to identify common chart patterns and then analyzes the price movements that followed these patterns. It takes this information and projects it into the future to provide traders with potential price actions that may occur if the same pattern is identified in real-time market data. This projection helps traders to understand the possible outcomes based on the previous occurrences of the pattern, thereby offering a clearer perspective of the market scenario. By analyzing the historical data and understanding the subsequent price movements following the appearance of a specific pattern, the indicator can provide valuable insights into potential future market behavior.
█ Calculations
The indicator works by scanning historical price data for various candlestick patterns. It includes all in-built TradingView patterns, credit to TradingView that has coded them.
Essentially, the indicator takes the historical price moves that followed the pattern to forecast what might happen next.
█ Example
In this example, the algorithm is set to search for the Inverted Hammer Bullish candlestick pattern. If the pattern is found, the historical outcome is then projected into the future. This helps traders to understand how the past pattern evolved over time.
█ How to use
Providing traders with a comprehensive understanding of historical patterns and their implications for future price action allows them to assess the likelihood of specific market scenarios objectively. For example, suppose the pattern forecast indicator suggests that a particular pattern is likely to lead to a bullish move in the market. A trader might consider going long if the same pattern is identified in the real-time market. Similarly, a trader might consider shorting the asset if the indicator suggests a bearish move is likely, if the same pattern is identified in the real-time market.
█ Settings
Pattern
Select the pattern that the indicator should scan for. All inbuilt TradingView patterns can be selected.
Forecast Candles
Number of candles to project into the future.
-----------------
Disclaimer
The information contained in my Scripts/Indicators/Ideas/Algos/Systems does not constitute financial advice or a solicitation to buy or sell any securities of any type. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
My Scripts/Indicators/Ideas/Algos/Systems are only for educational purposes!
Ross Hook Pattern (Expo)█ Overview
The Ross Hook pattern is one of the most consistent and successful trading patterns that have been around for years. The Ross Hook is the first correction following the breakout of the 1-2-3 formation . This means that the Ross Hook only occurs in established trends. In other words, Ross Hook is a trend continuation setup. To fully understand the Ross Hook formation, you must understand the 1-2-3 pattern .
Ross Hook Pattern (Expo) is an indicator designed to detect the Ross Hook formation automatically and in real-time in any market and timeframe. With the inbuilt alert feature, the Ross Hook Pattern (Expo) Indicator analyzes the market for you and notifies you when the Ross Hook formations have been found.
█ How to use
Use this indicator to identify the Ross Hook pattern and to find good trend continuation setups. The formation can be used to determine when a trend is confirmed and established.
-----------------
Disclaimer
The information contained in my Scripts/Indicators/Ideas/Algos/Systems does not constitute financial advice or a solicitation to buy or sell any securities of any type. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
My Scripts/Indicators/Ideas/Algos/Systems are only for educational purposes!