Engulfing bar detectorHere’s the updated description with the added step about using Fibonacci levels across timeframes for confirmation:
Liquidity Engulfing Bar Detector
The **Liquidity Engulfing Bar Detector** is a powerful tool designed for traders who want to identify high-probability reversal patterns in the market based on liquidity grabbing and price action. This indicator highlights **Bullish Engulfing** and **Bearish Engulfing** bars that fulfill specific liquidity criteria, helping you spot potential trend reversals and trading opportunities.
**Features**:
1. **Bullish Engulfing Bars**: 
   - The current candle's low dips below the previous candle's low (grabs liquidity).
   - The current candle closes above the previous candle's open.
   - A green label is plotted above the engulfing bar for easy identification.
2. **Bearish Engulfing Bars**: 
   - The current candle's high exceeds the previous candle's high (grabs liquidity).
   - The current candle closes below the previous candle's open.
   - A red label is plotted below the engulfing bar for clear visibility.
3. **Customizable Alerts**:
   - Receive instant notifications via TradingView alerts when a bullish or bearish engulfing pattern is detected.
   - Alerts are fully customizable, allowing you to stay updated without actively monitoring the chart.
4. **Visual Markers**:
   - Clear and intuitive labels make it easy to spot key patterns directly on your chart.
   - Fully integrated with any timeframe and market, ensuring versatility for all trading styles.
---
### **How to Use**:
1. **Add the Indicator**:
   - Apply the Liquidity Engulfing Bar Detector to your chart to automatically highlight bullish and bearish engulfing bars.
2. **Enable Alerts**:
   - Set up TradingView alerts to get notified of potential setups in real-time.
3. **Analyze with Fibonacci Levels**:
   - Draw a Fibonacci retracement tool over the identified engulfing bar, from its low to its high (for bullish patterns) or high to low (for bearish patterns).
   - Use the following Fibonacci levels as key zones of interest:
     - **0.0 (start)**, **0.25**, **0.5 (midpoint)**, **0.75**, and **1.0 (end)**.
   - These levels often act as critical support or resistance zones for price action.
4. **Use Multi-Timeframe Confirmation**:
   - Validate zones from higher timeframes using lower timeframe candles:
     - **1-minute candles** for confirming zones on the **15-minute chart**.
     - **5-minute candles** for confirming zones on the **1-hour chart**.
     - **15-minute candles** for confirming zones on the **4-hour chart**.
   - This approach ensures precision in your entry points and aligns intraday movements with higher timeframe setups.
5. **Integrate with Your Strategy**:
   - Combine the indicator with other tools (e.g., trendlines, moving averages, or volume analysis) for confirmation.
   - Use proper risk management to maximize your trading edge.
---
### **Why Use This Indicator?**
Liquidity grabs often signal the participation of major market players, which can lead to significant reversals or continuations. By combining liquidity concepts with engulfing bar patterns and Fibonacci analysis, this indicator helps you:
- Identify key market turning points.
- Improve your entries and exits with multi-timeframe precision.
- Enhance your trading strategy with an edge rooted in smart money concepts.
---
**Note**: This indicator is best used with proper risk management and alongside other technical or fundamental analyses.
---
Let me know if there's anything more you'd like to include!
ค้นหาในสคริปต์สำหรับ "liquidity"
Trading IQ - ICT LibraryLibrary   "ICTlibrary" 
Used to calculate various ICT related price levels and strategies. An ongoing project.
Hello Coders!
This library is meant for sourcing ICT related concepts. While some functions might generate more output than you require, you can specify "Lite Mode" as "true" in applicable functions to slim down necessary inputs.
 isLastBar(userTF) 
  Identifies the last bar on the chart before a timeframe change
  Parameters:
     userTF (simple int) : the timeframe you wish to calculate the last bar for, must be converted to integer using 'timeframe.in_seconds()'
  Returns: bool true if bar on chart is last bar of higher TF, dalse if bar on chart is not last bar of higher TF
 necessaryData(atrTF) 
  returns necessaryData UDT for historical data access
  Parameters:
     atrTF (float) : user-selected timeframe ATR value.
  Returns: logZ. log return Z score, used for calculating order blocks.
 method gradBoxes(gradientBoxes, idColor, timeStart, bottom, top, rightCoordinate) 
  creates neon like effect for box drawings
  Namespace types: array
  Parameters:
     gradientBoxes (array) : an array.new() to store the gradient boxes
     idColor (color) 
     timeStart (int) : left point of box
     bottom (float) : bottom of box price point
     top (float) : top of box price point
     rightCoordinate (int) : right point of box
  Returns: void
 checkIfTraded(tradeName) 
  checks if recent trade is of specific name
  Parameters:
     tradeName (string) 
  Returns: bool true if recent trade id matches target name, false otherwise
 checkIfClosed(tradeName) 
  checks if recent closed trade is of specific name
  Parameters:
     tradeName (string) 
  Returns: bool true if recent closed trade id matches target name, false otherwise
 IQZZ(atrMult, finalTF) 
  custom ZZ to quickly determine market direction.
  Parameters:
     atrMult (float) : an atr multiplier used to determine the required price move for a ZZ direction change
     finalTF (string) : the timeframe used for the atr calcuation
  Returns: dir market direction. Up => 1, down => -1
 method drawBos(id, startPoint, getKeyPointTime, getKeyPointPrice, col, showBOS, isUp) 
  calculates and draws Break Of Structure
  Namespace types: array
  Parameters:
     id (array) 
     startPoint (chart.point) 
     getKeyPointTime (int) : the actual time of startPoint, simplystartPoint.time
     getKeyPointPrice (float) : the actual time of startPoint, simplystartPoint.price
     col (color) : color of the BoS line / label
     showBOS (bool) : whether to show label/line. This function still calculates internally for other ICT related concepts even if not drawn.
     isUp (bool) : whether BoS happened during price increase or price decrease.
  Returns: void
 method drawMSS(id, startPoint, getKeyPointTime, getKeyPointPrice, col, showMSS, isUp, upRejections, dnRejections, highArr, lowArr, timeArr, closeArr, openArr, atrTFarr, upRejectionsPrices, dnRejectionsPrices) 
  calculates and draws Market Structure Shift. This data is also used to calculate Rejection Blocks.
  Namespace types: array
  Parameters:
     id (array) 
     startPoint (chart.point) 
     getKeyPointTime (int) : the actual time of startPoint, simplystartPoint.time
     getKeyPointPrice (float) : the actual time of startPoint, simplystartPoint.price
     col (color) : color of the MSS line / label
     showMSS (bool) : whether to show label/line. This function still calculates internally for other ICT related concepts even if not drawn.
     isUp (bool) : whether MSS happened during price increase or price decrease.
     upRejections (array) 
     dnRejections (array) 
     highArr (array) : array containing historical highs, should be taken from the UDT "necessaryData" defined above
     lowArr (array) : array containing historical lows, should be taken from the UDT "necessaryData" defined above
     timeArr (array) : array containing historical times, should be taken from the UDT "necessaryData" defined above
     closeArr (array) : array containing historical closes, should be taken from the UDT "necessaryData" defined above
     openArr (array) : array containing historical opens, should be taken from the UDT "necessaryData" defined above
     atrTFarr (array) : array containing historical atr values (of user-selected TF), should be taken from the UDT "necessaryData" defined above
     upRejectionsPrices (array) : array containing up rejections prices. Is sorted and used to determine selective looping for invalidations.
     dnRejectionsPrices (array) : array containing down rejections prices. Is sorted and used to determine selective looping for invalidations.
  Returns: void
 method getTime(id, compare, timeArr) 
  gets time of inputted price (compare) in an array of data
this is useful when the user-selected timeframe for ICT concepts is greater than the chart's timeframe
  Namespace types: array
  Parameters:
     id (array) : the array of data to search through, to find which index has the same value as "compare"
     compare (float) : the target data point to find in the array
     timeArr (array) : array of historical times
  Returns: the time that the data point in the array was recorded
 method OB(id, highArr, signArr, lowArr, timeArr, sign) 
  store bullish orderblock data
  Namespace types: array
  Parameters:
     id (array) 
     highArr (array) : array of historical highs
     signArr (array) : array of historical price direction "math.sign(close - open)"
     lowArr (array) : array of historical lows
     timeArr (array) : array of historical times
     sign (int) : orderblock direction, -1 => bullish, 1 => bearish
  Returns: void
 OTEstrat(OTEstart, future, closeArr, highArr, lowArr, timeArr, longOTEPT, longOTESL, longOTElevel, shortOTEPT, shortOTESL, shortOTElevel, structureDirection, oteLongs, atrTF, oteShorts) 
  executes the OTE strategy
  Parameters:
     OTEstart (chart.point) 
     future (int) : future time point for drawings
     closeArr (array) : array of historical closes
     highArr (array) : array of historical highs
     lowArr (array) : array of historical lows
     timeArr (array) : array of historical times
     longOTEPT (string) : user-selected long OTE profit target, please create an input.string() for this using the example below
     longOTESL (int) : user-selected long OTE stop loss, please create an input.string() for this using the example below
     longOTElevel (float) : long entry price of selected retracement ratio for OTE
     shortOTEPT (string) : user-selected short OTE profit target, please create an input.string() for this using the example below
     shortOTESL (int) : user-selected short OTE stop loss, please create an input.string() for this using the example below
     shortOTElevel (float) : short entry price of selected retracement ratio for OTE
     structureDirection (string) : current market structure direction, this should be "Up" or "Down". This is used to cancel pending orders if market structure changes
     oteLongs (bool) : input.bool() for whether OTE longs can be executed
     atrTF (float) : atr of the user-seleceted TF
     oteShorts (bool) : input.bool() for whether OTE shorts can be executed
@exampleInputs
oteLongs        = input.bool(defval = false, title = "OTE Longs", group = "Optimal Trade Entry")
longOTElevel    = input.float(defval = 0.79, title = "Long Entry Retracement Level", options =  , group = "Optimal Trade Entry")
longOTEPT       = input.string(defval = "-0.5", title = "Long TP", options =  , group = "Optimal Trade Entry")
longOTESL       = input.int(defval = 0, title = "How Many Ticks Below Swing Low For Stop Loss", group = "Optimal Trade Entry")
oteShorts       = input.bool(defval = false, title = "OTE Shorts", group = "Optimal Trade Entry")
shortOTElevel   = input.float(defval = 0.79, title = "Short Entry Retracement Level", options =  , group = "Optimal Trade Entry")
shortOTEPT      = input.string(defval = "-0.5", title = "Short TP", options =  , group = "Optimal Trade Entry")
shortOTESL      = input.int(defval = 0, title = "How Many Ticks Above Swing Low For Stop Loss", group = "Optimal Trade Entry")
  Returns: void (0)
 displacement(logZ, atrTFreg, highArr, timeArr, lowArr, upDispShow, dnDispShow, masterCoords, labelLevels, dispUpcol, rightCoordinate, dispDncol, noBorders) 
  calculates and draws dispacements
  Parameters:
     logZ (float) : log return of current price, used to determine a "significant price move" for a displacement
     atrTFreg (float) : atr of user-seleceted timeframe
     highArr (array) : array of historical highs
     timeArr (array) : array of historical times
     lowArr (array) : array of historical lows
     upDispShow (int) : amount of historical upside displacements to show
     dnDispShow (int) : amount of historical downside displacements to show
     masterCoords (map) : a  map to push the most recent displacement prices into, useful for having key levels in one data structure
     labelLevels (string) : used to determine label placement for the displacement, can be inside box, outside box, or none, example below
     dispUpcol (color) : upside displacement color
     rightCoordinate (int) : future time for displacement drawing, best is "last_bar_time"
     dispDncol (color) : downside displacement color
     noBorders (bool) : input.bool() to remove box borders, example below
@exampleInputs
labelLevels     = input.string(defval = "Inside" , title = "Box Label Placement", options =  )
noBorders       = input.bool(defval = false, title = "No Borders On Levels")
  Returns: void
 method getStrongLow(id, startIndex, timeArr, lowArr, strongLowPoints) 
  unshift strong low data to array id
  Namespace types: array
  Parameters:
     id (array) 
     startIndex (int) : the starting index for the timeArr array of the UDT "necessaryData".
this point should start from at least 1 pivot prior to find the low before an upside BoS
     timeArr (array) : array of historical times
     lowArr (array) : array of historical lows
     strongLowPoints (array) : array of strong low prices. Used to retrieve highest strong low price and see if need for
removal of invalidated strong lows
  Returns: void
 method getStrongHigh(id, startIndex, timeArr, highArr, strongHighPoints) 
  unshift strong high data to array id
  Namespace types: array
  Parameters:
     id (array) 
     startIndex (int) : the starting index for the timeArr array of the UDT "necessaryData".
this point should start from at least 1 pivot prior to find the high before a downside BoS
     timeArr (array) : array of historical times
     highArr (array) : array of historical highs
     strongHighPoints (array) 
  Returns: void
 equalLevels(highArr, lowArr, timeArr, rightCoordinate, equalHighsCol, equalLowsCol, liteMode) 
  used to calculate recent equal highs or equal lows
  Parameters:
     highArr (array) : array of historical highs
     lowArr (array) : array of historical lows
     timeArr (array) : array of historical times
     rightCoordinate (int) : a future time (right for boxes, x2 for lines)
     equalHighsCol (color) : user-selected color for equal highs drawings
     equalLowsCol (color) : user-selected color for equal lows drawings
     liteMode (bool) : optional for a lite mode version of an ICT strategy. For more control over drawings leave as "True", "False" will apply neon effects
  Returns: void
 quickTime(timeString) 
  used to quickly determine if a user-inputted time range is currently active in NYT time
  Parameters:
     timeString (string) : a time range
  Returns: true if session is active, false if session is inactive
 macros(showMacros, noBorders) 
  used to calculate and draw session macros
  Parameters:
     showMacros (bool) : an input.bool() or simple bool to determine whether to activate the function
     noBorders (bool) : an input.bool() to determine whether the box anchored to the session should have borders
  Returns: void
 po3(tf, left, right, show) 
  use to calculate HTF po3 candle
@tip only call this function on "barstate.islast"
  Parameters:
     tf (simple string) 
     left (int) : the left point of the candle, calculated as bar_index + left,
     right (int) : :the right point of the candle, calculated as bar_index + right,
     show (bool) : input.bool() whether to show the po3 candle or not
  Returns: void
 silverBullet(silverBulletStratLong, silverBulletStratShort, future, userTF, H, L, H2, L2, noBorders, silverBulletLongTP, historicalPoints, historicalData, silverBulletLongSL, silverBulletShortTP, silverBulletShortSL) 
  used to execute the Silver Bullet Strategy
  Parameters:
     silverBulletStratLong (simple bool) 
     silverBulletStratShort (simple bool) 
     future (int) : a future time, used for drawings, example "last_bar_time"
     userTF (simple int) 
     H (float) : the high price of the user-selected TF
     L (float) : the low price of the user-selected TF
     H2 (float) : the high  price of the user-selected TF
     L2 (float) : the low  price of the user-selected TF
     noBorders (bool) : an input.bool() used to remove the borders from box drawings
     silverBulletLongTP (series silverBulletLevels) 
     historicalPoints (array) 
     historicalData (necessaryData) 
     silverBulletLongSL (series silverBulletLevels) 
     silverBulletShortTP (series silverBulletLevels) 
     silverBulletShortSL (series silverBulletLevels) 
  Returns: void
 method invalidFVGcheck(FVGarr, upFVGpricesSorted, dnFVGpricesSorted) 
  check if existing FVGs are still valid
  Namespace types: array
  Parameters:
     FVGarr (array) 
     upFVGpricesSorted (array) : an array of bullish FVG prices, used to selective search through FVG array to remove invalidated levels
     dnFVGpricesSorted (array) : an array of bearish FVG prices, used to selective search through FVG array to remove invalidated levels
  Returns: void (0)
 method drawFVG(counter, FVGshow, FVGname, FVGcol, data, masterCoords, labelLevels, borderTransp, liteMode, rightCoordinate) 
  draws FVGs on last bar
  Namespace types: map
  Parameters:
     counter (map) : a counter, as map, keeping count of the number of FVGs drawn, makes sure that there aren't more FVGs drawn
than int FVGshow
     FVGshow (int) : the number of FVGs to show. There should be a bullish FVG show and bearish FVG show. This function "drawFVG" is used separately
for bearish FVG and bullish FVG.
     FVGname (string) : the name of the FVG, "FVG Up" or "FVG Down"
     FVGcol (color) : desired FVG color
     data (FVG) 
     masterCoords (map) : a map containing the names and price points of key levels. Used to define price ranges.
     labelLevels (string) : an input.string with options "Inside", "Outside", "Remove". Determines whether FVG labels should be inside box, outside,
or na.
     borderTransp (int) 
     liteMode (bool) 
     rightCoordinate (int) : the right coordinate of any drawings. Must be a time point.
  Returns: void
 invalidBlockCheck(bullishOBbox, bearishOBbox, userTF) 
  check if existing order blocks are still valid
  Parameters:
     bullishOBbox (array) : an array declared using the UDT orderBlock that contains bullish order block related data
     bearishOBbox (array) : an array declared using the UDT orderBlock that contains bearish order block related data
     userTF (simple int) 
  Returns: void (0)
 method lastBarRejections(id, rejectionColor, idShow, rejectionString, labelLevels, borderTransp, liteMode, rightCoordinate, masterCoords) 
  draws rejectionBlocks on last bar
  Namespace types: array
  Parameters:
     id (array) : the array, an array of rejection block data declared using the UDT rejection block
     rejectionColor (color) : the desired color of the rejection box
     idShow (int) 
     rejectionString (string) : the desired name of the rejection blocks
     labelLevels (string) : an input.string() to determine if labels for the block should be inside the box, outside, or none.
     borderTransp (int) 
     liteMode (bool) : an input.bool(). True = neon effect, false = no neon.
     rightCoordinate (int) : atime for the right coordinate of the box
     masterCoords (map) : a map  that stores the price of key levels and assigns them a name, used to determine price ranges
  Returns: void
 method OBdraw(id, OBshow, BBshow, OBcol, BBcol, bullishString, bearishString, isBullish, labelLevels, borderTransp, liteMode, rightCoordinate, masterCoords) 
  draws orderblocks and breaker blocks for data stored in UDT array()
  Namespace types: array
  Parameters:
     id (array) : the array, an array of order block data declared using the UDT orderblock
     OBshow (int) : the number of order blocks to show
     BBshow (int) : the number of breaker blocks to show
     OBcol (color) : color of order blocks
     BBcol (color) : color of breaker blocks
     bullishString (string) : the title of bullish blocks, which is a regular bullish orderblock or a bearish orderblock that's converted to breakerblock
     bearishString (string) : the title of bearish blocks, which is a regular bearish orderblock or a bullish orderblock that's converted to breakerblock
     isBullish (bool) : whether the array contains bullish orderblocks or bearish orderblocks. If bullish orderblocks,
