OPEN-SOURCE SCRIPT
Wick Sequence Breakout

█ OVERVIEW
Wick Sequence Breakout is an adaptive indicator that detects candle sequences with characteristic wick proportions, builds a formation zone around them, and waits for a breakout. A formation is considered valid only when the required number of candles with a dominant upper or lower wick appears inside a defined window.
After a formation is created, the indicator analyzes volume inside the box to determine whether buyers or sellers are dominant. A signal appears only when the breakout direction matches the dominant volume side. An optional breakout candle size filter can further limit signals generated by candles that are too small.
After a confirmed breakout, the formation is closed. An optional TP/SL module can display Entry, Stop Loss, and up to three Take Profit levels based on ATR or a fixed percentage and a defined Risk.
█ CONCEPTS
The indicator combines three elements into a single process: candle geometry, formation structure, and dominant volume analysis. A single wick by itself does not generate a signal — the required number of candles meeting the defined conditions must appear inside the specified window.
Wick-Based Formation
The formation is built from wick proportions relative to the candle’s full range.
For a bearish formation:
• Upper Wick — must account for at least a specified percentage of the candle’s full range.
• Lower Wick — must not exceed a specified percentage of the range.
For a bullish formation:
• Lower Wick — must account for at least a specified percentage of the candle’s full range.
• Upper Wick — must not exceed a specified percentage of the range.
The candle body color does not matter. Only wick geometry counts, and — if the filter is enabled — the candle’s minimum range relative to ATR.
Wick Sequence
A single candle that meets the conditions does not yet create a formation. The indicator checks a defined number of recent candles and counts how many of them meet the bullish or bearish requirements.
Min. Number of Wick Candles defines how many such candles must appear inside the Window Size.
For example, with a setting of 3 candles inside a 5-candle window, a formation is created if at least three of the last five candles meet the requirements for a given direction.
If bullish and bearish conditions are met in the same window at the same time, neither side receives a formation. This prevents an ambiguous signal.
Candle Range Filter
An optional ATR filter can exclude small candles from the formation-building process.
A candle must have a range at least equal to:
ATR × ATR Multiplier
Candles that do not meet this condition are not counted toward the wick sequence.
This allows the formation to be limited to candles of sufficient size relative to current market volatility.
Formation Box
After a new formation is detected, the indicator creates a box covering the full range of the candles used in the formation window:
• Top — the highest High in the window.
• Bottom — the lowest Low in the window.
• Left — the first candle of the analyzed window.
• Right — moves forward while waiting for a breakout.
The box is initially neutral. Its purpose is to visually mark the area from which a breakout is expected.
Breakout Detection
A breakout can be evaluated in two ways:
• High/Low — a breakout occurs when a candle’s High or Low breaches the upper or lower box boundary.
• Close — a breakout is evaluated using the closing price.
The breakout mode is set by the Breakout by close price option.
Unlike ATR-based filters for candle size, the breakout itself does not require an additional ATR margin. Crossing the relevant box boundary according to the selected mode is enough.
Volume Dominance
While a formation is active, the indicator estimates the share of buying and selling volume for the candles inside the box.
Each candle’s volume is split proportionally according to the close position within the High–Low range:
• the closer the candle closes to the High, the larger the share assigned to Buy Volume,
• the closer the candle closes to the Low, the larger the share assigned to Sell Volume.
This produces the current Buy/Sell Volume ratio.
The dominant side is defined as:
• Buy — when Buy Volume is greater than or equal to Sell Volume.
• Sell — when Sell Volume is greater than Buy Volume.
Two bars representing the relative share of both sides, plus a label showing the Buy/Sell percentage split, can be displayed under the box.
Volume-Confirmed Breakout
A box breakout by itself is not yet a signal.
For a bullish signal:
• price must break the top of the box,
• Buy Volume must dominate Sell Volume.
For a bearish signal:
• price must break the bottom of the box,
• Sell Volume must dominate Buy Volume.
This means the indicator filters out breakouts that occur against the dominant volume side.
Breakout Candle Size Filter
An optional breakout candle size filter can require the candle that generates the breakout to have a sufficiently large range.
The minimum range is defined as:
Average Candle Range × Size Multiplier
Average Candle Size Period defines the number of candles used to calculate the average range.
The filter can limit signals generated by small candles that technically cross the box boundary but do not have enough range.
Formation Lifecycle
An active formation remains on the chart until:
• a breakout,
• the wait limit is exceeded,
• or it is removed by the mismatched-direction filter.
After a breakout, the box is closed and is no longer active. If the breakout does not match the dominant volume side, the formation can be:
• left on the chart in a neutral color,
• or removed completely together with the volume bars and the percentage label.
Breakout Wait Limit
Breakout Wait Limit defines the maximum number of candles a formation can wait for a breakout. If the limit is exceeded without a breakout, the box is canceled and removed. Setting 0 disables the wait limit.
█ FEATURES
General
• Min. number of wick candles — the minimum number of candles meeting the wick requirements needed to create a formation.
• Window size (candles) — the number of recent candles analyzed in search of the required sequence.
• Min. upper wick share — the minimum upper-wick share for a bearish formation.
• Max. lower wick share — the maximum lower-wick share for a bearish formation.
• Min. lower wick share — the minimum lower-wick share for a bullish formation.
• Max. upper wick share — the maximum upper-wick share for a bullish formation.
• Breakout wait limit (bars) — the maximum number of candles to wait for a breakout. 0 = no limit.
• Breakout by close price — switches breakout confirmation between High/Low and the closing price.
Signal Filters
• Filter small candles (ATR) — rejects candles with a range smaller than ATR × multiplier.
• ATR multiplier — the minimum candle range required for a candle to be included in the formation.
• ATR period — the ATR period used by the candle filter.
• Filter by breakout candle size — requires a sufficiently large breakout candle.
• Size multiplier — the minimum breakout candle range relative to the average range.
• Average candle size period — the number of candles used to calculate the average range.
• Show bearish signals — enables/disables bearish breakout signals.
• Show bullish signals — enables/disables bullish breakout signals.
• Remove box on mismatched signal — removes the formation when the breakout direction does not match the dominant volume side.
Colors & Visualization
• Highlight wick candles — highlights individual candles that meet the wick requirements.
• Bullish color — the bullish-side color.
• Bearish color — the bearish-side color.
• Neutral color — the color of an active or ambiguous formation.
• Box background transparency — transparency of the box fill.
• Box border transparency — transparency of the box border.
• Show volume bars — shows Buy/Sell Volume bars under the formation.
• Show % label — shows the percentage share of the dominant and opposite volume sides.
TP/SL
• Show TP/SL levels — enables the Entry, SL, and TP module.
• SL = ATR — switches between an ATR-based Stop Loss and a fixed percentage.
• ATR period (TP/SL) — an independent ATR period used to calculate the SL distance.
• ATR multiplier for SL — the ATR multiplier that defines the Stop Loss distance.
• SL % from Entry — the percentage Stop Loss distance from Entry.
• RR for TP1 — the Risk:Reward ratio that defines the first target distance from Entry relative to risk (SL).
• RR for TP2 — the Risk:Reward ratio that defines the second target distance from Entry relative to risk (SL).
• RR for TP3 — the Risk:Reward ratio that defines the third target distance from Entry relative to risk (SL).
TP/SL — Display
• Show SL level — independently displays the Stop Loss level and label.
• Show TP1 level — independently displays TP1 and its label.
• Show TP2 level — independently displays TP2 and its label.
• Show TP3 level — independently displays TP3 and its label.
█ APPLICATIONS
Wick Sequence Analysis
Automatically searches for candle sequences with characteristic wick geometry instead of evaluating every candle manually. Useful for identifying repeatable price behavior inside a defined window.
Formation Range
The box shows the full price range of the analyzed sequence and makes it easy to see the area that must be broken for the formation to resolve in one direction.
Example of use
After the box is formed, it is worth checking whether the formation overlaps a significant support or resistance zone — candles with long wicks often confirm a price reaction at such a level. Before making a decision, additional confirmation from other analysis tools is recommended, for example momentum or the higher-timeframe trend, so that several independent methods point in the same market direction.
█ NOTES
• The indicator works only on assets that have volume.
• Candle body color does not affect wick formation classification.
• If bullish and bearish conditions are met in the same window at the same time, no formation is created.
• The formation is canceled after the Breakout Wait Limit is exceeded if no breakout has occurred earlier.
• TP/SL is a visual planning tool for Entry, SL, and TP levels, not an assessment of trade quality.
Wick Sequence Breakout is an adaptive indicator that detects candle sequences with characteristic wick proportions, builds a formation zone around them, and waits for a breakout. A formation is considered valid only when the required number of candles with a dominant upper or lower wick appears inside a defined window.
After a formation is created, the indicator analyzes volume inside the box to determine whether buyers or sellers are dominant. A signal appears only when the breakout direction matches the dominant volume side. An optional breakout candle size filter can further limit signals generated by candles that are too small.
After a confirmed breakout, the formation is closed. An optional TP/SL module can display Entry, Stop Loss, and up to three Take Profit levels based on ATR or a fixed percentage and a defined Risk.
█ CONCEPTS
The indicator combines three elements into a single process: candle geometry, formation structure, and dominant volume analysis. A single wick by itself does not generate a signal — the required number of candles meeting the defined conditions must appear inside the specified window.
Wick-Based Formation
The formation is built from wick proportions relative to the candle’s full range.
For a bearish formation:
• Upper Wick — must account for at least a specified percentage of the candle’s full range.
• Lower Wick — must not exceed a specified percentage of the range.
For a bullish formation:
• Lower Wick — must account for at least a specified percentage of the candle’s full range.
• Upper Wick — must not exceed a specified percentage of the range.
The candle body color does not matter. Only wick geometry counts, and — if the filter is enabled — the candle’s minimum range relative to ATR.
Wick Sequence
A single candle that meets the conditions does not yet create a formation. The indicator checks a defined number of recent candles and counts how many of them meet the bullish or bearish requirements.
Min. Number of Wick Candles defines how many such candles must appear inside the Window Size.
For example, with a setting of 3 candles inside a 5-candle window, a formation is created if at least three of the last five candles meet the requirements for a given direction.
If bullish and bearish conditions are met in the same window at the same time, neither side receives a formation. This prevents an ambiguous signal.
Candle Range Filter
An optional ATR filter can exclude small candles from the formation-building process.
A candle must have a range at least equal to:
ATR × ATR Multiplier
Candles that do not meet this condition are not counted toward the wick sequence.
This allows the formation to be limited to candles of sufficient size relative to current market volatility.
Formation Box
After a new formation is detected, the indicator creates a box covering the full range of the candles used in the formation window:
• Top — the highest High in the window.
• Bottom — the lowest Low in the window.
• Left — the first candle of the analyzed window.
• Right — moves forward while waiting for a breakout.
The box is initially neutral. Its purpose is to visually mark the area from which a breakout is expected.
Breakout Detection
A breakout can be evaluated in two ways:
• High/Low — a breakout occurs when a candle’s High or Low breaches the upper or lower box boundary.
• Close — a breakout is evaluated using the closing price.
The breakout mode is set by the Breakout by close price option.
Unlike ATR-based filters for candle size, the breakout itself does not require an additional ATR margin. Crossing the relevant box boundary according to the selected mode is enough.
Volume Dominance
While a formation is active, the indicator estimates the share of buying and selling volume for the candles inside the box.
Each candle’s volume is split proportionally according to the close position within the High–Low range:
• the closer the candle closes to the High, the larger the share assigned to Buy Volume,
• the closer the candle closes to the Low, the larger the share assigned to Sell Volume.
This produces the current Buy/Sell Volume ratio.
The dominant side is defined as:
• Buy — when Buy Volume is greater than or equal to Sell Volume.
• Sell — when Sell Volume is greater than Buy Volume.
Two bars representing the relative share of both sides, plus a label showing the Buy/Sell percentage split, can be displayed under the box.
Volume-Confirmed Breakout
A box breakout by itself is not yet a signal.
For a bullish signal:
• price must break the top of the box,
• Buy Volume must dominate Sell Volume.
For a bearish signal:
• price must break the bottom of the box,
• Sell Volume must dominate Buy Volume.
This means the indicator filters out breakouts that occur against the dominant volume side.
Breakout Candle Size Filter
An optional breakout candle size filter can require the candle that generates the breakout to have a sufficiently large range.
The minimum range is defined as:
Average Candle Range × Size Multiplier
Average Candle Size Period defines the number of candles used to calculate the average range.
The filter can limit signals generated by small candles that technically cross the box boundary but do not have enough range.
Formation Lifecycle
An active formation remains on the chart until:
• a breakout,
• the wait limit is exceeded,
• or it is removed by the mismatched-direction filter.
After a breakout, the box is closed and is no longer active. If the breakout does not match the dominant volume side, the formation can be:
• left on the chart in a neutral color,
• or removed completely together with the volume bars and the percentage label.
Breakout Wait Limit
Breakout Wait Limit defines the maximum number of candles a formation can wait for a breakout. If the limit is exceeded without a breakout, the box is canceled and removed. Setting 0 disables the wait limit.
█ FEATURES
General
• Min. number of wick candles — the minimum number of candles meeting the wick requirements needed to create a formation.
• Window size (candles) — the number of recent candles analyzed in search of the required sequence.
• Min. upper wick share — the minimum upper-wick share for a bearish formation.
• Max. lower wick share — the maximum lower-wick share for a bearish formation.
• Min. lower wick share — the minimum lower-wick share for a bullish formation.
• Max. upper wick share — the maximum upper-wick share for a bullish formation.
• Breakout wait limit (bars) — the maximum number of candles to wait for a breakout. 0 = no limit.
• Breakout by close price — switches breakout confirmation between High/Low and the closing price.
Signal Filters
• Filter small candles (ATR) — rejects candles with a range smaller than ATR × multiplier.
• ATR multiplier — the minimum candle range required for a candle to be included in the formation.
• ATR period — the ATR period used by the candle filter.
• Filter by breakout candle size — requires a sufficiently large breakout candle.
• Size multiplier — the minimum breakout candle range relative to the average range.
• Average candle size period — the number of candles used to calculate the average range.
• Show bearish signals — enables/disables bearish breakout signals.
• Show bullish signals — enables/disables bullish breakout signals.
• Remove box on mismatched signal — removes the formation when the breakout direction does not match the dominant volume side.
Colors & Visualization
• Highlight wick candles — highlights individual candles that meet the wick requirements.
• Bullish color — the bullish-side color.
• Bearish color — the bearish-side color.
• Neutral color — the color of an active or ambiguous formation.
• Box background transparency — transparency of the box fill.
• Box border transparency — transparency of the box border.
• Show volume bars — shows Buy/Sell Volume bars under the formation.
• Show % label — shows the percentage share of the dominant and opposite volume sides.
TP/SL
• Show TP/SL levels — enables the Entry, SL, and TP module.
• SL = ATR — switches between an ATR-based Stop Loss and a fixed percentage.
• ATR period (TP/SL) — an independent ATR period used to calculate the SL distance.
• ATR multiplier for SL — the ATR multiplier that defines the Stop Loss distance.
• SL % from Entry — the percentage Stop Loss distance from Entry.
• RR for TP1 — the Risk:Reward ratio that defines the first target distance from Entry relative to risk (SL).
• RR for TP2 — the Risk:Reward ratio that defines the second target distance from Entry relative to risk (SL).
• RR for TP3 — the Risk:Reward ratio that defines the third target distance from Entry relative to risk (SL).
TP/SL — Display
• Show SL level — independently displays the Stop Loss level and label.
• Show TP1 level — independently displays TP1 and its label.
• Show TP2 level — independently displays TP2 and its label.
• Show TP3 level — independently displays TP3 and its label.
█ APPLICATIONS
Wick Sequence Analysis
Automatically searches for candle sequences with characteristic wick geometry instead of evaluating every candle manually. Useful for identifying repeatable price behavior inside a defined window.
Formation Range
The box shows the full price range of the analyzed sequence and makes it easy to see the area that must be broken for the formation to resolve in one direction.
Example of use
After the box is formed, it is worth checking whether the formation overlaps a significant support or resistance zone — candles with long wicks often confirm a price reaction at such a level. Before making a decision, additional confirmation from other analysis tools is recommended, for example momentum or the higher-timeframe trend, so that several independent methods point in the same market direction.
█ NOTES
• The indicator works only on assets that have volume.
• Candle body color does not affect wick formation classification.
• If bullish and bearish conditions are met in the same window at the same time, no formation is created.
• The formation is canceled after the Breakout Wait Limit is exceeded if no breakout has occurred earlier.
• TP/SL is a visual planning tool for Entry, SL, and TP levels, not an assessment of trade quality.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.