Using "sl" as the format string, we would get the symbol followed by the name of the security. For example, Symbol refers to the string "s" and name refers to the string "l". The values are the strings that pick up the information described in the menu item. Viewing the source of this page, you will come across the section that defines the menus that let you select which elements go into a particular view. Provided a My Yahoo! () account, go to the following URL: Stock Exchange x FAQs How can one figure out the format string? The following list contains all the available data fields at Yahoo! along with the corresponding format string entry: Symbol s The regression tests scripts in the t/ subdirectory of the source distribution also contain simple examples. Two example scripts are provided to help with the mapping a stock symbols as well as with Yahoo! Finance server codes. Furthermore, authentication-based proxies can be used by setting the proxy user and password via the variables $Finance::YahooQuote::PROXYUSER and $Finance::YahooQuote::PROXYPASSWD. You may also provide a proxy (for the required http connection) by using the variable $Finance::YahooQuote::PROXY. You may optionally override the default LWP timeout of 180 seconds by setting $Finance::YahooQuote::TIMEOUT to your preferred value. It should work for other markets supported by Yahoo. Finance::YahooQuote can be used for stocks from the USA, Canada, various European exchanges, various Asian exchanges (Singapore, Taiwan, HongKong, Kuala Lumpur. Here the custom fields correspond to the 'named' fields of the list below.īeyond stock quotes, Finance::YahooQuote can also obtain quotes for currencies (from the Philadephia exchange - however Yahoo! appears to have stopped to support the currency symbols in a reliable manner), US mutual funds, options on US stocks, several precious metals and quite possibly more see the Yahoo! Finance website for full information. The getcustomquote returns an array of quotes corresponding to values for the symbols supplied in the first array reference, and the custom fields supplied in the second array reference. The useExtendedQueryFormat and useRealtimeQueryFormat are simpler interfaces which append symbols to the default quote string, as detailed above. The setQueryString permits to supply a new query string that will be used for subsequent data requests. It returns a simple array of values for the given symbol. The getonequote function returns just one quote, rather than an array. The getquote function returns an array of pointers to arrays with the above structure. If the real-time format has been selected, the following fields are also retrieved: 36 Ask (real-time) If the extended format has been selected, the following fields are also retrieved: 22 Short ratio The return value of getonequote is an array, with the following elements: 0 Symbol The download operation is efficient: only one request is made even if several symbols are requested at once. getcustomquote allows to specify a format other than the default to take advantage of the extended range of available information. The getonequote function will return a quote for a single stock symbol, while the getquote function will return a quote for each of the stock symbols passed to it. This module gets stock quotes from Yahoo! Finance. NOTE: As of November 2017, the module is no longer all that useful as Yahoo! decided to halt the API service it relies on. UseRealtimeQueryFormat() # switch to real-time query = getquote # Get quotes for a bunch of = getcustomquote(, # using custom format UseExtendedQueryFormat() # switch to extended query format $Finance::YahooQuote::PROXY = getonequote $symbol # Get a quote for a single = getquote # Get quotes for a bunch of symbols
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |