Skip to content
Algo Trade Analytics Docs

export - Pine Script Keyword

Used in libraries to prefix the declaration of functions or user-defined type definitions that will be available from other scripts importing the library.

  • Each library must have at least one exported function or user-defined type (UDT).
//@version=6//@description Library of debugging functions.library("Debugging_library", overlay = true)//@function Displays a string as a table cell for debugging purposes.//@param txt String to display.//@returns Void.export print(string txt) =>    var table t = table.new(position.middle_right, 1, 1)    table.cell(t, 0, 0, txt, bgcolor = color.yellow)// Using the function from inside the library to show an example on the published chart.// This has no impact on scripts using the library.print("Library Test")