Bentrix Docs
HomePricingDashboard

Pivot Points

Trend & channelsoverlay7 linesin every package

Levels computed from the previous closed period's high, low and close: a pivot P, resistance levels above it and support levels below.

Five families: Classic and Fibonacci draw three on each side, Camarilla and Woodie four, DeMark one; Woodie's pivot also reads the open of the period the levels are drawn across, and DeMark's the open of the previous one. A period's levels stay flat through that period, so each line is a staircase that steps when a new period opens. The period is the day on an intraday chart, the week on a daily chart and the month on a weekly one, unless another is chosen; a monthly chart has no pivots. It measures the previous period's range and centre carried forward, and the forming period sets none of its own levels beyond the open it began with, which Woodie's pivot reads.

01The study, live

Live figureScroll to zoom, drag the bars to pan.
bar —O — H — L — C —Pivot { level: -3 } —Pivot { level: -2 } —Pivot { level: -1 } —Pivot { level: 0 } —Pivot { level: 1 } —Pivot { level: 2 } —Pivot { level: 3 } —first value at —
Show where:

Computed by Bentrix’s own code over the same synthetic bars on every page — an illustration of how the study behaves, not a market.

What this figure shows

The figure is computed over 300 sample bars. Pivot Points has no value on the first 24 — the bars it needs before it can answer — and its first value stands on bar 25. Counting the conditions the study declares on these bars: price crosses above S3 never; price crosses below S3 never; price crosses above S2 4 times; price crosses below S2 4 times; price crosses above S1 7 times; price crosses below S1 7 times; price crosses above the pivot 4 times; price crosses below the pivot 4 times. Press a condition under the figure to see each place marked.

02Its parts, named

Warm-upno value on the first 24 bars: thestudy needs them before it cananswerPivot (7)one of the study's linesPivot (6)one of the study's linesPivot (5)one of the study's linesPivot (4)one of the study's linesPivot (3)one of the study's linesThe bars it readseach bar's open, high, low and close
Computed by Bentrix’s own code over the sample bars. It is drawn on once, as you reach the figure.

03What you see

Horizontal levels for the current period — a pivot and supports and resistances around it — computed from the previous period's high, low and close.

04Where it comes from

A floor traders' method from the open-outcry pits, where a quick way to mark the day's likely reference levels was needed before the open. Several families exist; Bentrix offers five: Classic, Fibonacci, Camarilla, Woodie and DeMark.

05The formula

The classic family:

P=H+L+C3,R1=2P−L,S1=2P−H,R2=P+(H−L),S2=P−(H−L)
H, L, Cthe previous period's high, low and close
Pthe pivot
Rk, Skthe resistance and support levels above and below it

using the previous period's high, low and close. The period is the study's own: a day on intraday charts, chosen automatically.

06A worked example

Take a previous day with a high of 27, a low of 23 and a close of 26.

P = (27 + 23 + 26) / 3 = 25.33

The classic levels are reflections of the day's range around it:

  • R1 = 2 × 25.33 − 23 = 27.67 and S1 = 2 × 25.33 − 27 = 23.67
  • R2 = 25.33 + (27 − 23) = 29.33 and S2 = 25.33 − (27 − 23) = 21.33

The Fibonacci kind keeps the same P and places the levels at 38.2 %, 61.8 % and 100 % of the range from it: R1 = 25.33 + 0.382 × 4 = 26.86. The Camarilla kind measures from the close: R1 = 26 + 4 × 1.1 / 12 = 26.37.

Woodie's kind gives the weight to the new period's open instead of the old close. Suppose today opens at 25: P = (27 + 23 + 2 × 25) / 4 = 25.00, and the levels follow as in the classic kind — R1 = 2 × 25.00 − 23 = 27.00, S1 = 2 × 25.00 − 27 = 23.00.

DeMark's kind chooses a sum by how the previous day closed against its own open. Suppose it opened at 24 and closed at 26, above its open: X = 2 × 27 + 23 + 26 = 103. Then P = 103 / 4 = 25.75, R1 = 103 / 2 − 23 = 28.50 and S1 = 103 / 2 − 27 = 24.50. It has no other level.

