Nicolas

Pivot Scalping Map: pivot points, round numbers and confluence zones on one intraday chart

Studio Only
Category: Indicators By: Nicolas Created: December 4, 2026, 4:38 PM
December 4, 2026, 4:38 PM
Indicators
0 Comments
ProRealCode Script
Pivot Scalping Map: pivot points, round numbers and confluence zones on one intraday chart

Pivot Scalping Map puts every level an intraday trader watches on one chart: the daily pivot points, the weekly and monthly pivots, yesterday’s high, low and close, today’s open and the round numbers. Each level carries a label with its name, its price and its distance from the price. Levels that fall at almost the same price are merged into one zone with one label naming them all, arrows mark the candles that rejected a daily level, and a table gives the bias, the next level on each side and how much of an average day the market has already travelled.

This code is written in ProRealCode Script and runs with ProRealCode Studio on ProRealTime Web.

Pivot scalping map on a 1-minute Mini Nasdaq 100 chart: daily pivots, round numbers and merged confluence zones with their labels, rejection arrows and the summary table

Mini Nasdaq 100 future, 1 minute, dark theme, Classic pivots. The price is 204.6 points under the daily pivot and has covered 82 % of an average day. Yesterday’s low and S1 make one red zone above the price: two red arrows mark the candles that were rejected under it early in the session. Lower down, S2 and the round number 27100 make one zone. The price crossed it, came back to it from below and was rejected again: green and red arrows on both sides of the same zone, a support that turned into resistance. Under it, the round number 27000 and the monthly pivot make a second green zone.

Why one map

A scalper works between levels: a level is where the price may stop, turn or speed up, and the distance to the next one is the room a trade has. The usual way is to stack several indicators, one for the pivots, one for yesterday’s prices, lines drawn by hand for the round numbers. They overlap, their labels hide each other, and the one thing that matters most, two or three levels at the same price, has to be spotted by eye.

Here all of them come from one code. They are sorted by price, the ones that coincide become a zone, and every label says how far it is from the price. The question “where is the next level, and how far?” has its answer written on the chart.

1. The levels

All the levels come from finished daily, weekly and monthly candles, read with MarketData on the chart’s own instrument whatever the timeframe of the chart. The candle in progress is never used, so a level never moves during the day. A new set of levels starts when the last finished daily candle changes.

The daily pivot points come from yesterday’s high (H), low (L) and close (C), with one of three formulas. The pivot itself is always P = (H + L + C) / 3.

  • Classic: the floor pivots. R1 = 2 × P – L, R2 = P + (H – L), R3 = H + 2 × (P – L), and the mirror for the supports: S1 = 2 × P – H, S2 = P – (H – L), S3 = L – 2 × (H – P).
  • Fibonacci: the pivot plus and minus 38.2 %, 61.8 % and 100 % of yesterday’s range (H – L) for R1 to R3 and S1 to S3.
  • Camarilla: tighter levels around yesterday’s close: C plus and minus 1.1 × (H – L) divided by 12, 6 and 4 for the first, second and third levels.

On top of the daily set, each a switch in the settings:

  • Mid-points (R0.5, R1.5, R2.5, S0.5, S1.5, S2.5): halfway between two daily levels. Off by default.
  • Weekly pivot (W PP, W R1, W S1): the same formula on last week’s high, low and close.
  • Monthly pivot (M PP, M R1, M S1): the same formula on last month’s.
  • Yesterday’s high, low and close (Y high, Y low, Y close).
  • Today’s open (Open): the open of the first candle of the day.
  • Round numbers (Round): every 100 points by default, drawn within one average day around the price (the average of the last 20 daily ranges, or today’s range if it is already wider).

Each family has its colour: amber for the pivot, red for R1 to R3, green for S1 to S3, blue for yesterday’s prices, purple for the weekly levels, orange for the monthly levels and grey for the open, the mid-points and the round numbers. The daily pivot is the thickest line, R1 to S3 are solid, and the other levels are dotted. The lines start at the first candle of the day and run a little past the last candle, where the labels sit.

