Iván González

Box Range: Intraday Levels From How Far Hourly Candles Usually Stretch

Category: Indicators By: Iván González Created: November 23, 2026, 12:14 PM
November 23, 2026, 12:14 PM
Indicators
0 Comments
Box Range: Intraday Levels From How Far Hourly Candles Usually Stretch

Introduction

 

How far can price travel from yesterday’s close before the move becomes unusual? The Yellow Box Range by arleay answers that with the instrument’s own history. It measures how far each 60-minute candle of the last sessions stretched above and below an anchor price, and turns those stretches into a set of levels that are fixed once at the start of each session: a yellow box where most hourly candles stay, an average range beyond it, a max range and the largest stretch ever seen in the sample.

The levels do not move during the session, so they work as a map for the day: inside the box is normal noise, beyond the average range a decision zone, and beyond the max range a trend day.

Theory Behind the Indicator

 

For every 60-minute candle the indicator records two distances from the anchor of its session: how far the high went above it and how far the low went below it (zero if the candle never crossed the anchor on that side). The anchor is the prior session’s close by default, or the session open.

At the start of each new session it takes the stretches of the last 50 sessions (at least 5 are needed) and builds the levels for each side separately:

  • Yellow box: the 70th percentile of the stretches. 70 % of hourly candles kept their high below the top of the box (or their low above the bottom).
  • Average range: the median of the stretches that went beyond the box. Roughly half of the breaks of the box continue past it and half turn back.
  • Max range: the 95th percentile. A close beyond it reads as a trend day.
  • Max trend: the largest stretch in the sample.

All the percentiles are exact (nearest rank), and the levels are anchor plus or minus each value.

Key Features at a Glance

 

  • Levels built from the instrument’s own hourly behaviour, recalculated once per session.
  • Yellow box, shaded average range zones, max range and max trend lines, anchor line.
  • Labels with prices for today’s levels.
  • Minimal view (today only) or full view with the past sessions.
  • Optional marks for breaks of each level, rejections at the average range, returns inside the box and retests of the box edge, read on closed candles only.
  • Panel with the current zone, today’s levels and how often past sessions reached each level or closed inside the box.

How to Read the Indicator

 

  • Inside the yellow box: normal session noise. Fading the edges is the classic idea.
  • Close above or below the box (YB▲ / YB▼): the next level is the edge of the average range.
  • Average range edge: the decision zone. A rejection candle there (AVG ✕) points back towards the box; a close beyond it (AVG▲ / AVG▼) is continuation, and the max range becomes the target.
  • Beyond the max range (MAX R▲ / MAX R▼): a trend day read.
  • RETEST: price broke out of the box and came back to hold its edge. The usual plan is a target at the average range and a stop beyond the opposite side of the box.
  • Back in: a close back inside the yellow box.
  • The panel’s “Reached” and “Max hit” rows show, for the sessions on the chart, how often the high and low reached each level, and “Closed in” how often the session closed inside the box.

Practical Applications

 

  • Mean reversion inside the day: fade moves into the average range when the panel shows that sessions rarely close beyond it.
  • Breakout confirmation: a close beyond the max range early in the session separates a trend day from a normal one.
  • Stop and target placement: the box edges and the average range give levels sized to the instrument’s real hourly volatility, not to a fixed number of points.
  • Context for other signals: a long signal right under the top of the average range has less room than one inside the box.

Indicator Configuration

 

  • sessWin (default 50): sessions of 60-minute candles used to measure the stretch (10 to 250).
  • anchorMode (default 0): 0 = prior close, 1 = session open.
  • pctBox (default 70): share of hourly candles that stay inside the box (50 to 95).
  • pctMax (default 95): share of hourly candles that stay inside the max range (80 to 99.5).
  • breakOnClose (default 1): a level counts as broken only on a close beyond it; 0 = a wick is enough. Best read on a 1 to 5-minute chart.
  • showMarks (default 0): mark breaks, rejections and retests.
  • maxMarks (default 12): drawing limit for the marks.
  • fullView (default 0): 0 = today’s levels, 1 = past sessions too.
  • sessShown (default 5): sessions drawn in full view.
  • showZones (default 1): shade the average range zones.
  • showMaxT (default 1): max trend lines.
  • showLabels (default 1) and showPrices (default 1): labels and prices on today’s levels.
  • showPanel (default 1): panel in the top right corner.

