Bentrix Docs
HomePricingDashboard

Three Line Break

Blocks that extend a trend on every new close beyond it, and turn only when a close breaks the extreme of the last three blocks. Small pullbacks disappear; a real reversal stands out.

The 300 hourly candles it is built from139 lines, reversing past the last 3

01What you see

A row of blocks ("lines") of varying height. Rising blocks follow each other upward, each starting where the last one ended; falling blocks step down. A block of the other colour appears only when the trend has clearly broken.

02How it is built

Line break reads one price per candle — the close by default — and a number of lines n, three by default.

  1. The first block runs from the first close to the first close that differs from it.
  2. Continue. In a rising trend, a close above the last block's close adds a rising block from that close to the new one. Closes between the last block's ends add nothing.
  3. Reverse. A falling block appears only when a close falls below the lowest point of the last n blocks:
C<min(the last n blocks)⇒a falling block from that low to C
Cthe price read on each candle — the close by default
nthe number of lines a reversal must break — three by default
  1. The mirror rules apply in a falling trend.

The block's height is however far price went — unlike Renko, the blocks are not all one size.

03Reading it

  • A reversal block is the signal: price has undone the last three moves. A trader on a three-line-break chart is in the trend until it reverses, and out — or reversed — when it does.
  • Many small blocks of one colour are a steady trend; one tall block is a burst.
  • Fewer lines (n=2) turn sooner; more lines turn later and only on a big move.

04Settings

SettingChoicesNew chart
Lines1 to 103
SourceClose, Open, High, Low, HL2, HLC3, OHLC4, High/LowClose
Colours, bodiesrising and fallingboth filled

05Indicators on line break

Computed on the blocks by default, or on the candles behind them by the study's Calculate on setting. The block of the candle still forming is drawn faint until that candle closes: its close can still take it away.

06From an agent or a program

Set it

chart_set_type turns a chart into this type, as the Chart type card does; style is laid over the chart’s own, field by field — these are its fields and a new chart’s values:

{
  "name": "chart_set_type",
  "arguments": {
    "chart": "<chart uri>",
    "type": "three_line_break",
    "style": {
      "elements": {
        "bodies": "filled",
        "line_break": 3,
        "line_break_source": "closes"
      }
    }
  }
}

Read it

chart_elements_get answers what the chart drew, newest last (at most 5,000; 500 when limit is not given), up to the clock. Each element is read as a bar — here, a line: from open to close, rising when close is above open:

FieldWhat it is
time, ordinalthe element’s address: the open time (UTC milliseconds) of the time candle whose prices completed it, and its place among the elements that one candle made — a fast hour can make several
open, high, low, closeits prices, as above
volumethe ticks of the candles it holds
formingtrue for the last element while it is still being built; it may change or vanish

An indicator on this chart is computed on these elements by default — study_attach with "on": "candles" computes it on the time candles behind them instead.

In a program

The same two steps in each language — chart, bench and market as in the read the candles guide:

Python

client.chart.set_type(chart, type_="three_line_break")
drawn = client.data.chart_elements_get(chart, limit=20)
for e in drawn["elements"]:
    print("element:", e)

JSJavaScript

await client.chart.setType({ chart, type: "three_line_break" });
const drawn = await client.data.chartElementsGet({ chart, limit: 20 });
for (const e of drawn.elements) {
  console.log("element:", e);
}

C#C#

await client.Chart.SetType(chart, type: "three_line_break");
var drawn = await client.Data.ChartElementsGet(chart, limit: 20);
foreach (var e in drawn!["elements"]!.AsArray())
{
    Console.WriteLine($"element: {e}");
}

GOGo

_ = must(client.Chart.SetType(ctx, mcp.ChartSetTypeArgs{Chart: chart, Type: mcp.Ptr[string]("three_line_break")}))
drawn := must(client.Data.ChartElementsGet(ctx, mcp.DataChartElementsGetArgs{Chart: chart, Limit: mcp.Ptr[int64](20)}))
for _, e := range at(drawn, "elements").([]any) {
	fmt.Println("element:", e)
}

Java

client.chart.setType(new Bentrix.ChartApi.SetTypeArgs(chart).type("three_line_break"));
Object drawn = client.data.chartElementsGet(new Bentrix.DataApi.ChartElementsGetArgs(chart).limit(20L));
for (Object e : (List<Object>) at(drawn, "elements")) {
    System.out.println("element:" + " " + e);
}

C++C++

client.chart.set_type(ChartApi::SetTypeArgs(chart).type("three_line_break"));
auto drawn = client.data.chart_elements_get(DataApi::ChartElementsGetArgs(chart).limit(20));
for (const Json &e : drawn["elements"].arr()) {
    std::cout << "element:" << " " << e.dump() << std::endl;
}

Julia

client.chart.set_type(chart; type_ = "three_line_break")
drawn = client.data.chart_elements_get(chart; limit = 20)
for e in drawn["elements"]
    println("element:", " ", e)
end

RR

client$chart$set_type(chart, type = "three_line_break")
drawn <- client$data$chart_elements_get(chart, limit = 20)
for (e in drawn$elements) {
  cat("element:", format(e), "\n")
}

RRust

client.chart().set_type(mcp::ChartSetTypeArgs::new(chart.clone()).type_("three_line_break"))?;
let drawn = client.data().chart_elements_get(mcp::DataChartElementsGetArgs::new(chart.clone()).limit(20))?;
for e in drawn["elements"].as_array().into_iter().flatten() {
    println!("element: {}", e);
}

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