Source Input
Yaser Rahmati | یاسر رحمتی
Last updated
Yaser Rahmati | یاسر رحمتی
Last updated
This script creates a simple indicator named "Input Source" that allows the user to select a data source (like close, open, high, low) for the indicator through a drop-down menu.
This line specifies the version of the Pine Script being used, which is version 5. Pine Script has multiple versions, and this line ensures the script is interpreted correctly by TradingView.
This line defines the indicator. The "Input Source"
string is the name of the indicator that will be displayed on the chart.
input.source
: This function creates an input option for the user, allowing them to select a data source for the indicator (such as close
, open
, high
, low
, etc.).
defval = close
: This sets the default value of the input to the closing price of each bar.
title = "Select Source"
: This is the label that will appear in the input settings dialog, allowing the user to know what the input is for.
This line plots the source price of the asset on the chart. Even though the input source is defined earlier, the script is set to plot the closing price by default, regardless of the user input.
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
, یاسر رحمتی
🌐 Personal Website 📄 Resume 🎥 Video Archive 💼 Finance Blog 🔐 Network & Security Notebook 🎬 Aparat Channel