FFriZz

.print()


You don't need to initialize anything..
After you import the library you can use .print() as easy as that..!
Hope this helps
* use a unique ID for each .print() call

let me know if you run into any bugs
by trying to make it as user friendly as possible i had to do
some not ideal things so there's a chance it could present some bugs with
a lot of labels present on the chart

and if you use label.all to parse and manipulate the labels on the chart..
most likely it will cause an issue but not a lot of people use this so
I don't think that will be a problem.

thanks,
FFriZz | frizlabz

Library "print"
Single function to print any type to console

method str(inp)
  `method` convert all types to string
```
(overload)
*.str(any inp) => string
```
  Namespace types: series string, simple string, input string, const string
  Parameters:
    inp (string): `any` - desc | Required
  Returns: `string` formatted string

method str(inp)
  Namespace types: series int, simple int, input int, const int
  Parameters:
    inp (int)

method str(inp)
  Namespace types: series float, simple float, input float, const float
  Parameters:
    inp (float)

method str(inp)
  Namespace types: series bool, simple bool, input bool, const bool
  Parameters:
    inp (bool)

method str(inp)
  Namespace types: series linefill
  Parameters:
    inp (linefill)

method str(inp)
  Namespace types: series line
  Parameters:
    inp (line)

method str(inp)
  Namespace types: series box
  Parameters:
    inp (box)

method str(inp)
  Namespace types: series label
  Parameters:
    inp (label)

method str(inp)
  Namespace types: matrix<string>
  Parameters:
    inp (matrix<string>)

method str(inp)
  Namespace types: matrix<int>
  Parameters:
    inp (matrix<int>)

method str(inp)
  Namespace types: matrix<float>
  Parameters:
    inp (matrix<float>)

method str(inp)
  Namespace types: matrix<bool>
  Parameters:
    inp (matrix<bool>)

method str(inp)
  Namespace types: matrix<linefill>
  Parameters:
    inp (matrix<linefill>)

method str(inp)
  Namespace types: matrix<line>
  Parameters:
    inp (matrix<line>)

method str(inp)
  Namespace types: matrix<box>
  Parameters:
    inp (matrix<box>)

method str(inp)
  Namespace types: matrix<label>
  Parameters:
    inp (matrix<label>)

method str(inp)
  Namespace types: linefill
  Parameters:
    inp (linefill)

method str(inp)
  Namespace types: line
  Parameters:
    inp (line)

method str(inp)
  Namespace types: box
  Parameters:
    inp (box)

method str(inp)
  Namespace types: label
  Parameters:
    inp (label)

method str(inp)
  Namespace types: string
  Parameters:
    inp (string)

method str(inp)
  Namespace types: int
  Parameters:
    inp (int)

method str(inp)
  Namespace types: float
  Parameters:
    inp (float)

method str(inp)
  Namespace types: bool
  Parameters:
    inp (bool)

method arrayShorten(str)
  arrayShorten
  Namespace types: series string, simple string, input string, const string
  Parameters:
    str (string): `string` - the string to shorten | Required
  Returns: `string` - a shortened version of the input string if it is an array with more than 7 elements, otherwise the original string

method matrixShorten(str)
  matrixShorten
  Namespace types: series string, simple string, input string, const string
  Parameters:
    str (string): `string` - the string to shorten | Required
  Returns: `string` - the shortened matrix string if the input is a matrix, otherwise returns the input string as is

method print(x, ID)
  print all types to theh same console with just this `method/function`
```
(overload)
*.print(any x, string ID, bool shorten=true?) => console
"param 'shorten' - only for arrays and matrixs" | true
```
  Namespace types: series string, simple string, input string, const string
  Parameters:
    x (string): - `any` input to convert
    ID (string): - `string` unique id for label on console `MUST BE UNIQUE`
  Returns: adds the `ID` and the `inp` to the console on the chart

method print(x, ID)
  Namespace types: series float, simple float, input float, const float
  Parameters:
    x (float)
    ID (string)

method print(x, ID)
  Namespace types: series int, simple int, input int, const int
  Parameters:
    x (int)
    ID (string)

method print(x, ID)
  Namespace types: series box
  Parameters:
    x (box)
    ID (string)

method print(x, ID)
  Namespace types: series bool, simple bool, input bool, const bool
  Parameters:
    x (bool)
    ID (string)

method print(x, ID)
  Namespace types: series label
  Parameters:
    x (label)
    ID (string)

method print(x, ID)
  Namespace types: series line
  Parameters:
    x (line)
    ID (string)

method print(x, ID)
  Namespace types: series linefill
  Parameters:
    x (linefill)
    ID (string)

method print(x, ID, shorten)
  Namespace types: string
  Parameters:
    x (string)
    ID (string)
    shorten (bool)

method print(x, ID, shorten)
  Namespace types: float
  Parameters:
    x (float)
    ID (string)
    shorten (bool)

method print(x, ID, shorten)
  Namespace types: int
  Parameters:
    x (int)
    ID (string)
    shorten (bool)

method print(x, ID, shorten)
  Namespace types: box
  Parameters:
    x (box)
    ID (string)
    shorten (bool)

method print(x, ID, shorten)
  Namespace types: bool
  Parameters:
    x (bool)
    ID (string)
    shorten (bool)

method print(x, ID, shorten)
  Namespace types: label
  Parameters:
    x (label)
    ID (string)
    shorten (bool)

method print(x, ID, shorten)
  Namespace types: line
  Parameters:
    x (line)
    ID (string)
    shorten (bool)

method print(x, ID, shorten)
  Namespace types: linefill
  Parameters:
    x (linefill)
    ID (string)
    shorten (bool)

method print(x, ID, shorten)
  Namespace types: matrix<string>
  Parameters:
    x (matrix<string>)
    ID (string)
    shorten (bool)

method print(x, ID, shorten)
  Namespace types: matrix<float>
  Parameters:
    x (matrix<float>)
    ID (string)
    shorten (bool)

method print(x, ID, shorten)
  Namespace types: matrix<int>
  Parameters:
    x (matrix<int>)
    ID (string)
    shorten (bool)

method print(x, ID, shorten)
  Namespace types: matrix<box>
  Parameters:
    x (matrix<box>)
    ID (string)
    shorten (bool)

method print(x, ID, shorten)
  Namespace types: matrix<bool>
  Parameters:
    x (matrix<bool>)
    ID (string)
    shorten (bool)

method print(x, ID, shorten)
  Namespace types: matrix<label>
  Parameters:
    x (matrix<label>)
    ID (string)
    shorten (bool)

method print(x, ID, shorten)
  Namespace types: matrix<line>
  Parameters:
    x (matrix<line>)
    ID (string)
    shorten (bool)

method print(x, ID, shorten)
  Namespace types: matrix<linefill>
  Parameters:
    x (matrix<linefill>)
    ID (string)
    shorten (bool)

Thư viện Pine

Với tinh thần TradingView thực sự, tác giả đã xuất bản 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 từ cộng đồng của chúng tôi có thể sử dụng lại nó. Chúc mừng tác giả! Bạn có thể sử dụng thư viện này một cách riêng tư hoặc trong các ấn phẩm mã nguồn mở khác, nhưng việc sử dụng lại mã này trong một ấn phẩm chịu sự điều chỉnh của Nội quy chung.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

Bạn muốn sử dụng thư viện này?

Sao chép văn bản vào khay nhớ tạm và dán nó vào tập lệnh của bạn.