the array will naturally contain bearish BB, and if bearish OB, the array will naturally contain bullish BB
     labelLevels (string) : an input.string() to determine if labels for the block should be inside the box, outside, or none.
     borderTransp (int) 
     liteMode (bool) : an input.bool(). True = neon effect, false = no neon.
     rightCoordinate (int) : atime for the right coordinate of the box
     masterCoords (map) : a map  that stores the price of key levels and assigns them a name, used to determine price ranges
  Returns: void
 FVG 
  UDT for FVG calcualtions
  Fields:
     H (series float) : high price of user-selected timeframe
     L (series float) : low price of user-selected timeframe
     direction (series string) : FVG direction => "Up" or "Down"
     T (series int) : => time of bar on user-selected timeframe where FVG was created
     fvgLabel (series label) : optional label for FVG
     fvgLineTop (series line) : optional line for top of FVG
     fvgLineBot (series line) : optional line for bottom of FVG
     fvgBox (series box) : optional box for FVG
 labelLine 
  quickly pair a line and label together as UDT
  Fields:
     lin (series line) : Line you wish to pair with label
     lab (series label) : Label you wish to pair with line
 orderBlock 
  UDT for order block calculations
  Fields:
     orderBlockData (array) : array containing order block x and y points
     orderBlockBox (series box) : optional order block box
     vioCount (series int) : = 0    violation count of the order block. 0 = Order Block, 1 = Breaker Block
     traded (series bool) 
     status (series string) : = "OB"   status == "OB" => Level is order block. status == "BB" => Level is breaker block.
     orderBlockLab (series label) : options label for the order block / breaker block.
 strongPoints 
  UDT for strong highs and strong lows
  Fields:
     price (series float) : price of the strong high or strong low
     timeAtprice (series int) : time of the strong high or strong low
     strongPointLabel (series label) : optional label for strong point
     strongPointLine (series line) : optional line for strong point
     overlayLine (series line) : optional lines for strong point to enhance visibility
     overlayLine2 (series line) : optional lines for strong point to enhance visibility
 displacement 
  UDT for dispacements
  Fields:
     highPrice (series float) : high price of displacement
     lowPrice (series float) : low price of displacement
     timeAtPrice (series int) : time of bar where displacement occurred
     displacementBox (series box) : optional box to draw displacement
     displacementLab (series label) : optional label for displacement
 po3data 
  UDT for po3 calculations
  Fields:
     dHigh (series float) : higher timeframe high price
     dLow (series float) : higher timeframe low price
     dOpen (series float) : higher timeframe open price
     dClose (series float) : higher timeframe close price
     po3box (series box) : box to draw po3 candle body
     po3line (array) : line array to draw po3 wicks
     po3Labels (array) : label array to label price points of po3 candle
 macros 
  UDT for session macros
  Fields:
     sessions (array) : Array of sessions, you can populate this array using the "quickTime" function located above "export macros".
     prices (matrix) : Matrix of session data -> open, high, low, close, time
     sessionTimes (array) : Array of session names. Pairs with array sessions.
     sessionLines (matrix) : Optional array for sesion drawings.
 OTEtimes 
  UDT for data storage and drawings associated with OTE strategy
  Fields:
     upTimes (array) : time of highest point before trade is taken
     dnTimes (array) : time of lowest point before trade is taken
     tpLineLong (series line) : line to mark tp level long
     tpLabelLong (series label) : label to mark tp level long
     slLineLong (series line) : line to mark sl level  long
     slLabelLong (series label) : label to mark sl level long
     tpLineShort (series line) : line to mark tp level short
     tpLabelShort (series label) : label to mark tp level short
     slLineShort (series line) : line to mark sl level  short
     slLabelShort (series label) : label to mark sl level short
 sweeps 
  UDT for data storage and drawings associated with liquidity sweeps
  Fields:
     upSweeps (matrix) : matrix containing liquidity sweep price points and time points for up sweeps
     dnSweeps (matrix) : matrix containing liquidity sweep price points and time points for down sweeps
     upSweepDrawings (array) : optional up sweep box array. Pair the size of this array with the rows or columns,
     dnSweepDrawings (array) : optional up sweep box array. Pair the size of this array with the rows or columns,
 raidExitDrawings 
  UDT for drawings associated with the Liquidity Raid Strategy
  Fields:
     tpLine (series line) : tp line for the liquidity raid entry
     tpLabel (series label) : tp label for the liquidity raid entry
     slLine (series line) : sl line for the liquidity raid entry
     slLabel (series label) : sl label for the liquidity raid entry
 m2022 
  UDT for data storage and drawings associated with the Model 2022 Strategy
  Fields:
     mTime (series int) : time of the FVG where entry limit order is placed
     mIndex (series int) : array index of FVG where entry limit order is placed. This requires an array of FVG data, which is defined above.
     mEntryDistance (series float) : the distance of the FVG to the 50% range. M2022 looks for the fvg closest to 50% mark of range.
     mEntry (series float) : the entry price for the most eligible fvg
     fvgHigh (series float) : the high point of the eligible fvg
     fvgLow (series float) : the low point of the eligible fvg
     longFVGentryBox (series box) : long FVG box, used to draw the eligible FVG
     shortFVGentryBox (series box) : short FVG box, used to draw the eligible FVG
     line50P (series line) : line used to mark 50% of the range
     line100P (series line) : line used to mark 100% (top) of the range
     line0P (series line) : line used to mark 0% (bottom) of the range
     label50P (series label) : label used to mark 50% of the range
     label100P (series label) : label used to mark 100% (top) of the range
     label0P (series label) : label used to mark 0% (bottom) of the range
     sweepData (array) 
 silverBullet 
  UDT for data storage and drawings associated with the Silver Bullet Strategy
  Fields:
     session (series bool) 
     sessionStr (series string) : name of the session for silver bullet
     sessionBias (series string) 
     sessionHigh (series float) : = high   high of session // use math.max(silverBullet.sessionHigh, high)
     sessionLow (series float) : = low    low of session  // use math.min(silverBullet.sessionLow, low)
     sessionFVG (series float) : if applicable, the FVG created during the session
     sessionFVGdraw (series box) : if applicable, draw the FVG created during the session
     traded (series bool) 
     tp (series float) : tp of trade entered at the session FVG
     sl (series float) : sl of trade entered at the session FVG
     sessionDraw (series box) : optional draw session with box
     sessionDrawLabel (series label) : optional label session with label
 silverBulletDrawings 
  UDT for trade exit drawings associated with the Silver Bullet Strategy
  Fields:
     tpLine (series line) : tp line drawing for strategy
     tpLabel (series label) : tp label drawing for strategy
     slLine (series line) : sl line drawing for strategy
     slLabel (series label) : sl label drawing for strategy
 unicornModel 
  UDT for data storage and drawings associated with the Unicorn Model Strategy
  Fields:
     hPoint (chart.point) 
     hPoint2 (chart.point) 
     hPoint3 (chart.point) 
     breakerBlock (series box) : used to draw the breaker block required for the Unicorn Model
     FVG (series box) : used to draw the FVG required for the Unicorn model
     topBlock (series float) : price of top of breaker block, can be used to detail trade entry
     botBlock (series float) : price of bottom of breaker block, can be used to detail trade entry
     startBlock (series int) : start time of the breaker block, used to set the "left = " param for the box
     includes (array) : used to store the time of the breaker block, or FVG, or the chart point sequence that setup the Unicorn Model.
     entry (series float) : // eligible entry price, for longs"math.max(topBlock, FVG.get_top())",
     tpLine (series line) : optional line to mark PT
     tpLabel (series label) : optional label to mark PT
     slLine (series line) : optional line to mark SL
     slLabel (series label) : optional label to mark SL
 rejectionBlocks 
  UDT for data storage and drawings associated with rejection blocks
  Fields:
     rejectionPoint (chart.point) 
     bodyPrice (series float) : candle body price closest to the rejection point, for "Up" rejections => math.max(open, close),
     rejectionBox (series box) : optional box drawing of the rejection block
     rejectionLabel (series label) : optional label for the rejection block
 equalLevelsDraw 
  UDT for data storage and drawings associated with equal highs / equal lows
  Fields:
     connector (series line) : single line placed at the first high or low, y = avgerage of distinguished equal highs/lows
     connectorLab (series label) : optional label to be placed at the highs or lows
     levels (array) : array containing the equal highs or lows prices
     times (array) : array containing the equal highs or lows individual times
     startTime (series int) : the time of the first high or low that forms a sequence of equal highs or lows
     radiate (array) : options label to "radiate" the label in connector lab. Can be used for anything
 necessaryData 
  UDT for data storage of historical price points.
  Fields:
     highArr (array) : array containing historical high points
     lowArr (array) : array containing historical low points
     timeArr (array) : array containing historical time points
     logArr (array) : array containing historical log returns
     signArr (array) : array containing historical price directions
     closeArr (array) : array containing historical close points
     binaryTimeArr (array) : array containing historical time points, uses "push" instead of "unshift" to allow for binary search
     binaryCloseArr (array) : array containing historical close points, uses "push" instead of "unshift" to allow the correct
     binaryOpenArr (array) : array containing historical optn points, uses "push" instead of "unshift" to allow the correct
     atrTFarr (array) : array containing historical user-selected TF atr points
     openArr (array) : array containing historical open points
Market Structure Inducements ICT [TradinFinder] CHoch BOS Sweeps🔵 Introduction 
Market Structure is the foundation for identifying trends in the market, crucial in technical analysis and strategies like ICT and SMC. Understanding key concepts such as Break of Structure (BOS) and Change of Character (CHOCH) helps traders recognize critical shifts in the market. BOS, referring to a Market Structure Change (BMS), and CHOCH or Market Structure Shift (MSS) signal trend reversals in the market. 
Additionally, the concept of Inducement, a vital tool in Smart Money strategies, allows traders to avoid price traps. Identifying valid pullback, valid inducement, POI, and Liquidity Grab helps traders find optimal entry and exit points and leverage Smart Money movements effectively.
 Bullish Market Structure :
  
 Bearish Market Structure :
  
🔵 How to Use 
The Market Structure indicator is designed to help traders better understand market structure and detect price traps. By using this indicator, you can identify the right entry and exit points based on structural changes in the market and avoid unprofitable trades. Below, we explain the key concepts and how to apply them in trading.
🟣 Market Structure 
Market Structure refers to the overall pattern of price movement in the market. Using this indicator, traders can identify uptrends and downtrends and make better trading decisions based on changes in market structure. The two key concepts here are Break of Structure (BOS) and Change of Character (CHOCH).
 Change of Character (CHOCH) : CHOCH occurs when the market shifts from an uptrend to a downtrend or vice versa. These changes typically indicate a broader trend reversal, and the indicator assists you in identifying them accurately.
  
 Break of Structure (BOS) : When the market breaks a key support or resistance level, it signals a change in market structure. This indicator helps you identify these breakouts in time and take advantage of trading opportunities.
  
🟣 Inducement 
Inducement refers to price traps set by Smart Money to trick retail traders into making the wrong trades. This indicator helps you recognize these traps and avoid unprofitable trades.
 Valid Inducement : Valid Inducement refers to deliberately created price traps by major market players to gather liquidity from retail traders. Once the market has collected sufficient liquidity, it makes the real move, and professional traders use this moment to enter.
  
🟣 Valid Pullback 
A Valid Pullback refers to a temporary market retracement, indicating a price correction within the main trend. This concept is crucial in technical analysis as it helps traders enter trades at the right time and profit from the continuation of the trend. The Market Structure indicator can identify these valid retracements, allowing traders to enter trades with greater confidence.
🟣 Point of Interest (POI) 
Another important concept in market analysis is the Point of Interest (POI), referring to key price areas on the chart. POI includes zones where significant price movements are likely to occur. The Market Structure indicator helps you locate these key points and use them as entry signals for trades.
🟣 Liquidity Grab 
Liquidity Grab refers to a scenario where the market intentionally moves to areas where retail traders' stop losses are placed. The goal is to gather liquidity, allowing major players to execute trades at better prices. By using this indicator, you can spot these liquidity grabs and avoid falling into price traps.
🔵 Setting 
 ChoCh Detector Period : The period of identifying the major market levels that occur when they break ChoCh.
 BoS & Liquidity Detector Period : The period of identifying minor levels, which are used to identify BoS and Liquidity levels.
 Inducement Detector Period : The period of identification of Inducement levels.
 Fast Trend Detector : This feature will help you update the major market structure levels sooner.
 Inducement Type Detector : Two modes "Sweeps" and "Total" can be used to identify the levels of Inducement. In "Sweeps" mode only Levels detected by touch shadow. In "Total" mode, all Levels are detected.
🔵 Conclusion 
In financial market analysis and forex trading, identifying Market Structure and Inducement is crucial. Market Structure helps you detect uptrends and downtrends, and understand Break of Structure (BOS) and Change of Character (CHOCH). The concept of Inducement also enables traders to spot Smart Money price traps and avoid unprofitable trades.
The Market Structure indicator is a powerful tool that, by analyzing the market structure and concepts like valid pullback and valid inducement, helps you make more precise trade entries. Additionally, by identifying POI and Liquidity Grab, the indicator gives you the ability to spot key market zones and use them to your advantage in trading.
Market Structure & Session Alerts### Market Structure & Session Alerts Indicator
#### Overview
The "Market Structure & Session Alerts" indicator is a comprehensive tool designed to assist traders in identifying key market structure levels, detecting liquidity sweeps, and receiving alerts for specific trading sessions. This indicator is particularly useful for traders who want to keep an eye on previous high and low levels and be alerted during pre-London and pre-New York sessions.
#### Features
1. **Previous High/Low Levels:**
   - **Daily, Weekly, and Monthly Highs and Lows:** The indicator plots the previous day, week, and month high and low levels on the chart. These levels can be crucial for identifying support and resistance zones.
   - **Toggle Display:** Users can choose to show or hide these levels using the "Show Previous Day/Week/Month High/Low" option.
2. **Liquidity Sweep Detection:**
   - **Liquidity Sweep Identification:** The indicator detects liquidity sweeps when the current price closes above the previous day's high. This can signal potential reversals or continuations in the market.
   - **Visual Alerts:** When a liquidity sweep is detected, a green triangle is plotted below the bar.
3. **Session Alerts:**
   - **Session Timings:** Users can set specific start and end times for the pre-London and pre-New York sessions to match their timezone.
   - **Visual Background Highlight:** The background of the chart is highlighted in yellow during the defined session times to provide a visual cue.
   - **Alert Messages:** The indicator can generate alerts to notify traders when the market enters the pre-London or pre-New York session.
4. **Current Price Line:**
   - The current price is plotted as a black line, providing a clear visual reference for the current market price.
#### How to Use
1. **Input Parameters:**
   - `Show Previous Day/Week/Month High/Low`: Enable or disable the display of previous high/low levels.
   - `Show Liquidity Sweep`: Enable or disable the detection and display of liquidity sweeps.
   - `Show Session Alerts`: Enable or disable session alerts and background highlights.
2. **Session Timing Adjustments:**
   - Set the `Pre-London Start`, `Pre-London End`, `Pre-New York Start`, and `Pre-New York End` times according to your timezone to ensure accurate session alerts.
3. **Alerts:**
   - Make sure alerts are enabled in your TradingView settings to receive notifications when the market enters the pre-London or pre-New York sessions.
