OPEN-SOURCE SCRIPT
Price Imbalance Flow Tracker

📊 PIFT: Price Imbalance Flow Tracker
At first glance, PIFT might look like a standard Bollinger Band overlay slapped on a few moving averages…
It’s not.

Every part of this system is custom-tuned:
- The envelopes aren’t based on standard deviation—they’re built from smoothed price structure using average candle range.
- There’s no central mean reversion assumption—bands don’t just expand and contract randomly; they flip in and out of dominance based on trend control.
- The MA lengths (25/50/100) are deliberately chosen to sync with RIFT’s RSI layers, following a proprietary ratio rooted in how momentum and structure align over time.
- It may resemble Bollinger Bands from a distance, but this is a bespoke trend envelope engine, built for clarity, control, and confluence—not statistical noise.
A precision envelope engine for price action that mirrors RIFT’s RSI logic—because momentum and structure should speak the same language. PIFT tracks trend dominance directly on the price chart using layered moving average envelopes and dynamic fill logic.
Together with my other indicator called RIFT (Relative Imbalance Flow Tracker), it forms a two-part confluence system:
- RIFT shows who’s winning the momentum battle.
- PIFT shows who’s controlling price structure.
- Use them side by side to spot false moves, real breakouts, and trend exhaustion with confidence.
🧠 How It Works
PIFT plots three WMA-based moving averages:
🔹 25 WMA = fast reaction line
🔸 50 WMA = medium-term trend
🟣 100 WMA = long-term structural flow
Each MA gets a fixed-width envelope based on average candle range (not percent of price), so bands stay visually consistent across timeframes.
Then the script checks envelope dominance:
- If the fast band extends beyond the others → it glows.
- If not → it fades out to reduce clutter.
🎨 Color Logic
🔴 Upper Band (Red) = Overextended uptrend
🟢 Lower Band (Green) = Oversold or trending support zone
🔍 How to Read It
🔴 Red envelope dominates but price slows? = Uptrend stalling
🟢 Green envelope dominates + candles cluster near band? = Watch for bounce
✅ Fast band flips dominance = Potential breakout or reversal
⚙️ Why It’s Useful
- See when price is actually leading, not just floating between MAs
- Avoid choppy MA crosses and use envelope shape and fills to understand context
- Watch for volatility compression before major shifts
- Use with RIFT to spot momentum/price mismatches and false moves
🔗 Works Best With: RIFT
- PIFT is the price-side partner to RIFT. When both show dominance in the same direction, confidence increases.
- When one flips but the other doesn't? You're looking at either early momentum divergence (RIFT) or a structural fakeout (PIFT). Either way: you’re ahead of the candles.

At first glance, PIFT might look like a standard Bollinger Band overlay slapped on a few moving averages…
It’s not.
Every part of this system is custom-tuned:
- The envelopes aren’t based on standard deviation—they’re built from smoothed price structure using average candle range.
- There’s no central mean reversion assumption—bands don’t just expand and contract randomly; they flip in and out of dominance based on trend control.
- The MA lengths (25/50/100) are deliberately chosen to sync with RIFT’s RSI layers, following a proprietary ratio rooted in how momentum and structure align over time.
- It may resemble Bollinger Bands from a distance, but this is a bespoke trend envelope engine, built for clarity, control, and confluence—not statistical noise.
A precision envelope engine for price action that mirrors RIFT’s RSI logic—because momentum and structure should speak the same language. PIFT tracks trend dominance directly on the price chart using layered moving average envelopes and dynamic fill logic.
Together with my other indicator called RIFT (Relative Imbalance Flow Tracker), it forms a two-part confluence system:
- RIFT shows who’s winning the momentum battle.
- PIFT shows who’s controlling price structure.
- Use them side by side to spot false moves, real breakouts, and trend exhaustion with confidence.
🧠 How It Works
PIFT plots three WMA-based moving averages:
🔹 25 WMA = fast reaction line
🔸 50 WMA = medium-term trend
🟣 100 WMA = long-term structural flow
Each MA gets a fixed-width envelope based on average candle range (not percent of price), so bands stay visually consistent across timeframes.
Then the script checks envelope dominance:
- If the fast band extends beyond the others → it glows.
- If not → it fades out to reduce clutter.
🎨 Color Logic
🔴 Upper Band (Red) = Overextended uptrend
🟢 Lower Band (Green) = Oversold or trending support zone
🔍 How to Read It
🔴 Red envelope dominates but price slows? = Uptrend stalling
🟢 Green envelope dominates + candles cluster near band? = Watch for bounce
✅ Fast band flips dominance = Potential breakout or reversal
⚙️ Why It’s Useful
- See when price is actually leading, not just floating between MAs
- Avoid choppy MA crosses and use envelope shape and fills to understand context
- Watch for volatility compression before major shifts
- Use with RIFT to spot momentum/price mismatches and false moves
🔗 Works Best With: RIFT
- PIFT is the price-side partner to RIFT. When both show dominance in the same direction, confidence increases.
- When one flips but the other doesn't? You're looking at either early momentum divergence (RIFT) or a structural fakeout (PIFT). Either way: you’re ahead of the candles.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.