Library "debug" Show Array or Matrix Elements In Table
Use anytime you want to see the elements in an array or a matrix displayed. Effective debugger, particularly for strategies and complex logic structures.
Look in code to find instructions. Reach out if you need assistance.
Functionality includes:
Viewing the contents of an array or matrix on screen.
Track variables and variable updates using debug()
Track if and when local scopes fire using debugs()
Types Allowed:
string
float
int
string
debug(_col, _row, _name, _value, _msg, _ip) Debug Variables in Matrix Parameters: _col (int): (int) Assign Column _row (int): (int) Assign Row _name (matrix<string>): (simple matrix) Matrix Name _value (string): (string) Assign variable as a string (str.tostring()) _msg (string) _ip (int): (int) (default 1) 1 for continuous updates. 2 for barstate.isnew updates. 3 for barstate.isconfirmed updates. -1 to only add once Returns: Returns Variable _value output and _msg formatted as '_msg: variableOutput' in designated column and row
debugs(_col, _row, _name, _msg) Debug Scope in Matrix - Identify When Scope Is Accessed Parameters: _col (int): (int) Column Number _row (int): (int) Row Number _name (matrix<string>): (simple matrix) Matrix Name _msg (string): (string) Message Returns: Message appears in debug panel using _col/_row as the identifier
viewArray(_arrayName, _pos, _txtSize, _tRows, s_index, s_border, _rowCol, bCol, _fillCond, _offset) Array Element Display (Supports float[], int[], string[], and bool[]) Parameters: _arrayName (float[]): ID of Array to be Displayed _pos (string): Position for Table _txtSize (string): Size of Table Cell Text _tRows (int): Number of Rows to Display Data In (columns will be calculated accordingly) s_index (bool): (Optional. Default True.) Show/Hide Index Numbers s_border (bool): (Optional. Default False.) Show/Hide Border _rowCol (string) bCol (color): = (Optional. Default Black.) Frame/Border Color. _fillCond (bool): (Optional) Conditional statement. Function displays array only when true. For instances where size is not immediately known or indices are na. Default = true, indicating array size is set at bar_index 0. _offset (int): (Optional) Use to view historical array states. Default = 0, displaying realtime bar. Returns: A Display of Array Values in a Table
viewMatrix(_matrixName, _pos, _txtSize, s_index, _resetIdx, s_border, bCol, _fillCond, _offset) Matrix Element Display (Supports <float>, <int>, <string>, and <bool>) Parameters: _matrixName (matrix<float>): ID of Matrix to be Displayed _pos (string): Position for Table _txtSize (string): Size of Table Cell Text s_index (bool): (Optional. Default True.) Show/Hide Index Numbers _resetIdx (bool) s_border (bool): (Optional. Default False.) Show/Hide Border bCol (color): = (Optional. Default Black.) Frame/Border Color. _fillCond (bool): (Optional) Conditional statement. Function displays matrix only when true. For instances where size is not immediately known or indices are na. Default = true, indicating matrix size is set at bar_index 0. _offset (int): (Optional) Use to view historical matrix states. Default = 0, displaying realtime bar. Returns: A Display of Matrix Values in a Table
v2 Minor Update. Pushed text alignment for multi line table boxes to top left. Also, given how it's built I can't really make too much customizable, but I did add a text color modifier. So nothing huge, but the alignment change is going to help me out with my project.
진정한 TradingView 정신에 따라, 저자는 이 파인 코드를 다른 파인 프로그래머들이 재사용할 수 있도록 오픈 소스 라이브러리로 공개했습니다. 저자에게 박수를 보냅니다! 이 라이브러리는 개인적으로 사용하거나 다른 오픈 소스 출판물에서 사용할 수 있지만, 이 코드를 출판물에서 재사용하는 것은 하우스 룰에 의해 관리됩니다.