Home
Random
Log in
Settings
About OrangDev Labs Wiki
Disclaimers
OrangDev Labs Wiki
Search
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.
The edit appears to have already been undone.
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 OrangDev Labs Wiki 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
OrangDev Labs Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Preview page with this template
Template used on this page:
Module:Stock tickers/NYSE/doc
(
edit
)