In this article, we delve into the ticker.linebreak()
function, its applications, and how to effectively utilize it in Pine Script.
Introduction to ticker.linebreak()
The ticker.linebreak()
function in Pine Script is designed to create a unique ticker ID for Line Break charts. These charts are a type of financial chart that displays a series of vertical boxes, focusing on price changes and ignoring time and volume. This function is particularly useful when you need to fetch Line Break values in Pine Script, although it’s important to note that Pine Script does not have a built-in function to directly draw these bars on a chart.
Code Example
Here’s a basic example to illustrate the use of ticker.linebreak()
:
//@version=5 indicator("", "", true) customLineBreakTicker = ticker.linebreak(syminfo.tickerid, 3) customLineBreakClose = request.security(customLineBreakTicker, timeframe.period, close) plot(customLineBreakClose)

Walkthrough of the Code
- Indicator Declaration:
//@version=5
: Specifies the version of Pine Script used.indicator("", "", true)
: Initializes a blank indicator with default settings.
- Creating a Line Break Ticker:
customLineBreakTicker = ticker.linebreak(syminfo.tickerid, 3)
:ticker.linebreak()
: The function used to create a Line Break ticker.syminfo.tickerid
: Fetches the current symbol’s ticker ID.3
: Specifies the number of lines in the Line Break chart.
- Fetching Line Break Values:
customLineBreakClose = request.security(customLineBreakTicker, timeframe.period, close)
:request.security()
: Requests data from another symbol or timeframe.customLineBreakTicker
: The Line Break ticker was created earlier.timeframe.period
: The current chart timeframe.close
: Fetches the closing values of the Line Break chart.
- Plotting the Line Break Close Values:
plot(customLineBreakClose)
: Plots the Line Break closing values on the chart.
Key Features of ticker.linebreak()
- Function Usability:
- Creates a unique ticker ID for Line Break charts, essential for analyzing price changes in a distinct way.
- Syntax:
ticker.linebreak(source, lines)
wheresource
is the ticker ID andlines
is the number of lines in the Line Break chart.
- Application:
- Used in conjunction with
request.security()
to fetch and display Line Break values.
- Used in conjunction with
Takeaways
- The
ticker.linebreak()
function is pivotal for creating Line Break chart types in Pine Script. - It enables the fetching of specific Line Break values but does not provide direct chart drawing capabilities.
- This function enhances the versatility of Pine Script, allowing for more complex and varied technical analysis.
In conclusion, understanding and effectively using the ticker.linebreak()
function can significantly enrich your Pine Script programming experience, especially when dealing with specialized chart types like Line Break charts.