#### Example Use Cases
- **Day Traders:** Identify potential support and resistance levels using the previous day's high and low.
- **Swing Traders:** Use weekly and monthly high and low levels to determine significant market structure points.
- **Scalpers:** Detect liquidity sweeps to identify potential quick trades.
- **Session Traders:** Be alerted when the market enters key trading sessions to align your trading strategy with major market activities.
This indicator combines multiple market analysis tools into one, providing a robust system for traders to enhance their trading decisions and market awareness.
Uptrick: Volume StrengthPurpose:
The "Uptrick: Volume Strength" indicator, known by its short title 'VolStrength,' is meticulously designed to evaluate the strength of volume activity within a market, providing traders with valuable insights into liquidity dynamics. By visualizing volume bars and comparing them to a predefined threshold, traders can gauge the intensity of buying or selling pressure, thereby assessing market liquidity and potential price movements.
Explanation:
Input Parameters:
Traders benefit from the ability to customize the threshold for high volume, allowing them to adapt the indicator to varying market conditions and trading strategies.
The calculation of the average volume over a specified period adds depth to the analysis, offering traders a reference point for assessing current volume levels relative to historical averages and evaluating liquidity trends.
Volume Analysis:
The script discerns between bars where the closing price exceeds the opening price (up bars) and bars where the closing price is lower than the opening price (down bars), facilitating the identification of bullish or bearish market sentiment.
High-volume bars that surpass the predefined threshold are prominently highlighted, serving as indicators of increased trading activity and enhanced liquidity levels.
Average Volume Visualization:
A line representing the average volume over the specified period is plotted on the chart, providing traders with a visual reference for evaluating current volume levels against historical averages. This aids in assessing the overall liquidity conditions in the market.
Volume Bar Representation:
The colorization of volume bars is contingent upon their direction (up or down) and whether they exceed the high volume threshold.
Up bars, symbolizing buying pressure, are typically depicted in green, while down bars, indicative of selling pressure, are rendered in red.
Notably, when volume surpasses the high volume threshold, the respective bar color is applied, accentuating significant volume spikes and their potential impact on liquidity and price dynamics.
Through its meticulous design and comprehensive features, the "Uptrick: Volume Strength" indicator equips traders with actionable insights into market liquidity dynamics. By integrating volume analysis into their trading strategies, traders can effectively assess liquidity conditions, identify potential price movements, and make informed trading decisions.
LIT - Timings Fx MartinThe Asia Liquidity Points Indicator is a powerful tool designed for traders to identify key liquidity points during the Asia trading session. This script is tailored specifically to aid traders in capitalizing on the unique characteristics of Asian markets, providing invaluable insights into liquidity zones that can significantly enhance trading decisions.
Key Features:
Asia Session Focus: The indicator focuses exclusively on the Asia trading session, which encompasses the trading activity primarily in the Asian markets such as Tokyo, Hong Kong, Singapore, and others.
Liquidity Zones Identification: The script utilizes advanced algorithms to identify and map out liquidity zones within the Asia trading session. These zones represent areas where significant buying or selling pressure is likely to occur, thus presenting lucrative trading opportunities.
Customizable Parameters: Traders have the flexibility to customize various parameters such as time frame, sensitivity, and display options to suit their trading preferences and strategies.
Visual Alerts: The indicator provides visual alerts on the trading chart, clearly indicating the location and strength of liquidity points. This feature enables traders to quickly identify potential entry or exit points based on the liquidity dynamics in the market.
Real-Time Updates: The script continuously monitors market activity during the Asia session, providing real-time updates on liquidity points as they evolve. This ensures traders stay informed and adaptable to changing market conditions.
Integration with Trading Strategies: The Asia Liquidity Points Indicator seamlessly integrates with various trading strategies, serving as a valuable tool for both discretionary and algorithmic traders. Whether used in isolation or in combination with other technical analysis tools, this indicator can enhance trading performance and profitability.
User-Friendly Interface: The indicator boasts a user-friendly interface, making it accessible to traders of all levels of experience. Whether you are a novice trader or a seasoned professional, you can easily incorporate this tool into your trading arsenal.
In conclusion, the Asia Liquidity Points Indicator offers traders a strategic advantage in navigating the nuances of the Asia trading session. By identifying key liquidity zones and providing real-time insights, this script empowers traders to make informed decisions and capitalize on lucrative trading opportunities in the dynamic Asian markets.
ICT - GAPs and Volume Imbalance
GAPs
Gaps are areas on chart where the price have moved sharply up or down, with no trading in between. Gaps often fill, but they don't have to.
Volume Imbalance
Volume imbalance - determined using 2 candles
Bullish Volume Imbalance - area between the close of 1st candle and the open of 2nd candle
Bearish Volume Imbalance - area between the close of 1st candle and the open of 2nd candle
How to use the indicator:-
When you find imbalance in volume or a GAP in the chart, you may expect price to rebalance it before continuation. 
Importantly, GAPs/Imbalances do not always fill. Traders should never assume that a gap/imbalance will fill without understanding the reasons for the gap and monitoring trading activity around the gap. 
Pair it with your current bias for better results. 
FX Mini-Day/Index Dividers V2This is a combination of the Mini-Day Separator Indicator, timings based off the research by  Tom Henstridge/@LiquiditySniper  and additional Index KZ delineations, based on ICT's 2022 Youtube Mentorship. 
*It borrows some minor code from  Enricoamato997 . Credit where it is due!
This is a joint effort by myself,  @vbwilkes / Offseason Vince  and  @Tom_FOREX / TraderTom  on the Index/Index Future portion. 
Index Future Example
  
Forex Example
 
AG_STRATEGY📈 AG_STRATEGY — Smart Money System + Sessions + PDH/PDL
AG_STRATEGY is an advanced Smart Money Concepts (SMC) toolkit built for traders who follow market structure, liquidity and institutional timing.
It combines real-time market structure, session ranges, liquidity levels, and daily institutional levels — all in one clean, professional interface.
✅ Key Features
🧠 Smart Money Concepts Engine
Automatic detection of:
BOS (Break of Structure)
CHoCH (Change of Character)
Dual structure system: Swing & Internal
Historical / Present display modes
Optional structural candle coloring
🎯 Liquidity & Market Structure
Equal Highs (EQH) and Equal Lows (EQL)
Marks strong/weak highs & lows
Real-time swing confirmation
Clear visual labels + smart positioning
⚡ Fair Value Gaps (FVG)
Automatic bullish & bearish FVGs
Higher-timeframe compatible
Extendable boxes
Auto-filtering to remove noise
🕓 Institutional Sessions
Asia
London
New York
Includes:
High/Low of each session
Automatic range plotting
Session background shading
London & NY Open markers
📌 PDH/PDL + Higher-Timeframe Levels
PDH / PDL (Previous Day High/Low)
Dynamic confirmation ✓ when liquidity is swept
Multi-timeframe level support:
Daily
Weekly
Monthly
Line style options: solid / dashed / dotted
🔔 Built-in Alerts
Internal & swing BOS / CHoCH
Equal Highs / Equal Lows
Bullish / Bearish FVG detected
🎛 Fully Adjustable Interface
Colored or Monochrome visual mode
Custom label sizes
Extend levels automatically
Session timezone settings
Clean, modular toggles for each component
🎯 Designed For Traders Who
Follow institutional order flow
Enter on BOS/CHoCH + FVG + Liquidity sweeps
Trade London & New York sessions
Want structure and liquidity clearly mapped
Prefer clean charts with full control
💡 Why AG_STRATEGY Stands Out
✔ Professional SMC engine
✔ Real-time swing & internal structure
✔ Session-based liquidity tracking
✔ Non-cluttered chart — high clarity
✔ Supports institutional trading workflows
FU Candle Detector (Smart Money Concept)  En Anglais🧠 Overall concept: “FU Candle” in Smart Money logic
In the context of Smart Money Concepts (SMC) or ICT (Inner Circle Trader), an FU Candle (also known as a “Fakeout Candle” or “Manipulation Candle”) is a candle that:
Creates an imbalance or a break (often above a swing high or below a swing low),
Attracts liquidity by trapping retail traders (liquidity grab),
Then abruptly reverses direction, revealing the hand of “Smart Money” (large institutions).
It therefore often marks:
The point of manipulation before an impulsive movement (reversal),
An area of interest for entering in the institutional direction (after the liquidity grab).
---
⚙️ How the “FU Candle Detector” script works
The script identifies these candlesticks by observing several typical criteria:
1. Detection of the manipulative candle (FU Candle)
Search for a candlestick that breaks a previous swing (significant high or low),
But closes in the opposite direction, often below/above the broken zone,
Thus indicating a fakeout.
Examples:
Bullish FU Candle: breaks a previous low, but closes bullish.
Bearish FU Candle: breaks a previous high, but closes bearish.
---
2. Visualization on the chart
The script generally displays:
🔴 Red markers for bearish FUs (Fake Breakout upwards),
🟢 Green markers for bullish FUs (Fake Breakout downwards),
🟦 Rectangles of areas of interest (often around the FU Candle Open),
📏 Horizontal lines on areas of imbalance (OB/FVG if integrated).
---
3. Possible additions depending on the version
Depending on the version you have received, the script can also:
Detect Fair Value Gaps (FVG) around FU Candles,
Mark Order Blocks (OB) associated with manipulation,
Add alerts when new FU Candles are detected,
Calculate the distance between the manipulation point and the price return,
Filter according to candle size, volume, or market structure (MSB/CHoCH).
---
🎯 Practical use
FU Candles are often used:
As confirmation of an imminent reversal,
To identify institutional entry zones (hidden Order Block),
To anticipate the direction of the next impulse after the liquidity hunt.
Typical entry example:
> Wait for the formation of an FU Candle + price return within the candle body = entry in the opposite direction to the false breakout.
📈 Recommended combinations
This detector is often combined with:
Structure Break Indicator (CHoCH / BOS)
Liquidity Pool Zones
Fair Value Gap Finder
Order Block Detector
This gives you a complete Smart Money Concept system, capable of mapping:
1. Where liquidity has been taken,
2. Where the price is rebalancing,
3. Where Smart Money is repositioning its orders.
LANZ Origins🔷 LANZ Origins – Multi-Framework Liquidity, Structure & Risk Management Overlay 
LANZ Origins is an advanced multi-framework visualization toolkit that unifies key institutional concepts into one efficient interface. Designed for professional traders, it merges session mapping, liquidity analysis, imbalance detection, multi-account risk control, and higher-timeframe candle tracing — all in a single overlay.
 🧩 Core Components 
 
 🈵 Asian Range Liquidity
 
Automatically detects and projects the Asian session range (19:00–02:00 NY) with an optional mid-price line (50 %). This provides visual context for intraday liquidity and manipulation zones commonly referenced in ICT-style analysis.
 
 📊 Imbalance Detector
 
Highlights Fair Value Gaps (FVG), Opening Gaps (OG), and Volume Imbalances (VI) directly on-chart, using separate color schemes for bullish and bearish inefficiencies. Each element can be customized by width, ATR filter, and extension length.
 
 🕯️ Higher-Timeframe Candles (ICT Style)
 
Displays multi-timeframe candles (HTF1–HTF6) simultaneously — e.g., 5 m, 30 m, 1 h, 4 h, 1 D, 1 W — each rendered with independent wick, border, and fill settings. Includes remaining-time counters, timeframe labels, and optional imbalance shading between bodies.
 
 📈 Market Structure (ZigZag 30 m)
 
Replicates 30-minute swing structure to all active timeframes, producing dynamic pivots with live extension. Ideal for contextualizing BOS/CHoCH events across multiple scales.
 
 💸 Multi-Account Lot Size Panel
 
Calculates position size for up to five accounts simultaneously, using your defined capital, risk %, and fixed SL distance (in pips). Results appear in a clean table at the bottom-right corner of the chart.
 
 🎨 Session Visualization
 
Colored backgrounds mark key trading phases:
🟢 Day division
🔴 No-action zone
🔵 Kill-zone
🟡 Hold session
 ⚙️ Customization & Performance 
Every module can be toggled individually, with full color, opacity, and style control. The script is optimized for overlay use and supports up to 500 boxes, lines, and labels with efficient resource handling.
 🧠 Best Use Case 
 LANZ Origins is ideal for traders who follow: 
 
 Smart Money Concepts / ICT methodology
 Liquidity & Imbalance-based trading
 Multi-timeframe confluence setups
 Risk-based position sizing workflows
 
 Use it to observe how price interacts with liquidity pools, higher-timeframe candles, and imbalances within key sessions — while monitoring lot size risk in real time. 
📌 Recommended Setup
 
 Timeframes: 30m - 5m – 3m
 Pairs: FX
 Session Timezone: New York (EST/EDT)
 Combine with: LANZ Strategy series for execution and journaling
 
 💬 Note 
 This indicator does not generate buy/sell signals. It’s a visual and analytical tool built to support your own decision-making process.
PRO Scalper(EN)
## What it is
**PRO Scalper** is an intraday price–action and liquidity map that helps you see where the market is likely to move **now**, not just where it has been.
It combines five building blocks that professional scalpers often watch together:
1. **Session Volume-Weighted Average Price (VWAP)** — the intraday “fair value” anchor.
2. **Opening Range** — the first minutes of the session that set the day’s balance.
3. **Trend filter** — higher-timeframe bias using **Exponential Moving Averages (EMA)** and optional **Average Directional Index (ADX)** strength.
4. **Two independent Supply/Demand zone engines** — zones are drawn from confirmed swing pivots, with midlines and **touch counters**.
5. **Order-flow style visuals**:
   * **Delta bubbles** (green/red circles) show where buying or selling pressure was unusually strong, using a safe **delta proxy** (no external feeds).
   * **Liquidity densities** (subtle rectangular bands) highlight clusters of large activity that often act as magnets or barriers and disappear when “eaten” by strong moves.
This mix gives you a **complete intraday picture**: the mean (VWAP), the day’s initial balance (Opening Range), the higher-timeframe push (trend filter), the nearby fuel or brakes (zones), and the live pressure points (bubbles and densities).
---
## Why these components
* **VWAP** tracks where the bulk of traded value sits. Price tends to rotate around it or accelerate away from it — a perfect compass for scalps.
* **Opening Range** frames the early auction. Many intraday breaks, fades and retests start at its boundaries.
* **EMA bias + ADX strength** separates trending conditions from chop, so you can keep only the zones that agree with the bigger push.
* **Pivot-based zones (two pairs at once)** are simple, objective and fast. Midlines help with confirmations; touch counters quantify how many times the zone was tested.
* **Bubbles and densities** add the “effort” layer: where the push appeared and where liquidity is concentrated. You see **where** a move is likely to continue or fail.
Together they reduce ambiguity: **context + level + effort** — all on one screen.
---
## How it works (plain language)
* **VWAP** resets each day and is calculated as the cumulative sum of typical price multiplied by volume divided by total volume.
* **Opening Range** is either automatic (a multiple of your chart timeframe) or a manual number of minutes. While it is forming, the highest high and lowest low are captured and plotted as the range.
* **Trend filter**
  * **EMA Fast** and **EMA Slow** define directional bias.
  * **ADX (optional)** adds “trend strength”: only when the Average Directional Index is above the chosen threshold do we treat the move as strong. You can source this from a higher timeframe.
* **Zones**
  * There are **two independent pairs** of pivots at the same time (for example 10-left 10-right and 5-left 5-right).
  * Each detected pivot creates a **Supply** (from a swing high) or **Demand** (from a swing low) box. Box depth = **zone depth × Average True Range** for adaptive sizing; the boxes **extend forward**.
  * Midline (optional dashed line inside the box) is the “balance” of the zone.
  * **“Only in trend”** mode can hide boxes that go against the higher-timeframe bias.
  * The **touch counter** increases when price revisits the box. Labels show the pair name and the number of touches.
* **Bubbles**
  * A safe **delta proxy** measures bar pressure (for example, range-weighted close vs open).
  * A **quantile filter** shows only unusually large pressure: choose lookback and percentile, and the script draws a circle sized by intensity (green = bullish pressure, red = bearish).
* **Densities**
  * The script marks heavy activity clusters as **subtle bands** around price (depth = fraction of Average True Range).
  * If price **breaks** a density with volume above its moving average, the band **disappears** (“eaten”), which often precedes continuation.
---
## How to use — practical playbooks
> Recommended chart: crypto or index futures, one to five minutes. Use **one hour** or **fifteen minutes** for the higher-timeframe bias.
### 1) Trend pullback scalp (continuation)
1. Enable **Only in trend** zones.
2. In an uptrend: wait for a pullback into a **Demand** zone that overlaps with VWAP or sits just below the Opening Range midpoint.
3. Look for **green bubbles** near the zone’s bottom or a fresh **density** under price.
4. Enter on a candle closing **back above the zone midline**.
5. Stop-loss: below the bottom of the zone or a small multiple of Average True Range.
6. Targets: previous swing high, Opening Range high, fixed risk multiples, or VWAP.
Mirror the logic for downtrends using Supply zones, red bubbles and densities above price.
### 2) Reversion with liquidity sweep (fade)
1. Bias neutral or countertrend allowed.
2. Price **wicks through** a zone boundary (or an Opening Range line) and **closes back inside** the zone.
3. The bubble color often flips (absorption).
4. Enter toward the **inside** of the zone; stop beyond the sweep wick; first target = zone midline, second = opposite side of the zone or VWAP.
### 3) Opening Range break and retest
1. Wait for the Opening Range to complete.
2. A break with a large bubble suggests intent.
3. Look for a **retest** into a nearby zone aligned with VWAP.
4. Trade continuation toward the next zone or the session extremes.
### 4) Density “eaten” continuation
1. When a density band **disappears** on high volume, it often means the resting liquidity was consumed.
2. Trade in the direction of the break, toward the nearest opposing zone.
---
## Settings — quick guide
**Core**
* *ATR Length* — used for zone and density depths.
* *Show VWAP / Show Opening Range*.
* *Opening Range*: Auto (multiple of timeframe minutes) or Manual minutes.
**Trend Filter**
* *Mode*: Off, EMA only, or EMA with ADX strength.
* *Use higher timeframe* and its value.
* *EMA Fast / EMA Slow*, *ADX Length*, *ADX threshold*.
* *Plot EMA filter* to display the moving averages.
**Zones (two pairs)**
* *Pivot A Left / Right* and *Pivot B Left / Right*.
* *Zone depth × ATR*, *Extend bars*.
* *Show zone midline*, *Only in trend zones*.
* Labels automatically show the touch counters.
**Bubbles**
* *Show Bubbles*.
* *Quantile lookback* and *Quantile percent* (higher percent = stricter filter, fewer bubbles).
**Densities**
* *Metric*: absolute delta proxy or raw volume.
* *Quantile lookback / percent*.
* *Depth × ATR*, *Extend bars*, *Merge distance* (in ATR),
* *Break condition*: volume moving average length and multiplier,
* *Midline for densities* (optional dashed line).
---
## Tips and risk management
* This script **does not use external order-flow feeds**. Delta is a **proxy** suitable for TradingView; tune quantiles per symbol and timeframe.
* Do not trade every bubble. Combine **context (trend + VWAP + Opening Range)** with **level (zone)** and **effort (bubble/density)**.
* Set stop-losses beyond the zone or at a fraction of Average True Range. Predefine risk per trade.
* Backtest your rules with a strategy script before using real funds.
* Markets differ. Parameters that work on Bitcoin may not transfer to low-liquidity altcoins or stocks.
* Nothing here is financial advice. Scalping is high-risk; slippage and over-trading can quickly damage your account.
---
## What makes PRO Scalper unique
* Two **independent** zone engines run in parallel, so you can see both **larger structure** and **fine intraday levels** at the same time.
* Clean **“only in trend” rendering** — zones and midlines against the bias can be hidden, reducing clutter and hesitation.
* **Touch counters** convert “feel” into numbers.
* **Self-contained order-flow visuals** (bubbles and densities) that require no extra data sources.
* Careful defaults: subtle colors for densities, clearer zones, and responsive auto Opening Range.
---
(RU)
## Что это такое
**PRO Scalper** — это индикатор для внутридневной торговли, который показывает **контекст и ликвидность прямо сейчас**.
Он объединяет пять модулей, которыми профессиональные скальперы пользуются вместе:
1. **VWAP** — средневзвешенная по объему цена за сессию, «справедливая стоимость» дня.
2. **Opening Range** — первая часть сессии, задающая баланс дня.
3. **Фильтр тренда** — направление старшего таймфрейма по **экспоненциальным средним** и при желании по силе тренда **Average Directional Index**.
4. **Две независимые системы зон спроса/предложения** — зоны строятся от подтвержденных экстремумов (пивотов), имеют **среднюю линию** и **счетчик касаний**.
5. **Визуализация «ордер-флоу»**:
   * **Пузыри дельты** (зеленые/красные круги) — места повышенного покупательного/продажного давления, рассчитанные через безопасный **прокси-дельты**.
   * **Плотности ликвидности** (ненавязчивые прямоугольные ленты) — скопления объема, которые нередко притягивают цену или удерживают ее и исчезают, когда «разъедаются» сильным движением.