2. The zones

Two levels a few points apart are, for the market, one level. The code measures the average candle range with the ATR of 50 candles, and every level closer than that distance to the lowest level of a group joins the group. A group of two or more levels becomes a zone: a shaded band from its lowest to its highest level, and a single label that names every level inside it, such as “S2 + Round” or “Y low + S1”. The price on a zone label is the middle of the zone.

A zone takes the colour of its side of the price: red when it is entirely above the price, green when it is entirely below, amber when the price is inside it. The setting “Zone: levels closer than” widens or narrows the merge; 0 never merges.

3. The labels

Each level or zone has one label at the right of the chart: its name, its price and its distance from the last price in points, with a sign. “Round 27200 · +4” is a round number 4 points above the price; “S3 26928.92 · -267.1” is the third support, 267.1 points under it. The distances move with every tick, the prices do not.

4. The rejection arrows

An arrow marks a candle that rejected one of the daily levels (the pivot, R1 to R3, S1 to S3, yesterday’s high or low). A rejection needs three things on the same candle:

  • the wick crosses the level;
  • the open and the close both stay on the side the candle came from;
  • that wick is at least half of the whole candle.

A red arrow above the candle is a rejection from below: the price went up through the level and closed back under it. A green arrow under the candle is the opposite, a rejection from above. Only the daily levels count here: a candle that rejects a round number alone gets no arrow, while a candle whose wick crosses the daily level inside a zone does.

Pivot scalping map on a 1-minute Mini Dow chart in light theme: a rejection arrow above the candle that touched the daily pivot, and a zone where yesterday's close meets a round number

Mini Dow future, 1 minute, light theme, mid-points on. A red arrow sits above the candle whose wick touched the daily pivot at 51255.67 and closed back under it. The price is now 20.7 points under the pivot, the next level up. Below, yesterday’s close and the round number 51200 are merged into one green zone, “Y close + Round 51199”, 36 points away.

5. The levels of the past days

When a new day starts, the daily pivot, R1 to R3 and S1 to S3 of the day that just ended stay on the chart as thin lines across that day. Scrolling back shows how the price behaved around each of them, day after day, which is the quickest way to see whether these levels mean anything on a given instrument.

The table

  • Pivot map · Classic: the title, with the formula in use.
  • Bias: above or below the daily pivot, and by how many points. Green above, red below.
  • Next level up: the nearest level or zone entirely above the price, with its price and distance, as on its label.
  • Next level down: the same, below the price. A zone the price is inside is neither up nor down.
  • Day range: today’s high minus today’s low, and that range as a percentage of the average of the last 20 days, with a bar. The bar turns amber at 100 %: the market has already done a full average day, and the room left on each side is usually smaller.
  • Zones today: how many zones and how many levels the map holds.

While the daily candles are still loading, a small card says “Pivot map · waiting for the daily candles” in place of the table, and the levels appear as soon as the candles arrive.

Settings and how to use it

Paste the code into a new Studio tab and run it on an intraday chart; the captures above are on 1 minute. Every setting has a help text in the Settings form. There are twelve, in four sections:

Pivot points

  • Pivot formula: Classic by default, or Fibonacci or Camarilla.
  • Mid-points between the daily levels: a switch, off by default.
  • Weekly pivot, R1 and S1: a switch, on by default.
  • Monthly pivot, R1 and S1: a switch, on by default.

Other levels

  • Yesterday’s high, low and close: a switch, on by default.
  • Today’s open: a switch, on by default.
  • Round numbers every (0 = none): 100 by default. Adapt it to the instrument: 100 suits an index that moves several hundred points a day, 50 or 25 a quieter one, and 0 hides the round numbers.

