Iván González

FX EVO Delta Profile: Liquidity Zones with Volume Delta Quadrants

Category: Indicators By: Iván González Created: November 12, 2026, 3:03 PM
November 12, 2026, 3:03 PM
Indicators
0 Comments
FX EVO Delta Profile: Liquidity Zones with Volume Delta Quadrants

Introduction

 

Liquidity pools sit above swing highs and below swing lows: that is where stops and breakout orders rest, and where price often goes hunting before turning. Knowing where those pools are is only half of the story. The other half is who traded inside them when price got there: were buyers or sellers in control, how much of the level has already been absorbed, and did the sweep find real participation or just thin air?

The FX EVO Delta Profile answers those questions on the price chart. It builds buy-side and sell-side liquidity zones from major swings, splits every zone into four quadrants, accumulates the estimated volume delta traded in each quadrant, shows how much “health” the zone has left, and flags four kinds of reversal patterns when price sweeps a zone. A small dashboard keeps score of how each signal type has performed on the chart you are looking at.

Theory Behind the Indicator

 

Liquidity zones. A swing high is a bar whose high is the highest of the 15 bars on each side (15 is the default pivot length). It creates a buy-side liquidity zone (BSL) from that high down to the top of the candle body. A swing low creates a sell-side liquidity zone (SSL) from the low up to the bottom of the body. If the body leaves a zone thinner than 0.1 ATR, the zone is widened to 0.1 ATR so it stays visible.

Overlap filter. With the filter on, a new zone that overlaps an active one only replaces it when it is more extreme (a higher high for BSL, a lower low for SSL); otherwise the new zone is ignored. Each side keeps the 10 most recent zones by default.

Estimated delta. There is no tick data in a candle, so the delta of each bar is estimated from its shape: volume multiplied by (close minus open) divided by the bar range. A strong bullish bar gives a large positive delta, a doji almost none. When a bar trades into a zone, its delta is shared out among the quadrants it overlaps, in proportion to how much of the bar’s range falls in each one.

Zone health. Every zone gets a capacity equal to the average volume of the last 15 bars multiplied by the capacity setting (5 by default). The volume traded inside the zone is subtracted from 100 %, so a zone that has absorbed five average bars of volume reaches 0 %.

Sweeps. A BSL zone is swept when a bar trades above its top, an SSL zone when a bar trades below its bottom. Swept zones stop updating and are shown with dashed outlines and faded colours.

Reversal signals. When price is testing or sweeping a zone, the delta of the outer quadrant (the top quadrant of a BSL zone, the bottom one of an SSL zone) is compared with the total delta of the zone. Only the first pattern found is reported, and each zone signals once:

  • ABS (absorption at the extreme): price sweeps the zone but the outer quadrant holds delta against the move (sellers at the top of a BSL zone, buyers at the bottom of an SSL zone), and it carries more than 20 % of the zone’s activity. The sweep was absorbed.
  • EXH (exhaustion): price sweeps the zone with less than 10 % of the activity in the outer quadrant. A dry sweep with nobody behind it.
  • DIV (delta divergence): the close stays inside the zone while more than 60 % of the activity sits in the outer quadrant in the direction of the breakout. Volume got trapped and the breakout failed.
  • REJ (snapback): price sweeps the zone and closes back beyond its midpoint, on a bar whose own delta is against the sweep and larger than 20 % of its volume.

The strength of the signal sets the size and opacity of its label.

Performance dashboard. Each signal opens a virtual trade at the close of the signal bar, short from BSL zones and long from SSL zones. It counts as a win when price closes in profit for 3 consecutive bars within the next 10 bars. The dashboard shows totals, wins and win rate per signal type, in green above 50 % and in red below.

Key Features at a Glance

 

  • Buy-side and sell-side liquidity zones from major swing highs and lows, with an overlap filter.
  • Four delta quadrants per zone, coloured by the side that dominates and shaded by intensity, with their values.
  • Zone health from 100 % to 0 % as volume is absorbed.
  • Swept zones kept on the chart with dashed outlines (optional).
  • Four reversal signals on sweeps: absorption, exhaustion, divergence and snapback.
  • Dashboard with the time-based win rate of each signal type, in three possible corners and five text sizes.
  • Optional highlighting of the bars under evaluation (yellow while waiting, aqua while in profit).

How to Read the Indicator

 

  • Red zones above price (BSL) and green zones below (SSL): the liquidity pools. The more transparent quadrants have not been traded yet.
  • Green quadrant: buying delta dominates in that slice of the zone. Red quadrant: selling delta dominates. The darker the shade, the larger its delta compared with the other quadrants.
  • Health percentage on the right: how much capacity is left. A zone near 0 % has already absorbed a lot of volume and is less likely to hold.
  • Dashed zone: swept by price. It stays as a reference of what happened there.
  • ABS / EXH / DIV / REJ labels: red labels above the bar come from BSL zones (bearish reversal idea), green labels below the bar from SSL zones (bullish idea). Larger and more opaque labels mean a stronger reading.
  • Dashboard: a quick check of which signal type has worked on this instrument and timeframe. It is a short-term, time-based test, not a full backtest.

Delta is estimated from the candles, not read from real order flow: treat the quadrant values as a map of where the activity concentrated, not as exact buy and sell volumes.

