Money Flow Index (MFI) — Technical Indicators - TradingView

Search
  • Products
  • Community
  • Markets
  • Brokers
  • More
EN Get started
  • Indicators and strategies
  • Technical Indicators
  • Volume
  • Money Flow Index (MFI)
All types Open-source onlyMost recentMost popularNEXOUS_cl Elite Money Flow & Delta Profile [Institutional Editio📘 2. Description & Technical Analysis NEXOUS_cl Elite Delta Profile is a high-precision institutional-grade tool designed to decode market structure through the lens of Money Flow and Volume Distribution. Unlike standard volume profiles, this indicator analyzes the aggressive participation of "Smart Money" at specific price levels, providing traders with a clear map of liquidity and directional bias. Technical Analysis Framework: Money Flow Profiling: The indicator segments price action into customizable "bins" and calculates the cumulative volume flow (Buying vs. Selling pressure) for each. Delta Imbalance Detection: By comparing close vs. open proximity and volume intensity, it identifies whether a price level is being "Accepted" (Equilibrium) or "Rejected" (Breakout). Adaptive Balance Scoring: Utilizing a dual-gradient system, it highlights High-Balance Zones (Cyan) where institutional rotation occurs and Low-Balance Zones (Neon Green) which typically act as springboards for explosive moves. Smart Money Magnet (POC): Automatically identifies the most significant price level of the analyzed period, serving as a dynamic Support or Resistance anchor. 📖 3. Indicator User Guide How to trade with NEXOUS_cl: Identify the Value Area: Look for the longest bars in the profile. These represent the "Fair Value" where institutions are actively transacting. Color Interpretation: Cyan (High Balance): Price is stable. Ideal for mean-reversion trades or identifying strong S/R. Neon Green (Imbalance): One side is dominating. Watch for a rapid move away from these levels. Signal Execution: NEXOUS BUY: Triggered when price crosses above the institutional VWAP with a surge in positive Money Flow. NEXOUS SELL: Triggered when price breaks below the key rotation level with heavy selling delta. Timeframe Strategy: Optimized for 1m, 5m, and 15m for Scalping, and 1H/4H for Swing Trading. Works on all Crypto and Forex pairs. 🛠️ 4. Key Features History Lookback: Fully adjustable analysis window (up to 1500 bars). Price Resolution: Configurable bin counts for surgical precision. Integrated Alerts: Pre-configured JSON alert system for seamless connection to the Nexous AI Gateway. Heat Map Visualization: Instant visual recognition of market "hotspots".Pine Script® indicatorby NEXOUS_cl14Double Money Flow Index - DMFI | TR🎯 Overview Double Money Flow Index - DMFI | TR is an advanced volume‑weighted oscillator developed by Tiagorocha1989 that enhances the classic Money Flow Index (MFI) by applying the MFI formula twice. This “double MFI” approach amplifies shifts in money flow, reduces lag, and helps traders identify accumulation/distribution phases and potential reversals earlier than traditional MFI. With dual‑mode operation (centerline or moving‑average crossovers), an extensive selection of moving average types, and comprehensive visual customization, DMFI provides a powerful tool for volume‑based momentum analysis. 🔧 How It Works The standard Money Flow Index (MFI) combines price and volume to measure buying and selling pressure, ranging from 0 to 100. Double MFI applies the same logic to the MFI series itself, creating a “momentum of money flow” effect that highlights changes in the underlying MFI’s behaviour. Core Calculation Logic: First MFI: MFI = 100 - (100 / (1 + Money Flow Ratio)) where the period is user‑defined Length MFI and the source is Source MFI. (MFI internally uses typical price and volume to compute positive and negative money flow.) Double MFI (DMFI): DMFI = 2 × MFI - ta.mfi(MFI, Length_MFI) i.e., the current MFI minus the MFI of MFI (applied to the MFI series) and then doubled, effectively smoothing and amplifying changes in MFI. Reference Line (Entry_DMFI): The indicator compares DMFI to a reference line that can be either: 50 Line (classic MFI mode) – the traditional centerline separating bullish ( >50) and bearish ( <50) money flow. Signals occur when DMFI crosses above or below 50. DMFI MA (enhanced mode) – the reference line becomes a moving average of DMFI itself, providing smoother, filtered signals. The moving average type and length are fully customizable, with support for 12 different MA variants (see Key Features). The resulting oscillator oscillates around the chosen reference line: DMFI above reference → strengthening buying pressure (bullish money flow acceleration) DMFI below reference → strengthening selling pressure (bearish money flow acceleration) Magnitude indicates the strength of the acceleration. Values above 80 or below 20 are often considered overbought/oversold in classic MFI, but DMFI is unbounded. ✨ Key Features 🔹 Dual Operating Modes 50 Line Mode: Classic signals when DMFI crosses above or below 50 – simple and intuitive for MFI users. DMFI MA Mode: Smoother signals when DMFI crosses its own moving average – reduces whipsaws in choppy markets. 🔹 Extensive Moving Average Selection Choose from 12 MA types for the DMFI MA line, each with its own characteristics: EMA, SMA, RMA, WMA, VWMA, HMA, DEMA, TEMA, TRIMA, FRAMA, SWMA, T3. The T3 MA includes an adjustable T3 Factor for fine‑tuning smoothness. 🔹 Customizable MFI Parameters Length MFI: Lookback period for both MFI calculations (default 14). Source MFI: Price source for the first MFI (default Close). (MFI internally uses typical price and volume.) 🔹 Extended Range Visualization Gradient fills are drawn between DMFI and the reference line, with fixed bounds at 120 and 0. These zones help visualise extreme readings, referencing classic MFI overbought/oversold levels while accommodating DMFI’s unbounded nature. 🔹 Customizable Color Themes Eight distinct color schemes to match your chart aesthetics: Classic, Modern, Robust, Accented, Monochrome, Moderate, Aqua, Cosmic Each theme defines separate colors for bullish and bearish states. 🔹 Comprehensive Visual Feedback Colored DMFI Line: Changes colour based on its position relative to the reference line. Signal Line: Yellow line representing the 50 or MA reference. Gradient Fill Zones: Semi‑transparent fills showing extreme money flow areas (overbought/oversold zones). Dynamic Zone Fills: Additional fill between DMFI and the reference line, coloured by the prevailing bias. Color‑Coded Candles: Bars reflect the current DMFI bias (above or below reference). Signal Markers: Triangle up/down symbols at crossover points. Live Value Display: Current DMFI value shown in a floating label near the last bar. Trend Table: Bullish/Bearish status displayed in a table on the chart. 🔹 Ready‑to‑Use Alerts Built‑in alert conditions trigger LONG on bullish crossovers and SHORT on bearish crossunders, for both operating modes. ⚙️ Settings Summary Setting Description Default Color Choice Select from eight visual themes Classic Length MFI Lookback period for both MFI calculations 14 Source MFI Price source for the first MFI Close Entry/Exit Signal Choose between 50‑line or DMFI MA mode 50 Length MA Moving average period for DMFI MA mode 365 Moving Average Type of moving average for the signal line (12 options) EMA T3 Factor Factor for T3 moving average (0–1) 0.7 📈 Practical Applications 🔹 Money Flow Acceleration Detection The slope and position of DMFI relative to the reference line quickly reveal whether money flow is accelerating or decelerating. Steeply rising DMFI indicates strengthening buying pressure; steeply falling DMFI signals strengthening selling pressure. 🔹 50‑Line Crossovers In 50 Line mode, crossovers provide clear signals: Crossover above 50 → shift from bearish to bullish money flow, potential trend reversal up. Crossunder below 50 → shift from bullish to bearish money flow, potential trend reversal down. 🔹 Signal‑Line Crossovers In DMFI MA mode, crossovers between DMFI and its moving average generate filtered signals: DMFI crosses above its MA → bullish signal (buying pressure accelerating). DMFI crosses below its MA → bearish signal (selling pressure accelerating). These signals work well in trending markets by reducing false entries. 🔹 Overbought / Oversold Conditions Although DMFI is unbounded, traditional MFI levels (e.g., 80/20) can be referenced. Extreme DMFI readings (above 120 or below 0) often coincide with strong money flow and may precede reversals or pullbacks, especially when combined with divergences. 🔹 Divergence Trading Double MFI is excellent for spotting divergences with price: Bullish Divergence: Price makes a lower low while DMFI forms a higher low → possible upside reversal (accumulation). Bearish Divergence: Price makes a higher high while DMFI forms a lower high → possible downside reversal (distribution). Divergences are most reliable after extended trends or when DMFI is at extreme levels. 🔹 Money Flow Confirmation The magnitude of DMFI confirms the strength of money flow: Large positive values (well above reference) → strong buying pressure. Large negative values (well below reference) → strong selling pressure. Values nearing the reference line → money flow slowing, potential trend change. 🔹 Centerline Rejections When DMFI approaches the reference line (50 or MA) but reverses before crossing, it can signal continuation of the current money flow trend – a common pattern in strong trends. 🔹 Multiple Timeframe Analysis Compare DMFI readings across timeframes: higher‑timeframe DMFI defines the primary money flow trend, while lower‑timeframe DMFI helps pinpoint entry and exit timing. 🎯 Ideal For ✅ MFI Enthusiasts looking for a more responsive, smoothed version of the classic volume‑weighted indicator. ✅ Volume‑Based Traders wanting to measure buying/selling pressure acceleration. ✅ Trend Traders seeking confirmation of trend strength and direction with volume. ✅ Momentum Traders wanting an early view of money flow shifts. ✅ Divergence Traders looking for leading reversal signals in price/volume relationships. ✅ Swing Traders capturing medium‑term money flow shifts. ✅ System Developers needing a robust, customisable crossover‑based strategy. ✅ Beginner Traders who appreciate clear visual signals and multiple learning modes. 📌 Key Takeaways Double MFI Logic: Applying the MFI formula twice amplifies money flow signals and reduces lag compared to standard MFI. Dual‑Mode Flexibility: Choose 50‑line simplicity for classic MFI entries or MA‑smoothed signals for filtered trades. Unbounded Nature: DMFI has no fixed upper/lower limits; traditional levels (e.g., 80/20, 120/0) serve as useful reference zones. Volume Integration: Because MFI incorporates volume, DMFI provides a unique volume‑weighted perspective on momentum. Extensive MA Options: 12 moving average types give you complete control over the smoothness and responsiveness of the signal line. Rich Visuals: Colour themes, gradient fills for extreme zones, candle colouring, and live value labels provide immediate market context. Divergence Capability: The double calculation often reveals divergences earlier than simple MFI. Alert‑Ready: Pre‑built alerts for both LONG and SHORT signals based on crossovers. ⚠️ Important Notes Because DMFI is unbounded, its scale can vary significantly between instruments and timeframes. The gradient fills at 120 and 0 are arbitrary reference points derived from classic MFI overbought/oversold levels; they may not represent actual extreme conditions for all instruments. The default Length MFI of 14 is the standard MFI period, offering a balanced perspective. Shorter lengths (e.g., 9) produce more responsive signals, while longer lengths (e.g., 21) smooth out noise. The default Length MA of 365 in DMFI MA mode is designed for a long‑term context on daily charts; adjust it to match your trading horizon. Divergences are most reliable when they occur after extended trends and are confirmed by other tools. Always combine Double MFI with proper risk management and additional confirmation before live deployment. Disclaimer: This indicator is provided for educational and informational purposes only. Past performance does not guarantee future results. Always test thoroughly and align with your personal risk management strategy.Pine Script® indicatorby Tiagorocha1989Updated 93D Money Flow Index [UAlgo]3D Money Flow Index is a visual enhancement of the Money Flow Index that transforms a classic momentum oscillator into a pseudo 3D ribbon rendered inside its own pane. Instead of displaying MFI as only a single flat line, the script builds a front surface, a back surface, connecting edges, and shaded faces, then projects those elements through a camera style transformation using configurable yaw and pitch angles. The result is a depth based MFI visualization that makes momentum shifts, expansion, compression, and reversals much more expressive than a standard oscillator plot. The indicator runs in a separate pane ( overlay=false ) and combines several components into one visual framework: A custom MFI style calculation A 3D ribbon built from projected historical MFI values Optional dynamic ribbon depth based on volatility Buy and sell markers when MFI crosses key threshold levels Regular bullish and bearish divergence detection using MFI pivots versus price pivots Projected guide levels for 80, 50, and 20 This makes the script useful for traders who want both analysis and presentation. It keeps the familiar MFI logic at the core, but wraps it in a more intuitive spatial display that can help visually separate trend persistence, reversal attempts, and divergence structures. Educational tool only. Not financial advice. 🔹 Features 🔸 1) 3D Ribbon Style MFI Visualization The core feature of the script is a pseudo 3D MFI ribbon. For each historical bar inside the selected history length, the indicator creates a front and back layer around the same MFI value, connects those layers with side edges, and fills the face between them. This gives the oscillator a ribbon like body rather than a single thin line. The ribbon is projected into the pane using time for the horizontal axis and MFI value for the vertical axis, which creates a clean depth illusion without leaving the oscillator panel. 🔸 2) Adjustable Camera Style Projection The script includes two visual controls that change how the ribbon appears in space: Yaw Angle changes the left right visual rotation of the ribbon Pitch Angle changes the vertical tilt of the ribbon These controls allow the user to choose a flatter, more technical display or a more dramatic perspective oriented look. 🔸 3) Configurable Ribbon Depth The Ribbon Depth setting controls how thick the 3D body appears along the synthetic Z axis. Lower values create a thinner ribbon, while higher values create a deeper and more dramatic structure. This is especially useful when adapting the visualization for different screen sizes or preferred chart density. 🔸 4) Optional Dynamic Volatility Based Depth When enabled, the script automatically scales ribbon depth using current ATR relative to its longer average. This means the visual thickness expands during higher volatility and compresses during quieter periods. The result is a ribbon that can communicate both oscillator behavior and relative volatility regime at the same time. 🔸 5) Custom Money Flow Index Calculation Instead of using the built in ta.mfi() , the script calculates its own MFI style series from positive and negative money flow sums derived from price change and volume. This gives the indicator full internal control over the oscillator values used by the 3D engine, divergence logic, and threshold signals. 🔸 6) Buy and Sell Threshold Markers The script generates event markers when MFI crosses important momentum thresholds: Buy style event when MFI crosses above 20 Sell style event when MFI crosses below 80 These events are rendered as small 3D boxes attached to the ribbon, which keeps the signal presentation consistent with the indicator’s depth based design. 🔸 7) Regular Divergence Detection The indicator can detect regular divergence by comparing MFI pivots to price pivots: Bearish divergence when price makes a higher high but MFI makes a lower high Bullish divergence when price makes a lower low but MFI makes a higher low Divergence is optional and can be turned on or off through the settings. 🔸 8) 3D Aligned Divergence Lines When a divergence is detected, the script draws a thicker line between the two MFI pivot points, positioned on the ribbon’s front face so the divergence appears visually attached to the 3D structure instead of floating away from it. It also draws dotted connector lines from the divergence line back to the ribbon body, reinforcing the spatial relationship. 🔸 9) Historical Ribbon Length Control The History Length input limits how many bars of 3D ribbon are drawn. This helps balance visual richness with performance and keeps the pane from becoming overcrowded. 🔸 10) Gradient Color Mapping by MFI Level The ribbon is colored dynamically using a gradient based on MFI value: Lower readings lean bearish Higher readings lean bullish This means the ribbon itself functions as a live regime map, not just a structural shape. 🔸 11) Projected Guide Levels The script draws perspective aligned guide levels for: 80 50 20 These are not flat horizontal pane lines. They are projected using the same camera logic as the ribbon, which keeps the entire display visually coherent. 🔸 12) Full Last Bar Redraw for Visual Consistency All 3D objects are deleted and rebuilt on the last bar. This ensures that the current camera angles, ribbon depth, divergence set, and markers are always rendered consistently with the latest data. 🔸 13) Object Based Design for Maintainability The script uses several custom types: Point3D for synthetic 3D coordinates Point2D for projected time / value coordinates Camera for projection controls DivLine for stored divergence events This makes the visual engine and signal logic more structured and easier to extend. 🔹 Calculations 1) Custom MFI Style Calculation The script computes money flow using separate positive and negative sums based on the change in the selected source: float upper = math.sum(volume * (ta.change(src) <= 0 ? 0 : src), length) float lower = math.sum(volume * (ta.change(src) >= 0 ? 0 : src), length) Then it computes an MFI style output: float ratio = lower == 0 ? 0 : upper / lower 100.0 - (100.0 / (1.0 + ratio)) Interpretation: Positive source changes contribute to the upper flow sum. Negative source changes contribute to the lower flow sum. The resulting ratio is converted into an oscillator style value on a 0 to 100 scale. Important implementation note: This is a custom MFI style calculation, not the built in TradingView MFI function. The script uses its own edge case handling when lower == 0 . 2) Volatility Based Depth Scaling The dynamic depth option uses ATR relative to a longer ATR average: float atr = ta.atr(14) float avg_atr = ta.sma(atr, 100) float depth_scaler = use_dynamic_depth ? math.max(0.5, math.min(2.5, atr / avg_atr)) : 1.0 Interpretation: If current ATR is above its longer average, the ribbon becomes deeper. If current ATR is below its longer average, the ribbon becomes thinner. The multiplier is clamped between 0.5 and 2.5 for stability. 3) 3D Coordinate Model Each ribbon segment uses synthetic 3D coordinates: x represents bars back in history y represents the MFI value z represents the ribbon depth offset For each bar, the ribbon creates: A front point at z = -depth / 2 A back point at z = depth / 2 This creates the geometry needed for the front edge, back edge, side edge, and face fill. 4) Camera Projection Logic The script projects each 3D point into 2D coordinates using yaw and pitch rotations: float x1 = p.x * math.cos(rad_yaw) - p.z * math.sin(rad_yaw) float z1 = p.x * math.sin(rad_yaw) + p.z * math.cos(rad_yaw) float y1 = p.y * math.cos(rad_pitch) - z1 * math.sin(rad_pitch) Then it converts the projected coordinates into chart coordinates: int proj_time = int(ref_time - (x1 * time_step)) float proj_price = y1 Interpretation: The script does not use true 3D rendering. It uses geometric projection math to simulate depth within normal chart objects. 5) Time Step Mapping The horizontal spacing of projected points is derived from current chart time: int dt = time - time if bar_index == 0 dt := 60000 This lets the projected ribbon stay aligned with the current timeframe interval. 6) Ribbon Segment Construction For each bar pair in the selected history window, the script creates: Front line from point A front to point B front Back line from point A back to point B back Connector line from point A front to point A back A filled face polygon between the front and back edges This produces the actual ribbon body. The fill is created only for recent segments to stay within object limits: if i < 90 ... polylines.push(polyline.new(points, ... fill_color=face_col ...)) 7) Gradient Color Logic for the Ribbon The ribbon color is mapped from current MFI value: color base_col = color.from_gradient(val_a, 20, 80, col_bear, col_bull) Interpretation: Lower MFI values shift toward the bearish color. Higher MFI values shift toward the bullish color. Midrange values naturally blend between the two. 8) Buy and Sell Signal Logic The script defines simple threshold crossing events: bool sig_buy = ta.crossover(mfi_val, 20) bool sig_sell = ta.crossunder(mfi_val, 80) Interpretation: Buy event means MFI rises back above the lower threshold, which can suggest recovery from oversold pressure. Sell event means MFI falls back below the upper threshold, which can suggest rejection from overbought pressure. These are event markers, not standalone entry guarantees. 9) 3D Marker Drawing When a buy or sell signal occurs, the script draws a small 3D box marker using the same projection engine as the ribbon. The marker is built from four projected corners and connected with line segments so it appears attached to the ribbon structure. This keeps the signal styling consistent with the rest of the indicator. 10) Pivot Detection for Divergence The divergence engine finds pivot highs and lows on the MFI series: float ph = ta.pivothigh(mfi_val, piv_len, piv_len) float pl = ta.pivotlow(mfi_val, piv_len, piv_len) Each pivot is aligned to its true pivot bar using: int curr_piv_bar = bar_index - piv_len This ensures divergence anchors are placed at the actual turning points, not the later confirmation bar. 11) Bearish Divergence Logic When an MFI pivot high is confirmed, the script compares it with the prior MFI pivot high: bool bear_div = (curr_price_high > last_price_ph) and (curr_piv_val < last_ph_val) Interpretation: Price makes a higher high MFI makes a lower high If true, a bearish divergence line is stored. 12) Bullish Divergence Logic When an MFI pivot low is confirmed, the script compares it with the prior MFI pivot low: bool bull_div = (curr_price_low < last_price_pl) and (curr_piv_val > last_pl_val) Interpretation: Price makes a lower low MFI makes a higher low If true, a bullish divergence line is stored. 13) Divergence Storage and Cleanup Detected divergences are stored in an array of DivLine objects. Older divergence entries are removed once they fall too far outside the active visual window: if (bar_index - divergences.get(0).start_bar) > (history_len + 100) divergences.shift() This prevents old divergence structures from accumulating forever. 14) 3D Aligned Divergence Rendering When a divergence is drawn, the script places it on the front face of the ribbon by using: float z_offset = -current_depth / 2.0 This is an important visual detail because it keeps the divergence line attached to the ribbon surface rather than offset in empty space. The script also draws dotted connector lines from the divergence line endpoints back to the ribbon center plane, reinforcing the 3D attachment. 15) Projected Guide Level Rendering The indicator draws projected guide levels at 80, 50, and 20 using the same projection method: draw_grid_line(80, color.red) draw_grid_line(50, color.gray) draw_grid_line(20, color.green) This keeps the threshold references visually aligned with the ribbon perspective instead of using flat horizontal lines that would break the illusion. 16) Full Last Bar Rebuild Process On the last bar, the script: Deletes all existing lines, polylines, and labels Recreates the camera Rebuilds the ribbon over the selected history length Replots signal markers Renders divergence lines Draws guide levels This full redraw approach ensures visual consistency whenever the latest bar changes, the camera angles change, or volatility depth changes.Pine Script® indicatorby UAlgo56Volume Delta Profile BubblesVolume Delta Profile Bubbles 🔵 What is this indicator? Volume Delta Profile Bubbles is a unique indicator that combines two powerful concepts — Volume Profile and Volume Delta — to identify price levels where the market has reacted with significant volume AND strong directional pressure. Instead of showing a traditional vertical histogram on the price axis, this indicator stamps a bubble directly on the candle at the exact price level where the reaction occurred. The bigger the bubble, the more times that level has been confirmed over time. 🔵 How does it work? For each candle, the indicator analyzes two independent events: 🟢 Green bubble on the LOW — The lower wick is significant, buy volume is concentrated on the low, and that price level has been visited multiple times with the same bullish pressure. This identifies zones where the market found strong buyers. 🔴 Red bubble on the HIGH — The upper wick is significant, sell volume is concentrated on the high, and that price level has been visited multiple times with the same bearish pressure. This identifies zones where the market found strong sellers. A doji with long wicks on both sides can generate both a green bubble on the low and a red bubble on the high simultaneously — indicating a zone of strong contention from both sides. Volume is normalized using standard deviation (volume / stdev(volume, period)), which automatically adjusts for session differences. This means the indicator works correctly across Regular Trading Hours (RTH) and Extended Trading Hours (ETH) — a high volume candle in ETH is compared against typical ETH volumes, not RTH volumes. Bubble size reflects how many times that level has been confirmed: 🔵 Tiny → minimum confirmations 🔵 Small → 2x minimum confirmations 🔵 Normal → 3x minimum confirmations 🔵 Large → 4x minimum confirmations 🔵 Huge → 5x+ minimum confirmations 🔵 Parameters Price Tolerance (points) — The radius around a price level within which candles are considered "at the same level". Adjust based on your instrument's tick size. For XAUUSD use 0.3–0.8, for indices use 1–2. Volume Threshold (x std dev) — Minimum volume significance. At 1.0 many bubbles appear, at 2.0 only exceptional volume spikes trigger. Start at 1.5 and increase until bubbles visually align with clear market reactions. Delta Min % of candle volume — Minimum percentage of volume that must be concentrated on the wick to qualify as directional pressure. Lower to 15% for more signals, raise to 30%+ for high selectivity. Min Wick % of range — Minimum wick size relative to the total candle range. At 0.20 the wick must be at least 20% of the range. Raise to 0.30–0.40 to filter only candles with clear rejections. Min Confirmations — How many times the level must have been visited with the same characteristics before drawing a bubble. At 2 it is already selective. Raise to 3–4 to see only the most robust support/resistance levels. Lookback bars — How many bars back to calculate the Volume Profile. On low timeframes (1–5 min) use 200–300 to cover the current session. On higher timeframes (1H–4H) you can go up to 500. Normalization Period — The period for standard deviation calculation of volume. Default 200 is solid for most use cases. Transparency — Alpha of the bubbles. Since bubbles can overlap on the same level, lower transparency creates a natural gradient effect — overlapping bubbles become more visible. Alert Size — Minimum bubble size that triggers an alert. Set via dropdown: tiny / small / normal / large / huge. 🔵 Suggested Setups Breakout Setup (Bullish) When a medium-to-large green bubble forms and price subsequently closes above the bubble level, the market has absorbed all the selling pressure and buyers are in control. This often leads to an impulsive extension to the upside. Enter on the breakout candle or on a retest of the level. Liquidation Cascade Setup (Bearish) When price closes below a green bubble level with bearish bias, the long positions that accumulated at that level are being stopped out. Their stop losses become sell orders, adding further downward pressure. This often triggers a sharp bearish extension. The same logic applies in reverse for red bubbles — closes above a red bubble can trigger short squeeze extensions, closes below often lead to continuation. Confluence Setup A level with both a green and red bubble (visible on doji candles) is a zone of strong contention. When price returns to these levels, expect explosive moves in either direction. Wait for a clear directional close before committing. Size Matters Always prioritize large and huge bubbles — these represent levels tested and confirmed multiple times with significant volume. A huge green bubble on the low is a much stronger potential support than a tiny one. 🔵 Important Notes on Volume Data ⚠️ This indicator requires real volume data to function correctly. It will not work properly on instruments that do not provide actual traded volume. ✅ Works well on: Futures (ES, NQ, GC, CL), Crypto (BTC, ETH), Forex pairs on brokers that provide tick volume. ⚠️ Use with caution on: CFDs and some Forex pairs where volume data may represent tick count rather than actual traded volume. Results may be less reliable. ❌ Not suitable for: Instruments with no volume data at all. The Volume Delta calculation in this indicator is an approximation — without real tick-by-tick data, buy and sell volume are estimated based on wick proportions. On instruments with real volume data (futures, crypto), the approximation is reasonably accurate. On tick-volume instruments, treat the signals as directional bias indicators rather than precise measurements. 🔵 Call to Action If you find this indicator useful, please leave a comment sharing how you are using it and on which instruments. Your feedback helps improve future versions. 🚀 Boost the script if you want to support the development of more tools like this one. 📬 For questions, suggestions or bug reports, use the comment section below. ⚠️ Disclaimer This indicator is for educational and informational purposes only. It does not constitute financial advice, investment advice, or a recommendation to buy or sell any financial instrument. Past performance of any level identified by this indicator does not guarantee future results. Always use proper risk management and consult a qualified financial advisor before making any trading decisions. Trading involves substantial risk of loss.Pine Script® indicatorby Burdiga8465MFI Distribution [UAlgo]MFI Distribution is a statistics focused Money Flow Index indicator that combines a live MFI oscillator with a forward projected distribution histogram and normality diagnostics. Instead of only showing the current MFI line, the script collects a rolling history of MFI values, studies their distribution over a configurable lookback period, and visualizes the result as a histogram in the oscillator pane. The indicator is designed for traders who want to understand how MFI behaves as a distribution , not only where it is on the current bar. It provides a compact statistical framework that helps answer questions such as: Is MFI clustering around a narrow regime or spread across the full range Is the recent MFI behavior skewed toward strong buying or selling pressure Does the MFI sample look approximately normal, or is it fat tailed / asymmetric How extreme is the current reading relative to the recent distribution To support this, the script includes: A live MFI line with dynamic gradient coloring Overbought and oversold visual zones with gradient fills A histogram of MFI frequency distribution over the selected lookback An optional Gaussian curve overlay for visual comparison A statistical dashboard with mean, standard deviation, skewness, kurtosis, and Jarque Bera normality test results The histogram is drawn into the future area of the pane, so it does not interfere with the live MFI trace while still remaining visually aligned to the 0 to 100 oscillator scale. Educational tool only. Not financial advice. 🔹 Features 🔸 1) Live MFI Oscillator with Regime Aware Coloring The script plots a standard MFI line and colors it dynamically based on level behavior: High MFI values transition toward red tones Low MFI values transition toward green tones Mid range values remain purple This makes the oscillator easier to read at a glance, especially during sustained overbought or oversold conditions. 🔸 2) Overbought and Oversold Zone Visualization The indicator includes standard MFI reference levels at 80 and 20, then adds gradient fills that become visible when the MFI pushes into extreme zones. This provides better visual emphasis for momentum extremes without cluttering the chart. 🔸 3) Rolling MFI History Collection for Statistical Analysis The script maintains an internal array of the latest MFI values up to the user defined lookback length. This rolling sample is used to compute all distribution statistics and histogram frequencies on the last bar. This design keeps the indicator responsive while ensuring the displayed distribution reflects the most recent market behavior. 🔸 4) Forward Projected MFI Distribution Histogram A histogram is drawn in the oscillator pane using bins over the fixed MFI range from 0 to 100. Each bin counts how many MFI observations fall inside that interval during the lookback window. The histogram is projected to the right of current price action in the pane, giving users a clean distribution panel without covering the live MFI line. 🔸 5) Configurable Histogram Resolution and Width Users can control: Lookback period used for distribution analysis Number of histogram bins Visual width of the histogram in future bars This makes the tool flexible for both high level regime reading and finer distribution inspection. 🔸 6) Optional Gaussian Curve Overlay When enabled, the script overlays a theoretical normal distribution curve using the sample mean and sample standard deviation. The curve is normalized to the histogram height so users can visually compare the empirical MFI distribution against a bell curve shape. This is useful for quickly spotting asymmetry, multimodal clustering, or fat tail behavior. 🔸 7) Full Statistical Summary Dashboard A built in dashboard table displays: Mean Standard Deviation Skewness Kurtosis (excess kurtosis) Jarque Bera statistic Pass / Fail normality status (95% threshold logic) This turns the indicator into a compact quantitative diagnostic panel, not only a visual oscillator. 🔸 8) Jarque Bera Normality Test Classification The script evaluates whether the MFI sample is approximately normal using a Jarque Bera style test and a fixed chi square threshold (95% confidence, 2 degrees of freedom). It then marks the result as PASS (Normal) or FAIL (Non Normal). This helps traders distinguish between more stable oscillator regimes and structurally distorted ones. 🔸 9) Histogram Color Theme Based on Normality Result The histogram automatically changes style depending on the test result: Teal themed histogram when normality test passes Red themed histogram when normality test fails This creates an immediate visual signal of distribution quality without needing to read the dashboard first. 🔸 10) Last Bar Only Heavy Processing for Efficiency Statistical calculations, histogram drawing, and dashboard refresh are performed only on the last bar. This reduces object churn and improves performance while preserving real time utility. 🔸 11) Object Based Drawing Management The script uses custom types to organize logic: DistributionStats for statistical values and normality output HistoDrawer for histogram bars, curve lines, and labels This makes the code structured and easier to extend with future features such as percentiles, z scores, or alternate tests. 🔹 Calculations 1) MFI Calculation The script computes Money Flow Index from a user selected source and length: mfi_val = ta.mfi(mfi_src, mfi_len) This value is plotted in the oscillator pane and colored dynamically according to level. 2) Rolling History Buffer for Distribution Sampling Each valid MFI value is pushed into a rolling array used for statistical analysis: if not na(mfi_val) mfi_history.push(mfi_val) if mfi_history.size() > lookback mfi_history.shift() This ensures the sample size is capped at the selected lookback and continuously refreshed with recent values. 3) Sample Variance and Standard Deviation The script computes sample variance using the classic n minus 1 denominator: sum_sq_diff / (n - 1) Standard deviation is then calculated as: stats.stdev := math.sqrt(variance_val) Using sample variance is appropriate here because the lookback window is treated as a sample of recent market behavior. 4) Sample Skewness Calculation Skewness is computed from standardized deviations and corrected for sample size: (n * sum_cube_diff) / ((n - 1) * (n - 2)) Interpretation: Positive skew suggests more mass on lower values with a right tail toward high MFI prints Negative skew suggests more mass on higher values with a left tail toward low MFI prints 5) Excess Kurtosis Calculation The script calculates excess kurtosis , where a normal distribution is centered around 0: float term1 = (n * (n + 1) * sum_quad_diff) / ((n - 1) * (n - 2) * (n - 3)) float term2 = (3 * math.pow(n - 1, 2)) / ((n - 2) * (n - 3)) term1 - term2 Interpretation: Positive excess kurtosis suggests heavier tails or more peaked behavior Negative excess kurtosis suggests flatter distribution behavior 6) Jarque Bera Normality Test The script uses skewness and excess kurtosis to compute the Jarque Bera statistic: stats.jb_stat := (n / 6.0) * (math.pow(stats.skew, 2) + 0.25 * math.pow(stats.kurt, 2)) Then it compares the result against a 95 percent chi square critical value (2 degrees of freedom): stats.is_normal := stats.jb_stat < 5.991 Important note: The code defines a jb_p_value field in the stats type, but this version does not explicitly calculate or display a p value. The pass / fail logic is threshold based. 7) Fixed MFI Range Histogram Binning (0 to 100) The histogram always bins data over the full MFI range: float min_val = 0.0 float max_val = 100.0 float bin_size = (max_val - min_val) / bins Each MFI value is mapped to a bin index: int bin_idx = math.floor(val / bin_size) The index is clamped so values at boundaries stay valid: if bin_idx >= bins bin_idx := bins - 1 if bin_idx < 0 bin_idx := 0 This makes the histogram consistent across symbols and timeframes. 8) Frequency Counting and Peak Detection For each binned MFI observation, the script increments a frequency counter and tracks the highest bin count: int new_count = frequencies.get(bin_idx) + 1 frequencies.set(bin_idx, new_count) if new_count > max_freq max_freq := new_count The maximum frequency is later used to normalize histogram bar heights. 9) Histogram Rendering Geometry The histogram is drawn as boxes in the oscillator pane, projected to the right of the last bar: int start_bar = bar_index + 5 float base_y = 10.0 float available_height = 80.0 This effectively uses the MFI pane vertical range from about 10 to 90 for histogram height visualization, keeping it aligned with the oscillator scale. Each bin is mapped to x coordinates using its MFI interval and the user selected histogram width: int x_left = start_bar + math.round((bin_val_start / 100.0) * chart_width_bars) int x_right = start_bar + math.round((bin_val_end / 100.0) * chart_width_bars) Each frequency is mapped to a vertical height using: float bar_height_val = (freq / max_freq) * available_height 10) Histogram Color Logic from Normality Result The histogram color theme is selected from the Jarque Bera pass / fail result: Teal palette when stats.is_normal is true Red palette when stats.is_normal is false This creates a direct link between statistical classification and visual presentation. 11) Gaussian Curve Overlay Calculation The script defines a normal probability density function: (1.0 / (sigma * math.sqrt(2.0 * math.pi))) * math.exp(-0.5 * math.pow((x - mu) / sigma, 2)) For curve plotting: It samples points across the histogram width Maps each x position back to an MFI value from 0 to 100 Computes the PDF at that MFI value using the sample mean and standard deviation Scales the PDF by the theoretical peak so the curve fits the histogram height Key normalization idea: float pdf_peak = normal_pdf(stats.mean, stats.mean, stats.stdev) float current_y = base_y + (pdf_val / pdf_peak) * available_height This makes the Gaussian curve visually comparable to the empirical histogram, even though one is a density and the other is raw frequency. 12) Dashboard Table Metrics On the last bar, the script updates a table with the computed statistics: Mean StdDev Skewness Kurtosis Jarque Bera statistic and normality classification The result cell color changes based on normality: Green for PASS (Normal) Red for FAIL (Non Normal) This gives traders a compact quantitative summary next to the visual distribution. 13) Overbought and Oversold Gradient Fills The script adds gradient fills that appear when MFI moves beyond standard thresholds: fill(plot_mfi, p_ob, 100, 80, ...) fill(plot_mfi, p_os, 20, 0, ...) This helps contextualize whether the current MFI reading is extreme while the histogram and dashboard describe the broader behavior of the recent MFI sample.Pine Script® indicatorby UAlgo51Money Flow Index - MFI | TR🎯 Overview Money Flow Index - MFI | TR is a volume-weighted momentum oscillator that measures the strength of money flowing in and out of a security over a specified period. Developed by Tiagorocha1989, this enhanced version of the classic Money Flow Index combines price and volume data to identify overbought and oversold conditions, detect divergences, and generate clear trading signals with dual-mode operation and comprehensive visual features. 🔧 How It Works The Money Flow Index (MFI) is often referred to as the volume-weighted Relative Strength Index (RSI). It uses both price and volume to measure buying and selling pressure, providing a more complete picture of market dynamics than price-only oscillators. Core Calculation Logic: The MFI calculation follows these steps: Typical Price: (High + Low + Close) / 3 for each period Money Flow: Typical Price × Volume Money Flow Ratio: If Typical Price increases, it's Positive Money Flow If Typical Price decreases, it's Negative Money Flow Money Flow Ratio = (Sum of Positive Money Flow over n periods) / (Sum of Negative Money Flow over n periods) MFI: 100 - (100 / (1 + Money Flow Ratio)) The resulting oscillator oscillates between 0 and 100, with: Readings above 80 suggesting overbought conditions (potential reversal down) Readings below 20 suggesting oversold conditions (potential reversal up) 50 level serving as the centerline indicating neutral momentum The indicator compares MFI to a reference line that can be either: The traditional 50 level (centerline) A user-defined moving average of MFI itself (MFI MA mode) ✨ Key Features 🔹 Dual Operating Modes 50 Level Mode: Classic MFI implementation where signals occur when MFI crosses above or below the 50 centerline, indicating momentum shifts MFI MA Mode: Enhanced version where signals occur when MFI crosses its own moving average, providing smoother, filtered entries 🔹 Flexible Moving Average Selection Choose from six MA types for the MFI MA mode: EMA (Exponential Moving Average) for responsive signals SMA (Simple Moving Average) for smoother readings RMA (Rolling Moving Average) for weighted recent data WMA (Weighted Moving Average) for customizable weighting VWMA (Volume-Weighted Moving Average) incorporating volume HMA (Hull Moving Average) for reduced lag 🔹 Customizable MFI Parameters Length MFI: Lookback period for MFI calculation (default 14) Source MFI: Price source for calculations (default Close) 🔹 Volume Integration Unlike price-only oscillators, MFI incorporates volume, making it particularly effective for identifying genuine buying and selling pressure. 🔹 Customizable Color Themes Eight distinct color schemes to match your charting preferences: Classic – Green for bullish, Red for bearish Modern – White for bullish, Purple for bearish Robust – Amber for bullish, Maroon for bearish Accented – Violet for bullish, Pink for bearish Monochrome – Light gray for bullish, Dark gray for bearish Moderate – Green for bullish, Red for bearish Aqua – Blue for bullish, Orange for bearish Cosmic – Pink for bullish, Purple for bearish 🔹 Comprehensive Visual Feedback Colored MFI Line: Changes color based on position relative to the reference line Signal Line: Yellow line showing 50 or MA reference Gradient Fill Zones: Clear visualization of overbought (above 80) and oversold (below 20) conditions Dynamic Zone Fills: Semi-transparent fills showing when MFI is above or below the reference line Color-Coded Candles: Bars reflect current MFI bias (above or below reference) Signal Markers: Triangle up/down symbols at crossover points Live Value Display: Current MFI value shown in a floating label Trend Table: Bullish/Bearish status displayed on the chart 🔹 Ready-to-Use Alerts Built-in alert conditions trigger LONG signals on bullish crossovers and SHORT signals on bearish crossunders across both operating modes. ⚙️ Settings Summary Color Choice: Select from eight visual themes (Default: Classic) Length MFI: Lookback period for MFI calculation (Default: 14) Source MFI: Price source for calculations (Default: Close) Entry/Exit Signal: Choose between 50 level or MFI MA mode (Default: 50) Length MA: Moving average period for MFI MA mode (Default: 365) MFI MA Type: Moving average method for signal line (Default: EMA) 📈 Practical Applications 🔹 Overbought/Oversold Detection Traditional MFI usage identifies extreme conditions: Readings above 80 suggest overbought conditions and potential reversal down Readings below 20 suggest oversold conditions and potential reversal up The indicator provides gradient fills in these zones for visual clarity Volume weighting makes these signals more reliable than RSI alone 🔹 Centerline Crossovers In 50 Level mode, crossovers provide momentum signals: Crossover above 50 → Bullish momentum strengthening (buying pressure exceeding selling pressure) Crossunder below 50 → Bearish momentum strengthening (selling pressure exceeding buying pressure) 🔹 Signal Line Crossovers In MFI MA mode, crossovers between MFI and its moving average provide filtered signals that reduce whipsaws in ranging markets while maintaining sensitivity in trends. 🔹 Divergence Trading MFI is excellent for spotting divergences, often more reliable than price-only oscillators due to volume confirmation: Bullish Divergence: Price makes lower low, MFI makes higher low → Potential upside reversal (weakening selling pressure) Bearish Divergence: Price makes higher high, MFI makes lower high → Potential downside reversal (weakening buying pressure) Divergences are most significant when occurring at extreme levels (above 80 or below 20) 🔹 Volume Confirmation The volume component adds an extra dimension: MFI rising with price confirms bullish trend (volume supporting the move) MFI falling while price rises suggests weak buying pressure (potential reversal) MFI rising while price falls suggests hidden accumulation 🔹 Failure Swings Look for MFI moves above 80 (or below 20), a pullback, and then a move beyond the previous extreme, confirmed by volume patterns. 🔹 Multiple Timeframe Analysis Compare MFI readings across different timeframes: Higher timeframe MFI confirms primary trend direction with volume confirmation Lower timeframe MFI identifies entry timing and short-term momentum shifts 🎯 Ideal For ✅ Volume-Aware Traders seeking to incorporate volume into momentum analysis ✅ Mean Reversion Traders looking for overbought and oversold opportunities with volume confirmation ✅ Divergence Traders wanting more reliable reversal signals through volume confirmation ✅ Swing Traders capturing medium-term momentum shifts with volume support ✅ System Developers needing volume-weighted momentum signals ✅ Institutional Traders who value volume analysis for confirmation 📌 Key Takeaways Volume-Weighted Momentum: Unlike RSI, MFI incorporates volume, providing a more complete picture of buying and selling pressure Dual-Mode Flexibility: Choose between classic 50-level crossovers for traditional signals or MA-smoothed signals for filtered entries Comprehensive Visualization: Color themes, gradient fills for overbought/oversold zones, candles, and labels provide immediate market awareness Divergence Capability: Volume-weighted divergences are often more reliable than price-only divergences Alert-Ready: Built-in alerts for both LONG and SHORT signals across both operating modes ⚠️ Important Notes MFI, like RSI, can remain in overbought or oversold territory for extended periods during strong trends. The default length of 14 is standard but can be adjusted for different trading styles. The 365-day MA default in MFI MA mode is designed for longer-term trend context on daily charts. Volume spikes can cause sudden MFI movements; consider using smooth volume inputs if available. Divergences are most reliable when they occur at extreme readings. Always combine with proper risk management and additional confirmation for best results. Disclaimer: This indicator is provided for educational and informational purposes only. Past performance is not indicative of future results. Always conduct thorough testing and align with your risk management strategy before live deployment.Pine Script® indicatorby Tiagorocha1989Updated 4Money Flow Index - MFI🎯 Overview This is an advanced Money Flow Index - MFI indicator that combines volume-weighted momentum analysis with dynamic moving average filtering. Unlike basic MFI implementations, this version features gradient overbought/oversold zones, multiple color themes, and a clear signal dashboard for precise money flow identification. 🧩 Core Components 1. ⚙️ Technical Foundation 📊 Primary Calculation: Uses TradingView's built-in ta.mfi() function which incorporates both price and volume data 📈 Dual Analysis Components: MFI Line: Volume-weighted momentum oscillator MA Filter: Customizable moving average acting as dynamic signal line Threshold Zones: Gradient fills for overbought and oversold conditions ⚡ Volume Integration: Unique ability to combine price action with trading volume for more reliable signals 2. 🎛️ Configuration Parameters 📏 MFI Length: Default 14 periods (standard setting) 🔄 MA Filter Settings: Length: Customizable (default 365 periods) Type: 6 options available (EMA, SMA, RMA, WMA, VWMA, HMA) 🎨 Color Themes: 5 visual schemes consistent with your indicator suite: Classic, Modern, Robust, Accented, Monochrome 📊 Signal Interpretation: 🟢 BULLISH: MFI > MA Filter (money flow above trend) 🔴 BEARISH: MFI < MA Filter (money flow below trend) ⚠️ OVERBOUGHT: MFI > 80 (potential reversal zone) ⚠️ OVERSOLD: MFI < 20 (potential reversal zone) 3. 🎨 Visual Elements 🚨 Gradient Zones: Overbought zone : Red gradient intensifying toward 100 Oversold zone : Green gradient intensifying toward 0 📋 Dashboard Display: Top-right status indicator showing "⬆️ Bullish" or "⬇️ Bearish" 📊 Dynamic Coloring: MFI line changes color based on position relative to MA ⚡ Trading Applications 📈 Primary Uses: 🎯 Money Flow Direction: MFI > MA = Bullish money flow regime MFI < MA = Bearish money flow regime 💪 Trend Strength with Volume Confirmation: MFI considers both price movement AND volume Higher volume moves have more significance Validates price trends with volume support 🚨 Extreme Zone Signals: Overbought: MFI > 80 (potential sell opportunity) Oversold: MFI < 20 (potential buy opportunity) 📊 Zone Analysis: 🔴 Overbought Zone : Red gradient fills Indicates excessive buying pressure Watch for bearish reversals 🟢 Oversold Zone : Green gradient fills Indicates excessive selling pressure Watch for bullish reversals 🟡 Equilibrium: Yellow MA line acts as volume-weighted trend filter 🎨 Customization Options 👁️ Display Features: 📊 Dual Components: Always shows both MFI line and MA filter 🎨 Gradient Visualization: Automatic fill for overbought/oversold conditions 📋 Status Dashboard: Clear bullish/bearish money flow indication 📈 Customizable MA: Choose from 6 different moving average types 🎨 Visual Themes: (Consistent suite) 🎨 Classic: Green/Red (traditional volume-weighted colors) 🚀 Modern: Cyan/Purple (contemporary) 💪 Robust: Amber/Deep Purple (high contrast) 🌈 Accented: Purple/Magenta (vibrant) ⚫⚪ Monochrome: Light Gray/Dark Gray (minimalist) 🔔 Alert System 🟢 LONG Alert: Triggers when MFI crosses above MA 🔴 SHORT Alert: Triggers when MFI crosses below MA 📧 Format: Includes ticker symbol for tracking ⚡ Key Advantages ✅ Strengths: 🎯 Volume-Weighted Accuracy: Combines price and volume for more reliable signals 💪 Overbought/Oversold Filter: Built-in 80/20 thresholds with gradient visualization 👁️ Clear Trend Identification: MA filter separates noise from meaningful money flow 🔄 Flexible Configuration: Multiple MA types for different trading styles 📊 Professional Dashboard: Immediate money flow status recognition 📊 Optimal Settings: ⚡ Short-term Trading: MFI Length 10-14, MA Length 20-50 📊 Medium-term Trading: MFI Length 14-20, MA Length 50-100 📈 Long-term Trading: MFI Length 20-30, MA Length 100-365 🏆 Unique Features: 🎯 Volume Integration: The only oscillator in your suite that includes volume data 📊 Gradient Thresholds: Visual intensity shows proximity to extremes 🎨 Consistent Design: Matches your indicator family aesthetics 📋 Money Flow Dashboard: Quick visual confirmation of volume trends 🔧 Dual Analysis: Combines oscillator with dynamic trend filter 🔄 Trading Strategies 1. Basic Money Flow Strategy: Go LONG when MFI crosses above MA from oversold Go SHORT when MFI crosses below MA from overbought Exit when opposite extreme is reached 2. Divergence Detection: Price makes higher high, MFI makes lower high → Bearish divergence (selling pressure weakening) Price makes lower low, MFI makes higher low → Bullish divergence (buying pressure increasing) 3. Volume Confirmation: Strong trend + rising MFI = High conviction move Weak trend + declining MFI = Potential reversal 📈 Performance Tips Volume Matters: MFI is most effective in markets with consistent volume Extreme Zones: levels often act as support/resistance for the indicator Divergence Signals: More reliable than simple overbought/oversold readings Trend Alignment: MFI above MA in uptrend, below MA in downtrend Confirmation: Combine with price action at key support/resistance levels This enhanced MFI indicator provides professional-grade volume-weighted analysis with intuitive visualization, allowing traders to identify money flow trends, spot potential reversals at extremes, and filter signals through the customizable moving average for higher accuracy trading decisions! 📊💰Pine Script® indicatorby Tiagorocha1989Updated 3Blockcircle Global Central Bank Balance Sheet and Money SupplyOVERVIEW This indicator aggregates money supply (M2) and central bank balance sheet data from the world's largest economies into a single, unified view of global liquidity conditions. Rather than manually tracking dozens of separate data feeds or building your own aggregation logic, you get a ready-to-use tool that pulls from FRED, TradingView Economics, and real-time FX rates to convert everything into USD terms automatically. Global liquidity has historically served as a leading indicator for risk assets. When central banks expand their balance sheets and the money supply grows, capital tends to flow into equities, crypto, and other risk-on assets. When liquidity contracts, markets often follow. This indicator gives you that macro context directly on your chart. The global liquidity movement (expansionary or contractionary) often leads to asset price appreciation/depreciation in CRYPTOCAP:BTC , SP:SPX , etc WHAT MAKES IT ORIGINAL AND DIFFERENT Combines both M2 money supply AND central bank balance sheet data in one place, whereas most existing tools focus on only one metric Aggregates 11 economies for M2 (USA, EU, China, Japan, UK, Canada, India, Russia, Brazil, Australia, Switzerland) and 10 central banks for balance sheet data Automatically handles currency conversion using live FX rates so all values display in USD Includes a dedicated US Net Liquidity calculation (Fed Balance Sheet minus Reverse Repo minus TGA) which filters out temporary distortions that other aggregate tools ignore Provides granular country by country breakdown in the information table so you can identify which central banks are driving the aggregate trend Offers four moving average types (SMA, EMA, WMA, RMA) for trend smoothing with configurable length HOW IT WORKS The indicator requests monthly M2 data from TradingView's Economics feeds for each included country. Central bank balance sheet data is pulled the same way. All non-USD values are converted using daily FX rates from major currency pairs. The script then sums these converted values to produce the Global M2 and Global CBBS lines. For US liquidity specifically, the script pulls weekly data for the Reverse Repo Program (RRP) and Treasury General Account (TGA) from FRED. Net Liquidity is calculated as: Fed Balance Sheet minus RRP minus TGA. This formula removes funds parked in reverse repos and Treasury cash balances, showing what is actually circulating in the financial system. KEY FEATURES Global M2 Money Supply line tracking 11 major economies with individual toggles for each country Global Central Bank Balance Sheet line tracking 10 central banks with individual toggles US-specific components, including Reverse Repo, TGA, and Net Liquidity as separate plot lines Moving average overlays with selectable type and length for identifying trend direction Fill the option between M2 and CBBS lines to visualize the gap between money supply and central bank assets Value labels at line endpoints showing current readings and period-over-period percentage change Comprehensive information table with optional country breakdown view Full color customization for all lines, configurable line width, and style options Alert conditions for significant M2 and CBBS changes plus MA crossover signals HOW TO USE Add to any chart and observe the overall direction of global liquidity. Rising lines generally support risk on positioning, while declining lines suggest caution Watch for divergences between the M2 and CBBS lines. If money supply grows faster than central bank assets, private credit may be expanding. If CBBS rises faster, central banks are actively injecting liquidity Use the US Net Liquidity line to understand short term dollar liquidity conditions separate from longer term global trends Enable moving averages to filter noise and identify when liquidity trends are changing direction Toggle individual countries on or off in the settings to see how specific regions contribute to the total Reference the information table for exact values and percentage changes without leaving your chart SETTINGS BREAKDOWN Table Settings: position, text size, and whether to show the country breakdown Display Settings: toggle visibility for each line, fill area, value labels, percent labels, and the info table Line Styling: customize colors for each metric, adjust line width, and select solid, dashed, or dotted style Moving Average: enable or disable MA overlays for M2 and CBBS, select MA type, and set length Global M2 Countries: individually enable or disable each of the 11 economies US Liquidity Components: toggle RRP and TGA data Global CBBS Countries: individually enable or disable each of the 10 central banks Alerts: set percentage threshold for change based alerts IMPORTANT CONSIDERATIONS Data updates depend on the publication schedule of each source. M2 and CBBS data are typically monthly with some delay. US Fed Balance Sheet, US RRP and US TGA update weekly FX conversion uses daily close rates which may introduce minor discrepancies during volatile currency periods Some emerging market data may have longer reporting lags than developed market data Hope you find it useful and impactful to your trading and investment decisions! If you have any questions at all, please just ask, happy to helpPine Script® indicatorby blockcircleUpdated 39Smart Money Flow Signals [QuantAlgo]🟢 Overview The Smart Money Flow Signals indicator synthesizes significant volume-price dynamics through multi-component analysis to identify potential accumulation and distribution phases driven by substantial market participants. It combines Money Flow Index momentum, Chaikin Money Flow accumulation patterns, volume-weighted price momentum, and buying/selling pressure metrics into a unified composite oscillator that quantifies periods of concentrated capital movement, helping traders and investors identify conditions where significant volume participants may be actively positioning across multiple market conditions and timeframes. 🟢 How It Works The indicator's core methodology lies in its weighted composite approach, where multiple volume-price components are calculated sequentially and then integrated to create a comprehensive significant flow activity signal. First, the Money Flow Index (MFI) is calculated to measure buying and selling pressure by incorporating volume into price momentum analysis: raw_money_flow = source * volume positive_flow = source >= source ? raw_money_flow : 0 negative_flow = source < source ? raw_money_flow : 0 positive_money_flow = math.sum(positive_flow, mfi_period) negative_money_flow = math.sum(negative_flow, mfi_period) money_flow_index = 100 - 100 / (1 + positive_money_flow / negative_money_flow) This creates an RSI-style momentum indicator that tracks whether money (price × volume) is flowing into or out of the asset, with values ranging from 0 to 100 where readings above 50 suggest buying pressure dominance. Then, Chaikin Money Flow (CMF) is computed to evaluate accumulation and distribution by analyzing where prices close within each bar's range, weighted by volume: money_flow_multiplier = high != low ? (close - low - (high - close)) / (high - low) : 0 money_flow_volume = money_flow_multiplier * volume volume_sma = ta.sma(volume, trend_period) chaikin_money_flow = volume_sma != 0 ? ta.sma(money_flow_volume, trend_period) / volume_sma : 0 Positive CMF values indicate accumulation (closes near the high of the range), while negative values indicate distribution (closes near the low of the range), with volume weighting emphasizing periods of significant participation. Next, Volume Analysis is performed to quantify current volume intensity relative to historical averages: volume_average = ta.sma(volume, trend_period) volume_strength = volume_average != 0 ? volume / volume_average : 1 volume_weight = math.log(volume_strength + 1) The logarithmic transformation creates a volume weight that amplifies signals during high-volume periods while preventing extreme volume spikes from overwhelming the composite calculation. Following this, Buy/Sell Pressure is quantified by comparing cumulative volume during bullish versus bearish candles: buying_pressure = math.sum(volume * (close >= open ? 1 : 0), trend_period) selling_pressure = math.sum(volume * (close < open ? 1 : 0), trend_period) pressure_ratio = (buying_pressure - selling_pressure) / (buying_pressure + selling_pressure) * 100 This creates a directional pressure ratio that reveals whether significant participants are predominantly buying or selling, expressed as a percentage between -100 (all selling) and +100 (all buying). Then, Volume-Weighted Momentum is calculated through an exponential smoothing channel that adjusts price deviation based on volume intensity: exponential_smooth_average = ta.ema(source, momentum_channel_period) deviation = ta.ema(math.abs(source - exponential_smooth_average), momentum_channel_period) channel_index = deviation != 0 ? (source - exponential_smooth_average) / (0.015 * deviation) * (1 + volume_weight * 0.5) : 0 This channel index measures how far price has deviated from its exponential average relative to typical deviation, with the volume weight multiplier (1 + volume_weight * 0.5) amplifying the signal when significant volume accompanies the price movement. Finally, the Composite Wave is constructed by combining all components with specific weighting to create the final oscillator: momentum_wave = ta.ema(channel_index, trend_period) money_flow_wave = (money_flow_index - 50) * 1.2 chaikin_flow_wave = chaikin_money_flow * 100 composite_wave = momentum_wave * 0.5 + chaikin_flow_wave * 0.3 + money_flow_wave * 0.2 smoothed_wave = ta.sma(composite_wave, signal_smoothing) This creates a multi-dimensional volume flow oscillator that combines price-volume momentum, accumulation-distribution patterns, and buying-selling pressure into a single signal, providing traders with probabilistic insights into periods of concentrated market activity and directional bias based on weighted component convergence. 🟢 Signal Interpretation ▶ Positive Values (Above Zero, Green): Composite money flow above equilibrium indicating net accumulation pressure, positive buying volume dominance, and bullish volume-price alignment = Favorable conditions for long positions, significant capital flowing into the asset = Buy/hold opportunities ▶ Negative Values (Below Zero, Red): Composite money flow below equilibrium indicating net distribution pressure, negative selling volume dominance, and bearish volume-price alignment = Unfavorable conditions for long positions, significant capital flowing out of the asset = Sell/short opportunities ▶ Extreme Overbought Zone: Excessive bullish money flow indicating potential accumulation exhaustion, where buying pressure may have reached unsustainable levels with elevated reversal risk = Caution on new longs, potential distribution phase beginning, profit-taking zone for existing positions ▶ Extreme Oversold Zone: Excessive bearish money flow indicating potential distribution exhaustion, where selling pressure may have reached unsustainable levels with elevated reversal risk = Caution on new shorts, potential accumulation phase beginning, buying opportunity zone for contrarian entries ▶ Smoothed Trend Line (White) Alignment: When the smoothed trend line confirms the composite wave direction, it validates the underlying volume-price trend and filters false signals caused by short-term noise ▶ Volume Intensity Correlation: Gradient intensity (color saturation) reflects combined wave strength, volume participation, and directional alignment, where darker/more saturated colors indicate stronger concentrated activity and higher-probability directional moves 🟢 Features ▶ Preconfigured Presets: Three optimized parameter configurations accommodate different trading styles, timeframes, and market analysis approaches. 1. "Default" provides balanced volume flow measurement suitable for swing trading on 4-hour and daily charts, offering moderate responsiveness to money flow shifts with standard RSI-equivalent MFI period and moderate smoothing for most market conditions. 2. "Fast Response" delivers heightened sensitivity optimized for active intraday trading and scalping on 1-minute to 1-hour charts, using compressed calculation periods across all components and minimal smoothing to capture rapid volume flow changes and quick trend shifts as they develop, ideal for early entry/exit opportunities with acceptance of increased signal frequency during consolidation. 3. "Smooth Trend" offers conservative extreme identification ideal for position trading and long-term analysis on daily to weekly charts, employing extended periods across all money flow components with substantial smoothing to filter short-term noise and isolate only strong, sustained accumulation and distribution phases driven by significant volume participants. ▶ Built-in Alerts: Seven alert conditions enable comprehensive automated monitoring of significant money flow transitions and extreme market states. 1. "Bullish Flow" triggers when the composite wave crosses above zero, signaling the shift from distribution to accumulation and concentrated buying activity beginning. 2. "Bearish Flow" activates when the composite wave crosses below zero, signaling the shift from accumulation to distribution and concentrated selling activity starting. 3. "Any Flow Direction Change" provides a combined notification for either bullish or bearish crossover regardless of direction, useful for general money flow momentum shifts. 4. "Extreme Overbought" alerts when the composite wave reaches or exceeds the overbought threshold (default +60), indicating excessive buying pressure and potential exhaustion. 5. "Extreme Oversold" notifies when the composite wave reaches or falls below the oversold threshold (default -60), indicating excessive selling pressure and potential capitulation. 6. "Overbought Reversal" triggers specifically when the wave crosses back down through the overbought level after being extended, signaling the beginning of distribution from extreme levels. 7. "Oversold Reversal" activates when the wave crosses back up through the oversold level after being extended, signaling the beginning of accumulation from extreme levels. ▶ Color Customization: Six visual themes (Classic, Aqua, Cosmic, Ember, Neon, plus Custom) accommodate different chart backgrounds and visual preferences, ensuring optimal contrast and immediate identification of bullish versus bearish volume flow conditions across various devices and screen sizes. Optional bar coloring provides instant visual context of current significant volume activity intensity and direction without switching between the price pane and indicator pane, enabling traders and investors to immediately assess volume-price positioning dynamics while analyzing price action. Pine Script® indicatorby QuantAlgo14 1.1 KMB-MACD## Description **MB-MACD** is a custom Pine Script indicator designed to enhance momentum analysis by combining a volume-based "Main Buy Ratio" (MB) calculation with a traditional MACD oscillator. The MB Ratio estimates institutional buying pressure by apportioning volume based on the candle's range and close position, providing a unique proxy for "smart money" flow. This smoothed MB value is then used as the source for MACD computation, allowing for divergence detection between price action, the MB line, and the MACD Histogram. Key features include: - **MB Line**: A histogram-style plot showing smoothed buy/sell ratio, colored bullishly (teal) or bearishly (pink) based on direction. - **MACD Histogram**: Standard MACD applied to the MB source, with optional smoothing. - **Divergence Detection**: Identifies bullish and bearish divergences on both the MB line and MACD Histogram, with configurable filters for momentum decay and zero-line alignment. - **Visualization Options**: Display divergence lines and labels in the indicator pane or synced as an overlay on the main chart for better context. - **Alerts**: Triggers for bullish or bearish divergences to notify users of potential reversal setups. This indicator is particularly useful for swing traders and momentum followers looking to spot hidden divergences that may signal trend reversals or continuations. It emphasizes risk management by highlighting where price and momentum decouple, but remember: divergences are probabilistic signals and should be confirmed with other tools. As this is a community-shared script, I encourage users to test it thoroughly and provide feedback. If you spot any bugs, calculation errors, or improvements (e.g., edge cases with low-volume symbols or performance issues on certain timeframes), please comment below or reach out—your input helps refine it for everyone! ## User Manual ### Introduction The **MB-MACD** indicator integrates volume analysis with MACD to detect divergences in price and momentum. The core innovation is the "Main Buy Ratio" (MB), which approximates buying vs. selling volume within each bar based on its range and close position. This MB value is smoothed and fed into a MACD calculation, enabling divergence scans on both the MB line and the resulting MACD Histogram. Divergences occur when price makes higher highs/lower lows, but the oscillator (MB or Histogram) fails to confirm—often signaling potential reversals. The script offers flexible display options, filters to reduce false positives, and alerts for real-time notifications. **Important Notes:** - This is not financial advice; use it for educational purposes and backtest on your symbols/timeframes. - Works best on liquid stocks or indices with reliable volume data (e.g., daily or higher timeframes). - Performance may vary on low-volume assets or during after-hours trading. - If you encounter issues (e.g., no divergences detected or rendering errors), check your chart settings and report them in the comments for community debugging. ### Inputs Explanation The inputs are grouped for ease of configuration. Adjust them via the indicator's settings panel in TradingView. #### Core Parameters - **Show MB Line** (Default: True): Enables/disables the MB Ratio histogram plot. - **Show MACD Histogram** (Default: True): Enables/disables the MACD line and histogram plots. - **MB Smoothing (SMA)** (Default: 10, Min: 1): Length for smoothing the raw MB Ratio using a Simple Moving Average (SMA). Higher values reduce noise but may lag. - **Pivot Lookback Length** (Default: 5, Min: 2): Bars to look back/forward for detecting price pivots (highs/lows) used in divergence logic. - **Max Lines Kept** (Default: 100, Min: 10): Limits the number of divergence lines/labels to prevent chart clutter. #### Display Settings - **Show Lines (Indicator Pane)** (Default: True): Draws divergence lines on the MB line in the indicator pane. - **Show Labels (Indicator Pane)** (Default: True): Adds labels (e.g., "L" for line divergence) at divergence points in the pane. - **Show Hist Divergence Lines** (Default: True): Draws dashed lines for MACD Histogram divergences in the pane. - **Show Hist Divergence Labels** (Default: True): Adds labels (e.g., "H" for histogram divergence) in the pane. - **Sync Lines to Main Chart (Overlay)** (Default: True): Mirrors divergence lines and labels onto the main price chart for context (slightly offset for visibility). #### Filters & Tolerance - **Peak Alignment Tolerance (Bars)** (Default: 5, Min: 0): Allows flexibility in matching oscillator peaks/valleys to price pivots (e.g., within ±5 bars). - **Max Divergence Distance (Bars)** (Default: 20, Min: 5): Maximum bars between two pivots for a valid divergence; prevents detecting overly distant signals. - **Enable Momentum Decay Filter** (Default: True): For Histogram divergences, requires the current peak/valley to have a smaller absolute value than the previous (indicating convergence/decay). - **Enable Zero-Side Filter** (Default: False): Ensures both peaks/valleys in a divergence are on the same side of the zero line (e.g., both positive or both negative). #### MACD Settings - **MACD Fast Length** (Default: 12): Fast EMA length for MACD. - **MACD Slow Length** (Default: 26): Slow EMA length for MACD. - **MACD Signal Length** (Default: 9): Smoothing length for the MACD signal line. - **MACD Source Smoothing** (Default: 3, Min: 1): Additional SMA smoothing applied to the MB Ratio before MACD calculation. ### How It Works 1. **MB Ratio Calculation**: For each bar, the script computes the position of the close within the high-low range (0-1). This scales the volume into "buy" and "sell" portions, then derives a net ratio (-100% to +100%). It's smoothed via SMA for the final MB line. 2. **MACD Application**: The (optionally smoothed) raw MB is used as the MACD source, producing a MACD line, signal line, and histogram. 3. **Pivot Detection**: Uses Pine's `ta.pivothigh`/`ta.pivotlow` to find price highs/lows over the lookback period. 4. **Divergence Scanning**: - **Bearish (on Highs)**: Price makes a higher high, but MB/Hist makes a lower high. - **Bullish (on Lows)**: Price makes a lower low, but MB/Hist makes a higher low (closer to zero). - Scans nearby bars for oscillator matches and applies filters. 5. **Rendering**: Lines/labels are drawn in the indicator pane or overlaid on the chart. Colors: Teal for bullish, Pink/Maroon for bearish. 6. **Cleanup**: Automatically removes old lines/labels to stay under the max limit. ### Interpreting the Outputs - **MB Line (Columns)**: Positive (teal) indicates net buying pressure; negative (pink) shows selling. Watch for crossovers above/below zero as momentum shifts. - **MACD Histogram (Area)**: Green/teal for positive momentum; red/maroon for negative. Widening bars suggest strengthening trends; narrowing indicates weakening. - **Divergence Lines/Labels**: - Solid lines: MB line divergences (thicker, labeled "L"). - Dashed lines: Histogram divergences (thinner, labeled "H"). - Bullish: Teal lines sloping up (potential bottom reversal). - Bearish: Pink lines sloping down (potential top reversal). - **Overlay on Chart**: Lines connect price pivots (or offset slightly for Histogram). Use this to visualize how divergences align with candlesticks. - **Zero Line**: Gray horizontal line; divergences filtered by side if enabled. **Example Usage**: - On a daily stock chart, enable overlays and watch for a bullish "L" or "H" label near a price low—could signal a buy if confirmed by volume breakout. - In a downtrend, bearish divergences on highs might warn of further downside. ### Alerts - **Bullish Divergence (L or H)**: Triggers on any detected bullish divergence (MB or Histogram). - **Bearish Divergence (L or H)**: Triggers on bearish divergences. - Set up via TradingView's alert menu: Select the indicator, choose the condition, and customize the message (e.g., includes ticker). ### Troubleshooting / Known Issues - **No Divergences Shown**: Increase "Peak Alignment Tolerance" or reduce filters. Ensure pivot length suits your timeframe (shorter for intraday). - **Too Many Lines/Labels**: Lower "Max Lines Kept" or increase "Max Divergence Distance" to filter distant signals. - **Performance on Low-Volume Symbols**: MB Ratio may be unreliable; test on high-volume assets first. - **Rendering Errors**: If lines don't appear, check chart zoom or ensure "force_overlay=true" isn't conflicting with other indicators. - **NaN/Undefined Values**: Rare on live data but possible in historical backtests; report with symbol/timeframe for fixes. ### Feedback and Contributions This script is open for community improvement! If you find bugs (e.g., false positives in divergences, calculation edge cases, or UI glitches), or have suggestions (like additional filters or visualizations), please share in the comments. Your feedback helps make it better—let's debug and enhance it together!Pine Script® indicatorby Kuokkuok050326777 mean reversion engineA guy asked his librarian if they had any books on "paranoia." She leaned in and whispered, "They're right behind you." He hasn't been back to the library since.Pine Script® indicatorby barcodedev363D Isometric MFI (Christmas Edition) [Kodexius]3D Isometric MFI (Christmas Edition) is a visual-first interpretation of the classic Money Flow Index, rendered as a projected 3D-style ribbon using an isometric mapping. Instead of plotting a standard oscillator line, the script reconstructs recent MFI history as a depth-aware ribbon that moves from back to front, producing a layered perspective effect that helps you read momentum shifts, regime transitions, and relative strength changes as a continuous structure. This Christmas Edition was also built for fun and as a creative seasonal experiment. The goal is to keep the underlying indicator logic familiar, while presenting it in a playful, “3D showroom” style that looks great in a separate oscillator panel. The indicator is designed for presentation quality and chart readability. It uses controlled object management (lines, polylines, labels) and renders only the most recent portion of the MFI history (user-defined depth). A decorative snow background effect adds atmosphere. 🔹 Features 🎄 🔸 Isometric 3D Projection Engine The ribbon is produced by projecting 3D points (time offset, MFI value, depth) into 2D chart coordinates. - X represents bar offset into history - Y represents the MFI value - Z introduces depth and perspective Angle controls the projection direction, and Vertical Zoom scales the perceived amplitude. 🔸 Depth-Limited Ribbon Rendering (Back to Front) Only the most recent History Depth values are drawn to keep performance and readability stable. - Each segment connects two consecutive MFI values - A top edge, bottom edge, and filled face are drawn to simulate thickness - Older segments fade into the background 🔸 Dynamic Gradient Coloring + Depth Fade Ribbon color follows a value-based gradient: - Lower values lean red (risk-off pressure) - Higher values lean green (risk-on pressure) - Mid values blend naturally Transparency increases with depth so older history is less dominant but still readable. 🔸 Tip Label (Value + Candy Marker) 🍭🍬 The most recent ribbon tip displays current MFI value. A candy symbol that switches based on the 50 midpoint The label is offset so it does not cover the ribbon tip. 🔸 Projected Reference Grid (80, 50, 20) A projected grid is drawn at classic MFI reference levels to improve orientation: - 80 Overbought reference - 50 Midpoint reference - 20 Oversold reference These grid lines use the same projection math, so they stay aligned at any angle or zoom. 🔸 Seasonal Snow Background Effect ❄️ Randomized snow is rendered behind the ribbon using lightweight labels. This is purely decorative and does not alter MFI values or logic. 🔸 Object Lifecycle Management Because 3D-style drawing uses many objects, the script manages them explicitly by storing references in arrays, deleting old objects, and redrawing on the last bar. This helps prevent visual stacking artifacts and keeps the panel clean. 🔹 Calculations 1) Money Flow Index Computation The script separates “positive” and “negative” money flow based on the direction of change in the selected source, then converts their ratio into the standard 0 to 100 oscillator. Classic MFI Calculations. calc_mfi(int length, float source) => float upper = math.sum(volume * (ta.change(source) <= 0 ? 0 : source), length) float lower = math.sum(volume * (ta.change(source) >= 0 ? 0 : source), length) float mfi = 100.0 if lower != 0 float r = upper / lower mfi := 100 - (100 / (1 + r)) mfi Interpretation: upper accumulates volume-weighted source values on up moves lower accumulates volume-weighted source values on down moves if lower is zero, MFI defaults to 100 to avoid division errors otherwise, MFI is computed from the ratio transform 2) History Buffer Management The current MFI value is pushed into the front of an array every bar. The array is trimmed to History Depth so rendering stays bounded. array.unshift(ctx.history_val, mfi_curr) if ctx.history_val.size() > depth ctx.history_val.pop() 3) 3D Point Model and Ribbon Thickness Each segment is built from four projected points to form a filled face (a simple quad). A small thickness is applied to create the “ribbon” look, and depth is used to simulate perspective. 4) Isometric Projection to Chart Coordinates 3D points are mapped into chart coordinates with an angle rotation and scaling for zoom and depth. method project(Point3 p, int anchor_bar, float angle_rad, float zoom, float z_scale) => float x_world = -float(p.x) * 2.0 float z_val = p.z * z_scale float screen_x_offset = (x_world * math.cos(angle_rad)) - (z_val * 1.0) float screen_y_offset = (p.y * zoom) + (x_world * math.sin(angle_rad)) * 0.5 int final_x = anchor_bar + int(math.round(screen_x_offset)) float final_y = screen_y_offset chart.point.from_index(final_x, final_y) 5) Gradient and Depth Transparency Color is derived from MFI value via a gradient, and transparency increases with segment depth so recent data remains dominant while older context stays visible. 6) Projected Reference Grid Construction The 80, 50, 20 levels are drawn as dotted segments across the same historical span, using the same projection and depth fade logic for consistent alignment. 🎆 Wishing you a great year ahead 🎄✨ May your charts be clear, your risk be controlled, and your next year be filled with health, peace, and good trades. Happy Holidays and Happy New Year.Pine Script® indicatorby UnknownUnicorn113699460Updated 20Participation-Weighted Orderflow Bubbles (HTF / LTF Context ToolThis indicator visualizes participation-weighted market pressure by aggregating lower-timeframe price and volume data into higher-timeframe context bubbles. It is designed to help identify directional dominance, balance, and absorption across timeframes. This is a context and bias tool, not a trade signal generator. What the indicator shows Each bubble represents a single chart bar, built from lower-timeframe candles. Total Notional Aggregated volume multiplied by price from lower-timeframe candles. Buy / Sell Proxies Lower-timeframe candles are classified based on where they close within their range: – Close near the high → buy-side proxy – Close near the low → sell-side proxy – Middle of the range → neutral Delta (USD and %) Buy proxy notional minus sell proxy notional, expressed as both absolute USD delta and percentage of total notional. Bubble colors Green Buy-side participation dominance. Sell color (user configurable) Sell-side participation dominance. The default is chosen for visibility on bearish candles and can be changed in settings. Grey Balanced participation. Indicates two-way trade, consolidation, or auction. Yellow (Absorption) High notional with limited price movement, suggesting potential absorption or distribution. Coloring uses both relative dominance (delta percentage) and absolute dominance (minimum delta in USD), which improves behavior on higher timeframes. Bubble size and visuals Bubble size scales with total notional. HD glow layers adapt automatically by timeframe. Bubbles are drawn in front of candles for clarity. Optional text displays delta and total notional. Hovering over a bubble shows detailed information including total notional, buy/sell/neutral proxies, delta values, absorption status, and the number of lower-timeframe candles used. Timeframe behavior The indicator is designed to work across multiple timeframes. On higher timeframes, more grey bubbles are expected due to natural auction and balance behavior. Colored bubbles on higher timeframes represent sustained participation rather than short-term momentum. Visual density and performance are automatically adjusted on higher timeframes. How to use it Recommended workflow: 1. Higher timeframe (1H, 4H, Daily) Use the bubbles to identify dominant buy or sell participation, balance zones, and absorption near highs or lows. 2. Lower timeframe (5m, 15m) Take trades in alignment with the most recent higher-timeframe dominance. Be cautious or range-focused inside higher-timeframe balance zones. Use structure and price action for entries. What this indicator is not This indicator does not show true bid/ask data. It does not display actual market versus limit orders. It does not replace a DOM or exchange orderflow feed. It should not be used as a standalone entry signal. The indicator works within TradingView’s available data and provides a probabilistic, participation-weighted view of market pressure rather than true tape or orderflow data. Best practices Use a 1-minute lower timeframe for best results. Avoid setting the lower timeframe too high relative to the chart timeframe. Combine this tool with structure, levels, and session context. Treat grey bubbles as information about balance, not as noise. This tool is intended for traders who want better context and bias, not more signals. Pine Script® indicatorby shabahat_kazmi12325MFI Volume Profile [Kodexius]The MFI Volume Profile indicator blends a classic volume profile with the Money Flow Index so you can see not only where volume traded, but also how strong the buying or selling pressure was at those prices. Instead of showing a simple horizontal histogram of volume, this tool adds a money flow dimension and turns the profile into a price volume momentum heat map. The script scans a user controlled lookback window and builds a set of price levels between the lowest and highest price in that period. For every bar inside that window, its volume is distributed across the price levels that the bar actually touched, and that volume is combined with the bar’s MFI value. This creates a volume weighted average MFI for each price level, so every row of the profile knows both how much volume traded there and what the typical money flow condition was when that volume appeared. On the chart, the indicator plots a stack of horizontal boxes to the right of current price. The length of each box represents the relative amount of volume at that price, while the color represents the average MFI there. Levels with stronger positive money flow will lean toward warmer shades, and levels with weaker or negative money flow will lean toward cooler or more neutral shades inside the configured MFI band. Each row is also labeled in the format Volume , so you can instantly read the exact volume and money flow value at that level instead of guessing. This gives you a detailed map of where the market really cared about price, and whether that interest came with strong inflow or outflow. It can help you spot areas of accumulation, distribution, absorption, or exhaustion, and it does so in a compact visual that sits next to price without cluttering the candles themselves. Features Combined volume profile and MFI weighting The indicator builds a volume profile over a user selected lookback and enriches each price row with a volume weighted average MFI. This lets you study both participation and money flow at the same price level. Volume distributed across the bar price range For every bar in the window, volume is not assigned to a single price. Instead, it is proportionally distributed across all price rows between the bar low and bar high. This creates a smoother and more realistic profile of where trading actually happened. MFI based color gradient between 30 and 70 Each price row is colored according to its average MFI. The gradient is anchored between MFI values of 30 and 70, which covers typical oversold, neutral and overbought zones. This makes strong demand or distribution areas easier to spot visually. Configurable structure resolution and depth Main user inputs are the lookback length, the number of rows, the width of the profile in bars, and the label text size. You can quickly switch between coarse profiles for a big picture and higher resolution profiles for detailed structure. Numeric labels with volume and MFI per row Every box is labeled with the total volume at that level and the average MFI for that level, in the format Volume . This gives you exact values while still keeping the visual profile clean and compact. Calculations Money Flow Index calculation currentMfi is calculated once using ta.mfi(hlc3, mfiLen) as usual, Creation of the profileBins array The script creates an array named profileBins that will hold one VPBin element per price row. Each VPBin contains volume which is the total volume accumulated at that price row mfiProduct which is the sum of volume multiplied by MFI for that row The loop; for i = 0 to rowCount - 1 by 1 array.push(profileBins, VPBin.new(0.0, 0.0)) pre allocates a clean structure with zero values for all rows. Finding highest and lowest price across the lookback The script starts from the current bar high and low, then walks backward through the lookback window for i = 0 to lookback - 1 by 1 highestPrice := math.max(highestPrice, high ) lowestPrice := math.min(lowestPrice, low ) After this loop, highestPrice and lowestPrice define the full price range covered by the chosen lookback. Price range and step size for rows The code computes float rangePrice = highestPrice - lowestPrice rangePrice := rangePrice == 0 ? syminfo.mintick : rangePrice float step = rangePrice / rowCount rangePrice is the total height of the profile in price terms. If the range is zero, the script replaces it with the minimum tick size for the symbol. Then step is the price height of each row. This step size is used to map any price into a row index. Processing each bar in the lookback For every bar index i inside the lookback, the script checks that currentMfi is not missing. If it is valid, it reads the bar high, low, volume and MFI float barTop = high float barBottom = low float barVol = volume float barMfi = currentMfi Mapping bar prices to bin indices The bar high and low are converted into row indices using the known lowestPrice and step int indexTop = math.floor((barTop - lowestPrice) / step) int indexBottom = math.floor((barBottom - lowestPrice) / step) Then the indices are clamped into valid bounds so they stay between zero and rowCount - 1. This ensures that every bar contributes only inside the profile range Splitting bar volume across all covered bins Once the top and bottom indices are known, the script calculates how many rows the bar spans int coveredBins = indexTop - indexBottom + 1 float volPerBin = barVol / coveredBins float mfiPerBin = volPerBin * barMfi Here the total bar volume is divided equally across all rows that the bar touches. For each of those rows, the same fraction of volume and volume times MFI is used. Accumulating into each VPBin Finally, a nested loop iterates from indexBottom to indexTop and updates the corresponding VPBin for k = indexBottom to indexTop by 1 VPBin binData = array.get(profileBins, k) binData.volume := binData.volume + volPerBin binData.mfiProduct := binData.mfiProduct + mfiPerBin Over all bars in the lookback window, each row builds up total volume at that price range total volume times MFI at that price range Later, during the drawing stage, the script computes avgMfi = bin.mfiProduct / bin.volume for each row. This is the volume weighted average MFI used both for coloring the box and for the numeric MFI value shown in the label Volume .Pine Script® indicatorby UnknownUnicorn113699460Updated 77Global M2 Money Supply (100+ countries, USD, Offset)Global M2 Money Supply: -potentially 100+ countries - countries can be added in Script, -USD, Offset -offset in months can be manually adjusted to account for the time that i takes for liquidity to hit the marketPine Script® indicatorby PeterURosslerUpdated 18Twiggs Go Money Flow Enhanced [KingThies]█ OVERVIEW The Twiggs Money Flow (TMF) is a volume-weighted momentum oscillator that measures buying and sellistng pressure by analyzing where price closes within each bar's true range. It's an enhanced version of Chaikin Money Flow that uses Wilder's smoothing method, providing better trend persistence and smoother signals. The indicator oscillates around a zero listne: Values above zero indicate accumulation (buying pressure) Values below zero indicate distribution (sellistng pressure) TMF was developed by Colistn Twiggs as an improvement over traditional money flow indicators by incorporating true range calculations and Wilder's exponential moving average. █ CONCEPTS True Range Boundaries TMF calculates a modified true range for each bar by comparing the current bar's high and low with the previous close: True Range High = maximum of (previous close, current high) True Range Low = minimum of (previous close, current low) This accounts for overnight gaps and ensures price continuity between bars. Average Daily Value (ADV) The ADV represents the portion of volume attributable to buying versus sellistng: ADV = Volume × ((Close - TR Low) - (TR High - Close)) / True Range When price closes near the high of the true range, ADV is positive and large. When price closes near the low, ADV is negative and large. A close in the middle produces values near zero. Wilder's Moving Average Unlistke simple moving averages, Wilder's smoothing method gives more weight to recent values while maintaining memory of historical data: WMA = (Previous WMA × (Period - 1) + Current Value) / Period This creates smoother trends that are less prone to whipsaws than standard moving averages. Final Calculation TMF = Wilder's MA(ADV, Period) / Wilder's MA(Volume, Period) By dividing smoothed ADV by smoothed volume, TMF normalistzes the reading and makes it comparable across different securities and timeframes. █ HOW TO USE Zero listne Crossovers The most straightforward trading signals: A cross above zero suggests buyers are gaining control. Consider this a bullistsh signal, especially when confirmed by price action. A cross below zero suggests sellers are gaining control. Consider this a bearish signal. The longer TMF remains above or below zero, the stronger the trend. Extreme Values Strong positive or negative readings indicate intense buying or sellistng pressure: Sustained high positive values (above +0.4) suggest strong accumulation but may also indicate overbought conditions. Sustained low negative values (below -0.4) suggest strong distribution but may also indicate oversold conditions. These extremes work best when used in conjunction with price levels and support/resistance zones. Divergences Divergences between price and TMF often signal potential reversals: Bearish divergence: Price makes a higher high but TMF makes a lower high — suggests buying pressure is weakening despite rising prices. Bullistsh divergence: Price makes a lower low but TMF makes a higher low — suggests sellistng pressure is weakening despite fallistng prices. Trend Confirmation Use TMF to confirm the strength of existing trends: In an uptrend, TMF should remain mostly positive with occasional dips below zero. In a downtrend, TMF should remain mostly negative with occasional rises above zero. If TMF contradicts the price trend, consider the trend weak or potentially ending. █ FEATURES Period (default: 21) The lookback length for Wilder's moving average calculation: Shorter periods (10–15) make TMF more responsive to recent changes but increase noise and false signals. Longer periods (30–50) create smoother readings but lag price action more significantly. The default 21-period setting balances responsiveness with relistabilistty. Consider adjusting the period based on your trading timeframe and the volatilistty of the security you're analyzing. █ LIMITATIONS TMF is a lagging indicator due to its smoothing method. Signals may occur after optimal entry or exit points. In low-volume or illistquid markets, TMF can produce erratic readings that may not reflect true buying or sellistng pressure. Ranging or choppy markets often generate frequent zero-listne crosses that can lead to whipsaws. listke all volume-based indicators, TMF's relistabilistty depends on accurate volume data. For securities with unrelistable volume reporting, consider using price-based momentum indicators instead. █ NOTES This indicator uses area-style plotting in the original version to visualistze the magnitude of buying and sellistng pressure. The filled area makes it easy to see at a glance whether the market is in accumulation or distribution mode. TMF works on any timeframe but tends to be most relistable on daily charts where volume data is most accurate and meaningful. █ CREDITS Original indicator developed by LazyBear . Based on the Twiggs Money Flow concept from Incredible Charts: Incredible Charts – Twiggs Money Flow . Pine Script® indicatorby kingthies35Delta Money Flow IndexThe Delta Money Flow Index is a modified version of the traditional Money Flow Index that uses directional volume instead of total volume to measure buying and selling pressure in a different way. It helps traders identify overbought/oversold conditions based on actual buy/sell pressure rather than just total volume. It's designed for traders who want to see if price movements are backed by genuine buying or selling activity. How to use it: - Values above 80 indicate overbought conditions - Values below 20 indicate oversold conditions - The 50 level acts as a neutral zone. Above suggests buyers are in control, below suggests sellers are in control. - Traders can check for divergences for potential reversal signals - Works best on intraday timeframes where delta volume is most meaningful What makes it different: Unlike the standard MFI which uses total volume, the Delta MFI calculates an approximation of volume delta by assigning positive volume to up-closing candles and negative volume to down-closing candles. This means: - It focuses on directional pressure, not just activity - Filters out low-conviction volume that doesn't move price - Provides clearer signals when actual buying/selling dominates The indicator includes visual aids like background colors for overbought/oversold and a fill showing whether the Delta MFI is above or below the 50 midpoint for quick interpretation. Pine Script® indicatorby VEGAlgoUpdated 2157Flow Control Oscillator (FCO)Flow Control Oscillator (FCO) The Flow Control Oscillator (FCO) is a momentum-based indicator that combines volume analysis and money flow to determine who is in control of the market—buyers or sellers—and how strong that control is. Unlike pure price-based oscillators, FCO integrates both price action and volume distribution to provide a more complete picture of market dynamics. How It Works Core Components: Money Flow Index (MFI) - Scaled to -1 to +1 range Measures the flow of money into and out of an asset Identifies buying and selling pressure based on price and volume Chaikin Money Flow (CMF) - Already in -1 to +1 range Measures the accumulation/distribution of volume Shows whether volume is accumulating (buying) or distributing (selling) Combined Flow Control Line (FCO Line) - Equal-weighted composite of MFI and CMF Smoothed with SMA (default: 3 periods) Values above 0 = Buyers in control Values below 0 = Sellers in control Signal Line - WMA of the FCO line (default: 6 periods) Used for timing entries and confirming momentum shifts Momentum Histogram- Shows the rate of change in buyer/seller control Weighted by ADX (Average Directional Index) when enabled Larger bars = stronger momentum ADX weighting filters out choppy, unreliable signals Key Zones Neutral Zone (-0.3 to +0.3): Balanced market, low conviction Healthy Trend Zone (±0.3 to ±0.7): Clear control without exhaustion Warning Zone (±0.7 to ±1.0): Extended, approaching exhaustion Extreme Zone (beyond ±1.0): Overbought/oversold, reversal likely What To Look For Reversal Setups: FCO in extreme zone (beyond ±1.0) FCO crosses Signal line in opposite direction Momentum histogram shrinking (weakening pressure) Interpretation: Buyers or sellers are exhausted and losing control Trend Strength Setups: FCO crosses zero line (control shift) Momentum histogram growing in the same direction ADX confirms strong trend (no orange background) Signal line moving in same direction as FCO Interpretation: New control being established with building momentum Divergences: Price makes new high/low but FCO doesn't confirm Indicates weakening momentum despite price movement Early warning of potential reversal Choppy Market Warning: Orange background (ADX < 20) Small momentum bars regardless of FCO position Interpretation: Weak trend, avoid trading or use tight stops Best Practices: Use with context: Combine with support/resistance levels (like VWAP) for confluence Multi-timeframe confirmation: Check higher timeframe FCO for overall bias Wait for confirmation: Let signals develop rather than predicting turns Respect extreme zones: Best reversal opportunities occur when FCO is beyond ±1.0 Filter with ADX: Pay attention to background coloring—avoid choppy conditions The indicator includes comprehensive alert conditions for: Reversal setups (extreme + cross + weakening momentum) Trend strength signals (zero cross + growing momentum + strong ADX) FCO/Signal crossovers Extreme overbought/oversold conditions Control shifts (buyers/sellers taking control) Pine Script® indicatorby WalrusQuantUpdated 3133RSI + MFIRSI and MFI combined, width gradient fields if OS or OB, shows divergences separate for wicks and bodies, shows dots when mfi and rsi oversold at the same time. Pine Script® indicatorby wilinskilukasz72Aggregated Open Interest Multi-Exchange (USD)This indicator aggregates Open Interest (OI) data from multiple major cryptocurrency exchanges into a single unified view in USD, using data available on TradingView. It automatically adapts to the asset you're viewing on the chart. Features: Aggregates OI from 7 major exchanges: Binance, Bybit, OKX, Bitget, Deribit, HTX, and Coinbase All values converted to USD - unlike native OI which shows contracts/coins Uses only data available on TradingView platform Automatically detects the asset from your chart (BTC, ETH, SOL, etc.) True apples-to-apples comparison across exchanges Displays as candlesticks showing OI open, high, low, and close Toggle exchanges on/off individually Handles different contract types per exchange automatically Why USD conversion matters: Traditional OI indicators show values in contracts or crypto units, making it difficult to compare across exchanges. This indicator converts everything to USD, giving you the real dollar value of open positions across all exchanges. How it works: Simply add the indicator to any crypto perpetual futures chart. It will automatically fetch and aggregate OI data from all supported exchanges for that asset using TradingView's built-in data feeds, converting everything to USD. Supported Exchanges: Binance, Bybit, Bitget, HTX: USDT perpetuals Deribit: BTC/ETH use USD contracts, others use USDC OKX: Contract-based (automatically converted) Coinbase: USDC perpetuals Perfect for traders who want a comprehensive view of total market Open Interest in USD across exchanges using reliable TradingView data. Pine Script® indicatorby carlosbucciUpdated 2121- Standardized Money Flow Index with Multi-MA and BB OverlayThis custom Money Flow Index (MFI) script enhances the standard MFI by introducing multiple layers of configurability, statistical normalization, and visual clarity. It begins with the traditional MFI calculation using the average price, hlc3, and a user-defined length, then offers the option to standardize the output. Standardization transforms the MFI into a z-score by subtracting a rolling mean and dividing by a rolling standard deviation, making the indicator statistically interpretable across different assets, timeframes, and volatility regimes. When standardization is active, the overbought and oversold thresholds shift from the conventional 80 and 20 to +2 and –2, aligning them with standard deviation boundaries and improving signal clarity in volatile environments. Beyond standardization, the script introduces a robust smoothing engine. Users can choose from several moving average types, including SMA, EMA, SMMA (RMA), WMA, and VWMA, to reduce noise and highlight trend shifts. A particularly advanced option is the “SMA + Bollinger Bands” mode, which overlays volatility envelopes around the smoothed MFI using a user-defined standard deviation multiplier. This feature helps traders identify when the MFI is unusually high or low relative to its recent behaviour, adding a volatility-adjusted layer of insight, especially useful in momentum or mean-reversion setups. Visually, the script is designed for clarity, modularity, and flexibility. It plots the raw or standardized MFI in purple, overlays the smoothed version in yellow if enabled, and adds green Bollinger Bands when selected. It also includes horizontal reference lines for overbought, oversold, and midpoint levels, which dynamically adjust based on whether standardization is active. A shaded background between the overbought and oversold lines further enhances readability, helping traders quickly assess momentum extremes and potential inflection zones. Compared to the standard MFI, which offers a fixed calculation, limited visual feedback, and no statistical context, this enhanced version is modular, customizable, and statistically grounded. It allows traders to tailor the indicator to their strategy, whether they prefer raw signals, smoothed trends, or volatility-adjusted extremes. These enhancements make it a powerful building block for more sophisticated signal engines, especially when combined with filter gating, persistent state logic, or multi-indicator overlays. Pine Script® indicatorby chriskokal1Updated 25StratNinjaTable - VerticalA Pine Script v6 indicator that displays a vertical table with key The Strat data and supporting metrics. ✦ Table Structure: Overview: Ticker – the stock symbol. TF – the chart’s main timeframe. MFI – Money Flow Index with selectable timeframe. ATR – Average True Range with color coding: Green – below 3%. Yellow – between 3% and 6%. Red – above 6%. Timeframes: Displayed vertically (5m, 15m, 1H, D, W, M, etc.). Each shows the current bar type according to The Strat (1, 2U, 2D, 3). Text color reflects candle direction (green = close above open, red = close below open). Includes a countdown timer to bar close. Fundamentals: Market Cap – in billions. Sector – stock sector. SMA20 Δ – distance from the 20-period SMA (in %). Avg Volume (30d) – average 30-day volume (in millions). ✦ Adjustments Made: Removed the Strat Pattern section completely. Removed the DIR column – direction is now represented by Strat cell text color. Reordered Overview section: Ticker → TF → MFI → ATR. ATR now has three levels of coloring (Green/Yellow/Red) for >3% and >6%Pine Script® indicatorby koriatmanagement28Multi-Indicator Panel (RSI, Stoch, MACD, VIX Fix, MFI)A versatile single-pane oscillator panel combining RSI, Stochastic, MACD (scaled to 0–100), Williams VIX Fix (normalized & inverted: low value = high fear), and MFI. Each module is toggleable, with reference levels, background highlights, and ready-made alerts. Key features Per-indicator toggles: RSI, Stoch %K/%D, MACD (lines + optional histogram), inverted 0–100 VIX Fix, and MFI. Standard levels & center line at 50; adjustable overbought/oversold thresholds. Contextual background coloring (optional) for extreme conditions. Built-in alerts: RSI/Stoch OB/OS, MACD–Signal cross, VIX Fix “High Fear/Low Fear,” and MFI OB/OS. Unified scale: MACD mapped around 50 to align with other oscillators; VIX Fix normalized to 0–100. How to use (quick) Add the indicator → enable needed modules via “Indicator Toggles.” Tune periods & levels (e.g., RSI 14, Stoch 14/3, MACD 12-26-9, VIX Fix 22/252, MFI 14). (Optional) Turn on MACD histogram. Create alerts from “Add alert on…” using the provided conditions. Interpretation notes Inverted VIX Fix: low values ⇒ high fear/volatility (potential bounces); high values ⇒ complacency. Scaled MACD: lines around 50 ≈ MACD zero; line crosses remain valid despite scaling. Disclaimer Analysis tool, not financial advice. Test across timeframes/instruments and pair with risk management.Pine Script® indicatorby rahmadsaleh86Updated 37Show more publications12345678999

Từ khóa » Chỉ Số Mfi