Zones and signals

  • Zone: levels closer than (x average candle range): 1 by default, in multiples of the ATR of 50 candles. Raise it to merge more, lower it to keep the levels apart, 0 never merges.
  • Arrows on rejections: a switch, on by default.
  • Alert when the price reaches a daily level: a switch, off by default. When it is on, an alert with a sound fires once per candle when the live candle touches a daily pivot level or yesterday’s high or low. It works in real time only, not on the history.

Display

  • Daily levels of the past days: a switch, on by default.
  • Summary table: a switch, on by default.

Settings form of the pivot scalping map: pivot formula, mid-points, weekly and monthly pivots, yesterday's levels, today's open, round numbers, zone width and rejection arrows

The settings form, here with the mid-points switched on. The sections Pivot points, Other levels and Zones and signals are visible; Display is further down.

Things to know before reading the chart:

  • The day is the platform’s day. The levels follow the instrument’s own daily candles, so they change when the platform closes a daily candle, not at a fixed hour of your choosing.
  • A weekly or monthly level that is not known yet is left out, for instance while its candles are still loading. The daily levels do not wait for it.
  • The round-number step is the setting to check first. The round numbers are drawn within one average day on each side of the price, twelve at most. With a step of 100, an index whose average day is 500 points gets about ten of them, and one whose average day is 60 points gets one or none.
  • Many levels make many zones. If the map is crowded, switch off the families you do not use, the mid-points first, or lower the zone width.

A typical reading: the price falls towards a green zone where S2 meets a round number, and the table says the day range is already past 100 % of an average day. The move has used most of its usual room, and the zone gathers two reasons for buyers to show up. A green arrow on that zone is a third. Each of these is a reason. None of them is a signal on its own: if the price closes through the zone instead, the next label down says how far the next level is.

Under the hood

The code also shows several additions of ProRealCode Script: MarketData on the chart’s own instrument to read finished daily, weekly and monthly candles from an intraday chart, TIMEFRAME for the 20-day average range, FUNCTION with several return values (the seven levels of a pivot set, the three parts of a colour) and with text parameters, arrays of text for the names of the levels, input() settings with list, switch and number types grouped in sections with their help texts, DRAWLABEL for the labels, DRAWRECTANGLE for the zones, DRAWARROWUP and DRAWARROWDOWN for the rejections, alert() for the touches, and a table built with DRAWTABLE, TABLEMERGE, TABLECELL and TABLEBAR for the day range.

//----------------------------------------------------------------
// PRC_Pivot Scalping Map | indicator
// Author: Nicolas
// Date: 04.12.2026
// https://www.prorealcode.com
// License: CC BY-NC 4.0 - free to use, share and modify for
// non-commercial purposes, provided the author and the source
// above are credited.
// https://creativecommons.org/licenses/by-nc/4.0/
//----------------------------------------------------------------
// Every level an intraday trader watches, on one chart: the daily
// pivot points, the weekly and monthly pivots, yesterday's high, low
// and close, today's open and the round numbers. Each level carries
// its name, its price and its distance from the price. Levels that
// fall at the same price are merged into one zone. Arrows mark the
// candles that rejected a level, and a table gives the bias, the
// next level on each side and how much of an average day is done.
// Runs with ProRealCode Studio: https://www.prorealcode.com/prorealcode-studio/
//----------------------------------------------------------------

DEFPARAM overlay = true

