Open main menu
Home
Random
Donate
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Stock tickers/NYSE
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
local getArgs = require('Module:Arguments').getArgs local p = {} function p.GetURL(frame) local args = getArgs(frame) return p._GetURL(args) end function p._GetURL(args) local ticker = args[1] local exchange = args.exchange -- By default the exchange will be NYSE if not exchange then exchange = 'NYSE' end -- Get corrected ticker ticker = p.FormatTickerURL(ticker) -- NYSE official URL url = 'https://www.nyse.com/quote/' .. exchangeCode[exchange] .. ':' .. ticker return url end function p.FormatTickerURL(ticker) -- Convert to upper case ticker = string.upper(ticker) -- NYSE.com formats for preferred shares / when issued -- Example: Input: PRE.PRD, Output: PREpD ticker = string.gsub(ticker, "%.PR", "p") ticker = string.gsub(ticker, "%.WI", "w") return ticker end -- Get NYSE exchange codes exchangeCode = { ['NYSE'] = 'XNYS', ['AMEX'] = 'XASE', ['ARCA'] = 'ARCX', ['NASDAQ'] = 'XNAS' } return p
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:High-use
(
edit
)
Template:Module other
(
edit
)
Template:Module rating
(
edit
)
Template:Ombox
(
edit
)
Template:Tlx
(
edit
)
Module:Arguments
(
edit
)
Module:Effective protection level
(
edit
)
Module:Message box
(
edit
)
Module:Message box/configuration
(
edit
)
Module:Message box/ombox.css
(
edit
)
Module:Stock tickers/NYSE/doc
(
edit
)
Module:Template link general
(
edit
)
Module:Yesno
(
edit
)