syminfo.prefix() - Pine Script Function
syminfo.prefix()
Section titled “syminfo.prefix()”Overview
Section titled “Overview”Returns exchange prefix of the symbol, e.g. “NASDAQ”.
Syntax
Section titled “Syntax”syminfo.prefix(symbol) → simple stringParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| symbol | simple string | Symbol. Note that the symbol should be passed with a prefix. For example: “NASDAQ:AAPL” instead of “AAPL”. |
Returns
Section titled “Returns”Returns exchange prefix of the symbol, e.g. “NASDAQ”.
Remarks
Section titled “Remarks”- The result of the function is used in the ticker.new/ticker.modify and request.security.
Examples
Section titled “Examples”Example 1
Section titled “Example 1”//@version=6indicator("syminfo.prefix fun", overlay=true)i_sym = input.symbol("NASDAQ:AAPL")pref = syminfo.prefix(i_sym)tick = syminfo.ticker(i_sym)t = ticker.new(pref, tick, session.extended)s = request.security(t, "1D", close)plot(s)