Skip to content

input

Functions

bool

pine
input.bool(
    const bool defval,
    const string title = na,
    const string tooltip = na,
    const string inline = na,
    const string group = na,
    const bool confirm = false,
    const plot_display display = display.all,
    input bool active = true
  ) → input bool

Add an input to the script settings.

Parameters

NameTypeDefaultDescription
defvalconst boolThe default value of the input.
titleconst stringnaThe label for the input in the settings.
tooltipconst stringnaThe tooltip text for the input.
inlineconst stringnaThe inline group name for layout.
groupconst stringnaThe input group name for organization.
confirmconst boolfalseIf true, a confirmation dialog is shown.
displayconst plot_displaydisplay.allThe display mode for the input.
activeinput booltrueIf true, the input is active.

Returns: input bool


color

pine
input.color(
    const color defval,
    const string title = na,
    const string tooltip = na,
    const string inline = na,
    const string group = na,
    const bool confirm = false,
    const plot_display display = display.all,
    input bool active = true
  ) → input color

Add an input to the script settings.

Parameters

NameTypeDefaultDescription
defvalconst colorThe default color value of the input.
titleconst stringnaThe label for the input in the settings.
tooltipconst stringnaThe tooltip text for the input.
inlineconst stringnaThe inline group name for layout.
groupconst stringnaThe input group name for organization.
confirmconst boolfalseIf true, a confirmation dialog is shown.
displayconst plot_displaydisplay.allThe display mode for the input.
activeinput booltrueIf true, the input is active.

Returns: input color


enum

pine
input.enum(
    const T defval,
    const string title = na,
    const array<T> options = na,
    const string tooltip = na,
    const string inline = na,
    const string group = na,
    const bool confirm = false,
    const plot_display display = display.all,
    input bool active = true
  ) → input T

Add an input to the script settings.

Parameters

NameTypeDefaultDescription
defvalconst TThe default enum value of the input.
titleconst stringnaThe label for the input in the settings.
optionsconst array<T>naAn array of allowed enum values.
tooltipconst stringnaThe tooltip text for the input.
inlineconst stringnaThe inline group name for layout.
groupconst stringnaThe input group name for organization.
confirmconst boolfalseIf true, a confirmation dialog is shown.
displayconst plot_displaydisplay.allThe display mode for the input.
activeinput booltrueIf true, the input is active.

Returns: input T


float

Add an input to the script settings.

Parameters

NameTypeDefaultDescription
defvalconst floatThe default value of the input.
titleconst stringnaThe label for the input in the settings.
optionsconst array<float>naAn array of allowed values for the input.
tooltipconst stringnaThe tooltip text for the input.
inlineconst stringnaThe inline group name for layout.
groupconst stringnaThe input group name for organization.
confirmconst boolfalseIf true, a confirmation dialog is shown.
displayconst plot_displaydisplay.allThe display mode for the input.
activeinput booltrueIf true, the input is active.

Returns: input float

Add an input to the script settings.

Parameters

NameTypeDefaultDescription
defvalconst floatThe default value of the input.
titleconst stringnaThe label for the input in the settings.
minvalconst floatnaThe minimum allowed value.
maxvalconst floatnaThe maximum allowed value.
stepconst floatnaThe step size for value increments.
tooltipconst stringnaThe tooltip text for the input.
inlineconst stringnaThe inline group name for layout.
groupconst stringnaThe input group name for organization.
confirmconst boolfalseIf true, a confirmation dialog is shown.
displayconst plot_displaydisplay.allThe display mode for the input.
activeinput booltrueIf true, the input is active.

Returns: input float


int

Add an input to the script settings.

Parameters

NameTypeDefaultDescription
defvalconst intThe default value of the input.
titleconst stringnaThe label for the input in the settings.
optionsconst array<int>naAn array of allowed values for the input.
tooltipconst stringnaThe tooltip text for the input.
inlineconst stringnaThe inline group name for layout.
groupconst stringnaThe input group name for organization.
confirmconst boolfalseIf true, a confirmation dialog is shown.
displayconst plot_displaydisplay.allThe display mode for the input.
activeinput booltrueIf true, the input is active.

Returns: input int

Add an input to the script settings.

Parameters

NameTypeDefaultDescription
defvalconst intThe default value of the input.
titleconst stringnaThe label for the input in the settings.
minvalconst intnaThe minimum allowed value.
maxvalconst intnaThe maximum allowed value.
stepconst intnaThe step size for value increments.
tooltipconst stringnaThe tooltip text for the input.
inlineconst stringnaThe inline group name for layout.
groupconst stringnaThe input group name for organization.
confirmconst boolfalseIf true, a confirmation dialog is shown.
displayconst plot_displaydisplay.allThe display mode for the input.
activeinput booltrueIf true, the input is active.

Returns: input int


price

pine
input.price(
    const float defval,
    const string title = na,
    const string tooltip = na,
    const string inline = na,
    const string group = na,
    const bool confirm = false,
    const plot_display display = display.all,
    input bool active = true
  ) → input float

Add an input to the script settings.

Parameters

NameTypeDefaultDescription
defvalconst floatThe default price value of the input.
titleconst stringnaThe label for the input in the settings.
tooltipconst stringnaThe tooltip text for the input.
inlineconst stringnaThe inline group name for layout.
groupconst stringnaThe input group name for organization.
confirmconst boolfalseIf true, a confirmation dialog is shown.
displayconst plot_displaydisplay.allThe display mode for the input.
activeinput booltrueIf true, the input is active.

