PINE LIBRARY
ohlc

Library "ohlc"
Library having OHLC and Indicator type and method implementations.
getOhlcArray(o, h, l, c, highBeforeLow, highAfterLow, lowBeforeHigh, lowAfterHigh, barindex, bartime, indicators)
get array of OHLC values when called on every bar
Parameters:
o (float): Open price
h (float): High Price
l (float): Low Price
c (float): Close Price
highBeforeLow (float): to be calculated based on lower timeframe. high price attained within the candle before reaching the lowest point.
highAfterLow (float): to be calculated based on lower timeframe. high price attained within the candle after reaching the lowest point.
lowBeforeHigh (float): to be calculated based on lower timeframe. low price attained within the candle before reaching the highest point.
lowAfterHigh (float): to be calculated based on lower timeframe. low price attained within the candle after reaching the highest point.
barindex (int): bar_index of OHLC data
bartime (int): time of OHLC cata
indicators (array<Indicator>): array containing indicator
Returns: Array of OHLC objects
pushWithLimit(this, item, maxItems)
Push items to OHLC array with maxItems limit
Parameters:
this (array<OHLC>)
item (OHLC): OHLC Item to be pushed to the array
maxItems (int): max Items the array can hold at a time
Returns: current object
pushWithLimit(this, item, maxItems)
Push items to Indicator array with maxItems limit
Parameters:
this (array<Indicator>)
item (Indicator): Indicator Item to be pushed to the array
maxItems (int): max Items the array can hold at a time
Returns: current object
unshiftWithLimit(this, item, maxItems)
Unshift items to OHLC array with maxItems limit
Parameters:
this (array<OHLC>)
item (OHLC): OHLC Item to be unshifted to the array
maxItems (int): max Items the array can hold at a time
Returns: current object
unshiftWithLimit(this, item, maxItems)
Unshift items to Indicator array with maxItems limit
Parameters:
this (array<Indicator>)
item (Indicator): Indicator Item to be unshifted to the array
maxItems (int): max Items the array can hold at a time
Returns: current object
method getPoints(indicators)
get array of points based on array of indicator values
Namespace types: array<Indicator>
Parameters:
indicators (array<Indicator>): Array containing indicator objects
Returns: array of indicator points
method plot(indicator, xloc, line_color, line_style, line_width)
plots an array of Indicator using polyline
Namespace types: array<Indicator>
Parameters:
indicator (array<Indicator>): Array containing indicator objects
xloc (string): can have values xloc.bar_index or xloc.bar_time. Used for drawing the line based on either bars or time.
line_color (color): color in which the plots need to be printed on chart.
line_style (string): line style line.style_solid, line.style_dotted, line.style_dashed, line.style_arrow_right, line.style_arrow_left, line.style_arrow_both
line_width (int): width of the plot line
Returns: array of plot polyline
Indicator
Object containing Indicator name and value
Fields:
name (series string): Indicator Name
value (chart.point): Indicator Value as a chart point
OHLC
Object containing OHLC and indicator values
Fields:
o (series float): Open price
h (series float): High Price
l (series float): Low Price
c (series float): Close Price
highBeforeLow (series float): to be calculated based on lower timeframe. high price attained within the candle before reaching the lowest point.
highAfterLow (series float): to be calculated based on lower timeframe. high price attained within the candle after reaching the lowest point.
lowBeforeHigh (series float): to be calculated based on lower timeframe. low price attained within the candle before reaching the highest point.
lowAfterHigh (series float): to be calculated based on lower timeframe. low price attained within the candle after reaching the highest point.
barindex (series int): bar_index of OHLC data
bartime (series int): time of OHLC cata
indicators (array<Indicator>): array containing indicator
Library having OHLC and Indicator type and method implementations.
getOhlcArray(o, h, l, c, highBeforeLow, highAfterLow, lowBeforeHigh, lowAfterHigh, barindex, bartime, indicators)
get array of OHLC values when called on every bar
Parameters:
o (float): Open price
h (float): High Price
l (float): Low Price
c (float): Close Price
highBeforeLow (float): to be calculated based on lower timeframe. high price attained within the candle before reaching the lowest point.
highAfterLow (float): to be calculated based on lower timeframe. high price attained within the candle after reaching the lowest point.
lowBeforeHigh (float): to be calculated based on lower timeframe. low price attained within the candle before reaching the highest point.
lowAfterHigh (float): to be calculated based on lower timeframe. low price attained within the candle after reaching the highest point.
barindex (int): bar_index of OHLC data
bartime (int): time of OHLC cata
indicators (array<Indicator>): array containing indicator
Returns: Array of OHLC objects
pushWithLimit(this, item, maxItems)
Push items to OHLC array with maxItems limit
Parameters:
this (array<OHLC>)
item (OHLC): OHLC Item to be pushed to the array
maxItems (int): max Items the array can hold at a time
Returns: current object
pushWithLimit(this, item, maxItems)
Push items to Indicator array with maxItems limit
Parameters:
this (array<Indicator>)
item (Indicator): Indicator Item to be pushed to the array
maxItems (int): max Items the array can hold at a time
Returns: current object
unshiftWithLimit(this, item, maxItems)
Unshift items to OHLC array with maxItems limit
Parameters:
this (array<OHLC>)
item (OHLC): OHLC Item to be unshifted to the array
maxItems (int): max Items the array can hold at a time
Returns: current object
unshiftWithLimit(this, item, maxItems)
Unshift items to Indicator array with maxItems limit
Parameters:
this (array<Indicator>)
item (Indicator): Indicator Item to be unshifted to the array
maxItems (int): max Items the array can hold at a time
Returns: current object
method getPoints(indicators)
get array of points based on array of indicator values
Namespace types: array<Indicator>
Parameters:
indicators (array<Indicator>): Array containing indicator objects
Returns: array of indicator points
method plot(indicator, xloc, line_color, line_style, line_width)
plots an array of Indicator using polyline
Namespace types: array<Indicator>
Parameters:
indicator (array<Indicator>): Array containing indicator objects
xloc (string): can have values xloc.bar_index or xloc.bar_time. Used for drawing the line based on either bars or time.
line_color (color): color in which the plots need to be printed on chart.
line_style (string): line style line.style_solid, line.style_dotted, line.style_dashed, line.style_arrow_right, line.style_arrow_left, line.style_arrow_both
line_width (int): width of the plot line
Returns: array of plot polyline
Indicator
Object containing Indicator name and value
Fields:
name (series string): Indicator Name
value (chart.point): Indicator Value as a chart point
OHLC
Object containing OHLC and indicator values
Fields:
o (series float): Open price
h (series float): High Price
l (series float): Low Price
c (series float): Close Price
highBeforeLow (series float): to be calculated based on lower timeframe. high price attained within the candle before reaching the lowest point.
highAfterLow (series float): to be calculated based on lower timeframe. high price attained within the candle after reaching the lowest point.
lowBeforeHigh (series float): to be calculated based on lower timeframe. low price attained within the candle before reaching the highest point.
lowAfterHigh (series float): to be calculated based on lower timeframe. low price attained within the candle after reaching the highest point.
barindex (series int): bar_index of OHLC data
bartime (series int): time of OHLC cata
indicators (array<Indicator>): array containing indicator
Thư viện Pine
Theo đúng tinh thần TradingView, tác giả đã công bố mã Pine này như một thư viện mã nguồn mở để các lập trình viên Pine khác trong cộng đồng có thể tái sử dụng. Chúc mừng tác giả! Bạn có thể sử dụng thư viện này cho mục đích cá nhân hoặc trong các ấn phẩm mã nguồn mở khác, nhưng việc tái sử dụng mã này trong các ấn phẩm phải tuân theo Nội Quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Thư viện Pine
Theo đúng tinh thần TradingView, tác giả đã công bố mã Pine này như một thư viện mã nguồn mở để các lập trình viên Pine khác trong cộng đồng có thể tái sử dụng. Chúc mừng tác giả! Bạn có thể sử dụng thư viện này cho mục đích cá nhân hoặc trong các ấn phẩm mã nguồn mở khác, nhưng việc tái sử dụng mã này trong các ấn phẩm phải tuân theo Nội Quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.