The chart must be 60 minutes or lower. Sessions are the platform’s daily candles.

The Code

 

//---------------------------------------------------------------
// PRC_Yellow Box Range
// version = 0
// 23.11.2026
// Iván González @ www.prorealcode.com
// Author: arleay
// Sharing ProRealTime knowledge
//--------------------------------------------------------------------//
defparam drawonlastbaronly = true
//--------------------------------------------------------------------//
// Inputs
//--------------------------------------------------------------------//
// Levels
sessWin = 50          // sessions of 60-minute candles used to measure the stretch (10..250)
anchorMode = 0        // 0 = prior close, 1 = session open
pctBox = 70           // % of 60-minute candles whose high (top) or low (bottom) stays inside the box (50..95)
pctMax = 95           // % of 60-minute candles that stay inside the max range (80..99.5)
// Breaks
breakOnClose = 1      // 1 = a level counts as broken only on a close beyond it, 0 = a wick is enough
showMarks = 0         // 1 = mark breaks, rejections and retests
maxMarks = 12         // drawing limit for the marks (0..60)
// Chart
fullView = 0          // 0 = minimal (today's levels), 1 = full (past sessions too)
sessShown = 5         // sessions drawn in full view (1..60)
showZones = 1         // shade the average range zones
showMaxT = 1          // show the max trend lines
showLabels = 1        // show labels
showPrices = 1        // show prices in the labels
showPanel = 1         // show the panel
//--------------------------------------------------------------------//
// Data of the 60-minute and daily candles
//--------------------------------------------------------------------//
TIMEFRAME(1 hour)
hO = open
hPH = high[1]
hPL = low[1]
hPC = close[1]
TIMEFRAME(daily)
dayO = open
dPH = high[1]
dPL = low[1]
dPC = close[1]
TIMEFRAME(default)

ONCE nSmp = 0          // 60-minute samples stored
ONCE nSes = 0          // sessions started
ONCE ancOk = 0
ONCE lvReady = 0
ONCE nD = 0            // sessions with levels (drawn days)
ONCE nEv = 0           // break / rejection / retest marks
ONCE zoneSt = 0
ONCE rejU = 0
ONCE rejD = 0
ONCE rtU = 0
ONCE rtD = 0
ONCE dHiOk = 0
ONCE nDays = 0
ONCE hYT = 0
ONCE hYB = 0
ONCE hAT = 0
ONCE hAB = 0
ONCE hMT = 0
ONCE hMB = 0
ONCE hIn = 0

// A new 60-minute or daily candle starts when its open or the previous candle changes
newHour = 0
newDay = 0
IF barindex > 0 THEN
   IF hO <> hO[1] OR hPH <> hPH[1] OR hPL <> hPL[1] OR hPC <> hPC[1] THEN
      newHour = 1
   ENDIF
   IF dayO <> dayO[1] OR dPH <> dPH[1] OR dPL <> dPL[1] OR dPC <> dPC[1] THEN
      newDay = 1
   ENDIF
ENDIF

//--------------------------------------------------------------------//
// 1) Stretch of the 60-minute candle that has just closed, measured from its session anchor
//--------------------------------------------------------------------//
IF newHour = 1 AND ancOk = 1 THEN
   $sU[nSmp] = max(0, hPH - ancCur)
   $sD[nSmp] = max(0, ancCur - hPL)
   nSmp = nSmp + 1
ENDIF