input(method, "Classic", "Pivot formula", string, options = ["Classic", "Fibonacci", "Camarilla"], group = "Pivot points", tooltip = "Classic: the floor pivots, from yesterday's high, low and close. Fibonacci: the pivot plus and minus 38.2, 61.8 and 100 percent of yesterday's range. Camarilla: tighter levels around yesterday's close.")
input(showMid, 0, "Mid-points between the daily levels", bool, group = "Pivot points", tooltip = "Adds a dotted level halfway between two daily levels. R0.5 is halfway between the pivot and R1.")
input(showWeekly, 1, "Weekly pivot, R1 and S1", bool, group = "Pivot points", tooltip = "The same formula on last week's high, low and close.")
input(showMonthly, 1, "Monthly pivot, R1 and S1", bool, group = "Pivot points", tooltip = "The same formula on last month's high, low and close.")
input(showPrev, 1, "Yesterday's high, low and close", bool, group = "Other levels", tooltip = "The three prices of the last finished day.")
input(showOpen, 1, "Today's open", bool, group = "Other levels", tooltip = "The open of the first candle of the day.")
input(roundStep, 100, "Round numbers every (0 = none)", float, minval = 0, group = "Other levels", tooltip = "100 draws 24400, 24500, 24600 around the price. Use 50 or 25 on a quieter index, 0 to hide them.")
input(conflAtr, 1, "Zone: levels closer than (x average candle range)", float, minval = 0, group = "Zones and signals", tooltip = "Levels closer to each other than this are merged into one zone, with one label. The average range is the ATR of 50 candles. 0 never merges.")
input(showReject, 1, "Arrows on rejections", bool, group = "Zones and signals", tooltip = "An arrow when a candle crosses a daily level with its wick and closes back on the side it came from, the wick being at least half of the candle.")
input(useAlerts, 0, "Alert when the price reaches a daily level", bool, group = "Zones and signals", tooltip = "One alert per candle, with a sound, when the live candle touches a daily pivot level or yesterday's high or low.")
input(showPast, 1, "Daily levels of the past days", bool, group = "Display", tooltip = "Keeps the daily pivot levels of the finished days on the chart, to see how the price reacted to them.")
input(showTable, 1, "Summary table", bool, group = "Display", tooltip = "The bias against the daily pivot, the next level on each side, and today's range against the average of the last 20 days.")

// The seven levels of a pivot set, from a high, a low and a close
FUNCTION pivots(h, l, c, m)
    p = (h + l + c) / 3
    w = h - l
    IF m = 1 THEN
        RETURN p, p + 0.382 * w, p + 0.618 * w, p + w, p - 0.382 * w, p - 0.618 * w, p - w
    ELSIF m = 2 THEN
        RETURN p, c + w * 1.1 / 12, c + w * 1.1 / 6, c + w * 1.1 / 4, c - w * 1.1 / 12, c - w * 1.1 / 6, c - w * 1.1 / 4
    ENDIF
    RETURN p, 2 * p - l, p + w, h + 2 * (p - l), 2 * p - h, p - w, l - 2 * (h - p)
ENDFUNCTION

// One more level in the list of the day. A level that is not known yet
// (a weekly candle still loading) is left out.
FUNCTION addLevel(k, v, nm, kind)
    IF ISSET(v) THEN
        $lv[k] = v
        $nm[k] = nm
        $kd[k] = kind
        RETURN k + 1
    ENDIF
    RETURN k
ENDFUNCTION

// The colour of a family of levels
FUNCTION kindColour(kind)
    IF kind = 0 THEN
        RETURN 250, 195, 80
    ELSIF kind = 1 THEN
        RETURN 240, 85, 95
    ELSIF kind = 2 THEN
        RETURN 60, 210, 150
    ELSIF kind = 3 THEN
        RETURN 90, 170, 255
    ELSIF kind = 5 THEN
        RETURN 180, 130, 255
    ELSIF kind = 6 THEN
        RETURN 255, 150, 70
    ENDIF
    RETURN 130, 138, 152
ENDFUNCTION

// -- 1. The candles the levels are made from --------------------------
// MarketData reads the platform's own daily, weekly and monthly
// candles, whatever the timeframe of the chart. Only finished candles
// are read: a level never moves during the day.
yH = MarketData("", 1 day, high, updateonclose)
yL = MarketData("", 1 day, low, updateonclose)
yC = MarketData("", 1 day, close, updateonclose)
wH = MarketData("", 1 week, high, updateonclose)
wL = MarketData("", 1 week, low, updateonclose)
wC = MarketData("", 1 week, close, updateonclose)
mH = MarketData("", 1 month, high, updateonclose)
mL = MarketData("", 1 month, low, updateonclose)
mC = MarketData("", 1 month, close, updateonclose)