Practical Applications

 

  • Stop-hunt reversals: an ABS or REJ label after a sweep of a well-defined swing is the classic liquidity grab setup. Wait for structure to confirm on the next bars.
  • Failed breakouts: a DIV label tells you that heavy activity at the edge did not produce a breakout, which often precedes a move back through the zone.
  • Target selection: unswept zones with high health are natural targets, since the liquidity behind them is still there.
  • Instrument choice: zones and delta need volume. On instruments without volume data the quadrants stay empty and only the outlines and the sweeps remain.

Indicator Configuration

 

  • pivLen (default 15): pivot length, bars on each side of a swing.
  • maxZones (default 10): maximum zones kept per type (1 to 40).
  • showSwept (default 1): keep swept zones visible with dashed outlines.
  • filterOverlaps (default 1): a new zone may not overlap an active one unless it is more extreme.
  • showDecay (default 1): show the health of the active zones.
  • zoneCapacity (default 5.0): multiple of the average volume a zone can absorb before reaching 0 %.
  • enableReversals (default 1): detect the ABS, EXH, DIV and REJ signals.
  • showDash (default 1): show the performance dashboard.
  • dashPos (default 1): dashboard position, 1 top right, 2 bottom right, 3 bottom left.
  • dashSize (default 1): dashboard text size, from 1 (tiny) to 5 (huge).
  • evalWindow (default 10): maximum bars to wait for the reversal.
  • holdBars (default 3): consecutive closes in profit needed to count a win.
  • highlightBars (default 0): colour the bars under evaluation.
  • Colours of the BSL and SSL outlines and of the buy and sell delta at the top of the code.

The Code

 

//---------------------------------------------------------------
// PRC_FX EVO Delta Profile
// version = 0
// 11.11.2026
// Iván González @ www.prorealcode.com
// Author: FX EVO (based on Liquidity Delta Profiler by LuxAlgo)
// Sharing ProRealTime knowledge
//--------------------------------------------------------------------//
DEFPARAM DRAWONLASTBARONLY = true

//----- Settings
pivLen = 15            // pivot length: bars to the left and to the right of a swing
maxZones = 10          // max zones per type (1 to 40)
showSwept = 1          // 1 = keep swept zones visible with dashed outlines
filterOverlaps = 1     // 1 = a new zone may not overlap an active one (the most extreme level wins)
showDecay = 1          // 1 = show the remaining health of each active zone
zoneCapacity = 5.0     // multiple of the average volume a zone can absorb before reaching 0 %
enableReversals = 1    // 1 = detect reversal signals (ABS, EXH, DIV, REJ) on sweeps
showDash = 1           // 1 = show the reversal performance dashboard
dashPos = 1            // dashboard position: 1 = top right, 2 = bottom right, 3 = bottom left
dashSize = 1           // dashboard text: 1 = tiny, 2 = small, 3 = normal, 4 = large, 5 = huge
evalWindow = 10        // max bars to wait for the reversal to happen
holdBars = 3           // consecutive closes in profit needed to count a win
highlightBars = 0      // 1 = colour the bars under evaluation (yellow = evaluating, aqua = in profit)

//----- Colours (BSL outline, SSL outline, buy delta, sell delta)
bslR = 242
bslG = 54
bslB = 69
sslR = 8
sslG = 153
sslB = 129
buyR = 8
buyG = 153
buyB = 129
sellR = 242
sellG = 54
sellB = 69

slotSize = 50          // array room per zone type (maxZones can be up to 40)
maxLabels = 480        // signal labels kept on the chart

//----- Bar data stored by bar number (read by index, never with a variable [offset] in a loop)
$bO[barindex] = open
$bH[barindex] = high
$bL[barindex] = low
$bC[barindex] = close
$bV[barindex] = volume
atrV = AverageTrueRange[14](close)
IF barindex >= 13 THEN
   $bA[barindex] = atrV
   $bAok[barindex] = 1
ELSE
   $bA[barindex] = 0
   $bAok[barindex] = 0
ENDIF
IF barindex >= pivLen - 1 THEN
   $bAv[barindex] = average[pivLen](volume)
ELSE
   $bAv[barindex] = 0
ENDIF

//----- State reset on (re)load. Every persistent value lives in an array:
// arrays are NOT rewound between ticks of the live bar, scalars are.
IF barindex = 0 THEN
   $gs[0] = 0 - 1      // last processed bar
   $gs[1] = 0          // number of BSL zones
   $gs[2] = 0          // number of SSL zones
   $gs[3] = 0          // number of signal labels
   $gs[4] = 0          // number of trades under evaluation
   FOR k = 1 TO 8 DO
      $st[k] = 0       // totals and wins: ABS, EXH, DIV, REJ
   NEXT
ENDIF