//--------------------------------------------------------------------//
// 2) Breaks, rejections and retests, read on the last CLOSED candle
//    (the live candle is not used, so marks do not appear and vanish tick by tick)
//--------------------------------------------------------------------//
IF nD > 0 AND barindex > 0 THEN
   pH = high[1]
   pL = low[1]
   pC = close[1]
   pO = open[1]
   IF dHiOk = 0 THEN
      dHi = pH
      dLo = pL
      dHiOk = 1
   ELSE
      dHi = max(dHi, pH)
      dLo = min(dLo, pL)
   ENDIF
   dCl = pC
   IF breakOnClose = 1 THEN
      upX = pC
      dnX = pC
   ELSE
      upX = pH
      dnX = pL
   ENDIF
   IF upX > lvMT THEN
      zNow = 3
   ELSIF upX > lvAT THEN
      zNow = 2
   ELSIF upX > lvYT THEN
      zNow = 1
   ELSIF dnX < lvMB THEN
      zNow = -3
   ELSIF dnX < lvAB THEN
      zNow = -2
   ELSIF dnX < lvYB THEN
      zNow = -1
   ELSE
      zNow = 0
   ENDIF
   // codes: 1..3 break up (box, average, max), -1..-3 break down,
   // 4 rejection at the top of the average range, 5 at the bottom, 6 back in the box,
   // 7 retest of the top of the box, 8 retest of the bottom
   IF zNow > 0 AND zNow > zoneSt AND zoneSt >= 0 THEN
      $evB[nEv] = barindex - 1
      $evY[nEv] = pH
      $evC[nEv] = zNow
      nEv = nEv + 1
   ENDIF
   IF zNow < 0 AND zNow < zoneSt AND zoneSt <= 0 THEN
      $evB[nEv] = barindex - 1
      $evY[nEv] = pL
      $evC[nEv] = zNow
      nEv = nEv + 1
   ENDIF
   IF rejU = 0 AND pH >= lvAT AND pC < lvAT AND pC < pO THEN
      rejU = 1
      $evB[nEv] = barindex - 1
      $evY[nEv] = pH
      $evC[nEv] = 4
      nEv = nEv + 1
   ENDIF
   IF rejD = 0 AND pL <= lvAB AND pC > lvAB AND pC > pO THEN
      rejD = 1
      $evB[nEv] = barindex - 1
      $evY[nEv] = pL
      $evC[nEv] = 5
      nEv = nEv + 1
   ENDIF
   IF zNow = 0 AND zoneSt <> 0 THEN
      $evB[nEv] = barindex - 1
      $evY[nEv] = pC
      $evC[nEv] = 6
      nEv = nEv + 1
   ENDIF
   IF zoneSt >= 1 AND zNow >= 1 AND rtU = 0 AND pL <= lvYT AND pC > lvYT THEN
      rtU = 1
      $evB[nEv] = barindex - 1
      $evY[nEv] = pL
      $evC[nEv] = 7
      nEv = nEv + 1
   ENDIF
   IF zoneSt <= -1 AND zNow <= -1 AND rtD = 0 AND pH >= lvYB AND pC < lvYB THEN
      rtD = 1
      $evB[nEv] = barindex - 1
      $evY[nEv] = pH
      $evC[nEv] = 8
      nEv = nEv + 1
   ENDIF
   zoneSt = zNow
ENDIF