// The average range of the last 20 days, on real daily candles
TIMEFRAME(1 day, updateonclose)
avgRange = Average[20](high - low)
TIMEFRAME(default)

m = 0
IF method = "Fibonacci" THEN
    m = 1
ELSIF method = "Camarilla" THEN
    m = 2
ENDIF
atr = AverageTrueRange[50](close)
q = POW(10, decimals)

// -- 2. A new day: new levels -----------------------------------------
// The day changes when the last finished daily candle changes.
newDay = 0
IF ISSET(yH) AND ISSET(yL) AND ISSET(yC) THEN
    IF barindex = 0 THEN
        newDay = 1
    ELSIF ISSET(yC[1]) = 0 THEN
        newDay = 1
    ELSIF yH <> yH[1] OR yL <> yL[1] OR yC <> yC[1] THEN
        newDay = 1
    ENDIF
ENDIF

once dayStart = 0 - 1
IF newDay THEN
    // The daily levels of the day that just ended stay on the chart
    IF showPast AND dayStart >= 0 THEN
        x2 = barindex - 1
        DRAWSEGMENT(dayStart, pp[1], x2, pp[1]) COLOURED(250, 195, 80, 170) STYLE(line, 1)
        DRAWSEGMENT(dayStart, res1[1], x2, res1[1]) COLOURED(240, 85, 95, 150) STYLE(line, 1)
        DRAWSEGMENT(dayStart, res2[1], x2, res2[1]) COLOURED(240, 85, 95, 150) STYLE(line, 1)
        DRAWSEGMENT(dayStart, res3[1], x2, res3[1]) COLOURED(240, 85, 95, 150) STYLE(line, 1)
        DRAWSEGMENT(dayStart, sup1[1], x2, sup1[1]) COLOURED(60, 210, 150, 150) STYLE(line, 1)
        DRAWSEGMENT(dayStart, sup2[1], x2, sup2[1]) COLOURED(60, 210, 150, 150) STYLE(line, 1)
        DRAWSEGMENT(dayStart, sup3[1], x2, sup3[1]) COLOURED(60, 210, 150, 150) STYLE(line, 1)
    ENDIF
    dayStart = barindex
    dayOpen = open
    dayHi = high
    dayLo = low
    (pp, res1, res2, res3, sup1, sup2, sup3) = pivots(yH, yL, yC, m)
ELSIF dayStart >= 0 THEN
    dayHi = MAX(dayHi, high)
    dayLo = MIN(dayLo, low)
ENDIF

// -- 3. Rejections and touches of the daily levels --------------------
// A rejection: the wick crosses the level, the open and the close stay
// on the side the candle came from, and the wick is half of the candle.
rej = 0
touch = 0 - 1
IF dayStart >= 0 THEN
    $dl[0] = pp
    $dl[1] = res1
    $dl[2] = res2
    $dl[3] = res3
    $dl[4] = sup1
    $dl[5] = sup2
    $dl[6] = sup3
    $dl[7] = yH
    $dl[8] = yL
    $dn[0] = "PP"
    $dn[1] = "R1"
    $dn[2] = "R2"
    $dn[3] = "R3"
    $dn[4] = "S1"
    $dn[5] = "S2"
    $dn[6] = "S3"
    $dn[7] = "yesterday's high"
    $dn[8] = "yesterday's low"
    rng = high - low
    FOR k = 0 TO 8 DO
        lev = $dl[k]
        IF high >= lev AND low <= lev THEN
            IF touch < 0 THEN
                touch = k
            ENDIF
            IF rej = 0 AND rng > 0 THEN
                IF open < lev AND close < lev AND high - MAX(open, close) >= 0.5 * rng THEN
                    rej = 0 - 1
                ELSIF open > lev AND close > lev AND MIN(open, close) - low >= 0.5 * rng THEN
                    rej = 1
                ENDIF
            ENDIF
        ENDIF
    NEXT
    IF showReject THEN
        IF rej = 0 - 1 THEN
            DRAWARROWDOWN(barindex, high + 0.4 * atr) COLOURED(240, 85, 95)
        ELSIF rej = 1 THEN
            DRAWARROWUP(barindex, low - 0.4 * atr) COLOURED(60, 210, 150)
        ENDIF
    ENDIF
    IF useAlerts AND touch >= 0 THEN
        hitName = $dn[touch]
        hitTxt = ROUND($dl[touch] * q) / q
        alert("Pivot map", "The price is on #hitName# (#hitTxt#)", onceperbar, 1)
    ENDIF