Итог — **полная картинка момента**: среднее (VWAP), баланс дня (Opening Range), старшая сила (фильтр тренда), ближайшие уровни топлива/тормозов (зоны), текущие точки усилия (пузыри и плотности).
---
## Почему именно эти элементы
* **VWAP** показывает, где сосредоточена стоимость; цена либо вращается вокруг него, либо быстро уходит — идеальный ориентир скальпера.
* **Opening Range** фиксирует ранний аукцион — от его границ часто начинаются пробои, возвраты и ретесты.
* **EMA + ADX** отделяют тренд от «пилы», позволяя оставлять на графике только зоны по направлению старшего таймфрейма.
* **Зоны от пивотов** просты, объективны и быстры; средняя линия помогает подтверждать разворот, счетчик касаний переводит субъективность в цифры.
* **Пузыри и плотности** добавляют слой «усилия»: где именно возник толчок и где сконцентрирована ликвидность.
Комбинация **контекста + уровня + усилия** уменьшает двусмысленность и ускоряет принятие решения.
---
## Как это работает (простыми словами)
* **VWAP** каждый день стартует заново: сумма «типичной цены × объем» делится на суммарный объем.
* **Opening Range** — автоматический (кратный минутам вашего таймфрейма) или вручную заданный период; пока он формируется, фиксируются максимум и минимум.
* **Фильтр тренда**
  * Две экспоненциальные средние задают направление.
  * **ADX** (по желанию) добавляет «силу». Источник можно взять со старшего таймфрейма.
* **Зоны**
  * Одновременно работает **две пары** пивотов (например 10-лево 10-право и 5-лево 5-право).
  * От пивота строится зона **предложения** (от максимума) или **спроса** (от минимума). Глубина зоны = **коэффициент × Average True Range**; зона тянется вперед.
  * Внутри рисуется **средняя линия** (по желанию).
  * Режим **«только по тренду»** скрывает зоны против старшего направления.
  * **Счетчик касаний** увеличивается, когда цена снова входит в зону; подпись показывает пару и количество касаний.
* **Пузыри**
  * Используется безопасный **прокси-дельты** — измерение «напряжения» внутри свечи.
  * Через **квантильный фильтр** выводятся только необычно сильные места: настраиваются окно и процент квантиля; размер кружка — сила, цвет: зеленый покупатели, красный продавцы.
* **Плотности**
  * Крупные активности отмечаются **ненавязчивыми прямоугольниками** (глубина — доля Average True Range).
  * Если плотность **пробивается** объемом выше среднего, она **исчезает** — часто это предвещает продолжение.
---
## Как пользоваться — практические схемы
> Рекомендация: крипто или фьючерсы, таймфрейм 1–5 минут. Для старшего фильтра удобно взять **1 час** или **15 минут**.
### 1) Скальп на откат по тренду
1. Включите **«только по тренду»**.
2. В восходящем тренде дождитесь отката в **зону спроса**, желательно рядом с **VWAP** или серединой **Opening Range**.
3. Подтверждение — **зеленые пузыри** у нижней границы зоны или свежая **плотность** под ценой.
4. Вход после закрытия свечи **выше средней линии** зоны.
5. Стоп-лосс: за нижнюю границу зоны или небольшой множитель Average True Range.
6. Цели: предыдущий максимум, верх Opening Range, фиксированные R-множители, либо VWAP.
Для нисходящего тренда зеркально: зоны предложения, красные пузыри и плотности над ценой.
### 2) Контрдвижение с «выбиванием ликвидности»
1. Нейтральный или контртрендовый режим.
2. Цена **выносит хвостом** границу зоны (или линию Opening Range) и **закрывается обратно внутри**.
3. Цвет пузыря часто меняется (поглощение).
4. Вход внутрь зоны; стоп — за хвост выбивания; цели: средняя линия, противоположная граница зоны или VWAP.
### 3) Пробой Opening Range + ретест
1. Дождитесь завершения диапазона.
2. Сильный пробой с крупным пузырем — признак намерения.
3. Ищите **ретест** в зоне по тренду рядом с линией диапазона и VWAP.
4. Торгуйте продолжение к следующей зоне.
### 4) Продолжение после «съеденной» плотности
1. Когда прямоугольник плотности **исчезает** на повышенном объеме, это значит, что ликвидность поглощена.
2. Торгуйте в сторону пробоя к ближайшей противоположной зоне.
---
## Настройки — краткая шпаргалка
**Core**
— Длина Average True Range (для размеров зон и плотностей).
— Включение VWAP и Opening Range.
— Длина Opening Range: автоматическая (кратная минутам ТФ) или ручная.
**Trend Filter**
— Режим: выкл., только средние, либо средние + ADX.
— Источник со старшего таймфрейма и его значение.
— Длины средних, длина ADX и порог силы.
— Показать/скрыть линий средних.
**Zones (две пары одновременно)**
— Пара A: лев/прав; Пара B: лев/прав.
— Глубина зоны × Average True Range, продление по барам.
— Средняя линия, режим **«только по тренду»**.
— Подписи со счетчиком касаний.
**Bubbles**
— Вкл./выкл., окно поиска и процент квантиля (чем выше процент — тем реже пузыри).
**Densities**
— Метрика: абсолютная прокси-дельты или чистый объем.
— Окно/квантиль, глубина × Average True Range, продление,
— Порог объединения (в Average True Range),
— Условие «разъедания» по объему,
— Средняя линия плотности (по желанию).
---
## Советы и риски
* Индикатор **не использует внешние потоки ордер-флоу**. Дельта — **прокси**, подходящая для TradingView; подбирайте квантили под инструмент и таймфрейм.
* Не торгуйте каждый пузырь. Склейте **контекст (тренд + VWAP + Opening Range)** с **уровнем (зона)** и **усилием (пузырь/плотность)**.
* Стоп-лосс — за границей зоны или по Average True Range. Риск на сделку задавайте заранее.
* Перед реальными деньгами протестируйте правила в стратегии.
* Разные рынки ведут себя по-разному; настройки из Биткоина могут не подойти малоликвидным альткоинам или акциям.
* Это не инвестиционная рекомендация. Скальпинг — высокий риск; проскальзывание и переизбыток сделок быстро наносят ущерб капиталу.
---
## Чем уникален PRO Scalper
* Две **одновременные** системы зон показывают и **крупную структуру**, и **точные локальные уровни**.
* Режим **«только по тренду»** чистит экран от лишних уровней и ускоряет решение.
* **Счетчики касаний** дают количественную опору.
* **Самодостаточные визуализации усилия** (пузыри и плотности) — без сторонних источников данных.
* Аккуратная цветовая схема: плотности — мягко, зоны — ясно; Opening Range — адаптивный.
Пусть он станет вашей «картой местности» для быстрых и дисциплинированных решений внутри дня.
Fractals & SweepThe Fractals & Sweep indicator is designed to identify key market structure points (fractals) and detect potential liquidity sweeps around those areas. It visually highlights both Bill Williams fractals and regular fractals, and alerts the user when the market sweeps liquidity above or below the most recent fractal levels.
Fractal Recognition:
Detects both bullish (low) and bearish (high) fractals on the price chart.
Users can choose between:
Bill Williams fractal logic (default), or
Regular fractal logic (when the “Filter Bill Williams Fractals” option is enabled).
Fractals are plotted directly on the chart as red downward triangles for highs and green upward triangles for lows.
Fractal Tracking:
The indicator stores the most recent high and low fractal levels to serve as reference points for potential sweep detection.
Sweep Detection:
A bearish sweep is triggered when the price wicks above the last fractal high but closes below it — suggesting a liquidity grab above resistance.
A bullish sweep is triggered when the price wicks below the last fractal low but closes above it — suggesting a liquidity grab below support.
When a sweep occurs, the indicator draws a horizontal line from the previous fractal point to the current bar.
Alert System:
Custom alerts notify the trader when a bearish sweep or bullish sweep occurs, allowing for timely reactions to potential reversals or liquidity traps.
Trend Pivots Profile [BigBeluga]🔵 OVERVIEW 
The  Trend Pivots Profile   is a dynamic volume profile tool that builds profiles around pivot points to reveal where liquidity accumulates during trend shifts. When the market is in an  uptrend , the indicator generates profiles at  low pivots . In a  downtrend , it builds them at  high pivots . Each profile is constructed using lower timeframe volume data for higher resolution, making it highly precise even in limited space. A colored trendline helps traders instantly recognize the prevailing trend and anticipate which type of profile (bullish or bearish) will form.
 🔵 CONCEPTS 
 
   Pivot-Driven Profiles : Profiles are only created when a new pivot forms, aligning liquidity analysis with market structure shifts.
  
   Trend-Contextual : Profiles form at low pivots in uptrends and at high pivots in downtrends.
  
   Lower Timeframe Data : Volume and close values are pulled from smaller timeframes to provide detailed, high-resolution profiles inside larger pivot windows.
   Adaptive Bin Sizing : Bin size is automatically calculated relative to ATR, ensuring consistent precision across different markets and volatility conditions.
  
   Point of Control (PoC) : The highest-volume level within each profile is marked with a PoC line that extends until the next pivot forms.
  
   Trendline Visualization : A wide, semi-transparent line follows the rolling average of highs and lows, colored  blue  in uptrends and  orange  in downtrends.
  
 
 🔵 FEATURES 
 
   Pivot Length Control : Adjust how far back the script looks to detect pivots (e.g., length 5 → profiles cover 10 bars after pivot).
  
 Pivot Profile toggle :
   On  → draw the filled pivot profile + PoC + pivot label.
   Off  → hide profiles; show only PoC level (clean S/R mode).
  
   Trend Length Filter : Smooths trendline detection to ensure reliable up/down bias.
   Precise Volume Distribution : Volume is aggregated into bins, creating a smooth volume curve around the pivot range.
   PoC Extension : Automatically extends the most active price level until a new pivot is confirmed.
   Profile Visualization : Profiles appear as filled shapes anchored at the pivot candle, colored based on trend.
   Trendline Overlay : Thick, semi-transparent trendline provides visual guidance on directional bias.
   Automatic Cleanup : Old profiles are deleted once they exceed the chart’s capacity (default 25 stored profiles).
 
 🔵 HOW TO USE 
 
   Spotting Trend Liquidity : In an uptrend, monitor profiles at low pivots to see where buyers concentrated. In downtrends, use high-pivot profiles to spot sell-side pressure.
   Watch the PoC : The PoC line highlights the strongest traded level of the pivot structure—expect reactions when price retests it.
   Anticipate Trend Continuation/Reversal : Use the trendline (blue = bullish, orange = bearish) together with pivot profiles to forecast directional momentum.
   Combine with HTF Context : Overlay with higher timeframe structure (order blocks, liquidity zones, or FVGs) for confluence.
   Fine-Tune with Inputs : Adjust  Pivot Length  for sensitivity and  Trend Length  for smoother or faster trend shifts.
 
 🔵 CONCLUSION 
The  Trend Pivots Profile   blends pivot-based structure with precise volume profiling. By dynamically plotting profiles on pivots aligned with the prevailing trend, highlighting PoCs, and overlaying a directional trendline, it equips traders with a clear view of liquidity clusters and directional momentum—ideal for anticipating reactions, pullbacks, or breakouts.
Volume Based Sampling [BackQuant]Volume Based Sampling  
 What this does 
This indicator converts the usual  time-based  stream of candles into an  event-based  stream of “synthetic” bars that are created  only when enough trading activity has occurred . You choose the activity definition:
 Volume bars : create a new synthetic bar whenever the cumulative number of shares/contracts traded reaches a threshold.
 Dollar bars : create a new synthetic bar whenever the cumulative traded  dollar value  (price × volume) reaches a threshold.
The script then keeps an internal ledger of these synthetic opens, highs, lows, closes, and volumes, and can display them as candles, plot a moving average calculated over the synthetic closes, mark each time a new sample is formed, and optionally overlay the native time-bars for comparison.
 Why event-based sampling matters 
Markets do not release information on a clock: activity clusters during news, opens/closes, and liquidity shocks.  Event-based bars  normalize for that heteroskedastic arrival of information: during active periods you get more bars (finer resolution); during quiet periods you get fewer bars (coarser resolution). Research shows this can reduce microstructure pathologies and produce series that are closer to i.i.d. and more suitable for statistical modeling and ML. In particular:
 Volume and dollar bars  are a common event-time alternative to time bars in quantitative research and are discussed extensively in  Advances in Financial Machine Learning  (AFML). These bars aim to homogenize information flow by sampling on traded size or value rather than elapsed seconds.
 The Volume Clock  perspective models market activity in “volume time,” showing that many intraday phenomena (volatility, liquidity shocks) are better explained when time is measured by traded volume instead of seconds. 
Related market microstructure work on  flow toxicity  and liquidity highlights that the risk dealers face is tied to information intensity of order flow, again arguing for activity-based clocks. 
 How the indicator works (plain English) 
 Choose your bucket type 
 
 Volume : accumulate volume until it meets a threshold.
 Dollar Bars : accumulate close × volume until it meets a dollar threshold.
 
 Pick the threshold rule 
 Dynamic threshold : by default, the script computes a rolling statistic (mean or median) of recent activity to set the next bucket size. This adapts bar size to changing conditions (e.g., busier sessions produce more frequent synthetic bars).
 Fixed threshold : optionally override with a constant target (e.g., exactly 100,000 contracts per synthetic bar, or $5,000,000 per dollar bar).
 Build the synthetic bar 
While a bucket fills, the script tracks:
o_s: first price of the bucket (synthetic open)
h_s: running maximum price (synthetic high)
l_s: running minimum price (synthetic low)
c_s: last price seen (synthetic close)
v_s: cumulative native volume inside the bucket
d_samples: number of native bars consumed to complete the bucket (a proxy for “how fast” the threshold filled)
 Emit a new sample 
Once the bucket meets/exceeds the threshold, a  new synthetic bar  is finalized and stored. If overflow occurs (e.g., a single native bar pushes you past the threshold by a lot), the code will emit multiple synthetic samples to account for the extra activity.
 Maintain a rolling history efficiently 
A  ring buffer  can overwrite the oldest samples when you hit your Max Stored Samples cap, keeping memory usage stable.
 Compute synthetic-space statistics 
The script computes an  SMA over the last N synthetic closes  and basic descriptors like average bars per synthetic sample, mean and standard deviation of synthetic returns, and more. These are all in  event time , not clock time.
 Inputs and options you will actually use 
 Data Settings 
 Sampling Method : Volume or Dollar Bars.
 Rolling Lookback : window used to estimate the dynamic threshold from recent activity.
 Filter : Mean or Median for the dynamic threshold. Median is more robust to spikes.
 Use Fixed? / Fixed Threshold : override dynamic sizing with a constant target.
 Max Stored Samples : cap on synthetic history to keep performance snappy.
 Use Ring Buffer : turn on to recycle storage when at capacity.
 Indicator Settings 
 SMA over last N samples : moving average in  synthetic space . Because its index is sample count, not minutes, it adapts naturally: more updates in busy regimes, fewer in quiet regimes.
 Visuals 
 
 Show Synthetic Bars : plot the synthetic OHLC candles.
 Candle Color Mode :
 Green/Red: directional close vs open
 Volume Intensity: opacity scales with synthetic size
 Neutral: single color
 Adaptive: graded by how large the bucket was relative to threshold
 Mark new samples : drop a small marker whenever a new synthetic bar prints.
 
 Comparison & Research 
 Show Time Bars : overlay the native time-based candles to visually compare how the two sampling schemes differ.
 How to read it, step by step 
 Turn on “Synthetic Bars”  and optionally overlay “Time Bars.” You will see that during high-activity bursts, synthetic bars print much faster than time bars.
 Watch the synthetic SMA . Crosses in synthetic space can be more meaningful because each update represents a roughly comparable amount of traded information.
 Use the “Avg Bars per Sample”  in the info table as a regime signal. Falling average bars per sample means activity is clustering, often coincident with higher realized volatility.
 Try Dollar Bars  when price varies a lot but share count does not; they normalize by dollar risk taken in each sample.  Volume Bars  are ideal when share count is a better proxy for information flow in your instrument.
 Quant finance background and citations 
 Event time vs. clock time : Easley, López de Prado, and O’Hara advocate measuring intraday phenomena on a  volume clock  to better align sampling with information arrival. This framing helps explain volatility bursts and liquidity droughts and motivates volume-based bars.
 Flow toxicity and dealer risk : The same authors show how adverse selection risk changes with the intensity and informativeness of order flow, further supporting activity-based clocks for modeling and risk management. 
 AFML framework : In  Advances in Financial Machine Learning , event-driven bars such as  volume, dollar, and imbalance bars  are presented as superior sampling units for many ML tasks, yielding more stationary features and fewer microstructure distortions than fixed time bars. ( Alpaca )
 Practical use cases 
 1) Regime-aware moving averages 
The synthetic  SMA in event time  is not fooled by quiet periods: if nothing of consequence trades, it barely updates. This can make  trend filters  less sensitive to calendar drift and more sensitive to true participation.
 2) Breakout logic on “equal-information” samples 
The script exposes simple alerts such as  breakout above/below the synthetic SMA . Because each bar approximates a constant amount of activity, breakouts are conditioned on comparable informational mass, not arbitrary time buckets.
 3) Volatility-adaptive backtests 
