OPEN-SOURCE SCRIPT
Statistical Footprint

Statistical Footprint - Behavioral Support & Resistance
This indicator identifies key price levels based on actual market behavior rather than traditional pivot calculations. It analyzes how bulls and bears have historically moved price from session opens, creating statistical zones where future reactions are most likely.
The concept is simple: track how far bullish candles typically push above the open versus how far bearish candles drop below it. These patterns reveal the market's behavioral "footprint" - showing where momentum typically stalls and reverses.
Key Features:
- Separate analysis for daily and weekly timeframes
- Smart zone merging when levels cluster together (within 5 points)
- Uses both mean and median calculations for more robust levels
- XGBoost-optimized lookback periods for maximum statistical significance
- Clean zone-only display focused on actionable price areas
How it Works:
The code separates bullish and bearish sessions, measuring their typical range extensions from the open. It then projects these statistical ranges forward from current session opens, creating "behavioral zones" where the market has historically shown consistent reactions.
When daily and weekly levels align closely, they merge into combined zones with enhanced significance. Labels show both the mean and median values when they differ meaningfully.
Best Used For:
- Identifying high-probability reversal zones
- Setting profit targets based on historical behavior
- Understanding market sentiment shifts at key levels
- Confluence analysis between different timeframes
The lookback periods have been optimized using machine learning to find the most predictive historical sample sizes for current market conditions.
This indicator identifies key price levels based on actual market behavior rather than traditional pivot calculations. It analyzes how bulls and bears have historically moved price from session opens, creating statistical zones where future reactions are most likely.
The concept is simple: track how far bullish candles typically push above the open versus how far bearish candles drop below it. These patterns reveal the market's behavioral "footprint" - showing where momentum typically stalls and reverses.
Key Features:
- Separate analysis for daily and weekly timeframes
- Smart zone merging when levels cluster together (within 5 points)
- Uses both mean and median calculations for more robust levels
- XGBoost-optimized lookback periods for maximum statistical significance
- Clean zone-only display focused on actionable price areas
How it Works:
The code separates bullish and bearish sessions, measuring their typical range extensions from the open. It then projects these statistical ranges forward from current session opens, creating "behavioral zones" where the market has historically shown consistent reactions.
When daily and weekly levels align closely, they merge into combined zones with enhanced significance. Labels show both the mean and median values when they differ meaningfully.
Best Used For:
- Identifying high-probability reversal zones
- Setting profit targets based on historical behavior
- Understanding market sentiment shifts at key levels
- Confluence analysis between different timeframes
The lookback periods have been optimized using machine learning to find the most predictive historical sample sizes for current market conditions.
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.