ENDIF

IF islastbarupdate THEN
    IF dayStart < 0 THEN
        // -- The daily candles have not arrived yet -------------------
        wait = DRAWTABLE(1, 1, topleft) FILLCOLOR(42, 45, 52, 245) BORDERCOLOR(84, 90, 102)
        TABLECELL(wait, 0, 0, "Pivot map · waiting for the daily candles", bold, center, 13) COLOURED(250, 195, 80)
    ELSE
        // -- 4. The list of today's levels ----------------------------
        n = 0
        n = addLevel(n, pp, "PP", 0)
        n = addLevel(n, res1, "R1", 1)
        n = addLevel(n, res2, "R2", 1)
        n = addLevel(n, res3, "R3", 1)
        n = addLevel(n, sup1, "S1", 2)
        n = addLevel(n, sup2, "S2", 2)
        n = addLevel(n, sup3, "S3", 2)
        IF showMid THEN
            n = addLevel(n, (pp + res1) / 2, "R0.5", 8)
            n = addLevel(n, (res1 + res2) / 2, "R1.5", 8)
            n = addLevel(n, (res2 + res3) / 2, "R2.5", 8)
            n = addLevel(n, (pp + sup1) / 2, "S0.5", 8)
            n = addLevel(n, (sup1 + sup2) / 2, "S1.5", 8)
            n = addLevel(n, (sup2 + sup3) / 2, "S2.5", 8)
        ENDIF
        IF showPrev THEN
            n = addLevel(n, yH, "Y high", 3)
            n = addLevel(n, yL, "Y low", 3)
            n = addLevel(n, yC, "Y close", 3)
        ENDIF
        IF showOpen THEN
            n = addLevel(n, dayOpen, "Open", 4)
        ENDIF
        IF showWeekly THEN
            (wp, wr1, wr2, wr3, ws1, ws2, ws3) = pivots(wH, wL, wC, m)
            n = addLevel(n, wp, "W PP", 5)
            n = addLevel(n, wr1, "W R1", 5)
            n = addLevel(n, ws1, "W S1", 5)
        ENDIF
        IF showMonthly THEN
            (mp, mr1, mr2, mr3, ms1, ms2, ms3) = pivots(mH, mL, mC, m)
            n = addLevel(n, mp, "M PP", 6)
            n = addLevel(n, mr1, "M R1", 6)
            n = addLevel(n, ms1, "M S1", 6)
        ENDIF
        // The round numbers around the price, within an average day
        reach = dayHi - dayLo
        IF ISSET(avgRange) THEN
            reach = MAX(reach, avgRange)
        ENDIF
        IF roundStep > 0 THEN
            firstRound = CEIL((close - reach) / roundStep) * roundStep
            FOR j = 0 TO 11 DO
                v = firstRound + j * roundStep
                IF v > close + reach THEN
                    BREAK
                ENDIF
                n = addLevel(n, v, "Round", 7)
            NEXT
        ENDIF

        // The levels sorted by price
        FOR i = 0 TO n - 1 DO
            $ix[i] = i
        NEXT
        FOR i = 1 TO n - 1 DO
            cur = $ix[i]
            j = i - 1
            go = 1
            WHILE go DO
                IF j < 0 THEN
                    go = 0
                ELSIF $lv[$ix[j]] > $lv[cur] THEN
                    $ix[j + 1] = $ix[j]
                    j = j - 1
                ELSE
                    go = 0
                ENDIF
            WEND
            $ix[j + 1] = cur
        NEXT

        // -- 5. Lines, zones and labels -------------------------------
        // Levels within the zone distance of each other make one zone:
        // one band, one label naming them all.
        tol = 0
        IF ISSET(atr) THEN
            tol = conflAtr * atr
        ENDIF
        x1 = dayStart
        x2 = barindex + 14
        nZones = 0
        hasUp = 0
        hasDn = 0
        s = 0
        WHILE s < n DO
            e = s
            go = 1
            WHILE go DO
                IF e + 1 >= n THEN
                    go = 0
                ELSIF $lv[$ix[e + 1]] - $lv[$ix[s]] <= tol THEN
                    e = e + 1
                ELSE
                    go = 0
                ENDIF
            WEND
            lo = $lv[$ix[s]]
            hi = $lv[$ix[e]]
            mid = (lo + hi) / 2
            names = ""
            FOR k = s TO e DO
                p = $ix[k]
                IF k > s THEN
                    names = names + " + "
                ENDIF
                names = names + $nm[p]
                (cr, cg, cb) = kindColour($kd[p])
                IF $kd[p] = 0 THEN
                    DRAWSEGMENT(x1, $lv[p], x2, $lv[p]) COLOURED(cr, cg, cb) STYLE(line, 2)
                ELSIF $kd[p] <= 2 THEN
                    DRAWSEGMENT(x1, $lv[p], x2, $lv[p]) COLOURED(cr, cg, cb) STYLE(line, 1)
                ELSE
                    DRAWSEGMENT(x1, $lv[p], x2, $lv[p]) COLOURED(cr, cg, cb, 210) STYLE(dottedline, 1)
                ENDIF
            NEXT
            pTxt = ROUND(mid * q) / q
            d = ROUND((mid - close) / pipsize * 10) / 10
            IF d >= 0 THEN
                txt = names + " " + pTxt + " · +" + d
            ELSE
                txt = names + " " + pTxt + " · " + d
            ENDIF
            IF e > s THEN
                // A zone takes the colour of its side of the price
                nZones = nZones + 1
                IF lo > close THEN
                    DRAWRECTANGLE(x1, lo, x2, hi) FILLCOLOR(240, 85, 95, 45) COLOURED(240, 85, 95, 0)
                    DRAWLABEL(x2 + 1, mid, txt, arrowleft, small) COLOURED(255, 255, 255) FILLCOLOR(240, 85, 95) BORDERCOLOR(240, 85, 95)
                ELSIF hi < close THEN
                    DRAWRECTANGLE(x1, lo, x2, hi) FILLCOLOR(60, 210, 150, 45) COLOURED(60, 210, 150, 0)
                    DRAWLABEL(x2 + 1, mid, txt, arrowleft, small) COLOURED(14, 18, 30) FILLCOLOR(60, 210, 150) BORDERCOLOR(60, 210, 150)
                ELSE
                    DRAWRECTANGLE(x1, lo, x2, hi) FILLCOLOR(250, 195, 80, 45) COLOURED(250, 195, 80, 0)
                    DRAWLABEL(x2 + 1, mid, txt, arrowleft, small) COLOURED(14, 18, 30) FILLCOLOR(250, 195, 80) BORDERCOLOR(250, 195, 80)
                ENDIF
            ELSE
                (cr, cg, cb) = kindColour($kd[$ix[s]])
                IF $kd[$ix[s]] = 1 THEN
                    DRAWLABEL(x2 + 1, mid, txt, arrowleft, small) COLOURED(255, 255, 255) FILLCOLOR(cr, cg, cb) BORDERCOLOR(cr, cg, cb)
                ELSE
                    DRAWLABEL(x2 + 1, mid, txt, arrowleft, small) COLOURED(14, 18, 30) FILLCOLOR(cr, cg, cb) BORDERCOLOR(cr, cg, cb)
                ENDIF
            ENDIF
            // The nearest level or zone on each side of the price
            IF lo > close AND hasUp = 0 THEN
                hasUp = 1
                upTxt = txt
            ENDIF
            IF hi < close THEN
                hasDn = 1
                dnTxt = txt
            ENDIF
            s = e + 1
        WEND

        // -- 6. The table ---------------------------------------------
        // A neutral grey card with its own text colours: it reads the
        // same on a dark and on a light chart.
        IF showTable THEN
            board = DRAWTABLE(6, 2, topleft) FILLCOLOR(42, 45, 52, 245) BORDERCOLOR(84, 90, 102)
            TABLEMERGE(board, 0, 0, 1, 2)
            TABLECELL(board, 0, 0, "Pivot map · " + method, bold, center, 14) COLOURED(238, 240, 244)
            TABLECELL(board, 1, 0, "Bias") COLOURED(168, 175, 188)
            bd = ROUND((close - pp) / pipsize * 10) / 10
            IF close >= pp THEN
                TABLECELL(board, 1, 1, "above the daily pivot · +" + bd, bold, right) COLOURED(70, 215, 155)
            ELSE
                TABLECELL(board, 1, 1, "below the daily pivot · " + bd, bold, right) COLOURED(255, 110, 120)
            ENDIF
            TABLECELL(board, 2, 0, "Next level up") COLOURED(168, 175, 188)
            IF hasUp THEN
                TABLECELL(board, 2, 1, upTxt, right) COLOURED(255, 110, 120)
            ELSE
                TABLECELL(board, 2, 1, "none above", right) COLOURED(168, 175, 188)
            ENDIF
            TABLECELL(board, 3, 0, "Next level down") COLOURED(168, 175, 188)
            IF hasDn THEN
                TABLECELL(board, 3, 1, dnTxt, right) COLOURED(70, 215, 155)
            ELSE
                TABLECELL(board, 3, 1, "none below", right) COLOURED(168, 175, 188)
            ENDIF
            TABLECELL(board, 4, 0, "Day range") COLOURED(168, 175, 188)
            dr = ROUND((dayHi - dayLo) / pipsize * 10) / 10
            IF ISSET(avgRange) AND avgRange > 0 THEN
                pct = ROUND((dayHi - dayLo) / avgRange * 100)
                IF pct >= 100 THEN
                    TABLEBAR(board, 4, 1, pct, 0, 150, "#dr# · #pct# % of an average day") COLOURED(250, 195, 80)
                ELSE
                    TABLEBAR(board, 4, 1, pct, 0, 150, "#dr# · #pct# % of an average day") COLOURED(110, 170, 255)
                ENDIF
            ELSE
                TABLECELL(board, 4, 1, "#dr#", right) COLOURED(238, 240, 244)
            ENDIF
            TABLECELL(board, 5, 0, "Zones today") COLOURED(168, 175, 188)
            TABLECELL(board, 5, 1, "#nZones# zones · #n# levels", right) COLOURED(238, 240, 244)
        ENDIF
    ENDIF
ENDIF

RETURN
No ITF file for this code
A Studio Only code is not imported into ProRealTime™. Copy it and paste it into the ProRealCode Studio editor.
Nicolas
Nicolas Legend
I created ProRealCode because I believe in the power of shared knowledge. I spend my time coding new tools and helping members solve complex problems. If you are stuck on a code or need a fresh perspective on a strategy, I am always willing to help. Welcome to the community!
Author’s Profile

Comments

ProRealCode ProRealCode
Loading...