How to Use Input?

Inputs
 

How to Use Input?


Intruduction

One of Pine Script's key features is the use of inputs. These allow users to customize and fine-tune their scripts without directly modifying the code. Inputs make scripts more flexible and user-friendly, enabling traders to adjust parameters easily.
Users can change input values from a script's "Settings/Inputs" tab. This feature allows users to adapt scripts to their preferences quickly and efficiently.
 
For example, when we create a Number-type input in Pineify, it appears as an adjustable parameter in the script settings on TradingView.
notion image
 
notion image
This feature allows traders to adjust input values directly on the TradingView platform without changing the script's code. Such flexibility lets users experiment with various parameters and fine-tune their trading indicators and strategies in real time.
 
Currently, Pineify supports creating the following types of inputs:
  • Number
  • Decimal
  • Text
  • Multiline Text
  • Color
  • Checkbox
  • Source
  • MA Type
  • Time Range
  • Date Time
  • Date Time Range
  • Timeframe
  • Ticker Symbol
 

Create Input

On the right panel of the editor, we can see all currently supported Input types. To create an input, simply click on the desired type and input configuration information.
notion image
 
The configuration information includes the following:
  • Name
  • Default Value
  • Options
  • Group
 
notion image
 
Once created, you can see all the currently created inputs in the Inputs Pane.
notion image
 
In TradingView's script settings, you can see all the Inputs you've created.
notion image
 

Sort Inputs

Inputs appear in the script settings in the order they were created. This setup can be helpful for organizing related inputs logically.
However, as your script grows more complex, you might need a different arrangement. Pineify offers an input sorting feature that lets you rearrange inputs to suit your needs.
 
To sort inputs, simply click the sorting button in the Inputs Pane toolbar. In the popup window, drag and drop the inputs to reorder them as desired. Finally, click save to apply your changes.
notion image
notion image
 

Input Groups

🔒 Only subscribed users can use the Input Groups feature.
Input Groups organize related inputs, making script settings more organized and easier to use. This feature lets you group similar inputs together, creating a clearer layout for adjusting parameters. It's especially helpful for scripts with many inputs, allowing quick access to related settings.
notion image
 
To use Input Groups, you first need to create an Input Group.
notion image
 
Click "Add Group," enter names for each group, adjust their order as needed, and then save your changes.
notion image
 
After creating groups, you can see the number of inputs in each group here. Clicking on a group filters the display to show only inputs in that group. By default, all inputs are shown.
notion image
 
Once created, you can modify existing inputs by selecting the corresponding Group from the Group option.
notion image
 

Turn on "Use Input”

In Pineify, you'll encounter the "Use Input" toggle in various sections such as Indicators, Plots, Alerts, and Price Data. This toggle indicates that these elements can be controlled through user inputs, allowing for greater customization and flexibility in your scripts.
When you activate the "Use Input" option, you simply need to select the appropriate input to bind to that particular element. This streamlined process enables you to easily connect your inputs with different aspects of your script, enhancing its adaptability and flexibility.
 
Let's take the creation of an EMA indicator as an example, where we bind the indicator's Length to a Number Input called "EMA Length". This demonstrates how inputs can be used to control specific aspects of your indicators, allowing for easy customization.
notion image
 
After completing the setup, you'll see the same name for both the input and the indicator's length parameter in the Pane.
notion image
 
In summary, Pine Script inputs in Pineify provide a powerful way to create customizable and flexible trading scripts, allowing users to easily adjust parameters without modifying the code directly, enhancing the adaptability and user-friendliness of trading indicators and strategies.