Algoprime Friction Heatmap with Smart Signals
- Indicateurs
- Version: 6.0
- Activations: 5
What This Indicator Does
This indicator combines two powerful analytical tools into one system:
- Volume Profile Engine - Builds an institutional-grade volume profile using Pro-Rata distribution, showing exactly where trading activity occurred at each price level
- Friction Analysis - Measures how much price rejection occurred at each level, identifying strong support/resistance zones and weak breakthrough areas
- Signal Generator - Fires non-repainting signals when momentum, structure, and friction conditions align, with exact Entry, SL, TP1, and TP2 levels
Core Algorithms
1. Pro-Rata Volume Distribution
Standard volume profile indicators assign all of a candle's volume to a single price level (typically the midpoint). This method is inaccurate because volume actually occurred across the entire range of the candle.
The Pro-Rata algorithm distributes each candle's volume proportionally across all price bins that the candle's range covers. For example, if a candle trades from 1.0850 to 1.0950, volume is distributed across all bins between those levels based on how much of the candle overlaps each bin.
This produces a more accurate representation of where institutional activity actually took place.
2. True Wick Rejection Friction
Friction measures how strongly price was rejected at each level. The calculation examines the wicks (shadows) of candles that intersect with each price bin. When a candle wicks beyond a bin boundary, that wick distance is scored as rejection force.
Higher friction values indicate levels where price historically struggled to break through. Lower friction values indicate areas where price moved freely.
- Friction above 0.70 - High friction node (strong support/resistance)
- Friction between 0.30 and 0.70 - Moderate friction
- Friction below 0.30 - Low friction node (likely breakthrough area)
3. Anti-Repaint Signal Engine
All signals are calculated exclusively on closed (completed) bars. This means once a signal appears on your chart, it will never disappear, move, or change. The Entry, Stop Loss, TP1, and TP2 levels are permanent from the moment the signal is generated.
The indicator uses a state machine to track signal lifecycle:
- NONE - No active signal, system scanning for opportunities
- OPEN - Fresh signal generated (bars 1-2), entry window active
- HOLD - Signal active (bars 3-8), manage existing position
- CLOSE - Signal expired, position should be closed
- WAIT - Cooldown period (5 bars), no new signals permitted
Signal Scoring System
Every potential signal is evaluated across six components, producing a score from 0 to 100. Only signals meeting the minimum score threshold are displayed.
| Component | Max Points | What It Measures |
|---|---|---|
| Friction Context | 25 | Is price at a high-friction zone? |
| POC Proximity | 20 | How close to Point of Control? |
| Momentum Alignment | 15 | Is multi-bar momentum confirming direction? |
| Structure (VAH/VAL) | 15 | Is price near Value Area boundaries? |
| HVN Density | 10 | Are there strong friction levels nearby? |
| Multi-Bar Confirmation | 10 | Is momentum consistent across multiple bars? |
A signal only fires when ALL of these conditions are met simultaneously: minimum score threshold is satisfied, friction at entry is sufficient, smoothed momentum exceeds the threshold, price is inside the Value Area, trend alignment confirms the direction, and the cooldown period has elapsed.
Stop Loss and Take Profit Logic
The SL/TP system uses ATR (Average True Range) combined with structural price levels:
- Stop Loss: Calculated as ATR x 1.0, validated against the nearest high-friction node. If a nearby friction level exists within 0.3x to 3x the ATR distance, the SL is placed at that structural level instead.
- TP1 (Target 1): Targets the nearest high-friction node in the signal direction. Falls back to 1.5x risk distance if no nearby node exists.
- TP2 (Target 2): Targets the Value Area High/Low (structural level), capped at maximum 2.5x risk distance to prevent unrealistic targets.
The typical risk-to-reward ratio achieved ranges from 1:2.0 to 1:3.5 depending on market conditions and the specific setup.
Dashboard Display
The built-in dashboard provides all essential information in a single glance:
- Point of Control (POC), Value Area High (VAH), Value Area Low (VAL)
- Current friction percentage and status (HIGH/MODERATE/LOW)
- Count of high-friction nodes and low-friction nodes in the profile
- Active signal state (OPEN BUY, HOLD SELL, WAIT, etc.)
- Exact Entry, SL, TP1, TP2 price levels
- Risk-to-reward ratio for the current signal
- Signal strength score with visual bar representation
Additional Visual Features
- Neon gradient Volume Profile bars (color-coded by friction and volume)
- POC, VAH, VAL lines with price labels
- High-friction and low-friction labels on volume nodes
- Power labels on the strongest friction clusters
- S/R Zone highlighting for extended friction areas (up to 2 zones)
- Alert zone dotted lines at nearest high-friction levels above and below price
- Signal entry arrow with score percentage
- Entry, SL, TP1, TP2 lines extending from the signal bar
Input Parameters
Core Parameters
| Parameter | Default | Description |
|---|---|---|
| VP Lookback Period | 200 | Number of bars used to calculate the volume profile |
| Volume Profile Bins | 50 | Number of price bins for the volume profile |
| Friction Lookback | 120 | Number of bars used to calculate friction scores |
| Min Volume Threshold | 0.001 | Minimum volume as percentage of 20-bar average to display a bin |
| High Friction Level | 0.70 | Threshold above which a bin is classified as high friction |
| Low Friction Level | 0.30 | Threshold below which a bin is classified as low friction |
Signal Parameters
| Parameter | Default | Description |
|---|---|---|
| Min Signal Score | 50 | Minimum composite score required to generate a signal (0-100) |
| Signal Cooldown | 8 | Minimum bars between signal generations |
| Signal Hold Bars | 3 | Minimum bars a signal remains in HOLD state |
| Momentum Lookback | 10 | Number of bars used for momentum calculation |
| Confirmation Bars | 4 | Number of bars required for multi-bar momentum confirmation |
| Wait Bars | 5 | Cooldown bars after a signal expires before new signals are permitted |
| SL ATR Multiplier | 1.0 | Stop loss distance as a multiplier of ATR(14) |
| Momentum Threshold | 0.30 | Minimum momentum value required for a directional signal |
| Min Friction Entry | 0.25 | Minimum friction score at the entry bin required for a signal |
Display Parameters
| Parameter | Default | Description |
|---|---|---|
| Show HF/LF Labels | true | Display high-friction and low-friction labels on volume nodes |
| Show Volume Histogram | false | Display histogram bars extending from the volume profile |
| Show Alert Lines | true | Display dotted alert zone lines at nearest high-friction levels |
| Show POC/VAH/VAL | true | Display Point of Control and Value Area lines |
| Show Dashboard | true | Display the information dashboard panel |
| Show S/R Zones | true | Display support/resistance zone rectangles |
| Show Power Labels | true | Display power indicators on strong friction clusters |
| Show Signal | true | Display signal arrows, entry, SL, and TP lines |
Color Parameters
| Parameter | Default | Description |
|---|---|---|
| Dashboard BG | Gray (200,200,205) | Dashboard background color |
| Dashboard Header | Darker Gray (160,165,175) | Dashboard header background color |
| Border | (130,135,145) | Border line color |
| Main Text | Black (0,0,0) | Primary text color |
| Dim Text | Dark Gray (80,80,90) | Secondary text color |
| Neon Cyan | Teal (0,120,160) | High-friction and VAH indicator color |
| Neon Pink | Magenta (160,30,70) | Low-friction and VAL indicator color |
| Gold | (160,120,0) | Power labels and alert zone color |
| POC | Navy (30,40,80) | Point of Control line color |
| Buy | Dark Green (0,128,0) | Buy signal color |
| Sell | Dark Red (180,0,0) | Sell signal color |
| Hist Bar | Blue (50,80,160) | Volume histogram bar color |
Recommended Settings
XAUUSD (Gold) - M15
| Lookback Period | 200 |
| Num Bins | 50 |
| Friction Lookback | 120 |
| High Friction | 0.70 |
| Low Friction | 0.30 |
| Signal Min Score | 50 |
| Momentum Threshold | 0.30 |
| SL ATR Multiplier | 1.0 |
EURUSD - M15
| Lookback Period | 200 |
| Num Bins | 60 |
| Friction Lookback | 120 |
| High Friction | 0.75 |
| Low Friction | 0.25 |
| Signal Min Score | 50 |
| Momentum Threshold | 0.25 |
| SL ATR Multiplier | 1.0 |
US30 (Dow Jones) - M5
| Lookback Period | 150 |
| Num Bins | 40 |
| Friction Lookback | 100 |
| High Friction | 0.70 |
| Low Friction | 0.30 |
| Signal Min Score | 45 |
| Momentum Threshold | 0.35 |
| SL ATR Multiplier | 1.2 |
Installation
1 Copy the Benai_FrictionHeatmap.ex5 file to your MetaTrader 5 terminal's Data Folder under MQL5/Indicators/
2 Restart MetaTrader 5 or refresh the Navigator panel (Ctrl+N)
3 Find "Benai_FrictionHeatmap" in the Indicators list and drag it onto your chart
4 Set the chart background to white and foreground to black for optimal color display (right-click chart, Properties)
5 The indicator is designed with default parameters optimized for XAUUSD M15. Adjust input parameters as needed for other symbols or timeframes
Frequently Asked Questions
Does this indicator repaint?
No. All signals are calculated exclusively on closed bars. Once a signal appears, the Entry, SL, TP1, and TP2 levels are permanent and will never change.
What timeframes work best?
M15 is the primary recommended timeframe. M5 is effective for scalping approaches. H1 works for swing trading styles. The algorithm functions across all timeframes but is optimized for M15.
What symbols work best?
XAUUSD (Gold) is the primary target symbol. The indicator also performs well on major currency pairs (EURUSD, GBPUSD, USDJPY), indices (US30, NAS100), and crypto (BTCUSD).
What is the minimum account size?
A minimum of is recommended for trading with micro lots (0.01). ,000 or more is recommended for standard lot sizes (0.1).
Can I use this with other indicators?
Yes. The indicator renders all objects in the background layer so it will not interfere with other chart tools or indicators.
How is this different from a standard Volume Profile?
Standard Volume Profile assigns volume using midpoint-only calculation, which is inaccurate. This indicator uses Pro-Rata distribution, which distributes volume proportionally across all price levels that each candle's range covers. Additionally, the friction scoring provides insight into rejection strength at each level, which no standard Volume Profile offers.
Does it work during news events?
The indicator functions during all market conditions. However, during extreme volatility events (NFP, FOMC), friction levels may shift rapidly. It is generally advisable to wait for market conditions to stabilize after major news releases before acting on signals.
Version History
v8.0 Current
- Pro-Rata Volume Distribution algorithm
- True Wick Rejection Friction scoring
- Anti-repaint signal engine (closed-bar only)
- 6-component scoring system (0-100)
- Smart signal state machine (5 states)
- ATR-based stop loss with structural validation
- Structure-based take profit with risk cap
- Glassmorphism dashboard with drop shadow
- Trend alignment using dual 8-bar averages
- Multi-bar momentum confirmation
- Power labels, S/R zones, alert zones
v4.0
- Gradient volume profile bars
- Volume histogram extension
- High-friction and low-friction labels
- Alert zone lines
Built with institutional-grade algorithms. Designed for serious traders who demand precision in their analysis.