//----- Engine: runs once per CLOSED bar (historical bars on themselves, the live bar once it closes)
FOR pss = 1 DOWNTO 0 DO
   ofs = pss
   doIt = 0
   IF ofs = 1 AND barindex >= 1 AND $gs[0] < barindex - 1 THEN
      doIt = 1
   ENDIF
   IF ofs = 0 AND NOT islastbarupdate AND $gs[0] < barindex THEN
      doIt = 1
   ENDIF
   IF doIt = 1 THEN
      bb = barindex - ofs
      $gs[0] = bb
      hi = $bH[bb]
      lo = $bL[bb]
      cl = $bC[bb]
      op = $bO[bb]
      vol = $bV[bb]

      //--- Confirmed swing high / low at bar pv (strict on the right, >= on the left)
      pv = bb - pivLen
      isPH = 0
      isPL = 0
      IF pv - pivLen >= 0 THEN
         isPH = 1
         isPL = 1
         hP = $bH[pv]
         lP = $bL[pv]
         FOR k = pv + 1 TO bb DO
            IF $bH[k] >= hP THEN
               isPH = 0
            ENDIF
            IF $bL[k] <= lP THEN
               isPL = 0
            ENDIF
         NEXT
         FOR k = pv - pivLen TO pv - 1 DO
            IF $bH[k] > hP THEN
               isPH = 0
            ENDIF
            IF $bL[k] < lP THEN
               isPL = 0
            ENDIF
         NEXT
      ENDIF

      avgVol = $bAv[bb]
      IF avgVol = 0 THEN
         avgVol = 1
      ENDIF
      capNow = avgVol * zoneCapacity

      //--- New zones (s = 0: BSL from a swing high, s = 1: SSL from a swing low)
      FOR s = 0 TO 1 DO
         newZ = 0
         IF s = 0 AND isPH = 1 THEN
            newZ = 1
            nTop = $bH[pv]
            nBot = max($bC[pv], $bO[pv])
            IF $bAok[pv] = 1 THEN
               IF nTop - nBot < $bA[pv] * 0.1 THEN
                  nBot = nTop - $bA[pv] * 0.1
               ENDIF
            ENDIF
         ENDIF
         IF s = 1 AND isPL = 1 THEN
            newZ = 1
            nBot = $bL[pv]
            nTop = min($bC[pv], $bO[pv])
            IF $bAok[pv] = 1 THEN
               IF nTop - nBot < $bA[pv] * 0.1 THEN
                  nTop = nBot + $bA[pv] * 0.1
               ENDIF
            ENDIF
         ENDIF
         IF newZ = 1 THEN
            base = s * slotSize
            nZ = $gs[1 + s]
            skipZ = 0
            IF filterOverlaps = 1 AND nZ > 0 THEN
               i = nZ - 1
               WHILE i >= 0 AND skipZ = 0 DO
                  zi = base + i
                  IF $zSw[zi] = 0 THEN
                     IF max(nBot, $zBot[zi]) <= min(nTop, $zTop[zi]) THEN
                        moreExtreme = 0
                        IF s = 0 AND nTop > $zTop[zi] THEN
                           moreExtreme = 1
                        ENDIF
                        IF s = 1 AND nBot < $zBot[zi] THEN
                           moreExtreme = 1
                        ENDIF
                        IF moreExtreme = 1 THEN
                           // the old zone is replaced: remove it from the list
                           IF i <= nZ - 2 THEN
                              FOR k = i TO nZ - 2 DO
                                 dst = base + k
                                 src = dst + 1
                                 $zTop[dst] = $zTop[src]
                                 $zBot[dst] = $zBot[src]
                                 $zLft[dst] = $zLft[src]
                                 $zRgt[dst] = $zRgt[src]
                                 $zSw[dst] = $zSw[src]
                                 $zSig[dst] = $zSig[src]
                                 $zVT[dst] = $zVT[src]
                                 $zCap[dst] = $zCap[src]
                                 FOR q = 0 TO 3 DO
                                    $zD[dst * 4 + q] = $zD[src * 4 + q]
                                 NEXT
                              NEXT
                           ENDIF
                           nZ = nZ - 1
                        ELSE
                           skipZ = 1
                        ENDIF
                     ENDIF
                  ENDIF
                  i = i - 1
               WEND
            ENDIF
            IF skipZ = 0 THEN
               // newest zone goes first: shift the list one place
               IF nZ > 0 THEN
                  FOR k = nZ DOWNTO 1 DO
                     dst = base + k
                     src = dst - 1
                     $zTop[dst] = $zTop[src]
                     $zBot[dst] = $zBot[src]
                     $zLft[dst] = $zLft[src]
                     $zRgt[dst] = $zRgt[src]
                     $zSw[dst] = $zSw[src]
                     $zSig[dst] = $zSig[src]
                     $zVT[dst] = $zVT[src]
                     $zCap[dst] = $zCap[src]
                     FOR q = 0 TO 3 DO
                        $zD[dst * 4 + q] = $zD[src * 4 + q]
                     NEXT
                  NEXT
               ENDIF
               $zTop[base] = nTop
               $zBot[base] = nBot
               $zLft[base] = pv
               $zRgt[base] = pv
               $zSw[base] = 0
               $zSig[base] = 0
               $zVT[base] = 0
               $zCap[base] = capNow
               FOR q = 0 TO 3 DO
                  $zD[base * 4 + q] = 0
               NEXT
               nZ = nZ + 1
               IF nZ > maxZones THEN
                  nZ = maxZones
               ENDIF
            ENDIF
            $gs[1 + s] = nZ
         ENDIF
      NEXT

      //--- Estimated delta of this bar, split over the zone quadrants it overlaps
      totR = hi - lo
      IF totR = 0 THEN
         barDelta = 0
      ELSE
         barDelta = vol * (cl - op) / totR
      ENDIF
      FOR s = 0 TO 1 DO
         base = s * slotSize
         nZ = $gs[1 + s]
         IF nZ > 0 THEN
            FOR i = nZ - 1 DOWNTO 0 DO
               zi = base + i
               IF $zSw[zi] = 0 THEN
                  $zRgt[zi] = bb
                  hit = 0
                  zStp = ($zTop[zi] - $zBot[zi]) / 4
                  FOR q = 0 TO 3 DO
                     qB = $zBot[zi] + q * zStp
                     qT = $zBot[zi] + (q + 1) * zStp
                     ovT = min(hi, qT)
                     ovB = max(lo, qB)
                     ov = 0
                     IF ovT > ovB THEN
                        ov = ovT - ovB
                     ENDIF
                     IF ov > 0 THEN
                        hit = 1
                        ovR = 0
                        IF totR > 0 THEN
                           ovR = ov / totR
                        ENDIF
                        $zD[zi * 4 + q] = $zD[zi * 4 + q] + barDelta * ovR
                        $zVT[zi] = $zVT[zi] + vol * ovR
                     ENDIF
                  NEXT
                  IF s = 0 AND hi > $zTop[zi] THEN
                     $zSw[zi] = 1
                  ENDIF
                  IF s = 1 AND lo < $zBot[zi] THEN
                     $zSw[zi] = 1
                  ENDIF

                  //--- Reversal detection on the zone being tested or swept
                  IF (hit = 1 OR $zSw[zi] = 1) AND enableReversals = 1 AND $zSig[zi] = 0 THEN
                     totD = 0
                     absD = 0
                     FOR q = 0 TO 3 DO
                        totD = totD + $zD[zi * 4 + q]
                        absD = absD + abs($zD[zi * 4 + q])
                     NEXT
                     IF absD > 0 THEN
                        zT = $zTop[zi]
                        zB = $zBot[zi]
                        zMid = (zT + zB) / 2
                        sweeping = 0
                        inside = 0
                        rejecting = 0
                        IF s = 0 THEN
                           outerD = $zD[zi * 4 + 3]
                           IF hi > zT THEN
                              sweeping = 1
                           ENDIF
                           IF cl < zMid THEN
                              rejecting = 1
                           ENDIF
                        ELSE
                           outerD = $zD[zi * 4]
                           IF lo < zB THEN
                              sweeping = 1
                           ENDIF
                           IF cl > zMid THEN
                              rejecting = 1
                           ENDIF
                        ENDIF
                        IF cl <= zT AND cl >= zB THEN
                           inside = 1
                        ENDIF
                        ratio = abs(outerD) / (absD + 0.0001)
                        sigK = 0
                        signif = 0
                        // 1. Absorption at the extreme: the outer quadrant is against the sweep
                        IF sweeping = 1 THEN
                           IF (s = 0 AND outerD < 0) OR (s = 1 AND outerD > 0) THEN
                              IF ratio > 0.2 THEN
                                 sigK = 1
                                 signif = ratio * 2
                              ENDIF
                           ENDIF
                        ENDIF
                        // 2. Exhaustion: dry sweep, almost no volume at the edge
                        IF sigK = 0 AND sweeping = 1 THEN
                           IF ratio < 0.1 THEN
                              sigK = 2
                              signif = 1.0 - ratio * 5
                           ENDIF
                        ENDIF
                        // 3. Delta divergence: heavy volume at the edge, but the close stays inside
                        IF sigK = 0 AND inside = 1 THEN
                           IF ratio > 0.6 THEN
                              IF (s = 0 AND outerD > 0) OR (s = 1 AND outerD < 0) THEN
                                 sigK = 3
                                 signif = ratio
                              ENDIF
                           ENDIF
                        ENDIF
                        // 4. Snapback: sweep and strong rejection in the same bar
                        IF sigK = 0 AND sweeping = 1 AND rejecting = 1 THEN
                           barRatio = abs(barDelta) / (vol + 0.0001)
                           IF ((s = 0 AND barDelta < 0) OR (s = 1 AND barDelta > 0)) AND barRatio > 0.2 THEN
                              sigK = 4
                              signif = barRatio * 2
                           ENDIF
                        ENDIF
                        IF sigK > 0 THEN
                           $zSig[zi] = 1
                           signif = min(max(signif, 0), 1)
                           sCls = 0
                           IF signif > 0.7 THEN
                              sCls = 2
                           ELSIF signif > 0.4 THEN
                              sCls = 1
                           ENDIF
                           nS = $gs[3]
                           $sgB[nS] = bb
                           $sgK[nS] = sigK
                           $sgS[nS] = s
                           $sgC[nS] = sCls
                           $sgA[nS] = $bA[bb]
                           IF s = 0 THEN
                              $sgY[nS] = hi
                           ELSE
                              $sgY[nS] = lo
                           ENDIF
                           $gs[3] = nS + 1
                           // the signal opens a virtual trade for the dashboard statistics
                           nT = $gs[4]
                           $tK[nT] = sigK
                           IF s = 0 THEN
                              $tDir[nT] = 0 - 1
                           ELSE
                              $tDir[nT] = 1
                           ENDIF
                           $tE[nT] = cl
                           $tB[nT] = bb
                           $tC[nT] = 0
                           $gs[4] = nT + 1
                        ENDIF
                     ENDIF
                  ENDIF
               ENDIF
            NEXT
         ENDIF
      NEXT

      //--- Trades under evaluation (win = holdBars closes in profit within evalWindow bars)
      hl = 0
      nT = $gs[4]
      IF nT > 0 THEN
         FOR i = nT - 1 DOWNTO 0 DO
            IF bb > $tB[i] THEN
               inP = 0
               IF $tDir[i] = 1 AND cl > $tE[i] THEN
                  inP = 1
               ENDIF
               IF $tDir[i] = -1 AND cl < $tE[i] THEN
                  inP = 1
               ENDIF
               IF inP = 1 THEN
                  $tC[i] = $tC[i] + 1
                  IF hl = 0 OR hl = 1 THEN
                     hl = 2
                  ENDIF
               ELSE
                  $tC[i] = 0
                  IF hl = 0 THEN
                     hl = 1
                  ENDIF
               ENDIF
               ended = 0
               won = 0
               IF $tC[i] >= holdBars THEN
                  ended = 1
                  won = 1
               ELSIF bb - $tB[i] >= evalWindow THEN
                  ended = 1
               ENDIF
               IF ended = 1 THEN
                  kk = $tK[i]
                  $st[2 * kk - 1] = $st[2 * kk - 1] + 1
                  IF won = 1 THEN
                     $st[2 * kk] = $st[2 * kk] + 1
                  ENDIF
                  IF i <= nT - 2 THEN
                     FOR k = i TO nT - 2 DO
                        $tK[k] = $tK[k + 1]
                        $tDir[k] = $tDir[k + 1]
                        $tE[k] = $tE[k + 1]
                        $tB[k] = $tB[k + 1]
                        $tC[k] = $tC[k + 1]
                     NEXT
                  ENDIF
                  nT = nT - 1
               ENDIF
            ENDIF
         NEXT
         $gs[4] = nT
      ENDIF
      $hl[bb] = hl
   ENDIF
