Parabolic Stop and Reverse, extended (Parabolic SAR Extended)
The SAR with a separately settable acceleration schedule and an offset applied at each reversal, so the level can be placed away from the prior extreme instead of exactly on it.
It measures the same thing as the SAR — side and trailing level. TA-Lib's output signs the value: positive in a long state, negative in a short one.
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
The figure is computed over 300 sample bars. Parabolic SAR Extended has no value on the first 1 — the bars it needs before it can answer — and its first value stands on bar 2. Counting the conditions the study declares on these bars: the trend line turns up 14 times; the trend line turns down 14 times. Press a condition under the figure to see each place marked.
02Its parts, named
03What you see
SAR Extended is a row of dots drawn over the candles, below price while it trails a rise and above price while it trails a fall, jumping to the other side when price reaches it. It is the Parabolic SAR with one more input: an offset that starts the dots further from price after each reversal.
04Where it comes from
J. Welles Wilder introduced the Parabolic SAR in 1978 as a trailing stop: SAR means stop and reverse, and its accelerating approach is what gives the dots their parabolic curve. SAR Extended is the form the TA-Lib library added to it (its SAREXT function), with an offset on each reversal.
05The formula
SAR Extended_(t+1) = SAR Extendedₜ + αₜ (EP − SAR Extendedₜ)
is the extreme point of the current move (its highest high in a rise, its lowest low in a fall). starts at the step and grows by the step at each new extreme, up to the maximum.
What the extended form adds is the offset on reverse: when price reaches the line and the move flips, the new line starts at the last extreme point moved a further share of price away,
SAR Extended_flip = EP (1 ± offset)
with when the new line is above price and when below. With an offset of 0, SAR Extended is the Parabolic SAR. TA-Lib's function, which computes it, keeps separate acceleration settings for rises and falls; in Bentrix both use the same start, step and maximum unless the three settings for a fall are given numbers of their own.
06A worked example
SAR Extended moves by the same recursion as the Parabolic SAR. Suppose the line is below price at 100.00, the extreme point is 104.00 and the factor 0.02: the next value is 100.00 + 0.02 × 4.00 = 100.08.
What the extended form adds is the offset on reverse. When price reaches the line and the phase flips, the Parabolic SAR restarts at the old extreme point, and SAR Extended with no offset does the same — say 104.00, now above price. With an offset of 0.01 it restarts 1 % further away:
104.00 × (1 + 0.01) = 105.04
That gives the new phase more room at its start.
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. SAR Extended starts under the second bar at the first bar's low, 18.00, with the extreme point at 22: the next value is 18.00 + 0.02 × (22 − 18.00) = 18.08, and under the last bar it reads 20.02. These bars never come down to the line, so there is no reverse for the offset to act on.
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 Extended", overlay = true) step = input.float(0.02, "Step") maximum = input.float(0.2, "Maximum") offset = input.float(0.0, "Offset on reverse") // The Parabolic SAR, restarting further from price by the offset after each flip. Below price it is positive, // above price TA-Lib writes it negative. sar = talib.SAREXT(0, offset, step, step, maximum, step, step, maximum) plot(sar > 0 ? sar : na, "Below price") plot(sar < 0 ? -sar : na, "Above price")
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. As with the Parabolic SAR: the study is always in one phase, and in a range it flips repeatedly. The offset makes each new phase harder to flip at once, at the price of a wider first distance.
09In different markets and timeframes
SAR Extended behaves as the Parabolic SAR does, with one addition: after a flip the new line can start further from price, giving the new phase room.
The offset is a fraction of price, so a number that suits a daily chart — half a per cent — is far too wide on M5, where a whole swing is smaller than that; it has to be set for the instrument and the timeframe. In a long trend the extra room at the start of a phase is small against the move. In a range the offset widens the first distance on both sides and delays each flip, so fewer flips are drawn and each one is reached later.
10With other studies
Read beside the Parabolic SAR with the same step and maximum, to see what the offset changes.
11What it does not tell you
SAR Extended is always on one side of price or the other, so in a sideways market it flips constantly. It describes the move it is trailing, and says nothing of how long that move will last.
12Inputs and defaults
- 1Maximum — 0.2The factor's ceiling.
- 2Offset — 0How far beyond the old extreme the dots restart after a flip, as a fraction of price. 0 gives the ordinary Parabolic SAR.
- 3Step — 0.02The acceleration factor's start and increment.
- 4First value — 0Where the first run begins: 0 lets the study find it; a price above zero starts it trailing a rise from that price, a negative one a fall.
- 5Initial acceleration — 0.02The acceleration a new run begins with. Left alone, it is the step.
- 6Initial acceleration, in a fall — 0.02The acceleration a run begins with while trailing a fall. Left alone, it is that of a rise.
- 7Step, in a fall — 0.02The step while the dots are above price, trailing a fall. Left alone, it is the step of a rise.
- 8Maximum, in a fall — 0.2The largest acceleration while trailing a fall. Left alone, it is the maximum of a rise.
- 9Timeframe — ChartThe chart's own by default; any higher one, read on the last closed candle. A finer one is never offered.
- 10Wait for the candle to close — OnThe value of a higher timeframe is taken only from a candle that has finished.
What each input changes
- First valueWhere the first run begins. At 0 the study finds the first direction itself; a price above zero starts it trailing a rise from that price, and a negative one a fall from that price.
- Initial accelerationThe acceleration a new run begins with while trailing a rise. Left as it is, it equals the step.
- Initial acceleration, in a fallThe same starting acceleration while the dots are above price. Left as it is, it is the start of a rise.
- Step, in a fallThe increase at each new low while the dots are above price. Left as it is, it is the step of a rise; set apart, the study closes on falling and on rising price at different speeds.
- Maximum, in a fallThe ceiling of the acceleration while the dots are above price. Left as it is, it is the maximum of a rise.
- In useStep 0.02, maximum 0.2, offset 0 (the Parabolic SAR itself); an offset of 0.005 to 0.02 is a fraction of price.
13Limits and common misreadings
Always in the market. The dots are on one side of price or the other on every bar; there is no state that says there is no trend.
The offset is a fraction of price, so the same number is a different distance on different instruments.
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 SAR and SAR Extended with an offset of 0.01 on one chart; find a flip and compare where each restarts.
Open the laboratory17In Bentrix
- From the menu: a chart's Indicators button › Trend & channels › Parabolic SAR Extended, or type Parabolic SAR Extended 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": "sar_ext"}).
The study, as a chart files it
This is a new Parabolic SAR Extended’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": "talib",
"kind": "sar_ext",
"settings": {
"max": 0.2,
"offset": 0.0,
"shape": "sar_ext",
"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": "talib",
"kind": "sar_ext",
"settings": {
"max": 0.2,
"offset": 0.0,
"shape": "sar_ext",
"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": "talib", "kind": "sar_ext", "settings": {"max": 0.2, "offset": 0.0, "shape": "sar_ext", "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": "talib", "kind": "sar_ext", "settings": { "max": 0.2, "offset": 0.0, "shape": "sar_ext", "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"] = "talib", ["kind"] = "sar_ext", ["settings"] = new Dictionary<string, object?> { ["max"] = 0.2, ["offset"] = 0.0, ["shape"] = "sar_ext", ["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": "talib", "kind": "sar_ext", "settings": map[string]any{"max": 0.2, "offset": 0.0, "shape": "sar_ext", "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", "talib", "kind", "sar_ext", "settings", obj("max", 0.2, "offset", 0.0, "shape", "sar_ext", "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", "talib"}, {"kind", "sar_ext"}, {"settings", Json::Object{{"max", 0.2}, {"offset", 0.0}, {"shape", "sar_ext"}, {"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" => "talib", "kind" => "sar_ext", "settings" => Dict{String,Any}("max" => 0.2, "offset" => 0.0, "shape" => "sar_ext", "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 = "talib", kind = "sar_ext", settings = list(max = 0.2, offset = 0.0, shape = "sar_ext", 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": "talib", "kind": "sar_ext", "settings": {"max": 0.2, "offset": 0.0, "shape": "sar_ext", "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 |
|---|---|
TrendUp | up trend |
TrendDown | down trend |
In a strategy
Filed under a key of your choice in a strategy document’s studies — here sar_ext: {"sar_ext": {"applied": "close", "convention": "talib", "kind": "sar_ext", "settings": {"max": 0.2, "offset": 0.0, "shape": "sar_ext", "step": 0.02}}} — its rules can name:
| Write | What it is |
|---|---|
sar_ext.trend_up | this line, as a value in a compare |
sar_ext.trend_down | this line, as a value in a compare |
{"cond": "sar_ext:trend.turns_up"} | a condition it declares itself |
{"cond": "sar_ext:trend.turns_down"} | a condition it declares itself |
19Sources
- 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