Aggiornato
FrizBug

Library "FrizBug"
Debug Tools | Pinescript Debugging Tool Kit
All in one Debugger - the benefit of wrapper functions to simply wrap variables or outputs and have the code still execute the same. Perfect for Debugging on Pine
str(inp)
โโOverloaded tostring like Function for all type+including Object Variables [ie. x1,y1,x2,y2] will also do arrays and matricies of all Types
โโParameters:
โโโโinp: All types
โโReturns: string
print_label(str, x_offset, y, barstate, style, color, textcolor, text_align, size)
โโLabel Helper Function - only needs the Str input to work
โโParameters:
str:
โโโโx_offset: offset from last bar + or -
โโโโy: price of label
โโโโbarstate: barstate built in variable [barstate.islast]
โโโโstyle: label style settin7[label.style_label_upper_left]
โโโโcolor: color setting [color.black]
โโโโtextcolor: textcolor [color.lime]
โโโโtext_align: text align setting [text.align_right/left/center]
โโโโsize: text_sise ['tiny','normal', or text.large, text.auto]
โโReturns: label
init()
โโinitializes the database arrays [1 var <string> and 1 varip <string>]
โโReturns: tuple [log,live] | 2 matrix<string> (1 matrix is varip(live) the other is reagular var (Bar))
update(log, live, live_console, log_console, live_lbl, log_lbl)
โโPut at the very end of your code / This updates all of the consoles
โโParameters:
โโโโlog: This matrix is the one used for Bar updates
โโโโlive: This matrix is the one used for Real Time updates
โโโโlive_console: on_offs for the consoles and lbls - call in the update function
โโโโlog_console: on_offs for the consoles and lbls - call in the update function
โโโโlive_lbl: on_offs for the consoles and lbls - call in the update function
โโโโlog_lbl: on_offs for the consoles and lbls - call in the update function
โโReturns: void
log(log, inp, str_label, off, rows, index_cols, bars_back)
โโFunction Will push to the Console offset to the right of Current bar, This is the main Console - it has 2 Feeds left and right (changeable)"
โโParameters:
โโโโlog: Matrix - Log or Live
โโโโinp: All types
โโโโstr_label: (optional) This input will label it on the feed
โโโโoff: Useful for when you don't want to remove the function"
โโโโrows: when printing or logging a matrix this will shorten the output will show last # of rows"
โโโโindex_cols: When printing or logging a array or matrix this will shorten the array or the columns of a matrix by the #"
โโโโbars_back: Adjustment for Bars Back - Default is 1 (0 for barstate.islast)"
โโReturns: inp - all types (The log and print functions can be used as wrapper functions see usage below for examples)
Print(log, str_label, off, bars_back)
โโFunction can be used to send information to a label style Console, Can be used as a wrapper function, Similar to str.format use with str()
โโParameters:
โโโโlog:
โโโโstr_label: (optional) Can be used to label Data sent to the Console
โโโโoff: Useful for when you don't want to remove the function
โโโโbars_back: Adjustment for Bars Back - Default is 1 (0 for barstate.islast)
โโReturns: string
print(inp, str_label, off, bars_back)
โโThis Function can be used to send information to a label style Console, Can be used as a wrapper function, Overload print function
โโParameters:
โโโโinp: All types
โโโโstr_label: string (optional) Can be used to label Data sent to the Console
โโโโoff: Useful for when you don't want to remove the function
โโโโbars_back: Adjustment for Bars Back - Default is 1 (0 for barstate.islast)
โโReturns: inp - all types (The log and print functions can be used as wrapper functions see usage below for examples)
Credits:
kaigouthro - for the font library
RicardoSantos - for the concept I used to make this
Thanks!
Use cases at the bottom
Debug Tools | Pinescript Debugging Tool Kit
All in one Debugger - the benefit of wrapper functions to simply wrap variables or outputs and have the code still execute the same. Perfect for Debugging on Pine
str(inp)
โโOverloaded tostring like Function for all type+including Object Variables [ie. x1,y1,x2,y2] will also do arrays and matricies of all Types
โโParameters:
โโโโinp: All types
โโReturns: string
print_label(str, x_offset, y, barstate, style, color, textcolor, text_align, size)
โโLabel Helper Function - only needs the Str input to work
โโParameters:
str:
โโโโx_offset: offset from last bar + or -
โโโโy: price of label
โโโโbarstate: barstate built in variable [barstate.islast]
โโโโstyle: label style settin7[label.style_label_upper_left]
โโโโcolor: color setting [color.black]
โโโโtextcolor: textcolor [color.lime]
โโโโtext_align: text align setting [text.align_right/left/center]
โโโโsize: text_sise ['tiny','normal', or text.large, text.auto]
โโReturns: label
init()
โโinitializes the database arrays [1 var <string> and 1 varip <string>]
โโReturns: tuple [log,live] | 2 matrix<string> (1 matrix is varip(live) the other is reagular var (Bar))
update(log, live, live_console, log_console, live_lbl, log_lbl)
โโPut at the very end of your code / This updates all of the consoles
โโParameters:
โโโโlog: This matrix is the one used for Bar updates
โโโโlive: This matrix is the one used for Real Time updates
โโโโlive_console: on_offs for the consoles and lbls - call in the update function
โโโโlog_console: on_offs for the consoles and lbls - call in the update function
โโโโlive_lbl: on_offs for the consoles and lbls - call in the update function
โโโโlog_lbl: on_offs for the consoles and lbls - call in the update function
โโReturns: void
log(log, inp, str_label, off, rows, index_cols, bars_back)
โโFunction Will push to the Console offset to the right of Current bar, This is the main Console - it has 2 Feeds left and right (changeable)"
โโParameters:
โโโโlog: Matrix - Log or Live
โโโโinp: All types
โโโโstr_label: (optional) This input will label it on the feed
โโโโoff: Useful for when you don't want to remove the function"
โโโโrows: when printing or logging a matrix this will shorten the output will show last # of rows"
โโโโindex_cols: When printing or logging a array or matrix this will shorten the array or the columns of a matrix by the #"
โโโโbars_back: Adjustment for Bars Back - Default is 1 (0 for barstate.islast)"
โโReturns: inp - all types (The log and print functions can be used as wrapper functions see usage below for examples)
Print(log, str_label, off, bars_back)
โโFunction can be used to send information to a label style Console, Can be used as a wrapper function, Similar to str.format use with str()
โโParameters:
โโโโlog:
โโโโstr_label: (optional) Can be used to label Data sent to the Console
โโโโoff: Useful for when you don't want to remove the function
โโโโbars_back: Adjustment for Bars Back - Default is 1 (0 for barstate.islast)
โโReturns: string
print(inp, str_label, off, bars_back)
โโThis Function can be used to send information to a label style Console, Can be used as a wrapper function, Overload print function
โโParameters:
โโโโinp: All types
โโโโstr_label: string (optional) Can be used to label Data sent to the Console
โโโโoff: Useful for when you don't want to remove the function
โโโโbars_back: Adjustment for Bars Back - Default is 1 (0 for barstate.islast)
โโReturns: inp - all types (The log and print functions can be used as wrapper functions see usage below for examples)
Credits:
kaigouthro - for the font library
RicardoSantos - for the concept I used to make this
Thanks!
Use cases at the bottom
Note di rilascio
v2Added:
console()
Updated:
init()
โโinitializes the database arrays [1 var <string> and 1 varip <string>]
โโReturns: [console,tick] - tuple 2 matrix<string> 1 matrix is varip(tick) the other is reagular var (Bar)
update(memory, tick, live_console, console_console, live_lbl, console_lbl)
โโPut at the very end of your code / This updates all of the consoles
โโParameters:
โโโโmemory: This matrix is the one used for Bar updates
โโโโtick: This matrix is the one used for Real Time updates
โโโโlive_console: on_offs for the consoles and lbls - call in the update function
โโโโconsole_console: on_offs for the consoles and lbls - call in the update function
โโโโlive_lbl: on_offs for the consoles and lbls - call in the update function
โโโโconsole_lbl: on_offs for the consoles and lbls - call in the update function
โโReturns: void
log()
print()
Removed:
Print(log, str_label, off, bars_back)
โโFunction can be used to send information to a label style Console, Can be used as a wrapper function, Similar to str.format use with str()
Little update will update this page when i have some time
Note di rilascio
v5Updated:
console()
print()
Got print function working tick and bar updates more info in chart pic
Note di rilascio
=) v6Note di rilascio
v7Updated:
str(input)
โโParameters:
โโโโinput
print_label(str, x_offset, y, barstate, style, color, textcolor, text_align, size)
โโprint_label
โโParameters:
โโโโstr: string - the string to be displayed in the label
โโโโx_offset: int - offset from last bar in time units, default is 150
โโโโy: float - the price at which the label will be displayed, default is the high of the current bar
โโโโbarstate: bool - whether the label should be displayed on the last bar, default is true
โโโโstyle: string - the style of the label, default is label.style_label_lower_right
โโโโcolor: color - the color of the label, default is black
โโโโtextcolor: color - the color of the text in the label, default is lime green
โโโโtext_align: string - the alignment of the text in the label, default is text.align_left
โโโโsize: string - the size of the text in the label, default is 'normal'
โโReturns: label - the created label object
description
This function creates and returns a label object that can be displayed on the chart.
The label displays the given string at the specified price, with the specified styling and colors.
The label is displayed on the last bar by default, but this can be changed by setting the barstate parameter.
The x_offset parameter determines the offset from the last bar in time units.
init(UTC, console, type)
โโinit
โโParameters:
โโโโUTC: integer - representing the time zone offset from UTC in hours. A positive value means the time zone is ahead of UTC (e.g. UTC+3),
while a negative value means the time zone is behind UTC (e.g. UTC-5). The default value is -6.
โโโโconsole: string - indicating the type of console to output data to. Valid options are 'table', 'label', 'box', and 'tool'.
The default value is 'table'.
โโโโtype: string - indicating the type of data to output. Valid options are 'tick' and 'bar'. The default value is 'bar'.
return out string[] - string array for logging debug data.
description
This function initializes the output data for a script by creating an array of strings called out,
and sets its value based on the values of the console and type parameters.
It also sets the utc variable to a string representation of the UTC parameter, and adds a header string to the beginning of out
indicating the type of console being used and the data type being output.
The possible values for console are 'table', 'label', 'box', and 'tool',
and the possible values for type are 'tick' and 'bar'.
The default values for console and type are 'table' and 'bar' respectively.
The function returns out (string[]) at the end.
update(console1, console2, console3)
โโupdate
โโParameters:
โโโโconsole1: string[] - An array of strings representing the console to be updated.
โโโโconsole2: string[] - An array of strings representing the console to be updated.
โโโโconsole3: string[] - An array of strings representing the console to be updated.
return (void)
description
The update function updates the given consoles with the latest input in their respective buffers.
It also checks for the type of console and updates the label, table, box, or tooltip accordingly.
If a console is not provided or is empty, it is skipped.
print(input, data_label, tick, pos, off, m_rows, a_index_m_cols, size, text_size, bg_color, text_color, border_color, UTC)
โโprint
โโParameters:
โโโโinput: type - The input to be printed in the console
of the console on the chart. Valid values are "1-9",
โโโโoff: bool - A flag indicating whether to disable printing [true] or enable it [false]. Default value is false.
โโโโm_rows: int - An optional parameter for printing a matrix with a specified number of rows.
โโโโa_index_m_cols: int - An optional parameter for printing a matrix with a specified number of columns.
โโโโsize: int - The maximum number of lines that can be displayed in the console. Default value is 20.
โโโโtext_size: string - The size of the text in the console. Default value is `size.small`.
โโโโbg_color: color - The background color of the console. Default value is `#00000075`.
โโโโtext_color: color - The color of the text in the console. Default value is `#00ff00`.
โโโโborder_color: color - The color of the border around the console. Default value is `#00ff00`.
โโโโUTC: int - The time zone offset to use when displaying timestamps in the console. Default value is -6.
Removed:
console_colors
-- Finally had some time to update the function headers hope this helps
Note di rilascio
v8Updated:
init(UTC, console, type)
โโinit
โโParameters:
โโโโUTC: integer - representing the time zone offset from UTC in hours. A positive value means the time zone is ahead of UTC (e.g. UTC+3),
while a negative value means the time zone is behind UTC (e.g. UTC-5). The default value is -6.
โโโโconsole: string - indicating the type of console to output data to. Valid options are 'table', 'label', 'box', and 'tool'.
The default value is 'table'.
โโโโtype: string - indicating the type of data to output. Valid options are 'tick' and 'bar'. The default value is 'bar'.
โโReturns: out string[] - string array for logging debug data.
description
This function initializes the output data for a script by creating an array of strings called out,
and sets its value based on the values of the console and type parameters.
It also sets the utc variable to a string representation of the UTC parameter, and adds a header string to the beginning of out
indicating the type of console being used and the data type being output.
The possible values for console are 'table', 'label', 'box', and 'tool',
and the possible values for type are 'tick' and 'bar'.
The default values for console and type are 'table' and 'bar' respectively.
The function returns out (string[]) at the end.
update(console1, console2, console3)
โโupdate
โโParameters:
โโโโconsole1: string[] - An array of strings representing the console to be updated.
โโโโconsole2: string[] - An array of strings representing the console to be updated.
โโโโconsole3: string[] - An array of strings representing the console to be updated.
โโReturns: (void)
description
The update function updates the given consoles with the latest input in their respective buffers.
It also checks for the type of console and updates the label, table, box, or tooltip accordingly.
If a console is not provided or is empty, it is skipped.
Removed:
console(input, tick, position, size, text_size, bg_color, text_color, border_color, UTC, data_label)
โโconsole
did a couple little updates added some documentation at the top of the script
Note di rilascio
v9added a safety check in the print() helper function to shorten string if it reaches a length of > 4000 before it gets added to the array and then does its final string check
Note di rilascio
v10Updated:
init(UTC, console)
โโParameters:
โโโโUTC
โโโโconsole
update(console1, console2, console3, bg_color, text_color, border_color)
โโ- The update function updates the given consoles with the latest input in their respective buffers.
It also checks for the type of console and updates the label, table, box, or tooltip accordingly.
If a console is not provided or is empty, it is skipped.
โโParameters:
โโโโconsole1: string[] - An array of strings representing the console to be updated.
โโโโconsole2: string[] - An array of strings representing the console to be updated.
โโโโconsole3: string[] - An array of strings representing the console to be updated.
โโโโbg_color: color - Color of the bg of the consoles
โโโโtext_color: color - Color of the text of the consoles
โโโโborder_color
โโReturns: (void)
log(console, inp, data_label, off, loop, tick, m_rows, m_cols)
โโParameters:
โโโโconsole
โโโโinp
โโโโdata_label
โโโโoff
โโโโloop
โโโโtick
โโโโm_rows
โโโโm_cols
print(input, data_label, tick, pos, off, loop, UTC, m_rows, m_cols, size, text_size, bg_color, text_color)
โโParameters:
โโโโinput
โโโโdata_label
โโโโtick
โโโโpos
โโโโoff
โโโโloop
โโโโUTC
โโโโm_rows
โโโโm_cols
โโโโsize
โโโโtext_size
โโโโbg_color
โโโโtext_color
Removed:
print_label(str, x_offset, y, barstate, style, color, textcolor, text_align, size)
โโprint_label
Note di rilascio
v11 comment out usage code for speed for the userNote di rilascio
v12Added:
shorten(str, a_index, m_rows, m_cols)
โโโ This function is designed to shorten the string representation of either a matrix or an array by limiting the number of rows and columns displayed.
If the input str is a matrix or array, the function first sets the variables mtx and arr to true or false depending on the value of the a_or_m input.
If mtx is true and the current bar is the last bar of the bar series and either m_rows or a_index_m_cols are not zero,
the function performs the following steps:
โ It removes all square brackets, newline characters, and empty brackets from the input string and splits it into an array s_s at the brackets.
โ It splits the first element of s_s into an array s_ss at the comma and space.
โ If the size of s_s is greater than m_rows * 2 or the size of s_ss is greater than a_index_m_cols * 2,
the function performs the following steps:
โ It creates a new array m_strbot and sets a variable pop_shift to the integer value of m_rows.
โ It creates a copy c_ of s_s and iterates over it in reverse, popping elements from c_ and appending them to m_strbot.
โ For each element, it splits it into an array s_s_s at the comma and space.
If the size of s_s_s is less than or equal to a_index_m_cols * 2,
it simply appends the element to m_strbot.
If the size of s_s_s is greater than a_index_m_cols * 2,
it creates a new array a_strbot, sets a variable a_pop_shift to the integer value of a_index_m_cols,
and performs the following steps:
โ It iterates over s_s_s in reverse, popping elements from it and appending them to a_strbot.
โ It creates a new array a_strtop and iterates over s_s_s in forward order,
shifting elements from it and appending them to a_strtop.
โ It concatenates a_strtop and a_strbot and joins them with a comma and space,
then appends the resulting string to m_strbot as an element.
โ It creates a new array m_strtop and sets c_ to a copy of s_s.
It iterates over c_ in forward order,
shifting elements from it and appending them to m_strtop.
For each element, it splits it into an array s_s_s at the comma and space.
If the size of s_s_s is less than or equal to a_index_m_cols * 2,
it simply appends the element to m_strtop.
If the size of s_s_s is greater than a_index_m_cols * 2,
it performs the same steps as before to create a_strtop and a_strbot, concatenates them,
and appends the resulting string to `m_strtop It concatenates m_strbot and m_strtop and joins them
with a comma and space to create a new string m_out.
It then sets out to m_out, preceded by '\n'.
โ If arr and barstate.islast and (m_rows or a_index_m_cols) is true,
it performs similar steps to shorten the input string if it is an array.
โ It creates a new array s_s by splitting str at the square brackets and creates
a new array s_ss by splitting the first element of s_s at the comma and space.
โ If the size of s_s is greater than m_rows * 2 or the size of s_ss is greater than a_index_m_cols * 2,
it creates new arrays a_strbot and a_strtop as before and concatenates them to create a new string a_out.
It then sets out to a_out, preceded by '\n'.
โ Finally, the function returns out[shortened array/matrix].
โโParameters:
โโโโstr: string - The input string to be shortened.
โโโโa_index: int - The number of indexs to keep in array when shortening it. Default value is 0.
โโโโm_rows: int - The number of rows to keep in the matrix when shortening it. Default value is 0.
โโโโm_cols: int - The number of columns matrix when shortening it. Default value is 0.
โโReturns: string - The shortened string.
Description:
converted to methods
Note di rilascio
Library "FrizBug": Debug Tools | The Pinescript Debugging Tool Kit
added docs() acts as a hover over reference for the documentation
docs()
init(console)
โโinit() - Console init Function**
โโParameters:
โโโโinput: - ('any type') required
โโReturns: `string` of the input
str(input)
โโParameters:
โโโโinput
update(console1, console2, console3, bg_color, text_color, border_color)
โโParameters:
โโโโconsole1
โโโโconsole2
โโโโconsole3
โโโโbg_color
โโโโtext_color
โโโโborder_color
shorten(str, a_index, m_rows, m_cols)
โโParameters:
โโโโstr
โโโโa_index
โโโโm_rows
โโโโm_cols
log(console, inp, data_label, off, loop, tick, m_rows, m_cols)
โโParameters:
โโโโconsole
โโโโinp
โโโโdata_label
โโโโoff
โโโโloop
โโโโtick
โโโโm_rows
โโโโm_cols
print(input, data_label, tick, pos, off, loop, m_rows, m_cols, size, text_size, bg_color, text_color)
โโParameters:
โโโโinput
โโโโdata_label
โโโโtick
โโโโpos
โโโโoff
โโโโloop
โโโโm_rows
โโโโm_cols
โโโโsize
โโโโtext_size
โโโโbg_color
โโโโtext_color
any
โโFields:
โโโโany
Note di rilascio
v14Updated:
docs()
Hover over documentation
need to clean this code up still works fine for now but I can implement objects once I have time
โโ
Note di rilascio
v15Updated:
method log(inp, console, data_label, off, buffer, loop, tick, m_rows, m_cols)
โโNamespace types: matrix<linefill>
โโParameters:
โโโโinp (matrix<linefill>)
โโโโconsole (string[])
โโโโdata_label (string)
โโโโoff (bool)
โโโโbuffer (int)
โโโโloop (int)
โโโโtick (bool)
โโโโm_rows (int)
โโโโm_cols (int)
method print(input, data_label, tick, pos, buffer, off, loop, m_rows, m_cols, size, text_size, bg_color, text_color)
โโNamespace types: matrix<linefill>
โโParameters:
โโโโinput (matrix<linefill>)
โโโโdata_label (string)
โโโโtick (bool)
โโโโpos (string)
โโโโbuffer (int)
โโโโoff (bool)
โโโโloop (int)
โโโโm_rows (int)
โโโโm_cols (int)
โโโโsize (int)
โโโโtext_size (string)
โโโโbg_color (color)
โโโโtext_color (color)
Removed:
docs()
Now can hover over the library call to see docs!
Note di rilascio
v16Added: docs() method didnt work
Note di rilascio
v17Trading With Robots - Audited Automated Trading Robots
Declinazione di responsabilitร
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Trading With Robots - Audited Automated Trading Robots
Declinazione di responsabilitร
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.