If you use synthetic bars as your base data stream, most signal rules become  self-paced : entry and exit opportunities accelerate in fast markets and slow down in quiet regimes, which often improves the realism of slippage and fill modeling in research pipelines (pair this indicator with strategy code downstream).
 4) Regime diagnostics 
 Avg Bars per Sample  trending down: activity is dense; expect larger realized ranges.
 Return StdDev (synthetic)  rising: noise or trend acceleration in event time; re-tune risk.
 Interpreting the info panel 
 Method : your sampling choice and current threshold.
 Total Samples : how many synthetic bars have been formed.
 Current Vol/Dollar : how much of the next bucket is already filled.
 Bars in Bucket : native bars consumed so far in the current bucket.
 Avg Bars/Sample : lower means higher trading intensity.
 Avg Return / Return StdDev : return stats computed over  synthetic closes .
 Research directions you can build from here 
 Imbalance and run bars 
Extend beyond pure volume or dollar thresholds to  imbalance bars  that trigger on directional order flow imbalance (e.g., buy volume minus sell volume), as discussed in the AFML ecosystem. These often further homogenize distributional properties used in ML. alpaca.markets
 Volume-time indicators 
Re-compute classical indicators (RSI, MACD, Bollinger) on the synthetic stream. The premise is that signals are updated by  traded information , not seconds, which may stabilize indicator behavior in heteroskedastic regimes.
 Liquidity and toxicity overlays 
Combine synthetic bars with proxies of  flow toxicity  to anticipate spread widening or volatility clustering. For instance, tag synthetic bars that surpass multiples of the threshold and test whether subsequent realized volatility is elevated. 
 Dollar-risk parity sampling for portfolios 
Use  dollar bars  to align samples across assets by notional risk, enabling cleaner cross-asset features and comparability in multi-asset models (e.g., correlation studies, regime clustering). AFML discusses the benefits of event-driven sampling for cross-sectional ML feature engineering. 
 Microstructure feature set 
Compute  duration in native bars per synthetic sample ,  range per sample , and  volume multiple of threshold  as inputs to  state classifiers  or  regime HMMs . These features are inherently activity-aware and often predictive of short-horizon volatility and trend persistence per the event-time literature. ( Alpaca )
 Tips for clean usage 
Start with dynamic thresholds using  Median  over a sensible lookback to avoid outlier distortion, then move to  Fixed  thresholds when you know your instrument’s typical activity scale.
Compare  time bars vs synthetic bars  side by side to develop intuition for how your market “breathes” in activity time.
Keep  Max Stored Samples  reasonable for performance; the ring buffer avoids memory creep while preserving a rolling window of research-grade data.
CMC Macro Regime PanelOverview (what it is):
A macro‑regime gate built entirely from TradingView-native symbols (CRYPTOCAP, FRED, DXY/VIX, HYG/LQD). It aggregates central‑bank liquidity (Fed balance sheet − RRP − Treasury General Account), USD strength, credit conditions, stablecoin flows/dominance, tech beta and BTC–NDX co‑move into one normalized score (CLRC). The panel outputs Risk‑ON/OFF regimes, an Early 3/5 pre‑signal, and an automatic BTC vs ETH vs ALTs preference. It is intentionally scoped to Daily & Weekly reads (no intraday timing). Publish with a clean chart and a clear description as per TradingView rules. 
TradingView
Why we also use other TradingView screens (and why that is compliant)
This script pulls data via request.security() from official TV symbols only; users often want to open the raw series on separate charts to sanity‑check:
CRYPTOCAP indices: TOTAL, TOTAL2, TOTAL3 (market cap aggregates) and dominance tickers like BTC.D, USDT.D. Helpful for regime & rotation (ALTs vs BTC). TradingView provides definitions for crypto market cap and dominance symbols. 
TradingView
+3
TradingView
+3
TradingView
+3
FRED releases: WALCL (Fed assets, weekly), RRPONTSYD (ON RRP, daily), WTREGEN (TGA, weekly), M2SL (M2, monthly). These are the official macro sources exposed on TV. 
FRED
+3
FRED
+3
FRED
+3
Risk proxies: TVC:DXY (USD index), TVC:VIX (implied vol), AMEX:HYG/AMEX:LQD (credit), NASDAQ:NDX (tech beta), BINANCE:ETHBTC. VIX/NDX relationship is well-documented; VIX measures 30‑day expected S&P500 vol. 
TradingView
+2
TradingView
+2
Compliance note: Using multiple screens is optional for users, but it explains/justifies how components work together (a requirement for public scripts). Keep publication chart clean; use extra screens only to illustrate in the description. 
TradingView
How it works (high level)
Liquidity block (Weekly/Monthly)
Net Liquidity = WALCL − RRPONTSYD − WTREGEN (YoY z‑score). WALCL is weekly (as of Wednesday) via H.4.1; RRP is daily; TGA is a Fed liability series. M2 YoY is monthly. 
FRED
+3
FRED
+3
FRED
+3
Risk conditions (Daily)
DXY 3‑month momentum (inverted), VIX level (inverted), Credit (HYG/LQD ratio or HY OAS). VIX is a 30‑day constant‑maturity implied vol index per Cboe methodology. 
Cboe
+1
Crypto‑internal (Daily)
Stablecoins (USDT+USDC+DAI 30‑day log change), USDT dominance (20‑day, inverted), TOTAL3 (63‑day momentum). Dominance symbols on TV follow a documented formula. 
TradingView
Beta & co‑move (Daily)
NDX 63‑day momentum, BTC↔NDX 90‑day correlation.
All components become z‑scores (optionally clipped), weighted, missing inputs drop and weights renormalize. We never use lookahead; we confirm on bar close to avoid repainting per Pine docs (barstate.isconfirmed, multi‑TF). 
TradingView
+2
TradingView
+2
What you see on the chart
White line (CLRC) = macro regime score.
Background: Green = Risk‑ON, Red = Risk‑OFF, Teal = Early 3/5 (pre‑signal).
Table: shows each component’s z‑score and the Preference: BTC / ETH / ALTs / Mixed.
Signals & interpretation
Designed for Daily (1D) and Weekly (1W) only.
Regime gates (default Fast preset):
Enter ON: CLRC ≥ +0.8; Hold ON while ≥ +0.5.
Enter OFF: CLRC ≤ −1.0; Hold OFF while ≤ −0.5.
0 / ±1 reading: CLRC is a standardized composite.
~0 = neutral baseline (no macro edge).
≥ +1 = strong macro tailwind (≈ +1σ).
≤ −1 = strong headwind (≈ −1σ).
Early 3/5 (teal): a fast pre‑signal when at least 3 of 5 daily checks align: USDT.D↓, DXY↓, VIX↓, HYG/LQD↑, ETHBTC↑ or TOTAL3↑. It often precedes a full ON flip—use for pre‑positioning rather than full sizing.
BTC/ETH/ALTs selector (only when ON):
ALTs when BTC.D↓ and (ETHBTC↑ or TOTAL3↑) ⇒ rotate down the risk curve.
BTC when BTC.D↑ and ETHBTC↓ ⇒ keep it concentrated.
ETH when ETHBTC↑ while BTC.D flat/up ⇒ add ETH beta.
(Dominance mechanics are documented by TV.) 
TradingView
Dissonance (incompatibility) rules — when to stand down
Use these overrides to avoid false comfort:
CLRC > +1 but USDT.D↑ and/or VIX spikes day‑over‑day → downgrade to Neutral; wait for USDT.D to stabilize and VIX to cool (VIX is a fear gauge of 30‑day expectation). 
Cboe Global Markets
CLRC > +1 but DXY↑ sharply (USD squeeze) → size below normal; require DXY momentum to roll over.
CLRC < −1 but Early 3/5 = true two days in a row → start reducing underweights; look for ON flip within a few bars.
NetLiq improving (W) but credit (HYG/LQD) deteriorating (D) → treat as mixed regime; prefer BTC over ALTs.
How to use (step‑by‑step)
A. Read on Daily (1D) — main regime
Open CRYPTOCAP:TOTAL3, 1D (panel applied).
Wait for bar close (use alerts on confirmed bar). Pine docs recommend barstate.isconfirmed to avoid repainting on realtime bars. 
TradingView
If ON, check Preference (BTC / ETH / ALTs).
Then drop to 4H on your trading pair for micro entries (this indicator itself is not for intraday timing).
B. Confirm weekly macro (1W) — once per week)
Review WALCL/RRP/TGA after the H.4.1 release on Thursdays ~4:30 pm ET. WALCL is “Weekly, as of Wednesday”; M2 is Monthly—so do not expect daily responsiveness from these. 
Federal Reserve
+2
FRED
+2
Recommended check times (practical schedule)
Daily regime read: right after your chart’s daily close (confirmed bar). For consistent timing across crypto, many users set chart timezone to UTC and read ~00:05 UTC; you can change chart timezone in TV’s settings. 
TradingView
In‑day monitoring: optional spot checks 16:00 & 20:00 UTC (DXY/VIX move during US hours), but act only after the daily bar confirms.
Weekly macro pass: Thu 21:30–22:30 UTC (after H.4.1 4:30 pm ET) or Fri after daily close, to let weekly FRED series propagate. 
Federal Reserve
Limitations & data latency (be explicit)
Higher‑TF data & confirmation: FRED weekly/monthly series will not reflect intraday risk in crypto; we aggregate them for regime, not for entry timing.
Repainting 101: Realtime bars move until close. This script does not use lookahead and follows Pine guidance on multi‑TF series; still, always act on confirmed bars. 
TradingView
+1
Public‑library compliance: Title EN‑only; description starts in EN; clean chart; justify component mash‑up; no lookahead; no unrealistic claims. 
TradingView
Alerts you can use
“Macro Risk‑ON (entry)” — fires on ON flip (confirmed bar).
“Macro Risk‑OFF (entry)” — fires on OFF flip.
“Early 3/5” — fires when the teal pre‑signal appears (not a regime flip).
“Preference change” — BTC/ETH/ALTs toggles while ON.
Publish note: Alerts are fine; just avoid implying guaranteed accuracy/performance. 
TradingView
Background research (why these inputs matter)
Liquidity → Crypto: Fed H.4.1 timing and series definitions (WALCL, RRP, TGA) formalize the “net liquidity” concept used here. 
FRED
+3
Federal Reserve
+3
FRED
+3
Stablecoins ↔ Non‑stable crypto: empirical work shows bi‑directional causality between stablecoin market cap and non‑stable crypto cap; stablecoin growth co‑moves with broader crypto activity.
Global liquidity link: world liquidity positively relates to total crypto market cap; lagged effects are observed at monthly horizons.
VIX/Uncertainty effect: fear shocks impair BTC’s “safe haven” behavior; VIX is a meaningful risk‑off read.
ICT Sweep + FVG Entry (v6) • Pro Pack 📌 ICT Sweep + FVG Entry Pro Pack
This indicator combines key ICT price action concepts with practical execution tools to help traders spot high-probability setups faster and more objectively. It’s designed for scalpers and intraday traders who want to keep their chart clean but never miss critical market structure events.
🔑 Features
Liquidity Pools (HTF)
• Auto-detects recent swing highs/lows from higher timeframes (5m/15m).
• Draws both lines and optional rectangles/zones for clear liquidity areas.
Liquidity Sweeps (BSL/SSL)
• Identifies when price sweeps above/below liquidity pools and rejects back.
• Optional Grade-A sweep filter (wick size + strong re-entry).
Fair Value Gaps (FVGs)
• Highlights bullish/bearish imbalances.
• Optional midline (50%) entry for precision.
• Auto-invalidation when price fully closes inside the gap.
Killzones (New York)
• Highlights AM (9:30–11:30) and PM (14:00–15:30) killzones.
• Option to block signals outside killzones for higher strike rate.
Bias Badge (DR50)
• Displays if price is trading in a Bull, Bear, or Range context based on displacement range midpoint.
SMT Assist (NQ vs ES)
• Detects simple divergences between indices:
Bearish SMT → NQ makes HH while ES doesn’t.
Bullish SMT → NQ makes LL while ES doesn’t.
SL/TP Helper & R:R Label
• Automatically draws stop loss (at sweep extreme) and target (opposite pool or recent swing).
• Displays expected Risk:Reward ratio and blocks entries if below your chosen minimum.
Filters
• ATR filter ensures signals only appear in sufficient volatility.
• Sweep quality filter avoids weak wicks and fake-outs.
🎯 How to Use
Start on HTF (5m/15m) → Identify liquidity zones and bias.
Drop to LTF (1m) → Wait for a liquidity sweep confirmation.
Check for FVG in the sweep’s direction → Look for retest entry.
Use the SL/TP helper to validate your risk/reward before taking the trade.
Focus entries during NY Killzones for maximum effectiveness.
✅ Why this helps
This tool reduces screen time and hesitation by automating repetitive ICT concepts:
Liquidity pools, sweeps, and FVGs are marked automatically.
Killzone timing and SMT divergence are simplified.
Clear visual signals for entries with built-in RR filter help keep your trading mechanical.
⚠️ Disclaimer: This script is for educational purposes only. It does not provide financial advice or guarantee results. Always use proper risk management.
ATAI Volume analysis with price action V 1.00ATAI Volume Analysis with Price Action  
 1. Introduction 
 1.1 Overview 
ATAI Volume Analysis with Price Action is a composite indicator designed for TradingView. It combines  per‑side volume data —that is, how much buying and selling occurs during each bar—with standard price‑structure elements such as swings, trend lines and support/resistance. By blending these elements the script aims to help a trader understand which side is in control, whether a breakout is genuine, when markets are potentially exhausted and where liquidity providers might be active.
The indicator is built around TradingView’s up/down volume feed accessed via the TradingView/ta/10 library. The following excerpt from the script illustrates how this feed is configured:
import TradingView/ta/10 as tvta
// Determine lower timeframe string based on user choice and chart resolution
string lower_tf_breakout = use_custom_tf_input ? custom_tf_input :
     timeframe.isseconds  ? "1S" :
     timeframe.isintraday ? "1"  :
     timeframe.isdaily    ? "5"  : "60"
// Request up/down volume (both positive)
  = tvta.requestUpAndDownVolume(lower_tf_breakout)
 Lower‑timeframe selection.  If you do not specify a custom lower timeframe, the script chooses a default based on your chart resolution:  1 second  for second charts,  1 minute  for intraday charts,  5 minutes  for daily charts and  60 minutes  for anything longer. Smaller intervals provide a more precise view of buyer and seller flow but cover fewer bars. Larger intervals cover more history at the cost of granularity.
 Tick vs. time bars.  Many trading platforms offer  a tick / intrabar calculation  mode that updates an indicator on every trade rather than only on bar close. Turning on one‑tick calculation will give the most accurate split between buy and sell volume on the current bar, but it typically reduces the amount of historical data available. For the highest fidelity in live trading you can enable this mode; for studying longer histories you might prefer to disable it. When volume data is completely unavailable (some instruments and crypto pairs), all modules that rely on it will remain silent and only the price‑structure backbone will operate.
  
 Figure caption,  Each panel shows the indicator’s info table for a different volume sampling interval. In the left chart, the parentheses “(5)” beside the buy‑volume figure denote that the script is aggregating volume over five‑minute bars; the center chart uses “(1)” for one‑minute bars; and the right chart uses “(1T)” for a one‑tick interval. These notations tell you which lower timeframe is driving the volume calculations. Shorter intervals such as 1 minute or 1 tick provide finer detail on buyer and seller flow, but they cover fewer bars; longer intervals like five‑minute bars smooth the data and give more history.
   
 Figure caption, The values in parentheses inside the info table come directly from the Breakout — Settings. The first row shows the custom lower-timeframe used for volume calculations (e.g., “(1)”, “(5)”, or “(1T)”)
 2. Price‑Structure Backbone 
Even without volume, the indicator draws structural features that underpin all other modules. These features are always on and serve as the reference levels for subsequent calculations.
 2.1 What it draws 
•	 Pivots:  Swing  highs  and  lows  are detected using the pivot_left_input and pivot_right_input settings. A pivot high is identified when the high recorded pivot_right_input bars ago exceeds the highs of the preceding pivot_left_input bars and is also higher than (or equal to) the highs of the subsequent pivot_right_input bars; pivot lows follow the inverse logic. The indicator retains only a fixed number of such pivot points per side, as defined by point_count_input, discarding the oldest ones when the limit is exceeded.
•	 Trend lines:  For each side, the indicator connects the earliest stored pivot and the most recent pivot (oldest high to newest high, and oldest low to newest low). When a new pivot is added or an old one drops out of the lookback window, the line’s endpoints—and therefore its slope—are recalculated accordingly.
•	 Horizontal support/resistance:  The highest high and lowest low within the lookback window defined by length_input are plotted as horizontal dashed lines. These serve as short‑term support and resistance levels.
•	 Ranked labels:  If showPivotLabels is enabled the indicator prints labels such as “HH1”, “HH2”, “LL1” and “LL2” near each pivot. The ranking is determined by comparing the price of each stored pivot: HH1 is the highest high, HH2 is the second highest, and so on; LL1 is the lowest low, LL2 is the second lowest. In the case of equal prices the newer pivot gets the better rank. Labels are offset from price using  ½ × ATR × label_atr_multiplier,  with the ATR length defined by label_atr_len_input. A dotted connector links each label to the candle’s wick.
 2.2 Key settings 
•	 length_input:  Window length for finding the highest and lowest values and for determining trend line endpoints. A larger value considers more history and will generate longer trend lines and S/R levels.
•	 pivot_left_input, pivot_right_input:  Strictness of swing confirmation. Higher values require more bars on either side to form a pivot; lower values create more pivots but may include minor swings.
•	 point_count_input:  How many pivots are kept in memory on each side. When new pivots exceed this number the oldest ones are discarded.
•	 label_atr_len_input and label_atr_multiplier:  Determine how far pivot labels are offset from the bar using ATR. Increasing the multiplier moves labels further away from price.
•	 Styling inputs  for trend lines, horizontal lines and labels (color, width and line style).
  
 Figure caption,  The chart illustrates how the indicator’s price‑structure backbone operates. In this daily example, the script scans for bars where the high (or low) pivot_right_input bars back is higher (or lower) than the preceding pivot_left_input bars and higher or lower than the subsequent pivot_right_input bars; only those bars are marked as pivots.
     These pivot points are stored and ranked: the highest high is labelled “HH1”, the second‑highest “HH2”, and so on, while lows are marked “LL1”, “LL2”, etc. Each label is offset from the price by half of an ATR‑based distance to keep the chart clear, and a dotted connector links the label to the actual candle.
     The red diagonal line connects the earliest and latest stored high pivots, and the green line does the same for low pivots; when a new pivot is added or an old one drops out of the lookback window, the end‑points and slopes adjust accordingly. Dashed horizontal lines mark the highest high and lowest low within the current lookback window, providing visual support and resistance levels. Together, these elements form the structural backbone that other modules reference, even when volume data is unavailable.
 3. Breakout Module 
 3.1 Concept 
