I’m creating a website, showing graphs from TradingView.
The graphs are taken from an input box the user enters.
I’m doing this:
new TradingView.widget({
"width": "100%",
"height": "100%",
"symbol": symbol,
The issue is, that if I just write a stock name, then it may find a stock with the same symbol from a market which is not NASDAQ or NYSE.
I can’t mention in the symbol if it is from NYSE or NASDAQ, because the user just inserts stock symbols, which are unknown when running the webpage.
How can I make it always take symbols only from NYSE or NASDAQ, and nothing else? Or on the other hand, if it fails to find NASDAQ:symbol, then let it try NYSE:symbol?
1