Library "Table" This library provides an easy way to convert arrays and matrixes of data into tables. There are a few different implementations of each function so you can get more or less control over the appearance of the tables. The basic rule of thumb is that all matrix rows must have the same number of columns, and if you are providing multiple arrays/matrixes to specify additional colors (background/text), they must have the same number of rows/columns as the data array. Finally, you do have the option of spanning cells across rows or columns with some special syntax in the data cell. Look at the examples to see how the arrays and matrixes need to be built before they can be used by the functions.
floatArrayToCellArray(floatArray) Helper function that converts a float array to a Cell array so it can be rendered with the fromArray function Parameters: floatArray (float[]): (array<float>) the float array to convert to a Cell array. Returns: array<Cell> The Cell array to return.
stringArrayToCellArray(stringArray) Helper function that converts a string array to a Cell array so it can be rendered with the fromArray function Parameters: stringArray (string[]): (array<string>) the array to convert to a Cell array. Returns: array<Cell> The Cell array to return.
floatMatrixToCellMatrix(floatMatrix) Helper function that converts a float matrix to a Cell matrix so it can be rendered with the fromMatrix function Parameters: floatMatrix (matrix<float>): (matrix<float>) the float matrix to convert to a string matrix. Returns: matrix<Cell> The Cell matrix to render.
stringMatrixToCellMatrix(stringMatrix) Helper function that converts a string matrix to a Cell matrix so it can be rendered with the fromMatrix function Parameters: stringMatrix (matrix<string>): (matrix<string>) the string matrix to convert to a Cell matrix. Returns: matrix<Cell> The Cell matrix to return.
fromMatrix(CellMatrix, position, verticalOffset, transposeTable, textSize, borderWidth, tableNumRows, blankCellText) Takes a CellMatrix and renders it as a table. Parameters: CellMatrix (matrix<Cell>): (matrix<Cell>) The Cells to be rendered in a table position (string): (string) Optional. The position of the table. Defaults to position.top_right verticalOffset (int): (int) Optional. The vertical offset of the table from the top or bottom of the chart. Defaults to 0. transposeTable (bool): (bool) Optional. Will transpose all of the data in the matrices before rendering. Defaults to false. textSize (string): (string) Optional. The size of text to render in the table. Defaults to size.small. borderWidth (int): (int) Optional. The width of the border between table cells. Defaults to 2. tableNumRows (int): (int) Optional. The number of rows in the table. Not required, defaults to the number of rows in the provided matrix. If your matrix will have a variable number of rows, you must provide the max number of rows or the function will error when it attempts to set a cell value on a row that the table hadn't accounted for when it was defined. blankCellText (string): (string) Optional. Text to use cells when adding blank rows for vertical offsetting.
fromMatrix(dataMatrix, position, verticalOffset, transposeTable, textSize, borderWidth, tableNumRows, blankCellText) Renders a float matrix as a table. Parameters: dataMatrix (matrix<float>): (matrix_float) The data to be rendered in a table position (string): (string) Optional. The position of the table. Defaults to position.top_right verticalOffset (int): (int) Optional. The vertical offset of the table from the top or bottom of the chart. Defaults to 0. transposeTable (bool): (bool) Optional. Will transpose all of the data in the matrices before rendering. Defaults to false. textSize (string): (string) Optional. The size of text to render in the table. Defaults to size.small. borderWidth (int): (int) Optional. The width of the border between table cells. Defaults to 2. tableNumRows (int): (int) Optional. The number of rows in the table. Not required, defaults to the number of rows in the provided matrix. If your matrix will have a variable number of rows, you must provide the max number of rows or the function will error when it attempts to set a cell value on a row that the table hadn't accounted for when it was defined. blankCellText (string): (string) Optional. Text to use cells when adding blank rows for vertical offsetting.
fromMatrix(dataMatrix, position, verticalOffset, transposeTable, textSize, borderWidth, tableNumRows, blankCellText) Renders a string matrix as a table. Parameters: dataMatrix (matrix<string>): (matrix_string) The data to be rendered in a table position (string): (string) Optional. The position of the table. Defaults to position.top_right verticalOffset (int): (int) Optional. The vertical offset of the table from the top or bottom of the chart. Defaults to 0. transposeTable (bool): (bool) Optional. Will transpose all of the data in the matrices before rendering. Defaults to false. textSize (string): (string) Optional. The size of text to render in the table. Defaults to size.small. borderWidth (int): (int) Optional. The width of the border between table cells. Defaults to 2. tableNumRows (int): (int) Optional. The number of rows in the table. Not required, defaults to the number of rows in the provided matrix. If your matrix will have a variable number of rows, you must provide the max number of rows or the function will error when it attempts to set a cell value on a row that the table hadn't accounted for when it was defined. blankCellText (string): (string) Optional. Text to use cells when adding blank rows for vertical offsetting.
fromArray(dataArray, position, verticalOffset, transposeTable, textSize, borderWidth, blankCellText) Renders a Cell array as a table. Parameters: dataArray (Cell[]): (array<Cell>) The data to be rendered in a table position (string): (string) Optional. The position of the table. Defaults to position.top_right verticalOffset (int): (int) Optional. The vertical offset of the table from the top or bottom of the chart. Defaults to 0. transposeTable (bool): (bool) Optional. Will transpose all of the data in the matrices before rendering. Defaults to false. textSize (string): (string) Optional. The size of text to render in the table. Defaults to size.small. borderWidth (int): (int) Optional. The width of the border between table cells. Defaults to 2. blankCellText (string): (string) Optional. Text to use cells when adding blank rows for vertical offsetting.
fromArray(dataArray, position, verticalOffset, transposeTable, textSize, borderWidth, blankCellText) Renders a string array as a table. Parameters: dataArray (string[]): (array_string) The data to be rendered in a table position (string): (string) Optional. The position of the table. Defaults to position.top_right verticalOffset (int): (int) Optional. The vertical offset of the table from the top or bottom of the chart. Defaults to 0. transposeTable (bool): (bool) Optional. Will transpose all of the data in the matrices before rendering. Defaults to false. textSize (string): (string) Optional. The size of text to render in the table. Defaults to size.small. borderWidth (int): (int) Optional. The width of the border between table cells. Defaults to 2. blankCellText (string): (string) Optional. Text to use cells when adding blank rows for vertical offsetting.
fromArray(dataArray, position, verticalOffset, transposeTable, textSize, borderWidth, blankCellText) Renders a float array as a table. Parameters: dataArray (float[]): (array_float) The data to be rendered in a table position (string): (string) Optional. The position of the table. Defaults to position.top_right verticalOffset (int): (int) Optional. The vertical offset of the table from the top or bottom of the chart. Defaults to 0. transposeTable (bool): (bool) Optional. Will transpose all of the data in the matrices before rendering. Defaults to false. textSize (string): (string) Optional. The size of text to render in the table. Defaults to size.small. borderWidth (int): (int) Optional. The width of the border between table cells. Defaults to 2. blankCellText (string): (string) Optional. Text to use cells when adding blank rows for vertical offsetting.
debug(message, position) Renders a debug message in a table at the desired location on screen. Parameters: message (string): (string) The message to render. position (string): (string) Optional. The position of the debug message. Defaults to position.middle_right.
Cell Type for each cell's content and appearance Fields: content (series string) bgColor (series color) textColor (series color) align (series string) colspan (series int) rowspan (series int)
W prawdziwym duchu TradingView autor opublikował ten kod Pine jako bibliotekę typu open source, aby inni programiści Pine z naszej społeczności mogli go ponownie wykorzystać. Pozdrowienia dla autora! Możesz używać tej biblioteki prywatnie lub w innych publikacjach typu open source, ale ponowne użycie tego kodu w publikacji podlega Zasadom Regulaminu.
I release TradingView indicators and libraries designed to make you a better trader. For detailed info about them, head over to improve.trading
Również na:
Wyłączenie odpowiedzialności
Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.