Symbol Input
FXC911 – Forex & Crypto News & Insights
Goals
The script allows the user to input a symbol (with Tesla as the default).
It then plots the closing price of the selected symbol on the chart.
This is a basic script useful for visualizing the closing prices of different stocks or financial instruments on a TradingView chart.
Pine Script Code
//@version=5
indicator("Input Symbol")
symbol = input.symbol(defval = "TSLA", title = "Select Symbol")
plot(close)
Code Output

Explanation
//@version=5
This line declares that the script is written using version 5 of the Pine Script language.
indicator("Input Symbol")
This line defines a new indicator with the name "Input Symbol". This is the title that will appear on the chart when you add this indicator.
symbol = input.symbol(defval = "TSLA", title = "Select Symbol")
This line creates an input field where the user can select a symbol (a ticker for a stock or other financial instrument). The default value is set to "TSLA" (Tesla). The title of this input field is "Select Symbol".
plot(close)
This line plots the closing price of the currently selected symbol (which defaults to Tesla if the user doesn't select a different one). The
plot
function is used to draw this 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:
🚀 Finance & Trading Insights: fxc911.ir
🐦 Twitter: x.com/fxc911_official/
Last updated