This module confirms that a price break beyond a recent high or low is supported by a genuine shift in buying or selling pressure. It requires price to clear the highest high (“HH1”) or lowest low (“LL1”) and, simultaneously, that the winning side shows a significant volume spike, dominance and ranking. Only  when all volume and price conditions pass  is a breakout labelled.
 3.2 Inputs 
•	 lookback_break_input :  This controls the number of bars used to compute moving averages and percentiles for volume. A larger value smooths the averages and percentiles but makes the indicator respond more slowly.
•	 vol_mult_input : The “spike” multiplier; the current buy or sell volume must be at least this multiple of its moving average over the lookback window to qualify as a breakout.
•	 rank_threshold_input (0–100) :  Defines a volume percentile cutoff: the current buyer/seller volume must be in the top (100−threshold)%(100−threshold)% of all volumes within the lookback window. For example, if set to 80, the current volume must be in the top 20 % of the lookback distribution.
•	 ratio_threshold_input (0–1) :  Specifies the minimum share of total volume that the buyer (for a bullish breakout) or seller (for bearish) must hold on the current bar; the code also requires that the cumulative buyer volume over the lookback window exceeds the seller volume (and vice versa for bearish cases).
•	 use_custom_tf_input / custom_tf_input :  When enabled, these inputs override the automatic choice of lower timeframe for up/down volume; otherwise the script selects a sensible default based on the chart’s timeframe.
•	 Label appearance settings :  Separate options control the ATR-based offset length, offset multiplier, label size and colors for bullish and bearish breakout labels, as well as the connector style and width.
 3.3 Detection logic 
 1.	Data preparation : Retrieve per‑side volume from the lower timeframe and take absolute values. Build rolling arrays of the last lookback_break_input values to compute simple moving averages (SMAs), cumulative sums and percentile ranks for buy and sell volume.
 2.	Volume spike:  A spike is flagged when the current buy (or, in the bearish case, sell) volume is at least vol_mult_input times its SMA over the lookback window.
 3.	Dominance test:  The buyer’s (or seller’s) share of total volume on the current bar must meet or exceed ratio_threshold_input. In addition, the cumulative sum of buyer volume over the window must exceed the cumulative sum of seller volume for a bullish breakout (and vice versa for bearish). A separate requirement checks the sign of delta: for bullish breakouts delta_breakout must be non‑negative; for bearish breakouts it must be non‑positive.
 4.	Percentile rank:  The current volume must fall within the top (100 – rank_threshold_input) percent of the lookback distribution—ensuring that the spike is unusually large relative to recent history.
 5.	Price test:  For a bullish signal, the closing price must close above the highest pivot (HH1); for a bearish signal, the close must be below the lowest pivot (LL1).
 6.	Labeling:  When all conditions above are satisfied, the indicator prints “Breakout ↑” above the bar (bullish) or “Breakout ↓” below the bar (bearish). Labels are offset using half of an ATR‑based distance and linked to the candle with a dotted connector.
  
 Figure caption,  (Breakout ↑ example) , On this daily chart, price pushes above the red trendline and the highest prior pivot (HH1). The indicator recognizes this as a valid breakout because the buyer‑side volume on the lower timeframe spikes above its recent moving average and buyers dominate the volume statistics over the lookback period; when combined with a close above HH1, this satisfies the breakout conditions. The “Breakout ↑” label appears above the candle, and the info table highlights that up‑volume is elevated relative to its 11‑bar average, buyer share exceeds the dominance threshold and money‑flow metrics support the move.
  
 Figure caption,  In this daily example, price breaks below the lowest pivot (LL1) and the lower green trendline. The indicator identifies this as a bearish breakout because sell‑side volume is sharply elevated—about twice its 11‑bar average—and sellers dominate both the bar and the lookback window. With the close falling below LL1, the script triggers a Breakout ↓ label and marks the corresponding row in the info table, which shows strong down volume, negative delta and a seller share comfortably above the dominance threshold.
 4. Market Phase Module (Volume Only) 
 4.1 Concept 
Not all markets trend; many cycle between periods of  accumulation  (buying pressure building up),  distribution  (selling pressure dominating) and  neutral  behavior. This module classifies the current bar into one of these phases  without using ATR , relying solely on buyer and seller volume statistics. It looks at net flows, ratio changes and an OBV‑like cumulative line with dual‑reference (1‑ and 2‑bar) trends. The result is displayed both as on‑chart labels and in a dedicated row of the info table.
 4.2 Inputs 
•	 phase_period_len:  Number of bars over which to compute sums and ratios for phase detection.
•	 phase_ratio_thresh : Minimum buyer share (for accumulation) or minimum seller share (for distribution, derived as 1 − phase_ratio_thresh) of the total volume.
•	 strict_mode:  When enabled, both the 1‑bar and 2‑bar changes in each statistic must agree on the direction (strict confirmation); when disabled, only one of the two references needs to agree (looser confirmation).
•	 Color customisation  for info table cells and label styling for accumulation and distribution phases, including ATR length, multiplier, label size, colors and connector styles.
•	 show_phase_module:  Toggles the entire phase detection subsystem.
•	 show_phase_labels:  Controls whether on‑chart labels are drawn when accumulation or distribution is detected.
 4.3 Detection logic 
The module computes three families of statistics over the volume window defined by phase_period_len:
 1.	Net sum (buyers minus sellers):  net_sum_phase = Σ(buy) − Σ(sell). A positive value indicates a predominance of buyers. The code also computes the differences between the current value and the values 1 and 2 bars ago (d_net_1, d_net_2) to derive up/down trends.
 2.	Buyer ratio:  The instantaneous ratio TF_buy_breakout / TF_tot_breakout and the window ratio Σ(buy) / Σ(total). The current ratio must exceed phase_ratio_thresh for accumulation or fall below 1 − phase_ratio_thresh for distribution. The first and second differences of the window ratio (d_ratio_1, d_ratio_2) determine trend direction.
 3.	OBV‑like cumulative net flow:  An on‑balance volume analogue obv_net_phase increments by TF_buy_breakout − TF_sell_breakout each bar. Its differences over the last 1 and 2 bars (d_obv_1, d_obv_2) provide trend clues.
The algorithm then combines these signals:
•	For  strict mode , accumulation requires: (a) current ratio ≥ threshold, (b) cumulative ratio ≥ threshold, (c) both ratio differences ≥ 0, (d) net sum differences ≥ 0, and (e) OBV differences ≥ 0. Distribution is the mirror case.
•	For  loose mode , it relaxes the directional tests: either the 1‑ or the 2‑bar difference needs to agree in each category.
If all conditions for accumulation are satisfied, the phase is labelled  “Accumulation” ; if all conditions for distribution are satisfied, it’s labelled  “Distribution” ; otherwise the phase is  “Neutral” .
 4.4 Outputs 
•	 Info table row : Row 8 displays “Market Phase (Vol)” on the left and the detected phase (Accumulation, Distribution or Neutral) on the right. The text colour of both cells matches a user‑selectable palette (typically green for accumulation, red for distribution and grey for neutral).
•	 On‑chart labels : When show_phase_labels is enabled and a phase persists for at least one bar, the module prints a label above the bar ( “Accum” ) or below the bar ( “Dist” ) with a dashed or dotted connector. The label is offset using ATR based on phase_label_atr_len_input and phase_label_multiplier and is styled according to user preferences.
  
 Figure caption, The chart displays a red “Dist” label above a particular bar, indicating that the accumulation/distribution module identified a distribution phase at that point. The detection is based on seller dominance: during that bar, the net buyer-minus-seller flow and the OBV‑style cumulative flow were trending down, and the buyer ratio had dropped below the preset threshold. These conditions satisfy the distribution criteria in strict mode. The label is placed above the bar using an ATR‑based offset and a dashed connector. By the time of the current bar in the screenshot, the phase indicator shows “Neutral” in the info table—signaling that neither accumulation nor distribution conditions are currently met—yet the historical “Dist” label remains to mark where the prior distribution phase began.
  
 Figure caption, In this example the market phase module has signaled an Accumulation phase. Three bars before the current candle, the algorithm detected a shift toward buyers: up‑volume exceeded its moving average, down‑volume was below average, and the buyer share of total volume climbed above the threshold while the on‑balance net flow and cumulative ratios were trending upwards. The blue “Accum” label anchored below that bar marks the start of the phase; it remains on the chart because successive bars continue to satisfy the accumulation conditions. The info table confirms this: the “Market Phase (Vol)” row still reads Accumulation, and the ratio and sum rows show buyers dominating both on the current bar and across the lookback window.
 5. OB/OS Spike Module 
 5.1 What overbought/oversold means here 
In many markets, a rapid extension up or down is often followed by a period of consolidation or reversal. The indicator interprets overbought (OB) conditions as abnormally strong selling risk at or after a price rally and oversold (OS) conditions as unusually strong buying risk after a decline. Importantly, these are not direct trade signals; rather they flag areas where caution or contrarian setups may be appropriate.
 5.2 Inputs 
•	 minHits_obos (1–7):  Minimum number of oscillators that must agree on an overbought or oversold condition for a label to print.
•	 syncWin_obos:  Length of a small sliding window over which oscillator votes are smoothed by taking the maximum count observed. This helps filter out choppy signals.
•	 Volume spike criteria:  kVolRatio_obos (ratio of current volume to its SMA) and zVolThr_obos (Z‑score threshold) across volLen_obos. Either threshold can trigger a spike.
•	 Oscillator toggles and periods:  Each of RSI, Stochastic (K and D), Williams %R, CCI, MFI, DeMarker and Stochastic RSI can be independently enabled; their periods are adjustable.
•	 Label appearance:  ATR‑based offset, size, colors for OB and OS labels, plus connector style and width.
 5.3 Detection logic 
 1.	Directional volume spikes:  Volume spikes are computed separately for buyer and seller volumes. A sell volume spike (sellVolSpike) flags a potential OverBought bar, while a buy volume spike (buyVolSpike) flags a potential OverSold bar. A spike occurs when the respective volume exceeds kVolRatio_obos times its simple moving average over the window or when its Z‑score exceeds zVolThr_obos.
 2.	Oscillator votes:  For each enabled oscillator, calculate its overbought and oversold state using standard thresholds (e.g., RSI ≥ 70 for OB and ≤ 30 for OS; Stochastic %K/%D ≥ 80 for OB and ≤ 20 for OS; etc.). Count how many oscillators vote for OB and how many vote for OS.
 3.	Minimum hits:  Apply the smoothing window syncWin_obos to the vote counts using a maximum‑of‑last‑N approach. A candidate bar is only considered if the smoothed OB hit count ≥ minHits_obos (for OverBought) or the smoothed OS hit count ≥ minHits_obos (for OverSold).
 4.	Tie‑breaking:  If both OverBought and OverSold spike conditions are present on the same bar, compare the smoothed hit counts: the side with the higher count is selected; ties default to OverBought.
 5.	Label printing:  When conditions are met, the bar is labelled as “OverBought X/7” above the candle or “OverSold X/7” below it. “X” is the number of oscillators confirming, and the bracket lists the abbreviations of contributing oscillators. Labels are offset from price using half of an ATR‑scaled distance and can optionally include a dotted or dashed connector line.
  
 Figure caption,  In this chart the overbought/oversold module has flagged an OverSold signal. A sell‑off from the prior highs brought price down to the lower trend‑line, where the bar marked “OverSold 3/7 DeM” appears. This label indicates that on that bar the module detected a buy‑side volume spike and that at least three of the seven enabled oscillators—in this case including the DeMarker—were in oversold territory. The label is printed below the candle with a dotted connector, signaling that the market may be temporarily exhausted on the downside. After this oversold print, price begins to rebound towards the upper red trend‑line and higher pivot levels.
  
 Figure caption, This example shows the overbought/oversold module in action. In the left‑hand panel you can see the OB/OS settings where each oscillator  (RSI, Stochastic, Williams %R, CCI, MFI, DeMarker and Stochastic RSI)  can be enabled or disabled, and the ATR length and label offset multiplier adjusted. On the chart itself, price has pushed up to the descending red trendline and triggered an “OverBought 3/7” label. That means the sell‑side volume spiked relative to its average and three out of the seven enabled oscillators were in overbought territory. The label is offset above the candle by half of an ATR and connected with a dashed line, signaling that upside momentum may be overextended and a pause or pullback could follow.
 6. Buyer/Seller Trap Module 
 6.1 Concept 
A bull trap occurs when price appears to break above resistance, attracting buyers, but fails to sustain the move and quickly reverses, leaving a long upper wick and trapping late entrants. A bear trap is the opposite: price breaks below support, lures in sellers, then snaps back, leaving a long lower wick and trapping shorts. This module detects such traps by looking for price structure sweeps, order‑flow mismatches and dominance reversals. It uses a scoring system to differentiate risk from confirmed traps.
 6.2 Inputs 
•	 trap_lookback_len:  Window length used to rank extremes and detect sweeps.
•	 trap_wick_threshold:  Minimum proportion of a bar’s range that must be wick (upper for bull traps, lower for bear traps) to qualify as a sweep.
•	 trap_score_risk:  Minimum aggregated score required to flag a trap risk. (The code defines a trap_score_confirm input, but confirmation is actually based on price reversal rather than a separate score threshold.)
•	 trap_confirm_bars:  Maximum number of bars allowed for price to reverse and confirm the trap. If price does not reverse in this window, the risk label will expire or remain unconfirmed.
•	 Label settings:  ATR length and multiplier for offsetting, size, colours for risk and confirmed labels, and connector style and width. Separate settings exist for bull and bear traps.
•	 Toggle inputs:  show_trap_module and show_trap_labels enable the module and control whether labels are drawn on the chart.
 6.3 Scoring logic 
The module assigns points to several conditions and sums them to determine whether a trap risk is present. For bull traps, the score is built from the following (bear traps mirror the logic with highs and lows swapped):
 1.	Sweep (2 points):  Price trades above the high pivot (HH1) but fails to close above it and leaves a long upper wick at least trap_wick_threshold × range. For bear traps, price dips below the low pivot (LL1), fails to close below and leaves a long lower wick.
 2.	Close break (1 point):  Price closes beyond HH1 or LL1 without leaving a long wick.
 3.	Candle/delta mismatch (2 points):  The candle closes bullish yet the order flow delta is negative or the seller ratio exceeds 50%, indicating hidden supply. Conversely, a bearish close with positive delta or buyer dominance suggests hidden demand.
 4.	Dominance inversion (2 points):  The current bar’s buyer volume has the highest rank in the lookback window while cumulative sums favor sellers, or vice versa.
 5.	Low‑volume break (1 point):  Price crosses the pivot but total volume is below its moving average.
The total score for each side is compared to trap_score_risk. If the score is high enough, a  “Bull Trap Risk”  or  “Bear Trap Risk”  label is drawn, offset from the candle by half of an ATR‑scaled distance using a dashed outline. If, within trap_confirm_bars, price reverses beyond the opposite level—drops back below the high pivot for bull traps or rises above the low pivot for bear traps—the label is upgraded to a solid  “Bull Trap”  or  “Bear Trap” . In this version of the code, there is no separate score threshold for confirmation: the variable trap_score_confirm is unused; confirmation depends solely on a successful price reversal within the specified number of bars.
  
 Figure caption, In this example the trap module has flagged a Bear Trap Risk. Price initially breaks below the most recent low pivot (LL1), but the bar closes back above that level and leaves a long lower wick, suggesting a failed push lower. Combined with a mismatch between the candle direction and the order flow (buyers regain control) and a reversal in volume dominance, the aggregate score exceeds the risk threshold, so a dashed “Bear Trap Risk” label prints beneath the bar. The green and red trend lines mark the current low and high pivot trajectories, while the horizontal dashed lines show the highest and lowest values in the lookback window. If, within the next few bars, price closes decisively above the support, the risk label would upgrade to a solid “Bear Trap” label.
  
 Figure caption, In this example the trap module has identified both ends of a price range. Near the highs, price briefly pushes above the descending red trendline and the recent pivot high, but fails to close there and leaves a noticeable upper wick. That combination of a sweep above resistance and order‑flow mismatch generates a Bull Trap Risk label with a dashed outline, warning that the upside break may not hold. At the opposite extreme, price later dips below the green trendline and the labelled low pivot, then quickly snaps back and closes higher. The long lower wick and subsequent price reversal upgrade the previous bear‑trap risk into a confirmed Bear Trap (solid label), indicating that sellers were caught on a false breakdown. Horizontal dashed lines mark the highest high and lowest low of the lookback window, while the red and green diagonals connect the earliest and latest pivot highs and lows to visualize the range.
 7. Sharp Move Module 
 7.1 Concept 
Markets sometimes display absorption or climax behavior—periods when one side steadily gains the upper hand before price breaks out with a sharp move. This module evaluates several order‑flow and volume conditions to anticipate such moves. Users can choose how many conditions must be met to flag a risk and how many (plus a price break) are required for confirmation.
 7.2 Inputs 
 •	sharp Lookback:  Number of bars in the window used to compute moving averages, sums, percentile ranks and reference levels.
 •	sharpPercentile:  Minimum percentile rank for the current side’s volume; the current buy (or sell) volume must be greater than or equal to this percentile of historical volumes over the lookback window.
 •	sharpVolMult:  Multiplier used in the volume climax check. The current side’s volume must exceed this multiple of its average to count as a climax.
 •	sharpRatioThr:  Minimum dominance ratio (current side’s volume relative to the opposite side) used in both the instant and cumulative dominance checks.
 •	sharpChurnThr:  Maximum ratio of a bar’s range to its ATR for absorption/churn detection; lower values indicate more absorption (large volume in a small range).
 •	sharpScoreRisk:  Minimum number of conditions that must be true to print a risk label.
 •	sharpScoreConfirm:  Minimum number of conditions plus a price break required for confirmation.
 •	sharpCvdThr:  Threshold for cumulative delta divergence versus price change (positive for bullish accumulation, negative for bearish distribution).
 •	Label settings:  ATR length (sharpATRlen) and multiplier (sharpLabelMult) for positioning labels, label size, colors and connector styles for bullish and bearish sharp moves.
 •	Toggles:  enableSharp activates the module; show_sharp_labels controls whether labels are drawn.
 7.3 Conditions (six per side) 