Returns: input float


session

pine
input.session(
    const string defval,
    const string title = na,
    const array<string> options = na,
    const string tooltip = na,
    const string inline = na,
    const string group = na,
    const bool confirm = false,
    const plot_display display = display.all,
    input bool active = true
  ) → input string

Add an input to the script settings.

Parameters

NameTypeDefaultDescription
defvalconst stringThe default session value of the input.
titleconst stringnaThe label for the input in the settings.
optionsconst array<string>naAn array of allowed session values.
tooltipconst stringnaThe tooltip text for the input.
inlineconst stringnaThe inline group name for layout.
groupconst stringnaThe input group name for organization.
confirmconst boolfalseIf true, a confirmation dialog is shown.
displayconst plot_displaydisplay.allThe display mode for the input.
activeinput booltrueIf true, the input is active.

Returns: input string


source

pine
input.source(
    const expression defval,
    const string title = na,
    const string tooltip = na,
    const string inline = na,
    const string group = na,
    const plot_display display = display.all,
    input bool active = true,
    const bool confirm = false
  ) → input float

Add an input to the script settings.

Parameters

NameTypeDefaultDescription
defvalconst expressionThe default series expression value of the input.
titleconst stringnaThe label for the input in the settings.
tooltipconst stringnaThe tooltip text for the input.
inlineconst stringnaThe inline group name for layout.
groupconst stringnaThe input group name for organization.
displayconst plot_displaydisplay.allThe display mode for the input.
activeinput booltrueIf true, the input is active.
confirmconst boolfalseIf true, a confirmation dialog is shown.

Returns: input float


string

pine
input.string(
    const string defval,
    const string title = na,
    const array<string> options = na,
    const string tooltip = na,
    const string inline = na,
    const string group = na,
    const bool confirm = false,
    const plot_display display = display.all,
    input bool active = true
  ) → input string

Add an input to the script settings.

Parameters

NameTypeDefaultDescription
defvalconst stringThe default string value of the input.
titleconst stringnaThe label for the input in the settings.
optionsconst array<string>naAn array of allowed values for the input.
tooltipconst stringnaThe tooltip text for the input.
inlineconst stringnaThe inline group name for layout.
groupconst stringnaThe input group name for organization.
confirmconst boolfalseIf true, a confirmation dialog is shown.
displayconst plot_displaydisplay.allThe display mode for the input.
activeinput booltrueIf true, the input is active.

Returns: input string


symbol

pine
input.symbol(
    const string defval,
    const string title = na,
    const string tooltip = na,
    const string inline = na,
    const string group = na,
    const bool confirm = false,
    const plot_display display = display.all,
    input bool active = true
  ) → input string

Add an input to the script settings.

Parameters

NameTypeDefaultDescription
defvalconst stringThe default symbol value of the input.
titleconst stringnaThe label for the input in the settings.
tooltipconst stringnaThe tooltip text for the input.
inlineconst stringnaThe inline group name for layout.
groupconst stringnaThe input group name for organization.
confirmconst boolfalseIf true, a confirmation dialog is shown.
displayconst plot_displaydisplay.allThe display mode for the input.
activeinput booltrueIf true, the input is active.

Returns: input string


text_area

pine
input.text_area(
    const string defval,
    const string title = na,
    const string tooltip = na,
    const string group = na,
    const bool confirm = false,
    const plot_display display = display.all,
    input bool active = true
  ) → input string

Add an input to the script settings.

Parameters

NameTypeDefaultDescription
defvalconst stringThe default text value of the input.
titleconst stringnaThe label for the input in the settings.
tooltipconst stringnaThe tooltip text for the input.
groupconst stringnaThe input group name for organization.
confirmconst boolfalseIf true, a confirmation dialog is shown.
displayconst plot_displaydisplay.allThe display mode for the input.
activeinput booltrueIf true, the input is active.

Returns: input string


time

pine
input.time(
    const int defval,
    const string title = na,
    const string tooltip = na,
    const string inline = na,
    const string group = na,
    const bool confirm = false,
    const plot_display display = display.all,
    input bool active = true
  ) → input int

Add an input to the script settings.

Parameters

NameTypeDefaultDescription
defvalconst intThe default time value of the input as UNIX timestamp.
titleconst stringnaThe label for the input in the settings.
tooltipconst stringnaThe tooltip text for the input.
inlineconst stringnaThe inline group name for layout.
groupconst stringnaThe input group name for organization.
confirmconst boolfalseIf true, a confirmation dialog is shown.
displayconst plot_displaydisplay.allThe display mode for the input.
activeinput booltrueIf true, the input is active.

Returns: input int


timeframe

pine
input.timeframe(
    const string defval,
    const string title = na,
    const array<string> options = na,
    const string tooltip = na,
    const string inline = na,
    const string group = na,
    const bool confirm = false,
    const plot_display display = display.all,
    input bool active = true
  ) → input string

Add an input to the script settings.

Parameters

NameTypeDefaultDescription
defvalconst stringThe default timeframe value of the input.
titleconst stringnaThe label for the input in the settings.
optionsconst array<string>naAn array of allowed timeframe values.
tooltipconst stringnaThe tooltip text for the input.
inlineconst stringnaThe inline group name for layout.
groupconst stringnaThe input group name for organization.
confirmconst boolfalseIf true, a confirmation dialog is shown.
displayconst plot_displaydisplay.allThe display mode for the input.
activeinput booltrueIf true, the input is active.

Returns: input string

基于 MIT 许可证发布。