NEXT

//----- Drawing (full redraw of the current state on the last bar)
IF islastbarupdate AND $gs[0] >= 0 THEN
   lastP = $gs[0]

   //--- Zones: four quadrants with their delta, outline and health
   FOR s = 0 TO 1 DO
      base = s * slotSize
      nZ = $gs[1 + s]
      IF s = 0 THEN
         sR = bslR
         sG = bslG
         sB = bslB
      ELSE
         sR = sslR
         sG = sslG
         sB = sslB
      ENDIF
      IF nZ > 0 THEN
         FOR i = 0 TO nZ - 1 DO
            zi = base + i
            sw = $zSw[zi]
            IF sw = 0 OR showSwept = 1 THEN
               zT = $zTop[zi]
               zB = $zBot[zi]
               xL = $zLft[zi]
               xR = $zRgt[zi]
               zStp = (zT - zB) / 4
               maxD = 0
               FOR q = 0 TO 3 DO
                  maxD = max(maxD, abs($zD[zi * 4 + q]))
               NEXT
               IF xR - xL >= 6 THEN
                  xT = xR - 3
               ELSE
                  xT = (xL + xR) / 2
               ENDIF
               FOR q = 0 TO 3 DO
                  d = $zD[zi * 4 + q]
                  qB = zB + q * zStp
                  qT = zB + (q + 1) * zStp
                  gap = zStp * 0.05
                  bTop = qT - gap
                  bBot = qB + gap
                  IF q = 0 THEN
                     bBot = qB
                  ENDIF
                  IF q = 3 THEN
                     bTop = qT
                  ENDIF
                  IF maxD > 0 AND abs(d) > 0.001 THEN
                     hasV = 1
                     IF d > 0 THEN
                        cR = buyR
                        cG = buyG
                        cB = buyB
                     ELSE
                        cR = sellR
                        cG = sellG
                        cB = sellB
                     ENDIF
                     IF sw = 1 THEN
                        trn = 90
                        txA = 128
                     ELSE
                        trn = 100 - floor(abs(d) / maxD * 60)
                        txA = 255
                     ENDIF
                  ELSE
                     hasV = 0
                     cR = sR
                     cG = sG
                     cB = sB
                     IF s = 0 THEN
                        dTr = 60 + (3 - q) * 10
                     ELSE
                        dTr = 60 + q * 10
                     ENDIF
                     IF sw = 1 THEN
                        trn = 90
                        txA = 51
                     ELSE
                        trn = dTr
                        txA = 128
                     ENDIF
                  ENDIF
                  fA = round(2.55 * (100 - trn))
                  IF sw = 1 THEN
                     DRAWRECTANGLE(xL, bTop, xR, bBot) COLOURED(sR, sG, sB, 51) STYLE(dottedline2, 1) FILLCOLOR(cR, cG, cB, fA)
                  ELSE
                     DRAWRECTANGLE(xL, bTop, xR, bBot) COLOURED(sR, sG, sB, 102) FILLCOLOR(cR, cG, cB, fA)
                  ENDIF
                  yT = (bTop + bBot) / 2
                  IF hasV = 1 THEN
                     IF abs(d) < 100 THEN
                        dv = round(abs(d) * 100) / 100
                     ELSE
                        dv = round(abs(d))
                     ENDIF
                     IF d > 0 THEN
                        DRAWTEXT("+#dv#", xT, yT, SansSerif, Standard, 8) COLOURED(cR, cG, cB, txA)
                     ELSE
                        DRAWTEXT("-#dv#", xT, yT, SansSerif, Standard, 8) COLOURED(cR, cG, cB, txA)
                     ENDIF
                  ELSE
                     DRAWTEXT("0", xT, yT, SansSerif, Standard, 8) COLOURED(cR, cG, cB, txA)
                  ENDIF
               NEXT
               IF sw = 1 THEN
                  DRAWRECTANGLE(xL, zT, xR, zB) COLOURED(sR, sG, sB, 51) STYLE(dottedline2, 1)
               ELSE
                  DRAWRECTANGLE(xL, zT, xR, zB) COLOURED(sR, sG, sB, 51)
               ENDIF
               IF sw = 0 AND showDecay = 1 THEN
                  hp = floor(max(0, 100 - ($zVT[zi] / $zCap[zi] * 100)))
                  DRAWTEXT("#hp#%", lastP + 3, (zT + zB) / 2, SansSerif, Bold, 10) COLOURED(sR, sG, sB, 255)
               ENDIF
            ENDIF
         NEXT
      ENDIF
   NEXT

   //--- Reversal signal labels (the most recent ones)
   nS = $gs[3]
   IF nS > 0 THEN
      k0 = max(0, nS - maxLabels)
      FOR k = k0 TO nS - 1 DO
         IF $sgS[k] = 0 THEN
            lR = 242
            lG = 54
            lB = 69
            yS = $sgY[k] + 0.6 * $sgA[k]
         ELSE
            lR = 76
            lG = 175
            lB = 80
            yS = $sgY[k] - 0.6 * $sgA[k]
         ENDIF
         IF $sgC[k] = 2 THEN
            lA = 230
            lSz = 12
         ELSIF $sgC[k] = 1 THEN
            lA = 179
            lSz = 10
         ELSE
            lA = 128
            lSz = 8
         ENDIF
         xS = $sgB[k]
         IF $sgK[k] = 1 THEN
            DRAWTEXT("ABS", xS, yS, SansSerif, Bold, lSz) COLOURED(lR, lG, lB, lA)
         ELSIF $sgK[k] = 2 THEN
            DRAWTEXT("EXH", xS, yS, SansSerif, Bold, lSz) COLOURED(lR, lG, lB, lA)
         ELSIF $sgK[k] = 3 THEN
            DRAWTEXT("DIV", xS, yS, SansSerif, Bold, lSz) COLOURED(lR, lG, lB, lA)
         ELSE
            DRAWTEXT("REJ", xS, yS, SansSerif, Bold, lSz) COLOURED(lR, lG, lB, lA)
         ENDIF
      NEXT
   ENDIF

   //--- Bars under evaluation (drawn over the candles)
   IF highlightBars = 1 THEN
      FOR j = 0 TO lastP DO
         IF $hl[j] > 0 THEN
            IF $hl[j] = 2 THEN
               hR = 0
               hG = 188
               hB = 212
            ELSE
               hR = 253
               hG = 216
               hB = 53
            ENDIF
            DRAWSEGMENT(j, $bH[j], j, $bL[j]) COLOURED(hR, hG, hB, 255)
            DRAWRECTANGLE(j - 0.3, max($bO[j], $bC[j]), j + 0.3, min($bO[j], $bC[j])) COLOURED(hR, hG, hB, 255) FILLCOLOR(hR, hG, hB, 255)
         ENDIF
      NEXT
   ENDIF

   //--- Reversal performance dashboard
   IF showDash = 1 THEN
      IF dashSize = 1 THEN
         fs = 8
      ELSIF dashSize = 2 THEN
         fs = 10
      ELSIF dashSize = 3 THEN
         fs = 12
      ELSIF dashSize = 4 THEN
         fs = 14
      ELSE
         fs = 18
      ENDIF
      cw = fs * 8
      rh = fs * 2
      dh = fs
      pw = 4 * cw
      ph = 6 * rh + 5 * dh
      IF dashPos = 3 THEN
         px = 10
      ELSE
         px = 0 - (pw + 90)
      ENDIF
      IF dashPos = 1 THEN
         py = -10
      ELSE
         py = ph + 30
      ENDIF
      // column centres and row centres (rows: title, headers, ABS, EXH, DIV, REJ; a divider between rows)
      c0 = px + cw / 2
      c1 = px + cw * 1.5
      c2 = px + cw * 2.5
      c3 = px + cw * 3.5
      cMid = px + pw / 2
      yTitle = py - rh / 2
      yHead = py - rh - dh - rh / 2
      IF dashPos = 1 THEN
         DRAWRECTANGLE(px, py, px + pw, py - ph) ANCHOR(TOPRIGHT, XSHIFT, YSHIFT) COLOURED(92, 74, 26, 255) FILLCOLOR(21, 25, 34, 255)
         DRAWTEXT("FX EVO Delta Profile - Reversal Performance", cMid, yTitle, SansSerif, Bold, fs) ANCHOR(TOPRIGHT, XSHIFT, YSHIFT) COLOURED(251, 189, 35, 255)
         DRAWTEXT("Signal", c0, yHead, SansSerif, Standard, fs) ANCHOR(TOPRIGHT, XSHIFT, YSHIFT) COLOURED(128, 128, 128, 255)
         DRAWTEXT("Total", c1, yHead, SansSerif, Standard, fs) ANCHOR(TOPRIGHT, XSHIFT, YSHIFT) COLOURED(128, 128, 128, 255)
         DRAWTEXT("Wins", c2, yHead, SansSerif, Standard, fs) ANCHOR(TOPRIGHT, XSHIFT, YSHIFT) COLOURED(128, 128, 128, 255)
         DRAWTEXT("Win %", c3, yHead, SansSerif, Standard, fs) ANCHOR(TOPRIGHT, XSHIFT, YSHIFT) COLOURED(128, 128, 128, 255)
      ELSIF dashPos = 2 THEN
         DRAWRECTANGLE(px, py, px + pw, py - ph) ANCHOR(BOTTOMRIGHT, XSHIFT, YSHIFT) COLOURED(92, 74, 26, 255) FILLCOLOR(21, 25, 34, 255)
         DRAWTEXT("FX EVO Delta Profile - Reversal Performance", cMid, yTitle, SansSerif, Bold, fs) ANCHOR(BOTTOMRIGHT, XSHIFT, YSHIFT) COLOURED(251, 189, 35, 255)
         DRAWTEXT("Signal", c0, yHead, SansSerif, Standard, fs) ANCHOR(BOTTOMRIGHT, XSHIFT, YSHIFT) COLOURED(128, 128, 128, 255)
         DRAWTEXT("Total", c1, yHead, SansSerif, Standard, fs) ANCHOR(BOTTOMRIGHT, XSHIFT, YSHIFT) COLOURED(128, 128, 128, 255)
         DRAWTEXT("Wins", c2, yHead, SansSerif, Standard, fs) ANCHOR(BOTTOMRIGHT, XSHIFT, YSHIFT) COLOURED(128, 128, 128, 255)
         DRAWTEXT("Win %", c3, yHead, SansSerif, Standard, fs) ANCHOR(BOTTOMRIGHT, XSHIFT, YSHIFT) COLOURED(128, 128, 128, 255)
      ELSE
         DRAWRECTANGLE(px, py, px + pw, py - ph) ANCHOR(BOTTOMLEFT, XSHIFT, YSHIFT) COLOURED(92, 74, 26, 255) FILLCOLOR(21, 25, 34, 255)
         DRAWTEXT("FX EVO Delta Profile - Reversal Performance", cMid, yTitle, SansSerif, Bold, fs) ANCHOR(BOTTOMLEFT, XSHIFT, YSHIFT) COLOURED(251, 189, 35, 255)
         DRAWTEXT("Signal", c0, yHead, SansSerif, Standard, fs) ANCHOR(BOTTOMLEFT, XSHIFT, YSHIFT) COLOURED(128, 128, 128, 255)
         DRAWTEXT("Total", c1, yHead, SansSerif, Standard, fs) ANCHOR(BOTTOMLEFT, XSHIFT, YSHIFT) COLOURED(128, 128, 128, 255)
         DRAWTEXT("Wins", c2, yHead, SansSerif, Standard, fs) ANCHOR(BOTTOMLEFT, XSHIFT, YSHIFT) COLOURED(128, 128, 128, 255)
         DRAWTEXT("Win %", c3, yHead, SansSerif, Standard, fs) ANCHOR(BOTTOMLEFT, XSHIFT, YSHIFT) COLOURED(128, 128, 128, 255)
      ENDIF
      FOR kk = 0 TO 4 DO
         // divider under the title, the headers and each signal row
         IF kk = 0 THEN
            yDv = py - rh - dh / 2
         ELSE
            yDv = py - (kk + 1) * rh - kk * dh - dh / 2
         ENDIF
         IF dashPos = 1 THEN
            DRAWRECTANGLE(px + 4, yDv, px + pw - 4, yDv - 1) ANCHOR(TOPRIGHT, XSHIFT, YSHIFT) COLOURED(92, 74, 26, 255) FILLCOLOR(92, 74, 26, 255)
         ELSIF dashPos = 2 THEN
            DRAWRECTANGLE(px + 4, yDv, px + pw - 4, yDv - 1) ANCHOR(BOTTOMRIGHT, XSHIFT, YSHIFT) COLOURED(92, 74, 26, 255) FILLCOLOR(92, 74, 26, 255)
         ELSE
            DRAWRECTANGLE(px + 4, yDv, px + pw - 4, yDv - 1) ANCHOR(BOTTOMLEFT, XSHIFT, YSHIFT) COLOURED(92, 74, 26, 255) FILLCOLOR(92, 74, 26, 255)
         ENDIF
      NEXT
      FOR kk = 1 TO 4 DO
         totK = $st[2 * kk - 1]
         winK = $st[2 * kk]
         IF totK > 0 THEN
            rateK = round(winK / totK * 10000) / 100
            IF rateK >= 50 THEN
               vR = 76
               vG = 175
               vB = 80
            ELSE
               vR = 242
               vG = 54
               vB = 69
            ENDIF
         ELSE
            rateK = 0
            vR = 219
            vG = 219
            vB = 219
         ENDIF
         yRw = py - (kk + 1) * rh - (kk + 1) * dh - rh / 2
         IF dashPos = 1 THEN
            IF kk = 1 THEN
               DRAWTEXT("ABS", c0, yRw, SansSerif, Standard, fs) ANCHOR(TOPRIGHT, XSHIFT, YSHIFT) COLOURED(219, 219, 219, 255)
            ELSIF kk = 2 THEN
               DRAWTEXT("EXH", c0, yRw, SansSerif, Standard, fs) ANCHOR(TOPRIGHT, XSHIFT, YSHIFT) COLOURED(219, 219, 219, 255)
            ELSIF kk = 3 THEN
               DRAWTEXT("DIV", c0, yRw, SansSerif, Standard, fs) ANCHOR(TOPRIGHT, XSHIFT, YSHIFT) COLOURED(219, 219, 219, 255)
            ELSE
               DRAWTEXT("REJ", c0, yRw, SansSerif, Standard, fs) ANCHOR(TOPRIGHT, XSHIFT, YSHIFT) COLOURED(219, 219, 219, 255)
            ENDIF
            DRAWTEXT("#totK#", c1, yRw, SansSerif, Standard, fs) ANCHOR(TOPRIGHT, XSHIFT, YSHIFT) COLOURED(219, 219, 219, 255)
            DRAWTEXT("#winK#", c2, yRw, SansSerif, Standard, fs) ANCHOR(TOPRIGHT, XSHIFT, YSHIFT) COLOURED(219, 219, 219, 255)
            DRAWTEXT("#rateK#%", c3, yRw, SansSerif, Standard, fs) ANCHOR(TOPRIGHT, XSHIFT, YSHIFT) COLOURED(vR, vG, vB, 255)
         ELSIF dashPos = 2 THEN
            IF kk = 1 THEN
               DRAWTEXT("ABS", c0, yRw, SansSerif, Standard, fs) ANCHOR(BOTTOMRIGHT, XSHIFT, YSHIFT) COLOURED(219, 219, 219, 255)
            ELSIF kk = 2 THEN
               DRAWTEXT("EXH", c0, yRw, SansSerif, Standard, fs) ANCHOR(BOTTOMRIGHT, XSHIFT, YSHIFT) COLOURED(219, 219, 219, 255)
            ELSIF kk = 3 THEN
               DRAWTEXT("DIV", c0, yRw, SansSerif, Standard, fs) ANCHOR(BOTTOMRIGHT, XSHIFT, YSHIFT) COLOURED(219, 219, 219, 255)
            ELSE
               DRAWTEXT("REJ", c0, yRw, SansSerif, Standard, fs) ANCHOR(BOTTOMRIGHT, XSHIFT, YSHIFT) COLOURED(219, 219, 219, 255)
            ENDIF
            DRAWTEXT("#totK#", c1, yRw, SansSerif, Standard, fs) ANCHOR(BOTTOMRIGHT, XSHIFT, YSHIFT) COLOURED(219, 219, 219, 255)
            DRAWTEXT("#winK#", c2, yRw, SansSerif, Standard, fs) ANCHOR(BOTTOMRIGHT, XSHIFT, YSHIFT) COLOURED(219, 219, 219, 255)
            DRAWTEXT("#rateK#%", c3, yRw, SansSerif, Standard, fs) ANCHOR(BOTTOMRIGHT, XSHIFT, YSHIFT) COLOURED(vR, vG, vB, 255)
         ELSE
            IF kk = 1 THEN
               DRAWTEXT("ABS", c0, yRw, SansSerif, Standard, fs) ANCHOR(BOTTOMLEFT, XSHIFT, YSHIFT) COLOURED(219, 219, 219, 255)
            ELSIF kk = 2 THEN
               DRAWTEXT("EXH", c0, yRw, SansSerif, Standard, fs) ANCHOR(BOTTOMLEFT, XSHIFT, YSHIFT) COLOURED(219, 219, 219, 255)
            ELSIF kk = 3 THEN
               DRAWTEXT("DIV", c0, yRw, SansSerif, Standard, fs) ANCHOR(BOTTOMLEFT, XSHIFT, YSHIFT) COLOURED(219, 219, 219, 255)
            ELSE
               DRAWTEXT("REJ", c0, yRw, SansSerif, Standard, fs) ANCHOR(BOTTOMLEFT, XSHIFT, YSHIFT) COLOURED(219, 219, 219, 255)
            ENDIF
            DRAWTEXT("#totK#", c1, yRw, SansSerif, Standard, fs) ANCHOR(BOTTOMLEFT, XSHIFT, YSHIFT) COLOURED(219, 219, 219, 255)
            DRAWTEXT("#winK#", c2, yRw, SansSerif, Standard, fs) ANCHOR(BOTTOMLEFT, XSHIFT, YSHIFT) COLOURED(219, 219, 219, 255)
            DRAWTEXT("#rateK#%", c3, yRw, SansSerif, Standard, fs) ANCHOR(BOTTOMLEFT, XSHIFT, YSHIFT) COLOURED(vR, vG, vB, 255)
         ENDIF
      NEXT
   ENDIF
ENDIF

RETURN

Download
Filename: PRC_FX-EVO-Delta-Profile.itf
Downloads: 0
Iván González
Iván González Legend
Currently debugging life, so my bio is on hold. Check back after the next commit for an update.
Author’s Profile

Comments

ProRealCode ProRealCode
Loading...