Decimal Input

FXC911 – Forex & Crypto News & Insights

Goals

  • This Pine Script creates an input field for users to enter a floating-point number between 1.0 and 10.0 in steps of 0.5.

  • The entered value is then plotted on the chart.

Pine Script Code

//@version = 5
indicator("Input Decimal Values")

value = input.float(title = "Enter Value: ", defval = 1.5, maxval = 10.0, minval = 1.0, step = 0.5)

plot(value)

Code Output

Explanation

//@version = 5
  • This line specifies that the script is written in Pine Script version 5.

indicator("Input Decimal Values")
  • This line declares the script as an indicator with the name "Input Decimal Values". This name will be displayed on the chart.

value = input.float(title = "Enter Value: ", defval = 1.5, maxval = 10.0, minval = 1.0, step = 0.5)
  • This line creates an input field for the user to enter a floating-point number.

    • title = "Enter Value: ": The label for the input field.

    • defval = 1.5: The default value is set to 1.5.

    • maxval = 10.0: The maximum allowable value is 10.0.

    • minval = 1.0: The minimum allowable value is 1.0.

    • step = 0.5: The value will increment or decrement by 0.5.

  • plot(value)

    • This line plots the user-defined value on the chart.

Keywords

pine script, trading view, script editor, indicators, strategies, backtesting, alerts, custom scripts, stock analysis, charting tools, technical analysis, built-in functions, pine script syntax, trading bots, automated trading, scripting language, market data, trading signals, financial markets, programming trading strategies

Visit me on:

Last updated