//--------------------------------------------------------------------//
// 3) New session: levels from the 60-minute stretches of the previous sessions
//--------------------------------------------------------------------//
IF newDay = 1 THEN
   nWin = min(nSes, sessWin)
   IF nWin >= 5 THEN
      w0 = $sesFirst[nSes - nWin]
      nW = nSmp - w0
      IF nW > 0 THEN
         FOR sideK = 0 TO 1 DO
            // working copy of the window (rebuilt every time: no state kept between ticks)
            vTop = 0
            FOR j = 0 TO nW - 1 DO
               IF sideK = 0 THEN
                  $w[j] = $sU[w0 + j]
               ELSE
                  $w[j] = $sD[w0 + j]
               ENDIF
               vTop = max(vTop, $w[j])
            NEXT
            // job 0: nearest-rank percentile of the box, job 1: of the max range,
            // job 2: median of the stretches beyond the box
            FOR jobK = 0 TO 2 DO
               IF jobK = 2 THEN
                  mA = 0
                  FOR j = 0 TO nW - 1 DO
                     IF $w[j] > vBox THEN
                        $w[mA] = $w[j]
                        mA = mA + 1
                     ENDIF
                  NEXT
                  nSel = mA
                  kSel = floor(mA / 2)
               ELSE
                  nSel = nW
                  IF jobK = 0 THEN
                     pctNow = pctBox
                  ELSE
                     pctNow = pctMax
                  ENDIF
                  kN = floor(pctNow * nW / 100)
                  IF kN * 100 < pctNow * nW THEN
                     kN = kN + 1
                  ENDIF
                  kSel = max(0, kN - 1)
               ENDIF
               selV = 0
               IF nSel > 0 THEN
                  // Wirth selection: k-th smallest value, exact with ties
                  wLo = 0
                  wHi = nSel - 1
                  WHILE wLo < wHi DO
                     pv = $w[kSel]
                     i1 = wLo
                     j1 = wHi
                     WHILE i1 <= j1 DO
                        WHILE $w[i1] < pv DO
                           i1 = i1 + 1
                        WEND
                        WHILE pv < $w[j1] DO
                           j1 = j1 - 1
                        WEND
                        IF i1 <= j1 THEN
                           tmp = $w[i1]
                           $w[i1] = $w[j1]
                           $w[j1] = tmp
                           i1 = i1 + 1
                           j1 = j1 - 1
                        ENDIF
                     WEND
                     IF j1 < kSel THEN
                        wLo = i1
                     ENDIF
                     IF kSel < i1 THEN
                        wHi = j1
                     ENDIF
                  WEND
                  selV = $w[kSel]
               ENDIF
               IF jobK = 0 THEN
                  vBox = selV
               ELSIF jobK = 1 THEN
                  vMax = selV
               ELSE
                  IF nSel > 0 THEN
                     vAvg = selV
                     IF nSel MOD 2 = 0 THEN
                        // even count: mean of the two middle values
                        lowMid = $w[0]
                        IF kSel >= 2 THEN
                           FOR j = 1 TO kSel - 1 DO
                              lowMid = max(lowMid, $w[j])
                           NEXT
                        ENDIF
                        vAvg = (vAvg + lowMid) / 2
                     ENDIF
                  ELSE
                     vAvg = vBox
                  ENDIF
               ENDIF
            NEXT
            IF sideK = 0 THEN
               uB = vBox
               uA = vAvg
               uM = vMax
               uT = vTop
            ELSE
               dB = vBox
               dA = vAvg
               dM = vMax
               dT = vTop
            ENDIF
         NEXT
         lvReady = 1
      ENDIF
   ENDIF
   $sesFirst[nSes] = nSmp
   nSes = nSes + 1
   IF anchorMode = 0 THEN
      ancCur = close[1]
   ELSE
      ancCur = open
   ENDIF
   ancOk = 1

   IF lvReady = 1 THEN
      // close the previous session and count which levels it reached
      IF nD > 0 AND dHiOk = 1 THEN
         nDays = nDays + 1
         IF dHi >= lvYT THEN
            hYT = hYT + 1
         ENDIF
         IF dLo <= lvYB THEN
            hYB = hYB + 1
         ENDIF
         IF dHi >= lvAT THEN
            hAT = hAT + 1
         ENDIF
         IF dLo <= lvAB THEN
            hAB = hAB + 1
         ENDIF
         IF dHi >= lvMT THEN
            hMT = hMT + 1
         ENDIF
         IF dLo <= lvMB THEN
            hMB = hMB + 1
         ENDIF
         IF dCl <= lvYT AND dCl >= lvYB THEN
            hIn = hIn + 1
         ENDIF
      ENDIF
      lvAnc = ancCur
      lvYT = ancCur + uB
      lvYB = ancCur - dB
      lvAT = ancCur + uA
      lvAB = ancCur - dA
      lvMT = ancCur + uM
      lvMB = ancCur - dM
      lvTT = ancCur + uT
      lvTB = ancCur - dT
      $dT0[nD] = barindex
      $dAnc[nD] = lvAnc
      $dYT[nD] = lvYT
      $dYB[nD] = lvYB
      $dAT[nD] = lvAT
      $dAB[nD] = lvAB
      $dMT[nD] = lvMT
      $dMB[nD] = lvMB
      $dTT[nD] = lvTT
      $dTB[nD] = lvTB
      nD = nD + 1
      zoneSt = 0
      rejU = 0
      rejD = 0
      rtU = 0
      rtD = 0
      dHiOk = 0
   ENDIF