For each side, the indicator computes six boolean conditions and sums them to form a score:
 1.	Dominance (instant and cumulative): 
–	 Instant dominance:  current buy volume ≥ sharpRatioThr × current sell volume.
–	 Cumulative dominance:  sum of buy volumes over the window ≥ sharpRatioThr × sum of sell volumes (and vice versa for bearish checks).
 2.	Accumulation/Distribution divergence:  Over the lookback window, cumulative delta rises by at least sharpCvdThr while price fails to rise (bullish), or cumulative delta falls by at least sharpCvdThr while price fails to fall (bearish).
 3.	Volume climax:  The current side’s volume is ≥ sharpVolMult × its average and the product of volume and bar range is the highest in the lookback window.
 4.	Absorption/Churn:  The current side’s volume divided by the bar’s range equals the highest value in the window and the bar’s range divided by ATR ≤ sharpChurnThr (indicating large volume within a small range).
 5.	Percentile rank:  The current side’s volume percentile rank is ≥ sharp Percentile.
 6.	Mirror logic for sellers:  The above checks are repeated with buyer and seller roles swapped and the price break levels reversed.
Each condition that passes contributes one point to the corresponding side’s score (0 or 1). Risk and confirmation thresholds are then applied to these scores.
 7.4 Scoring and labels 
 •	Risk:  If scoreBull ≥ sharpScoreRisk, a “Sharp ↑ Risk” label is drawn above the bar. If scoreBear ≥ sharpScoreRisk, a “Sharp ↓ Risk” label is drawn below the bar.
 •	Confirmation:  A risk label is upgraded to “Sharp ↑” when scoreBull ≥ sharpScoreConfirm and the bar closes above the highest recent pivot (HH1); for bearish cases, confirmation requires scoreBear ≥ sharpScoreConfirm and a close below the lowest pivot (LL1).
 •	Label positioning:  Labels are offset from the candle by ATR × sharpLabelMult (full ATR times multiplier), not half, and may include a dashed or dotted connector line if enabled.
  
 Figure caption, In this chart both bullish and bearish sharp‑move setups have been flagged. Earlier in the range, a  “Sharp ↓ Risk”  label appears beneath a candle: the sell‑side score met the risk threshold, signaling that the combination of strong sell volume, dominance and absorption within a narrow range suggested a potential sharp decline. The price did not close below the lower pivot, so this label remains a “risk” and no confirmation occurred. Later, as the market recovered and volume shifted back to the buy side, a  “Sharp ↑ Risk”  label prints above a candle near the top of the channel. Here, buy‑side dominance, cumulative delta divergence and a volume climax aligned, but price has not yet closed above the upper pivot (HH1), so the alert is still a risk rather than a confirmed sharp‑up move.
  
 Figure caption, In this chart a Sharp ↑ label is displayed above a candle, indicating that the sharp move module has confirmed a bullish breakout. Prior bars satisfied the risk threshold — showing buy‑side dominance, positive cumulative delta divergence, a volume climax and strong absorption in a narrow range — and this candle closes above the highest recent pivot, upgrading the earlier “Sharp ↑ Risk” alert to a full Sharp ↑ signal. The green label is offset from the candle with a dashed connector, while the red and green trend lines trace the high and low pivot trajectories and the dashed horizontals mark the highest and lowest values of the lookback window.
 8. Market‑Maker / Spread‑Capture Module 
 8.1 Concept 
Liquidity providers often  “capture the spread”  by buying and selling in almost equal amounts within a very narrow price range. These bars can signal temporary congestion before a move or reflect algorithmic activity. This module flags bars where  both buyer and seller volumes are high,  the price range is only a few ticks and the buy/sell split remains close to 50%. It helps traders spot potential liquidity pockets.
 8.2 Inputs 
 •	scalpLookback:  Window length used to compute volume averages.
 •	scalpVolMult:  Multiplier applied to each side’s average volume; both buy and sell volumes must exceed this multiple.
 •	scalpTickCount:  Maximum allowed number of ticks in a bar’s range (calculated as (high − low) / minTick). A value of 1 or 2 captures ultra‑small bars; increasing it relaxes the range requirement.
 •	scalpDeltaRatio:  Maximum deviation from a perfect 50/50 split. For example, 0.05 means the buyer share must be between 45% and 55%.
 •	Label settings:  ATR length, multiplier, size, colors, connector style and width.
 •	Toggles :  show_scalp_module and show_scalp_labels to enable the module and its labels.
 8.3 Signal 
When, on the current bar, both TF_buy_breakout and TF_sell_breakout exceed scalpVolMult times their respective averages and (high − low)/minTick ≤ scalpTickCount and the buyer share is within scalpDeltaRatio of 50%, the module prints a  “Spread ↔”  label above the bar. The label uses the same ATR offset logic as other modules and draws a connector if enabled.
  
 Figure caption, In this chart the spread‑capture module has identified a potential liquidity pocket. Buyer and seller volumes both spiked above their recent averages, yet the candle’s range measured only a couple of ticks and the buy/sell split stayed close to 50 %. This combination met the module’s criteria, so it printed a grey “Spread ↔” label above the bar. The red and green trend lines link the earliest and latest high and low pivots, and the dashed horizontals mark the highest high and lowest low within the current lookback window.
 9. Money Flow Module 
 9.1 Concept 
To translate volume into a monetary measure, this module multiplies each side’s volume by the closing price. It tracks buying and selling system money default currency on a per-bar basis and sums them over a chosen period. The difference between buy and sell currencies (Δ$) shows net inflow or outflow.
 9.2 Inputs 
 •	mf_period_len_mf:  Number of bars used for summing buy and sell dollars.
 •	Label appearance settings:  ATR length, multiplier, size, colors for up/down labels, and connector style and width.
 •	Toggles:  Use enableMoneyFlowLabel_mf and showMFLabels to control whether the module and its labels are displayed.
 9.3 Calculations 
 •	Per-bar money:  Buy $ = TF_buy_breakout × close; Sell $ = TF_sell_breakout × close. Their difference is Δ$ = Buy $ − Sell $.
 •	Summations:  Over mf_period_len_mf bars, compute Σ Buy $, Σ Sell $ and ΣΔ$ using math.sum().
 •	Info table entries:  Rows 9–13 display these values as texts like “↑ USD 1234 (1M)” or “ΣΔ USD −5678 (14)”, with colors reflecting whether buyers or sellers dominate.
 •	Money flow status:  If Δ$ is positive the bar is marked  “Money flow in” ; if negative,  “Money flow out” ; if zero, “Neutral”. The cumulative status is similarly derived from ΣΔ.Labels print at the bar that changes the sign of ΣΔ, offset using ATR × label multiplier and styled per user preferences.
  
 Figure caption, The chart illustrates a steady rise toward the highest recent pivot (HH1) with price riding between a rising green trend‑line and a red trend‑line drawn through earlier pivot highs. A green Money flow in label appears above the bar near the top of the channel, signaling that net dollar flow turned positive on this bar: buy‑side dollar volume exceeded sell‑side dollar volume, pushing the cumulative sum ΣΔ$ above zero. In the info table, the  “Money flow (bar)”  and  “Money flow Σ”  rows both read In, confirming that the indicator’s money‑flow module has detected an inflow at both bar and aggregate levels, while other modules (pivots, trend lines and support/resistance) remain active to provide structural context.
  
In this example the Money Flow module signals a net outflow. Price has been trending downward: successive high pivots form a falling red trend‑line and the low pivots form a descending green support line. When the latest bar broke below the previous low pivot (LL1), both the bar‑level and cumulative net dollar flow turned negative—selling volume at the close exceeded buying volume and pushed the cumulative Δ$ below zero. The module reacts by printing a red  “Money flow out”  label beneath the candle; the info table confirms that the “Money flow (bar)” and “Money flow Σ” rows both show Out, indicating sustained dominance of sellers in this period.
 10. Info Table 
 10.1 Purpose 
When enabled, the Info Table appears in the lower right of your chart. It summarises key values computed by the indicator—such as buy and sell volume, delta, total volume, breakout status, market phase, and money flow—so you can see at a glance which side is dominant and which signals are active.
 10.2 Symbols 
•	↑ / ↓ — Up (↑) denotes buy volume or money; down (↓) denotes sell volume or money.
•	MA — Moving average. In the table it shows the average value of a series over the lookback period.
•	Σ (Sigma) — Cumulative sum over the chosen lookback period.
•	Δ (Delta) — Difference between buy and sell values.
•	B / S — Buyer and seller share of total volume, expressed as percentages.
•	Ref. Price — Reference price for breakout calculations, based on the latest pivot.
•	Status — Indicates whether a breakout condition is currently active (True) or has failed.
 10.3 Row definitions 
1.	Up volume / MA up volume – Displays current buy volume on the lower timeframe and its moving average over the lookback period.
2.	Down volume / MA down volume – Shows current sell volume and its moving average; sell values are formatted in red for clarity.
3.	Δ / ΣΔ – Lists the difference between buy and sell volume for the current bar and the cumulative delta volume over the lookback period.
4.	Σ / MA Σ (Vol/MA) – Total volume (buy + sell) for the bar, with the ratio of this volume to its moving average; the right cell shows the average total volume.
5.	B/S ratio – Buy and sell share of the total volume: current bar percentages and the average percentages across the lookback period.
6.	Buyer Rank / Seller Rank – Ranks the bar’s buy and sell volumes among the last (n) bars; lower rank numbers indicate higher relative volume.
7.	Σ Buy / Σ Sell – Sum of buy and sell volumes over the lookback window, indicating which side has traded more.
8.	Breakout UP / DOWN – Shows the breakout thresholds (Ref. Price) and whether the breakout condition is active (True) or has failed.
9.	Market Phase (Vol) – Reports the current volume‑only phase: Accumulation, Distribution or Neutral.
10.	Money Flow – The final rows display dollar amounts and status:
–	↑ USD / Σ↑ USD – Buy dollars for the current bar and the cumulative sum over the money‑flow period.
–	↓ USD / Σ↓ USD – Sell dollars and their cumulative sum.
–	Δ USD / ΣΔ USD – Net dollar difference (buy minus sell) for the bar and cumulatively.
–	Money flow (bar) – Indicates whether the bar’s net dollar flow is positive (In), negative (Out) or neutral.
–	Money flow Σ – Shows whether the cumulative net dollar flow across the chosen period is positive, negative or neutral.
  
The chart above shows a sequence of different signals from the indicator. A Bull Trap Risk appears after price briefly pushes above resistance but fails to hold, then a green Accum label identifies an accumulation phase. An upward breakout follows, confirmed by a Money flow in print. Later, a Sharp ↓ Risk warns of a possible sharp downturn; after price dips below support but quickly recovers, a Bear Trap label marks a false breakdown. The highlighted info table in the center summarizes key metrics at that moment, including current and average buy/sell volumes, net delta, total volume versus its moving average, breakout status (up and down), market phase (volume), and bar‑level and cumulative money flow (In/Out).
 11. Conclusion & Final Remarks 
This indicator was developed as a holistic study of market structure and order flow. It brings together several well‑known concepts from technical analysis—breakouts, accumulation and distribution phases, overbought and oversold extremes, bull and bear traps, sharp directional moves, market‑maker spread bars and money flow—into a single Pine Script tool. Each module is based on widely recognized trading ideas and was implemented after consulting reference materials and example strategies, so you can see in real time how these concepts interact on your chart.
A distinctive feature of this indicator is its reliance on per‑side volume: instead of tallying only total volume, it separately measures buy and sell transactions on a lower time frame. This approach gives a clearer view of who is in control—buyers or sellers—and helps filter breakouts, detect phases of accumulation or distribution, recognize potential traps, anticipate sharp moves and gauge whether liquidity providers are active. The money‑flow module extends this analysis by converting volume into currency values and tracking net inflow or outflow across a chosen window.
Although comprehensive, this indicator is intended solely as a guide. It highlights conditions and statistics that many traders find useful, but it does not generate trading signals or guarantee results. Ultimately, you remain responsible for your positions. Use the information presented here to inform your analysis, combine it with other tools and risk‑management techniques, and always make your own decisions when trading.
ICT SIlver Bullet Trading Windows UK times🎯 Purpose of the Indicator
It’s designed to highlight key ICT “macro” and “micro” windows of opportunity, i.e., time ranges where liquidity grabs and algorithmic setups are most likely to occur. The ICT Silver Bullet concept is built on the idea that institutions execute in recurring intraday windows, and these often produce high-probability setups.
🕰️ Windows
London Macro Window
10:00 – 11:00 UK time
This aligns with a major liquidity window after the London equities open settles and London + EU traders reposition.
You’re looking for setups like liquidity sweeps, MSS (market structure shift), and FVG entries here.
New York Macro Window
15:00 – 16:00 UK time (10:00 – 11:00 NY time)
This is right after the NY equities open, a key ICT window for volatility and liquidity grabs.
Power Hour 
Usually 20:00 – 21:00 UK time (3pm–4pm NY time), the last trading hour of NY equities.
ICT often refers to this as another manipulation window where setups can form before the daily close.
🔍 What the Indicator Does
Draws session boxes or shading: so you can visually see the London/NY/Power Hour windows directly on your chart.
Macro vs. Micro time frames:
Macro windows → The ones you set (London & NY) are the major daily algo execution windows.
Micro windows → Within those boxes, ICT expects smaller intraday setups (like a Silver Bullet entry from a sweep + FVG).
Guides your trade selection: it tells you when not to hunt trades everywhere, but instead to wait for price action confirmation inside those boxes.
🧩 How This Fits ICT Silver Bullet Trading
The ICT Silver Bullet strategy says:
Wait for one of the macro windows (London or NY).
Look for liquidity sweep → market structure shift → FVG.
Enter with defined risk inside that hour.
This indicator essentially does step 1 for you: it makes those high-probability windows visually obvious, so you don’t waste time trading random hours where algos aren’t active.
Sunmool's Silver Bullet Model FinderICT Silver Bullet Model Indicator - Complete Guide
📈 Overview
The ICT Silver Bullet Model indicator is a supplementary tool for utilizing ICT's (Inner Circle Trader) market structure analysis techniques. This indicator detects institutional liquidity hunting patterns and automatically identifies structural levels, helping traders analyze market structure more effectively.
🎯 Core Features
1. Structural Level Identification
STL (Short Term Low): Recent support levels formed in the short term
STH (Short Term High): Recent resistance levels formed in the short term
ITL (Intermediate Term Low): Stronger support levels with more significance
ITH (Intermediate Term High): Stronger resistance levels with more significance
2. Kill Zone Time Display
London Kill Zone: 02:00-05:00 (default)
New York Kill Zone: 08:30-11:00 (default)
These are the most active trading hours for institutional players where significant price movements occur
3. Smart Sweep Detection
Bear Sweep (🔻): Pattern where price sweeps below lows then recovers - Simply indicates sweep occurrence
Bull Sweep (🔺): Pattern where price sweeps above highs then declines - Simply indicates sweep occurrence
Important: Sweep labels only mark liquidity hunting locations, not directional bias.
🔧 Configuration Parameters
Basic Settings
Sweep Detection Lookback: Number of candles for sweep detection (default: 20)
Structure Point Lookback: Number of candles for structural point detection (default: 10)
Sweep Threshold: Percentage threshold for sweep validation (default: 0.1%)
Time Settings
London Kill Zone: Active hours for London session
New York Kill Zone: Active hours for New York session
Visualization Settings
Customizable colors for each level type
Enable/disable alert notifications
📊 How to Use
1. Chart Setup
Most effective on 1-minute to 1-hour timeframes
Recommended for major currency pairs (EUR/USD, GBP/USD, etc.)
Also applicable to cryptocurrencies and indices
2. Signal Interpretation
🔻 Bear Sweep / 🔺 Bull Sweep Labels
Simply indicate liquidity hunting occurrence points
Not directional bias indicators
Reference for understanding overall context on HTF
🟢 Silver Bullet Long (Huge Green Triangle)
After Bear Sweep occurrence
Within Kill Zone timeframe
Current price positioned above swept level
→ Actual BUY entry signal
🔴 Silver Bullet Short (Huge Red Triangle)
After Bull Sweep occurrence
Within Kill Zone timeframe
Current price positioned below swept level
→ Actual SELL entry signal
3. Risk Management
Use swept levels as stop-loss reference points
Approach signals outside Kill Zone hours with caution
Recommended to use alongside other technical analysis tools
💡 Trading Strategies
Silver Bullet Strategy
Preparation Phase: Monitor charts 30 minutes before Kill Zone
Sweep Observation: Identify liquidity hunting points with 🔻🔺 labels (reference only)
Entry: Enter ONLY when huge triangle Silver Bullet signal appears within Kill Zone
Take Profit: Target opposite structural level or 1:2 reward ratio
Stop Loss: Beyond the swept level
Important: Small sweep labels are NOT trading signals!
Multi-Timeframe Approach
Step 1: HTF (Higher Time Frame) Sweep Reference
Observe 🔻🔺 sweep labels on 4-hour and daily charts
Reference only sweeps occurring at major structural levels
HTF sweeps are used to identify liquidity hunting points
Reference only, not for directional bias
Step 2: Transition to LTF (Lower Time Frame)
Move to 15-minute, 5-minute, and 1-minute charts
Analyze LTF with reference to HTF sweep information
Use STL, STH, ITL, ITH for precise entry point identification
Structural levels on LTF are the core of actual trading decisions
Only huge triangle (Silver Bullet) signals are actual entry signals
Recommended Usage
Identify overall sweep occurrence points on HTF (🔻🔺 labels)
Use this indicator on LTF to identify structural levels
Reference only huge triangle signals for actual trading during Kill Zone
Small sweep labels (🔻🔺) are for reference only, not entry signals
📋 Information Table Interpretation
Real-time information in the top-right table:
Kill Zone Status: Current active session status
Level Counts: Number of each structural level type
⚠️ Important Disclaimers
Backtesting results do not guarantee future performance
Exercise caution during high market volatility periods
Always apply proper risk management
Recommend comprehensive analysis with other analytical tools
🎓 Learning Resources
Study original ICT concepts through free YouTube educational content
Research Market Structure analysis techniques
Optimize through backtesting for personal use
🔬 Technical Implementation
Algorithm Logic
Pivot Point Detection: Uses TradingView's built-in pivot functions to identify swing highs and lows
Classification System: Automatically categorizes levels based on recent price action frequency
Sweep Validation: Confirms legitimate sweeps through price action analysis
Time-Based Filtering: Prioritizes signals during institutional active hours
Performance Optimization
Efficient array management prevents memory overflow
Dynamic level cleanup maintains chart clarity
Real-time calculation ensures minimal lag
🛠️ Customization Tips
Adjust lookback periods based on market volatility
Modify kill zone times for different market sessions
Experiment with sweep threshold for different instruments
Color-code levels according to personal preference
📈 Expected Outcomes
When properly implemented, this indicator can help traders:
Identify high-probability reversal points
Time entries with institutional flow
Reduce false signals through kill zone filtering
Improve risk-to-reward ratios
This indicator automates ICT's concepts into a user-friendly tool that can be enhanced through continuous learning and practical application. Success depends on understanding the underlying market structure principles and combining them with proper risk management techniques.
Smart Money Trades Pro [BOSWaves]Smart Money Trades Pro   – Advanced Market Structure & Liquidity Visualizer
 
 Overview 
