Parabolic Stop and Reverse Parabolic SAR
A stop-and-reverse level that trails price, drawn as dots below in an up-trend and above in a down-trend, accelerating by the step each time the trend makes a new extreme up to the maximum.
It measures nothing about strength: it is a position of a trailing level and a side. The readings are the side the dots are on and the bar on which they flip.
01The study, live
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
Counting the conditions the study declares on these bars: the dots flip below price 14 times; the dots flip above price 14 times. Press a condition under the figure to see each place marked.
02Its parts, named
03What you see
Dots below the bars in a rise and above them in a fall. They follow price, closing in faster as a move goes on, and jump to the other side when price touches them.
04Where it comes from
J. Welles Wilder introduced it in 1978 as a trailing stop: SAR means stop and reverse. Its accelerating approach is what gives the dots their parabolic curve.
05The formula
SAR_(t+1) = SARₜ + αₜ (EP − SARₜ)
is the extreme point of the current move (its highest high in a rise). starts at the step (0.02) and grows by the step at each new extreme, up to the maximum (0.2). When price crosses the SAR, it flips to the other side, starting at the last extreme point.
06A worked example
Suppose the SAR is below price at 100.00 in a rising phase, the highest high since the phase began (the extreme point) is 104.00, and the acceleration factor stands at its starting 0.02.
Next SAR = 100.00 + 0.02 × (104.00 − 100.00) = 100.08
The next bar makes a new high at 105.00, so the acceleration factor steps up to 0.04 and the extreme point becomes 105.00:
Next SAR = 100.08 + 0.04 × (105.00 − 100.08) = 100.28
Each new high raises the factor by another 0.02, up to the maximum of 0.20; from then on the dots close a fifth of the remaining gap every bar. When a bar's low reaches the SAR, the phase flips: the SAR jumps to the old extreme point, above price, and the factor starts again at 0.02.
On real bars: take eight that rise, with highs 21, 22, 24, 24, 25, 26, 26, 27, lows 18, 19, 20, 21, 21, 23, 23, 23 and closes 20, 21, 23, 22, 24, 25, 24, 26. Under the third bar the SAR stands at 18.00, the lowest low so far, with the extreme point at 24 and the factor at 0.02. Next SAR = 18.00 + 0.02 × (24 − 18.00) = 18.12, and then 18.12 + 0.02 × (24 − 18.12) = 18.24. The fifth bar's high of 25 raises the factor to 0.04 and the sixth's 26 to 0.06: the dots read 18.51, 18.96 and, under the last bar, 19.38.
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.
//@version=6 indicator("Parabolic SAR", overlay = true) step = input.float(0.02, "Step") maximum = input.float(0.2, "Maximum") // The stop trails the price and speeds up by `step` each time the trend makes a new extreme, up to `maximum`; // when the price crosses it, it jumps to the other side. sar = ta.sar(step, step, maximum) plot(sar, "SAR", style = plot.style_circles)
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
The dots' side is read as the direction of the current move.
A flip is read as price having reached the trailing level of the previous move.
Many traders use the dots as a trailing stop level, as Wilder intended.
How a flip fails. A flip says price reached the trailing level. The study is always in one phase or the other — Wilder designed it as stop and reverse — so in a market without direction it flips back and forth, each flip costing the distance between two dots.
How the tightening fails. The acceleration assumes a trend that keeps extending. In a slow, steady trend the dots catch up with price and are touched by an ordinary pullback.
09In different markets and timeframes
The Parabolic SAR is a trailing level for trending markets; it is always on one side of price or the other. In ranges it flips repeatedly. It tightens with time, so slow trends are stopped by ordinary pullbacks.
10With other studies
Wilder paired it with a trend filter — the ADX or his Directional Movement System — reading it only when a trend was present.
11What it does not tell you
The SAR is always on one side or the other, so in a sideways market it flips constantly. It describes the move it is trailing.
12Inputs and defaults
- 1Maximum — 0.2The ceiling of the acceleration factor. It limits how tightly the dots can ever follow.
- 2Step — 0.02The acceleration factor's starting value and its increase at each new extreme. Larger: the dots close on price sooner and are reached sooner.
- 3Initial acceleration — 0.02The acceleration a new run begins with. Left alone, it is the step.
- 4Timeframe — ChartThe chart's own by default; any higher one, read on the last closed candle. A finer one is never offered.
- 5Wait for the candle to close — OnThe value of a higher timeframe is taken only from a candle that has finished.
What each input changes
- Initial accelerationThe acceleration a new run begins with. Left as it is, it equals the step, as Wilder had it; a smaller start lets a new run trail more loosely for its first bars.
- In use0.02 and 0.2 are Wilder's. A smaller step (0.01) trails more loosely; a larger maximum lets it tighten further.
13Limits and common misreadings
Always in the market. There is no neutral state.
The start is arbitrary. The first phase and first value depend on where the data begins.
Time, not volatility. The dots tighten because bars pass, not because the market calmed.
14Conditions an alert or a strategy can watch
an event happens on one bar 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 the Parabolic SAR on a chart and replay a range, counting the flips; then replay a strong trend and note how many bars one phase lasts.
Open the laboratory17On pages of their own
18In Bentrix
- From the menu: a chart's Indicators button › Trend & channels › Parabolic SAR, or type Parabolic SAR in its search.
- Its settings: the settings card opens when it is added; its legend's name opens it again.
19From 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": "sar"}).
The study, as a chart files it
This is a new Parabolic SAR’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": "mt5",
"kind": "sar",
"settings": {
"max": 0.2,
"shape": "sar",
"step": 0.02
}
}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": "mt5",
"kind": "sar",
"settings": {
"max": 0.2,
"shape": "sar",
"step": 0.02
}
}
}
}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": "mt5", "kind": "sar", "settings": {"max": 0.2, "shape": "sar", "step": 0.02}}, limit=5)
print("times:", values["times"])
for line in values["lines"]:
print("line:", line["line"])
print(" newest values:", line["values"])JavaScript
const values = await client.study.values({ bench, symbol: market, timeframe: "H1", study: { "applied": "close", "convention": "mt5", "kind": "sar", "settings": { "max": 0.2, "shape": "sar", "step": 0.02 } }, 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#
var values = await client.Study.Values(bench, market, "H1", new Dictionary<string, object?> { ["applied"] = "close", ["convention"] = "mt5", ["kind"] = "sar", ["settings"] = new Dictionary<string, object?> { ["max"] = 0.2, ["shape"] = "sar", ["step"] = 0.02 } }, 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"]!}");
}Go
values := must(client.Study.Values(ctx, mcp.StudyValuesArgs{Bench: bench, Symbol: market, Timeframe: "H1", Study: map[string]any{"applied": "close", "convention": "mt5", "kind": "sar", "settings": map[string]any{"max": 0.2, "shape": "sar", "step": 0.02}}, 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", "mt5", "kind", "sar", "settings", obj("max", 0.2, "shape", "sar", "step", 0.02))).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++
auto values = client.study.values_(StudyApi::ValuesArgs(bench, market, "H1", Json::Object{{"applied", "close"}, {"convention", "mt5"}, {"kind", "sar"}, {"settings", Json::Object{{"max", 0.2}, {"shape", "sar"}, {"step", 0.02}}}}).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" => "mt5", "kind" => "sar", "settings" => Dict{String,Any}("max" => 0.2, "shape" => "sar", "step" => 0.02)); limit = 5)
println("times:", " ", values["times"])
for line in values["lines"]
println("line:", " ", line["line"])
println(" newest values:", " ", line["values"])
endR
values <- client$study$values(bench, market, "H1", list(applied = "close", convention = "mt5", kind = "sar", settings = list(max = 0.2, shape = "sar", step = 0.02)), 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")
}Rust
let values = client.study().values(mcp::StudyValuesArgs::new(bench.clone(), market.clone(), "H1", serde_json::json!({"applied": "close", "convention": "mt5", "kind": "sar", "settings": {"max": 0.2, "shape": "sar", "step": 0.02}})).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 itslinename and itsvalues;values[i]belongs to the candle attimes[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.
nullis a candle with no value yet — the warm-up, about 1 × the period at the start of the history.
line | What it is |
|---|
In a strategy
Filed under a key of your choice in a strategy document’s studies — here sar: {"sar": {"applied": "close", "convention": "mt5", "kind": "sar", "settings": {"max": 0.2, "shape": "sar", "step": 0.02}}} — its rules can name:
| Write | What it is |
|---|---|
{"cond": "sar:dots.flip_below"} | a condition it declares itself |
{"cond": "sar:dots.flip_above"} | a condition it declares itself |
20Sources
- Wilder, J. Welles Jr. New Concepts in Technical Trading Systems. Trend Research, 1978.
Bentrix 0.1.382Every number, name and default on these pages is read from the application itself.What is comingWhat changed