ENDIF

//--------------------------------------------------------------------//
// 4) Drawing
//--------------------------------------------------------------------//
IF islastbarupdate THEN
   tfOk = 0
   IF GetTimeFrame <= 3600 THEN
      tfOk = 1
   ENDIF
   IF tfOk = 1 AND nD > 0 THEN
      xr = barindex + 10
      IF fullView = 1 THEN
         nShow = min(sessShown, nD)
      ELSE
         nShow = 1
      ENDIF
      FOR iDw = 0 TO nShow - 1 DO
         k = nD - 1 - iDw
         x1 = $dT0[k]
         IF iDw = 0 THEN
            x2 = xr
         ELSE
            x2 = $dT0[k + 1]
         ENDIF
         yAnc = $dAnc[k]
         yYT = $dYT[k]
         yYB = $dYB[k]
         yAT = $dAT[k]
         yAB = $dAB[k]
         yMT = $dMT[k]
         yMB = $dMB[k]
         yTT = $dTT[k]
         yTB = $dTB[k]
         // yellow box and its edges
         DRAWRECTANGLE(x1, yYT, x2, yYB) COLOURED(255, 214, 0, 0) FILLCOLOR(255, 214, 0, 56)
         DRAWSEGMENT(x1, yYT, x2, yYT) COLOURED(0, 0, 0, 179) STYLE(line, 1)
         DRAWSEGMENT(x1, yYB, x2, yYB) COLOURED(0, 0, 0, 179) STYLE(line, 1)
         // average range zones
         IF showZones = 1 THEN
            DRAWRECTANGLE(x1, yAT, x2, yYT) COLOURED(242, 54, 69, 0) FILLCOLOR(242, 54, 69, 31)
            DRAWRECTANGLE(x1, yYB, x2, yAB) COLOURED(8, 153, 129, 0) FILLCOLOR(8, 153, 129, 31)
         ENDIF
         DRAWSEGMENT(x1, yAT, x2, yAT) COLOURED(0, 0, 0, 255) STYLE(dottedline2, 1)
         DRAWSEGMENT(x1, yAB, x2, yAB) COLOURED(0, 0, 0, 255) STYLE(dottedline2, 1)
         DRAWSEGMENT(x1, yMT, x2, yMT) COLOURED(0, 0, 0, 255) STYLE(dottedline, 1)
         DRAWSEGMENT(x1, yMB, x2, yMB) COLOURED(0, 0, 0, 255) STYLE(dottedline, 1)
         DRAWSEGMENT(x1, yAnc, x2, yAnc) COLOURED(0, 0, 0, 102) STYLE(dottedline, 1)
         IF showMaxT = 1 THEN
            DRAWSEGMENT(x1, yTT, x2, yTT) COLOURED(0, 0, 0, 115) STYLE(dottedline, 1)
            DRAWSEGMENT(x1, yTB, x2, yTB) COLOURED(0, 0, 0, 115) STYLE(dottedline, 1)
         ENDIF
         // labels, only on today's levels
         IF iDw = 0 AND showLabels = 1 THEN
            pw10 = POW(10, Decimals)
            pYT = round(yYT * pw10) / pw10
            pYB = round(yYB * pw10) / pw10
            pAT = round(yAT * pw10) / pw10
            pAB = round(yAB * pw10) / pw10
            pMT = round(yMT * pw10) / pw10
            pMB = round(yMB * pw10) / pw10
            pAnc = round(yAnc * pw10) / pw10
            pTT = round(yTT * pw10) / pw10
            pTB = round(yTB * pw10) / pw10
            xL = x2 + 6
            IF showPrices = 1 THEN
               DRAWTEXT("YB #pYT#", xL, yYT, SansSerif, Standard, 9) COLOURED(0, 0, 0, 255)
               DRAWTEXT("YB #pYB#", xL, yYB, SansSerif, Standard, 9) COLOURED(0, 0, 0, 255)
               DRAWTEXT("AVG #pAT#", xL, yAT, SansSerif, Standard, 9) COLOURED(0, 0, 0, 255)
               DRAWTEXT("AVG #pAB#", xL, yAB, SansSerif, Standard, 9) COLOURED(0, 0, 0, 255)
               DRAWTEXT("MAX R #pMT#", xL, yMT, SansSerif, Standard, 9) COLOURED(0, 0, 0, 255)
               DRAWTEXT("MAX R #pMB#", xL, yMB, SansSerif, Standard, 9) COLOURED(0, 0, 0, 255)
               DRAWTEXT("ANCHOR #pAnc#", xL, yAnc, SansSerif, Standard, 9) COLOURED(0, 0, 0, 128)
               IF showMaxT = 1 THEN
                  DRAWTEXT("MAX T #pTT#", xL, yTT, SansSerif, Standard, 9) COLOURED(0, 0, 0, 153)
                  DRAWTEXT("MAX T #pTB#", xL, yTB, SansSerif, Standard, 9) COLOURED(0, 0, 0, 153)
               ENDIF
            ELSE
               DRAWTEXT("YB", xL, yYT, SansSerif, Standard, 9) COLOURED(0, 0, 0, 255)
               DRAWTEXT("YB", xL, yYB, SansSerif, Standard, 9) COLOURED(0, 0, 0, 255)
               DRAWTEXT("AVG", xL, yAT, SansSerif, Standard, 9) COLOURED(0, 0, 0, 255)
               DRAWTEXT("AVG", xL, yAB, SansSerif, Standard, 9) COLOURED(0, 0, 0, 255)
               DRAWTEXT("MAX R", xL, yMT, SansSerif, Standard, 9) COLOURED(0, 0, 0, 255)
               DRAWTEXT("MAX R", xL, yMB, SansSerif, Standard, 9) COLOURED(0, 0, 0, 255)
               DRAWTEXT("ANCHOR", xL, yAnc, SansSerif, Standard, 9) COLOURED(0, 0, 0, 128)
               IF showMaxT = 1 THEN
                  DRAWTEXT("MAX T", xL, yTT, SansSerif, Standard, 9) COLOURED(0, 0, 0, 153)
                  DRAWTEXT("MAX T", xL, yTB, SansSerif, Standard, 9) COLOURED(0, 0, 0, 153)
               ENDIF
            ENDIF
         ENDIF
      NEXT
      // marks of the sessions on screen, newest first
      IF showMarks = 1 AND maxMarks > 0 AND nEv > 0 THEN
         tFirst = $dT0[nD - nShow]
         offY = averagetruerange[14](close) * 0.4
         nM = 0
         eLast = max(0, nEv - 80)
         FOR e = nEv - 1 DOWNTO eLast DO
            IF $evB[e] >= tFirst AND nM < maxMarks THEN
               nM = nM + 1
               eX = $evB[e]
               eY = $evY[e]
               eC = $evC[e]
               IF eC = 1 THEN
                  DRAWTEXT("YB▲", eX, eY + offY, SansSerif, Standard, 9) COLOURED(0, 0, 0, 255)
               ELSIF eC = 2 THEN
                  DRAWTEXT("AVG▲", eX, eY + offY, SansSerif, Standard, 9) COLOURED(0, 0, 0, 255)
               ELSIF eC = 3 THEN
                  DRAWTEXT("MAX R▲", eX, eY + offY, SansSerif, Standard, 9) COLOURED(0, 0, 0, 255)
               ELSIF eC = -1 THEN
                  DRAWTEXT("YB▼", eX, eY - offY, SansSerif, Standard, 9) COLOURED(0, 0, 0, 255)
               ELSIF eC = -2 THEN
                  DRAWTEXT("AVG▼", eX, eY - offY, SansSerif, Standard, 9) COLOURED(0, 0, 0, 255)
               ELSIF eC = -3 THEN
                  DRAWTEXT("MAX R▼", eX, eY - offY, SansSerif, Standard, 9) COLOURED(0, 0, 0, 255)
               ELSIF eC = 4 THEN
                  DRAWTEXT("AVG ✕", eX, eY + offY, SansSerif, Standard, 9) COLOURED(0, 0, 0, 255)
               ELSIF eC = 5 THEN
                  DRAWTEXT("AVG ✕", eX, eY - offY, SansSerif, Standard, 9) COLOURED(0, 0, 0, 255)
               ELSIF eC = 6 THEN
                  DRAWTEXT("back in", eX + 3, eY, SansSerif, Standard, 9) COLOURED(0, 0, 0, 255)
               ELSIF eC = 7 THEN
                  DRAWTEXT("RETEST", eX, eY - offY, SansSerif, Standard, 9) COLOURED(0, 0, 0, 255)
               ELSE
                  DRAWTEXT("RETEST", eX, eY + offY, SansSerif, Standard, 9) COLOURED(0, 0, 0, 255)
               ENDIF
            ENDIF
         NEXT
      ENDIF
   ENDIF

   // panel, anchored to the top right corner of the window
   IF showPanel = 1 THEN
      cLab = -280
      cVal = -150
      pY = -20
      nSesShow = min(nSes, sessWin)
      DRAWTEXT("Yellow Box Range", cLab, pY, SansSerif, Bold, 10) COLOURED(0, 0, 0, 255) ANCHOR(topright, xshift, yshift)
      DRAWTEXT("#nSesShow# sessions of 60m", cVal, pY, SansSerif, Standard, 9) COLOURED(0, 0, 0, 128) ANCHOR(topright, xshift, yshift)
      IF tfOk = 0 THEN
         DRAWTEXT("Note", cLab, pY - 18, SansSerif, Standard, 9) COLOURED(0, 0, 0, 128) ANCHOR(topright, xshift, yshift)
         DRAWTEXT("use a chart of 60m or lower", cVal, pY - 18, SansSerif, Standard, 9) COLOURED(0, 0, 0, 255) ANCHOR(topright, xshift, yshift)
      ELSIF nD > 0 THEN
         pw10 = POW(10, Decimals)
         qYT = round(lvYT * pw10) / pw10
         qYB = round(lvYB * pw10) / pw10
         qAT = round(lvAT * pw10) / pw10
         qAB = round(lvAB * pw10) / pw10
         qMT = round(lvMT * pw10) / pw10
         qMB = round(lvMB * pw10) / pw10
         DRAWTEXT("Now", cLab, pY - 18, SansSerif, Standard, 9) COLOURED(0, 0, 0, 128) ANCHOR(topright, xshift, yshift)
         IF zoneSt = 0 THEN
            DRAWTEXT("inside the yellow box", cVal, pY - 18, SansSerif, Standard, 9) COLOURED(0, 0, 0, 255) ANCHOR(topright, xshift, yshift)
         ELSIF zoneSt = 1 THEN
            DRAWTEXT("above the box → AVG #qAT#", cVal, pY - 18, SansSerif, Standard, 9) COLOURED(0, 0, 0, 255) ANCHOR(topright, xshift, yshift)
         ELSIF zoneSt = 2 THEN
            DRAWTEXT("above AVG, decision zone", cVal, pY - 18, SansSerif, Standard, 9) COLOURED(0, 0, 0, 255) ANCHOR(topright, xshift, yshift)
         ELSIF zoneSt = 3 THEN
            DRAWTEXT("above MAX R, trend", cVal, pY - 18, SansSerif, Standard, 9) COLOURED(0, 0, 0, 255) ANCHOR(topright, xshift, yshift)
         ELSIF zoneSt = -1 THEN
            DRAWTEXT("below the box → AVG #qAB#", cVal, pY - 18, SansSerif, Standard, 9) COLOURED(0, 0, 0, 255) ANCHOR(topright, xshift, yshift)
         ELSIF zoneSt = -2 THEN
            DRAWTEXT("below AVG, decision zone", cVal, pY - 18, SansSerif, Standard, 9) COLOURED(0, 0, 0, 255) ANCHOR(topright, xshift, yshift)
         ELSE
            DRAWTEXT("below MAX R, trend", cVal, pY - 18, SansSerif, Standard, 9) COLOURED(0, 0, 0, 255) ANCHOR(topright, xshift, yshift)
         ENDIF
         DRAWTEXT("Box", cLab, pY - 36, SansSerif, Standard, 9) COLOURED(0, 0, 0, 128) ANCHOR(topright, xshift, yshift)
         DRAWTEXT("#qYB# - #qYT#", cVal, pY - 36, SansSerif, Standard, 9) COLOURED(0, 0, 0, 255) ANCHOR(topright, xshift, yshift)
         DRAWTEXT("Average", cLab, pY - 54, SansSerif, Standard, 9) COLOURED(0, 0, 0, 128) ANCHOR(topright, xshift, yshift)
         DRAWTEXT("#qAB# / #qAT#", cVal, pY - 54, SansSerif, Standard, 9) COLOURED(0, 0, 0, 255) ANCHOR(topright, xshift, yshift)
         DRAWTEXT("Max range", cLab, pY - 72, SansSerif, Standard, 9) COLOURED(0, 0, 0, 128) ANCHOR(topright, xshift, yshift)
         DRAWTEXT("#qMB# / #qMT#", cVal, pY - 72, SansSerif, Standard, 9) COLOURED(0, 0, 0, 255) ANCHOR(topright, xshift, yshift)
         DRAWTEXT("Reached", cLab, pY - 90, SansSerif, Standard, 9) COLOURED(0, 0, 0, 128) ANCHOR(topright, xshift, yshift)
         DRAWTEXT("Max hit", cLab, pY - 108, SansSerif, Standard, 9) COLOURED(0, 0, 0, 128) ANCHOR(topright, xshift, yshift)
         DRAWTEXT("Closed in", cLab, pY - 126, SansSerif, Standard, 9) COLOURED(0, 0, 0, 128) ANCHOR(topright, xshift, yshift)
         IF nDays > 0 THEN
            rYT = round(100 * hYT / nDays)
            rYB = round(100 * hYB / nDays)
            rAT = round(100 * hAT / nDays)
            rAB = round(100 * hAB / nDays)
            rMT = round(100 * hMT / nDays)
            rMB = round(100 * hMB / nDays)
            rIn = round(100 * hIn / nDays)
            DRAWTEXT("box #rYT#% / #rYB#% · avg #rAT#% / #rAB#%", cVal, pY - 90, SansSerif, Standard, 9) COLOURED(0, 0, 0, 255) ANCHOR(topright, xshift, yshift)
            DRAWTEXT("#rMT#% / #rMB#% · n #nDays#", cVal, pY - 108, SansSerif, Standard, 9) COLOURED(0, 0, 0, 255) ANCHOR(topright, xshift, yshift)
            DRAWTEXT("#rIn#% of sessions", cVal, pY - 126, SansSerif, Standard, 9) COLOURED(0, 0, 0, 255) ANCHOR(topright, xshift, yshift)
         ELSE
            DRAWTEXT("box - / - · avg - / -", cVal, pY - 90, SansSerif, Standard, 9) COLOURED(0, 0, 0, 255) ANCHOR(topright, xshift, yshift)
            DRAWTEXT("- / - · n 0", cVal, pY - 108, SansSerif, Standard, 9) COLOURED(0, 0, 0, 255) ANCHOR(topright, xshift, yshift)
            DRAWTEXT("- of sessions", cVal, pY - 126, SansSerif, Standard, 9) COLOURED(0, 0, 0, 255) ANCHOR(topright, xshift, yshift)
         ENDIF
      ENDIF
      DRAWTEXT("Credit", cLab, pY - 144, SansSerif, Standard, 9) COLOURED(0, 0, 0, 128) ANCHOR(topright, xshift, yshift)
      DRAWTEXT("free · @arleaynt on X", cVal, pY - 144, SansSerif, Standard, 9) COLOURED(0, 0, 0, 90) ANCHOR(topright, xshift, yshift)
   ENDIF
ENDIF

RETURN

Original author: arleay, published open source under the Mozilla Public License 2.0.

Download
Filename: PRC_Yellow-Box-Range.itf
Downloads: 4
Iván González
Iván González Legend
I usually let my code do the talking, which explains why my bio is as empty as a newly created file. Bio to be initialized...
Author’s Profile

Comments

ProRealCode ProRealCode
Loading...