Smart Money Trades Pro is a comprehensive trading tool designed for traders seeking an in-depth understanding of market structure, liquidity dynamics, and institutional flow. The indicator systematically identifies key market turning points, including break of structure (BOS) and change of character (CHoCH) events, and overlays these with adaptive visualizations to highlight high-probability trade setups. By integrating ATR-based risk zones, progressive take-profit levels, and real-time trade analytics, Smart Money Trades Pro transforms complex price action into an interpretable framework suitable for multiple trading styles, including scalping, intraday, and swing trading.
  
Unlike traditional static indicators, Smart Money Trades Pro adapts continuously to market conditions. It evaluates swing highs and lows over a configurable lookback period, then determines structural breaks using customizable confirmation methods (candle body or wick). The resulting signals are augmented with dynamic entry, stop-loss, and target levels, allowing traders to analyze potential trade opportunities with both precision and context. The indicator’s design ensures that each visual element—trend-colored candles, signal markers, and risk/reward boxes—reflects real-time market conditions, offering an actionable interpretation of institutional activity.
 How It Works 
The indicator’s foundation is built upon market structure analysis. By calculating pivot highs and lows over a specified period, Smart Money Trades Pro identifies potential points of liquidity accumulation and exhaustion. When price breaks a pivot high or low, the indicator evaluates whether this constitutes a BOS or a CHoCH, signaling trend continuation or reversal. These events are marked on the chart with distinct visual cues, allowing traders to quickly discern shifts in market sentiment without manually analyzing historical price action.
Once a structural break is confirmed, the indicator automatically determines entry levels, stop-loss placements, and progressive take-profit zones (TP1, TP2, TP3). These calculations are based on ATR-derived volatility, ensuring that targets scale with current market conditions. Risk and reward zones are plotted as shaded boxes, providing a clear visual representation of potential profit relative to risk for each trade setup. This system allows traders to maintain discipline and consistency, with dynamic trade management baked directly into the visualization.
Trend direction is further reinforced by color-coded candles, which reflect the prevailing market bias. Bullish trends are represented by one color, bearish trends by another, and neutral conditions are displayed in muted tones. This continuous visual feedback simplifies the process of trend assessment and helps confirm the validity of trade setups alongside BOS and CHoCH markers.
 Signals and Breakouts 
Smart Money Trades Pro includes structured visual signals to indicate actionable price movements:
 
 Bullish Break Signals  – Triangular markers below the candle appear when a swing high is broken, suggesting potential long opportunities.
 Bearish Break Signals  – Triangular markers above the candle appear when a swing low is broken, indicating potential short setups.
 Change of Character (CHoCH)  – Special markers highlight trend reversals, showing where momentum shifts from bullish to bearish or vice versa.
 
These markers are strategically spaced to prevent overlap and remain clear during high-volatility periods. Traders can use them in combination with trend-colored candles, risk/reward zones, and ATR-based targets to assess the strength and reliability of each setup. The integrated table provides live trade information, including entry price, stop-loss level, take-profit levels, risk/reward ratio, and trade direction, ensuring that trade decisions are informed and data-driven.
 Interpretation 
 Trend Analysis : The indicator’s trend coloring, combined with BOS and CHoCH detection, provides an immediate view of market direction. Rising structures indicate bullish momentum, while falling structures signal bearish momentum. CHoCH markers highlight potential trend reversals or significant liquidity sweeps.
 Volatility and Risk Assessment : ATR-based calculations determine stop-loss distances and target levels, giving a quantitative measure of risk relative to market volatility. Wide ATR readings indicate periods of high price fluctuation, whereas narrow readings suggest consolidation and reduced risk exposure.
 Market Structure Insights : By monitoring swing highs and lows alongside break confirmations, traders can identify where institutional players are likely active. Areas with multiple structural breaks or overlapping targets can indicate liquidity hotspots, potential reversal zones, or areas of market congestion.
 Trade Management : The built-in trade zones allow traders to visualize entry, risk, and reward simultaneously. Progressive targets (TP1, TP2, TP3) reflect incremental profit-taking strategies, while dynamic stop-loss levels help preserve capital during adverse moves.
 Strategy Integration 
Smart Money Trades Pro supports a range of trading approaches:
 
 Trend Following : Enter trades in the direction of confirmed BOS while using CHoCH markers and trend-colored candles to validate momentum.
 Pullback Entries : Use failed breakout retests or minor reversals toward broken structure levels for lower-risk entries.
 Mean Reversion : In consolidated zones with narrow ATR and repeated BOS/CHoCH activity, anticipate reversals or short-term corrective moves.
 Multi-Timeframe Confirmation : Overlay signals on higher or lower timeframes to filter noise and improve trade accuracy.
 
Stop-loss levels should be placed just beyond the opposing structural point, while take-profit targets can be scaled using the ATR-based zones. Progressive targets allow for partial exits or scaling out of trades while maintaining exposure to larger moves.
 Advanced Techniques 
Traders seeking greater precision can combine Smart Money Trades Pro with volume, momentum, or volatility indicators to validate signals. Observing sequences of BOS and CHoCH markers across multiple timeframes provides insight into liquidity accumulation and depletion trends. Tracking the expansion or contraction of ATR-based zones helps anticipate shifts in volatility, enabling better timing for entries and exits.
Customizing the structure period and confirmation type allows the indicator to adapt to different asset classes and timeframes. Shorter periods increase sensitivity to smaller swings, while longer periods filter noise and emphasize higher-probability structural breaks. By integrating these features, the indicator offers a robust statistical framework for disciplined, data-driven trading decisions.
 Inputs and Customization 
 
 Structure Detection Period : Defines the lookback window for pivot high and low calculation.
 Break Confirmation : Choose whether to confirm breaks using candle body or wick.
 Display CHoCH : Toggle visibility of change-of-character markers.
 Color Trend Bars : Enable color-coding of candles based on market structure direction.
 Show Info Table : Display trade dashboard showing entry, stop-loss, take-profits, risk/reward, and bias.
 Table Position : Choose from top-left, top-right, bottom-left, or bottom-right placement.
 Color Customization : Configure bullish, bearish, neutral, risk, reward, and text colors for enhanced visual clarity.
 
 Why Use Smart Money Trades Pro 
Smart Money Trades Pro transforms complex market behavior into an actionable visual framework. By combining market structure analysis, liquidity tracking, ATR-based risk/reward mapping, and a dynamic trade dashboard, it provides a multidimensional view of the market. Traders can focus on execution, interpret trends, and evaluate overextensions or reversals without relying on guesswork. The indicator is suitable for scalping, intraday, and swing strategies, offering a comprehensive system for understanding and trading alongside institutional participants.
Sweep2Trade Pro [CHE]Sweep2Trade Pro \  — Liquidity Sweep → Trend → Confirmation 
Sweep2Trade Pro \  helps you catch high-probability reversals or continuations that start with a liquidity sweep, align with the T3 trend, and finalize with a structure confirmation (BOS). It’s designed to reduce noise, time your entries, and keep you out of weak, chop-driven signals.
  What’s a “sweep”? 
A liquidity sweep happens when price briefly breaks a prior swing high/low (where many stops sit), triggers those stops, and then snaps back. This “stop-hunt” creates liquidity for bigger players and often precedes a sharp move in the opposite direction if the break fails, or fuels continuation if structure actually shifts.
  What’s a BOS (Break of Structure)? 
A BOS is a price action event where the market takes out a recent swing level in the trend’s direction, signaling continuation and confirming that structure has shifted (bullish BOS through a recent swing high, bearish BOS through a recent swing low).
 How the indicator works (at a glance)
 1. Regime Filter (T3 + R²) 
    T3 Moving Average: A smoother, faster-responding moving average that aims to reduce lag while filtering noise, so trend direction changes are clearer.
    R² (Coefficient of Determination): Measures how “linear” the recent price path is (0→1). Higher values = stronger, cleaner trend; lower values = more chop. Used here to allow trades only when trend quality exceeds a user-set threshold.
 2. Sweep Detection 
    Bullish sweep: price pokes below a prior swing low and closes back above it.
    Bearish sweep: price pokes above a prior swing high and closes back below it.
    Lookback length is configurable.
 3. Sequence Lock (built-in FSM) 
   The script manages state in phases so you don’t jump the gun:
    Phase 1: Sweep detected → wait for T3 to turn in the corresponding direction.
    Phase 2: T3 direction confirmed → show “SWEEP OK” and wait for final confirmation.
    Trade Signal: Only fires if confirmation arrives before a timeout.
 4. Confirmation Layer 
    BOS via wick or close (you choose),
    Strong close toward the signal (top/bottom quartile of the candle),
    Optional “close above/below T3” condition.
     These checks help avoid weak sweeps that immediately fade.
 5. Alerts & Visuals 
    “SWEEP OK” markers show when the sweep + T3 direction align.
    Final BUY/SELL arrows appear only when the confirmation layer passes.
    Ready-made alert conditions for automation.
  What you can do with it 
 Time reversals after sweeps: Enter when a stop-hunt fades and structure confirms.
 Ride continuations: Use BOS with the T3 trend to pyramid or re-enter with structure on your side.
 Filter chop: Let R² gate entries to periods with cleaner directional drift.
 Automate: Use the included alerts with your platform or webhook setup.
  Inputs (key settings) 
 Regime Filter
   T3 Length / Volume Factor: Controls smoothness and responsiveness. Smaller length → faster, more sensitive; higher volume factor → smoother curve.
   R² Lookback & Threshold: Length of the linear fit window and the minimum “trend quality” required. Higher thresholds mean fewer, cleaner signals.
  Sweep / Sequence 
   Swing Lookback: How far back to define the “reference” high/low for sweeps.
   Timeout: Maximum bars allowed between phases to keep signals fresh.
   Restart timeout on Phase 2: Optional safety so entries don’t go stale.
 Confirmation
   BOS Lookback: Micro-pivot window for structure breaks.
   Wick vs Close BOS: Conservative traders may prefer close.
   Require close above/below T3: Tightens confirmation with trend alignment.
  Practical guide (quick start) 
1. Timeframe & markets: Works across majors, indices, and crypto. Start with 5m–1h intraday or 1h–4h swing; adjust R² threshold upward on noisier pairs.
2. Entry recipe (Long):
    Bullish sweep of a prior low → T3 turns up → BOS/strong close.
    Optional: enable “close above T3” for extra confirmation.
3. Entry recipe (Short): Mirror the above.
4. Stops: Common choices are just beyond the sweep wick (tighter) or past the BOS invalidation (safer).
5. Targets: Previous structural levels, measured move, or a T3 trail (exit when price closes back through T3).
6. Avoid low-quality contexts: If R² is very low, market is likely ranging erratically—skip or widen filters.
  Tips & best practices 
 Context first: The same sweep means different things in a strong trend vs. flat regime; that’s why the T3+R² filter exists.
 BOS choice: Wick-based BOS is earlier but noisier; close-based BOS is slower but cleaner. Tune per market.
 Backtest -> Forward test: Validate settings per symbol/timeframe; then paper trade before going live.
 Risk: Fixed fractional risk with asymmetric R\:R (e.g., 1:1.5–1:3) generally performs better than “all-in” discretionary sizing.
  Behind the scenes (for the curious) 
 T3 is a multi-stage EMA construction that produces a smooth curve with reduced lag versus simple/standard EMAs.
 R² is the square of correlation (0–1). Here it’s used as a moving gauge of how well price aligns to a linear path—our “trend quality” dial.
 Stop-hunts / sweeps are a recognized microstructure phenomenon where clustered stops provide the liquidity that fuels the next move.
  Disclaimer 
No indicator guarantees profits. Sweep2Trade Pro \  is a decision aid; always combine with solid risk management and your own judgment. Backtest, forward test, and size responsibly.
The content provided, including all code and materials, is strictly for educational and informational purposes only. It is not intended as, and should not be interpreted as, financial advice, a recommendation to buy or sell any financial instrument, or an offer of any financial product or service. All strategies, tools, and examples discussed are provided for illustrative purposes to demonstrate coding techniques and the functionality of Pine Script within a trading context.
Any results from strategies or tools provided are hypothetical, and past performance is not indicative of future results. Trading and investing involve high risk, including the potential loss of principal, and may not be suitable for all individuals. Before making any trading decisions, please consult with a qualified financial professional to understand the risks involved.
By using this script, you acknowledge and agree that any trading decisions are made solely at your discretion and risk.
Enhance your trading precision and confidence 🚀
Happy trading
Chervolino
Trading Macro Windows by BW v2 
 Trading Macros by BW: Integrating ICT Concepts for Session Analysis 
This indicator combines two key Inner Circle Trader (ICT) concepts—Change in State of Delivery (CISD) or Inverted Fair Value Gap (IFVG) signals with Macro Time Windows—to provide a unified tool for analyzing intraday price action, particularly during Pacific Time (PT) sessions. Rather than simply merging existing scripts, this integration creates a cohesive visual framework that highlights how macro consolidation periods interact with potential reversal or continuation signals like CISD or IFVG. By overlaying macro candle styling and borders on the chart alongside selectable signal lines, traders can better contextualize setups within ICT's macro narrative, where price often manipulates liquidity during these windows before displacing toward higher-timeframe objectives.
 Core Components and How They Work Together: 
 Macro Time Windows (Inspired by ICT's Macro Periods): 
ICT emphasizes "macro" as 30-minute windows (e.g., 06:45–07:15 PT, 07:45–08:15 PT, up to 11:45–12:15 PT) where price tends to consolidate, sweep liquidity, or form key structures like Fair Value Gaps (FVGs). These periods set the stage for the session's directional bias.
The indicator styles candles within these windows using a user-defined color for wicks, borders, and bodies (translucent for visibility). This visual emphasis helps traders focus on activity inside macros, where reversals or continuations often originate.
Borders are drawn as vertical lines at the start and end of each window (with a +5 minute buffer to capture related activity), using a dotted style by default. This creates a "study zone" that encapsulates macro events, allowing traders to assess if price is respecting or violating these zones in alignment with broader ICT models like the Power of 3 (AMD cycle).
Toggle: "Macro Candles Enabled" (default: true) – Turn off to disable styling and borders if focusing solely on signals.
 CISD or IFVG Signals (Selectable Mode): 
Mode Selection: Choose between "Change in the State of Delivery" (CISD) or "IFVG" (default: IFVG). Both detect shifts in market delivery during specific 30-minute slices (15–45 or 17–45 minutes past the hour in PT sessions).
CISD Mode: Based on ICT's definition of a sudden directional shift, this identifies aggressive displacements after sweeping recent highs/lows. It uses a rolling reference high/low over 6 bars, checks for sweeps (penetrating by at least 2 ticks in the last 2-3 bars), reclamation (closing beyond the reference with at least 50% body), and displacement (50% of prior range or an immediate FVG of 6+ ticks). Signals plot a horizontal line from the close, extending 24 bars right, labeled "CISD."
IFVG Mode: Focuses on Inverted Fair Value Gaps, where a bullish FVG (low > high  by 13+ ticks) forms but is inverted (closed below) in the same slice, signaling bearish intent (or vice versa). This targets violations against opposing liquidity, often leading to raids on external ranges. Signals plot similarly, labeled "IFVG."
Shared Logic: Both modes enforce a 55-bar cooldown to prevent clustering, operate only during PT sessions (06:30–13:00), and use tick-based thresholds for precision across instruments. The integration with macros allows traders to see if signals occur within or at the edges of macro windows, enhancing confirmation—for example, a CISD inside a macro might indicate a manipulated reversal toward the session's true objective.
Toggle: "Signals Enabled" (default: true) – Turn off to hide all signal lines and labels, isolating the macro visualization.
 How Components Interact: 
Macro windows provide the "narrative context" (consolidation/manipulation), while CISD/IFVG signals detect the "delivery shift" (displacement). Together, they form a mashup that justifies publication: isolated signals can be noisy, but when filtered by macro periods, they align with ICT's session model. For instance, an IFVG inversion during a macro might confirm a liquidity sweep before targeting PD arrays or order blocks.
No external dependencies; all calculations are self-contained using Pine's built-in functions like ta.highest/lowest for references and time-based sessions for windows.
Usage Guidelines:
Apply to intraday charts (e.g., 1-5 min) or stocks during PT hours.
Look for confluence: A bull IFVG signal post-macro low sweep might target the next macro high or daily bias.
Customize colors/styles for signals (solid/dashed/dotted lines) and macros to suit your chart.
Backtest in replay mode to observe how macros frame signals—e.g., price often respects macro borders as S/R.
Limitations: Timezone-fixed to PT (America/Los_Angeles); signals are directional hints, not trade entries. Combine with ICT tools like order blocks or liquidity pools for full setups.
This script draws from community ICT implementations but refines them into a single, purpose-built tool for macro-driven trading, reducing chart clutter while emphasizing interconnected concepts. Feedback welcome!






