07Built in Assay

The same study written in Assay, Bentrix’s script language, and drawn by Bentrix itself as the script’s graph: each block is one step of the formula. On the ladder the steps stand in the script’s order, one a row; on the board each wire carries a value from the block that gives it to the block that reads it, left to right. The script computes exactly what the study computes — Bentrix checks the two against each other, candle by candle.

THE SCRIPT’S GRAPH
//@version=6
indicator("Pivot Points", overlay = true)
// Which day a bar belongs to.
day = math.floor(time / 86400000)
newDay = bar_index == 0 or day != day[1]
// The day in progress, and the last day that has finished.
var float dayHigh = na
var float dayLow = na
var float dayClose = na
var float lastHigh = na
var float lastLow = na
var float lastClose = na
if newDay
    lastHigh := dayHigh
    lastLow := dayLow
    lastClose := dayClose
    dayHigh := high
    dayLow := low
else
    dayHigh := math.max(dayHigh, high)
    dayLow := math.min(dayLow, low)
dayClose := close
// The classic levels, from the finished day's high, low and close.
p = (lastHigh + lastLow + lastClose) / 3
r = lastHigh - lastLow
plot(lastLow - 2 * (lastHigh - p), "S3")
plot(p - r, "S2")
plot(2 * p - lastHigh, "S1")
plot(p, "Pivot")
plot(2 * p - lastLow, "R1")
plot(p + r, "R2")
plot(lastHigh + 2 * (p - lastLow), "R3")

Paste it into the Assay IDE to put it on a chart, or to change it. Looking at the graph is free in every package; editing it as blocks is Plus.

08Readings — what traders look for

Traders watch how price behaves at the levels: holding at one is read as the level acting as support or resistance this period; passing through is read as the market having moved beyond the previous period's range.

How a level fails. The levels are arithmetic on one day's three prices. They are watched by many, which is the whole of their force; on a day whose range is several times yesterday's, price passes all of them in the first hour.

Which day? The previous day's high, low and close depend on when the day ends. On a market that trades around the clock two brokers with different server times draw different pivots.

09In different markets and timeframes

Pivot points are intraday levels made from the previous day's high, low and close. They are watched widely on session-based markets; on a market that never closes they depend on where the day is cut.

10With other studies

Read beside the session's VWAP and the previous day's high and low themselves.

11What it does not tell you

!

The levels are arithmetic on yesterday's three prices. That many people watch them is the main reason they matter at all.

12Inputs and defaults

