PINE LIBRARY
Cập nhật matrixautotable

Library "matrixautotable"
Automatic Table from Matrixes with pseudo correction for na values and default color override for missing values. uses overloads in cases of cheap float only, with additional addon for strings next, then cell colors, then text colors, and tooltips last.. basic size and location are auto, include the template to speed this up...
TODO : make bools version
Pine Script®
matrixtable(_floatmatrix, _stringmatrix, _bgcolormatrix, _textcolormatrix, _tooltipmatrix, _textSize, tableYpos, tableXpos) matrixtable
Parameters:
_floatmatrix: <matrix> float vals
_stringmatrix: <matrix> string
_bgcolormatrix: <matrix> color
_textcolormatrix: <matrix>color
_tooltipmatrix: <matrix> string
_textSize: int
tableYpos: string
tableXpos: string
matrixtable(_floatmatrix, _stringmatrix, _bgcolormatrix, _textcolormatrix, _textSize, tableYpos, tableXpos) matrixtable
Parameters:
_floatmatrix: <matrix> float vals
_stringmatrix: <matrix> string
_bgcolormatrix: <matrix> color
_textcolormatrix: <matrix>color
_textSize: int
tableYpos: string
tableXpos: string
matrixtable(_floatmatrix, _stringmatrix, _bgcolormatrix, _txtdefcol, _textSize, tableYpos, tableXpos) matrixtable
Parameters:
_floatmatrix: <matrix> float vals
_stringmatrix: <matrix> string
_bgcolormatrix: <matrix> color
_txtdefcol: color
_textSize: int
tableYpos: string
tableXpos: string
matrixtable(_floatmatrix, _stringmatrix, _txtdefcol, _bgdefcol, _textSize, tableYpos, tableXpos) matrixtable
Parameters:
_floatmatrix: <matrix> float vals
_stringmatrix: <matrix> string
_txtdefcol: color
_bgdefcol: color
_textSize: int
tableYpos: string
tableXpos: string
matrixtable(_floatmatrix, _txtdefcol, _bgdefcol, _textSize, tableYpos, tableXpos) matrixtable
Parameters:
_floatmatrix: <matrix> float vals
_txtdefcol: color
_bgdefcol: color
_textSize: int
tableYpos: string
tableXpos: string
Automatic Table from Matrixes with pseudo correction for na values and default color override for missing values. uses overloads in cases of cheap float only, with additional addon for strings next, then cell colors, then text colors, and tooltips last.. basic size and location are auto, include the template to speed this up...
TODO : make bools version
var string group_table = ' Table'
var int _tblssizedemo = input.int ( 10 )
string tableYpos = input.string ( 'middle' , '↕' , inline = 'place' , group = group_table, options=['top', 'middle', 'bottom'])
string tableXpos = input.string ( 'center' , '↔' , inline = 'place' , group = group_table, options=['left', 'center', 'right'], tooltip='Position on the chart.')
int _textSize = input.int ( 1 , 'Table Text Size' , inline = 'place' , group = group_table)
var matrix<float> _floatmatrix = matrix.new<float> (_tblssizedemo, _tblssizedemo, 0 )
var matrix<string> _stringmatrix = matrix.new<string> (_tblssizedemo, _tblssizedemo, 'test' )
var matrix<color> _bgcolormatrix = matrix.new<color> (_tblssizedemo, _tblssizedemo, color.white )
var matrix<color> _textcolormatrix = matrix.new<color> (_tblssizedemo, _tblssizedemo, color.black )
var matrix<string> _tooltipmatrix = matrix.new<string> (_tblssizedemo, _tblssizedemo, 'tool' )
// basic table ready to go with the aboec matrixes (replace in your code)
// for demo purpose, random colors, random nums, random na vals
if barstate.islast
varip _xsize = matrix.rows (_floatmatrix) -1
varip _ysize = matrix.columns (_floatmatrix) -1
for _xis = 0 to _xsize -1 by 1
for _yis = 0 to _ysize -1 by 1
_randomr = int(math.random(50,250))
_randomg = int(math.random(50,250))
_randomb = int(math.random(50,250))
_randomt = int(math.random(10,90 ))
bgcolor = color.rgb(250 - _randomr, 250 - _randomg, 250 - _randomb, 100 - _randomt )
txtcolor = color.rgb(_randomr, _randomg, _randomb, _randomt )
matrix.set(_bgcolormatrix ,_yis,_xis, bgcolor )
matrix.set(_textcolormatrix ,_yis,_xis, txtcolor)
matrix.set(_floatmatrix ,_yis,_xis, _randomr)
// random na
_ymiss = math.floor(math.random(0, _yis))
_xmiss = math.floor(math.random(0, _xis))
matrix.set( _floatmatrix ,_ymiss, _xis, na)
matrix.set( _stringmatrix ,_ymiss, _xis, na)
matrix.set( _bgcolormatrix ,_ymiss, _xis, na)
matrix.set( _textcolormatrix ,_ymiss, _xis, na)
matrix.set( _tooltipmatrix ,_ymiss, _xis, na)
// import here
import kaigouthro/matrixautotable/1 as mtxtbl
// and render table..
mtxtbl.matrixtable(_floatmatrix, _stringmatrix, _bgcolormatrix, _textcolormatrix, _tooltipmatrix, _textSize ,tableYpos ,tableXpos)
matrixtable(_floatmatrix, _stringmatrix, _bgcolormatrix, _textcolormatrix, _tooltipmatrix, _textSize, tableYpos, tableXpos) matrixtable
Parameters:
_floatmatrix: <matrix> float vals
_stringmatrix: <matrix> string
_bgcolormatrix: <matrix> color
_textcolormatrix: <matrix>color
_tooltipmatrix: <matrix> string
_textSize: int
tableYpos: string
tableXpos: string
matrixtable(_floatmatrix, _stringmatrix, _bgcolormatrix, _textcolormatrix, _textSize, tableYpos, tableXpos) matrixtable
Parameters:
_floatmatrix: <matrix> float vals
_stringmatrix: <matrix> string
_bgcolormatrix: <matrix> color
_textcolormatrix: <matrix>color
_textSize: int
tableYpos: string
tableXpos: string
matrixtable(_floatmatrix, _stringmatrix, _bgcolormatrix, _txtdefcol, _textSize, tableYpos, tableXpos) matrixtable
Parameters:
_floatmatrix: <matrix> float vals
_stringmatrix: <matrix> string
_bgcolormatrix: <matrix> color
_txtdefcol: color
_textSize: int
tableYpos: string
tableXpos: string
matrixtable(_floatmatrix, _stringmatrix, _txtdefcol, _bgdefcol, _textSize, tableYpos, tableXpos) matrixtable
Parameters:
_floatmatrix: <matrix> float vals
_stringmatrix: <matrix> string
_txtdefcol: color
_bgdefcol: color
_textSize: int
tableYpos: string
tableXpos: string
matrixtable(_floatmatrix, _txtdefcol, _bgdefcol, _textSize, tableYpos, tableXpos) matrixtable
Parameters:
_floatmatrix: <matrix> float vals
_txtdefcol: color
_bgdefcol: color
_textSize: int
tableYpos: string
tableXpos: string
Phát hành các Ghi chú
v2Updated:
matrixtable(_stringmatrix, _textSize, tableYpos, tableXpos) matrixtable
Parameters:
_stringmatrix: <matrix> float vals
_textSize: int
tableYpos: string
tableXpos: string
Phát hành các Ghi chú
v3Fixed Error allowing for table resizing dynamically.
Phát hành các Ghi chú
v4minor glitch, fixed table repaint issue
Phát hành các Ghi chú
v5Updated Glitch problem on varying matrix sizes.
probably,..
Phát hành các Ghi chú
v6ix! matrixes of differrent sizes will fill to match largest of them with na vals
Phát hành các Ghi chú
v7Phát hành các Ghi chú
v8quick lastconfirmedhistory availability and better color invert/default cols
Phát hành các Ghi chú
v9Now can fit to screen area, change cell sizing, and returns table object for adjusting frame/border/bacckground
Added:
bgcolor(bgcolor)
Set background or Table
Parameters:
bgcolor: New Background Color
Returns: void
border()
frame()
Updated:
mtable()
autogenerate table from string matrix
matrixtable(_stringmatrix, _textSize, tableYpos, tableXpos)
matrixtable
Parameters:
_stringmatrix: <matrix> float vals
_textSize: int
tableYpos: string
tableXpos: string
Phát hành các Ghi chú
v10oversight - table blanking when live and all mtx's even sized fixed.
Phát hành các Ghi chú
v11added option for any type for two w/ or without background col
and any single type with plain no colors
Added:
anytwo()
anyone()
Phát hành các Ghi chú
v12switch dat/titles in anytwo, hide NAN on string convert
Phát hành các Ghi chú
v13added customizable w/h of cells and library imports updated to latest
Updated:
matrixtable(_stringmatrix, _textSize, tableYpos, tableXpos)
matrixtable
Parameters:
_stringmatrix: <matrix> float vals
_textSize: int
tableYpos: string
tableXpos: string
anytwo()
anyone()
Phát hành các Ghi chú
v14minor addition, (total rewrite coming in future)
Updated:
anyone(_colormtx, _textSize, tableYpos, tableXpos, _fit, _shrink, _w, _h, _defaultbg, _defaultxt)
Parameters:
_colormtx
_textSize
tableYpos
tableXpos
_fit
_shrink
_w
_h
_defaultbg
_defaultxt
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.