Pivot Points (classic, Chart)settings card
1Kindclassic
2TimeframeChart
3Wait for the candle to closeOn
  1. 1
    Kind — classicWhich formula places the levels: Classic (the floor traders'), Fibonacci, Camarilla, Woodie or DeMark. The first three use only the previous period's high, low and close; Woodie's also reads the open of the period the levels are drawn across, and DeMark's the open of the previous one.
  2. 2
    Timeframe — ChartThe chart's own by default; any higher one, read on the last closed candle. A finer one is never offered.
  3. 3
    Wait for the candle to close — OnThe value of a higher timeframe is taken only from a candle that has finished.

The settings in use

  • In useClassic is the most widely watched. Camarilla's levels stand close to the previous close and are used inside the day's range; Woodie's lean on the day's open; DeMark's draws only a pivot and one level each side.

13Limits and common misreadings

The day boundary is a convention on 24-hour markets.

No memory. Each day's levels know nothing of the days before.

14Conditions an alert or a strategy can watch

price crosses above S3 eventprice crosses below S3 eventprice crosses above S2 eventprice crosses below S2 eventprice crosses above S1 eventprice crosses below S1 eventprice crosses above the pivot eventprice crosses below the pivot eventprice crosses above R1 eventprice crosses below R1 eventprice crosses above R2 eventprice crosses below R2 eventprice crosses above R3 eventprice crosses below R3 event

Event: the bar it happens on an event happens on one barState: every bar while it holds a state holds on every bar while it lasts

These are the conditions the study itself declares — the same rules the alert editor and the strategy engine read, and the ones the figure's chips show.

15Practise it in the laboratory

Put Pivot Points on an intraday chart and, over twenty days, count how often the day's high or low fell within a few points of a level — and how often nowhere near one.

Open the laboratory

17In Bentrix

  • From the menu: a chart's Indicators button › Trend & channels › Pivot Points, or type Pivot Points in its search.
  • Its settings: the settings card opens when it is added; its legend's name opens it again.

18From an agent or a program

Two tools reach it. study_values computes it over a workbench’s candles up to the clock — no chart needed — and study_attach puts it on a chart, where it is drawn and saved with the chart ({"chart": "<chart uri>", "kind": "pivots"}).

The study, as a chart files it

This is a new Pivot Points’s entry — its kind, its calculation, the price it reads and its settings. Change a setting here to read it with other inputs.

{
  "applied": "close",
  "convention": "custom",
  "kind": "pivots",
  "settings": {
    "kind": "classic",
    "shape": "pivots"
  }
}

An agent

An agent calls the MCP tool with it:

{
  "name": "study_values",
  "arguments": {
    "bench": "bentrix://lab/\u2026/bench/\u2026",
    "symbol": "EURUSD",
    "timeframe": "H1",
    "limit": 5,
    "study": {
      "applied": "close",
      "convention": "custom",
      "kind": "pivots",
      "settings": {
        "kind": "classic",
        "shape": "pivots"
      }
    }
  }
}

A program

A program does the same in its language — bench and market as in the built-in indicators guide:

Python

values = client.study.values(bench, market, "H1", {"applied": "close", "convention": "custom", "kind": "pivots", "settings": {"kind": "classic", "shape": "pivots"}}, limit=5)
print("times:", values["times"])
for line in values["lines"]:
    print("line:", line["line"])
    print("  newest values:", line["values"])

JSJavaScript

const values = await client.study.values({ bench, symbol: market, timeframe: "H1", study: { "applied": "close", "convention": "custom", "kind": "pivots", "settings": { "kind": "classic", "shape": "pivots" } }, limit: 5 });
console.log("times:", values.times);
for (const line of values.lines) {
  console.log("line:", line.line);
  console.log("  newest values:", line.values);
}

C#C#

var values = await client.Study.Values(bench, market, "H1", new Dictionary<string, object?> { ["applied"] = "close", ["convention"] = "custom", ["kind"] = "pivots", ["settings"] = new Dictionary<string, object?> { ["kind"] = "classic", ["shape"] = "pivots" } }, limit: 5);
Console.WriteLine($"times: {values!["times"]!}");
foreach (var line in values!["lines"]!.AsArray())
{
    Console.WriteLine($"line: {line!["line"]!}");
    Console.WriteLine($"  newest values: {line!["values"]!}");
}

GOGo

values := must(client.Study.Values(ctx, mcp.StudyValuesArgs{Bench: bench, Symbol: market, Timeframe: "H1", Study: map[string]any{"applied": "close", "convention": "custom", "kind": "pivots", "settings": map[string]any{"kind": "classic", "shape": "pivots"}}, Limit: mcp.Ptr[int64](5)}))
fmt.Println("times:", at(values, "times"))
for _, line := range at(values, "lines").([]any) {
	fmt.Println("line:", at(line, "line"))
	fmt.Println("  newest values:", at(line, "values"))
}

Java

Object values = client.study.values(new Bentrix.StudyApi.ValuesArgs(bench, market, "H1", obj("applied", "close", "convention", "custom", "kind", "pivots", "settings", obj("kind", "classic", "shape", "pivots"))).limit(5L));
System.out.println("times:" + " " + at(values, "times"));
for (Object line : (List<Object>) at(values, "lines")) {
    System.out.println("line:" + " " + at(line, "line"));
    System.out.println("  newest values:" + " " + at(line, "values"));
}

C++C++

auto values = client.study.values_(StudyApi::ValuesArgs(bench, market, "H1", Json::Object{{"applied", "close"}, {"convention", "custom"}, {"kind", "pivots"}, {"settings", Json::Object{{"kind", "classic"}, {"shape", "pivots"}}}}).limit(5));
std::cout << "times:" << " " << values["times"].dump() << std::endl;
for (const Json &line : values["lines"].arr()) {
    std::cout << "line:" << " " << line["line"].dump() << std::endl;
    std::cout << "  newest values:" << " " << line["values"].dump() << std::endl;
}

Julia

values = client.study.values(bench, market, "H1", Dict{String,Any}("applied" => "close", "convention" => "custom", "kind" => "pivots", "settings" => Dict{String,Any}("kind" => "classic", "shape" => "pivots")); limit = 5)
println("times:", " ", values["times"])
for line in values["lines"]
    println("line:", " ", line["line"])
    println("  newest values:", " ", line["values"])
end

RR

values <- client$study$values(bench, market, "H1", list(applied = "close", convention = "custom", kind = "pivots", settings = list(kind = "classic", shape = "pivots")), limit = 5)
cat("times:", format(values$times), "\n")
for (line in values$lines) {
  cat("line:", format(line$line), "\n")
  cat("  newest values:", format(line$values), "\n")
}

RRust

let values = client.study().values(mcp::StudyValuesArgs::new(bench.clone(), market.clone(), "H1", serde_json::json!({"applied": "close", "convention": "custom", "kind": "pivots", "settings": {"kind": "classic", "shape": "pivots"}})).limit(5))?;
println!("times: {}", values["times"]);
for line in values["lines"].as_array().into_iter().flatten() {
    println!("line: {}", line["line"]);
    println!("  newest values: {}", line["values"]);
}

Reading the answer

  • times — the candles’ open times, in milliseconds since 1970 (UTC), oldest first.
  • lines — one entry per line, in this order, each with its line name and its values; values[i] belongs to the candle at times[i].
  • The last value is the candle at the clock’s, which may still be forming: it changes until that candle closes, as on the chart. Nothing after the clock is ever computed.
  • null is a candle with no value yet — the warm-up, about 1 × the period at the start of the history.
lineWhat it is
Pivot { level: -3 }Pivot { level: -3 }
Pivot { level: -2 }Pivot { level: -2 }
Pivot { level: -1 }Pivot { level: -1 }
Pivot { level: 0 }Pivot { level: 0 }
Pivot { level: 1 }Pivot { level: 1 }
Pivot { level: 2 }Pivot { level: 2 }
Pivot { level: 3 }Pivot { level: 3 }

In a strategy

Filed under a key of your choice in a strategy document’s studies — here pivots: {"pivots": {"applied": "close", "convention": "custom", "kind": "pivots", "settings": {"kind": "classic", "shape": "pivots"}}} — its rules can name:

WriteWhat it is
{"cond": "pivots:pivot.cross_up:S3"}a condition it declares itself
{"cond": "pivots:pivot.cross_down:S3"}a condition it declares itself
{"cond": "pivots:pivot.cross_up:S2"}a condition it declares itself
{"cond": "pivots:pivot.cross_down:S2"}a condition it declares itself
{"cond": "pivots:pivot.cross_up:S1"}a condition it declares itself
{"cond": "pivots:pivot.cross_down:S1"}a condition it declares itself
{"cond": "pivots:pivot.cross_up:P"}a condition it declares itself
{"cond": "pivots:pivot.cross_down:P"}a condition it declares itself
{"cond": "pivots:pivot.cross_up:R1"}a condition it declares itself
{"cond": "pivots:pivot.cross_down:R1"}a condition it declares itself
{"cond": "pivots:pivot.cross_up:R2"}a condition it declares itself
{"cond": "pivots:pivot.cross_down:R2"}a condition it declares itself
{"cond": "pivots:pivot.cross_up:R3"}a condition it declares itself
{"cond": "pivots:pivot.cross_down:R3"}a condition it declares itself

Its lines named pivot are more than one line of that name, so a strategy reaches them through the conditions above rather than by name.

19Sources

  1. Kirkpatrick, Charles D. & Dahlquist, Julie R. Technical Analysis: The Complete Resource for Financial Market Technicians, 2nd ed. FT Press, 2010.

Bentrix 0.1.382Every number, name and default on these pages is read from the application itself.What is comingWhat changed