开发者 |
urkekg
techwebux |
---|---|
更新时间 | 2024年6月28日 07:14 |
捐献地址: | 去捐款 |
PHP版本: | 5.6 及以上 |
WordPress版本: | 6.5.5 |
版权: | GPLv3 |
版权网址: | 版权信息 |
Plugins
-> Add New
Stock Ticker
pluginStock Ticker
Settings
-> Stock Ticker
AlphaVantage.co API Key
Alpha Vantage API Key you received in previous step (check this screenshot)All Stock Symbols
all stock symbols you’ll use on whole website in various widgets and shortcodes, separated by comma. This field is used to fetch stock data from AlphaVantage.co API by AJAX in background. Because AV have only API to get data for single symbol, that can take a while to get. Please note, for default shortcode symbols there is still have field in Default Settings section of plugin.Fetch Stock Data Now!
to initially fetch stock data to database and wait for a while until we get all symbols from AlphaVantage.co for the very first time.[stock_ticker]
to page or post, or Stock Ticker
Widget to preferred Widget Area.You can use standard symbols from stock exchanges supported by AlphaVantage.co. For example, you can try with AAPL, MSFT, IBM, CSCO, GOOG, YHOO, AMZN (Apple Inc; Microsoft Corporation; International Business Machines Corporation; Cisco Systems, Inc.; Google Inc; Yahoo! Inc; Amazon.com, Inc.) To check if AlphaVantage.co support your preferred symbol(s), you can use Symbol Search & Test tool on plugin settings page to search for keysords and symbols on AlphaVantage.co directly from your WordPress dashboard.
Try to find correct symbol on AlphaVantage.co by looing for it in Symbol Search & Test tool. Even try alternatives or company name. If that does not help, search Alpha Vantage community forum www.alpha-vantage.community or contact Alpha Vantage support.
Unfortunately, AlphaVantage.co no longer supports indexes (mid-2020). That is why Stock Ticker no longer provide quotes for them.
Unfortunately, AlphaVantage.co does not support commodities (metals, energies, grains, meats, softs). That is why Stock Ticker can't provide quotes for them.
Use Currency exchange symbols like EURGBP
to get rate of 1 Euro
= ? British Pounds
Please note, since mid-2020 AlphaVantage.co does not support anymore format EURGBP=X
so use syntax without =X
.
Enter symbol in format EXCHANGE:SYMBOL
like LON:LLOY
or SYMBOL.EXCHANGE
like LLOY.LON
for Lloyds Banking Group Plc from London Stock Exchange market.
Please note that AlphaVantage.co does not provide stock data always for all existing stocks.
Add to Custom Names
legend currency exchange symbol w/o =X
part, like:
EURGBP;Euro (€) ⇨ British Pound Sterling (£)
Add this to your template file (you also can add custom parameters for shortcode):
<?php echo do_shortcode('[stock_ticker]'); ?>
On Settings page for plugin you can set custom Value template. You can use macro keywords %exch_symbol%
, %symbol%
, %company%
, %price%
, %volume%
, %change%
, %changep%
and %ltrade%
mixed with HTML tags <span>
, <em>
and/or <strong>
.
Default template is %company% %price% %change% %changep%
but you can format it like:
<span style="color:#333">%company%</span> <em>%price%</em> <strong>%change%</strong> %changep%
%company%
but symbol is displayed insteadPlease note that Alpha Vantage does not provide company name in retrieved feeds. You'll need to set company name in Custom Names field on plugin settings page.
Unfortunately, we could not get stock quotes this time
?This can be temporary issue. First try to run Fetch Stock Data Now!
on plugin settings page.
If that does not help, next try to increase Fetch Timeout option on general plugin settings and then run Fetch Stock Data Now!
.
If you still experiencing issue, please contact us through support forum.
Since version 3.1 of Stock Ticker you can get stock data in custom functions. Fore example:
`
That will return associated array for requested symbols:
array(2) { ["AAPL"]=> array(11) { ["symbol"]=> string(4) "AAPL" ["tz"]=> string(10) "US/Eastern" ["last_refreshed"]=> string(19) "2018-09-14 00:00:00" ["last_open"]=> string(8) "225.7500" ["last_high"]=> string(8) "226.8400" ["last_low"]=> string(8) "222.5220" ["last_close"]=> string(8) "223.8400" ["last_volume"]=> string(8) "31999289" ["change"]=> string(7) "-2.5700" ["changep"]=> string(7) "-1.1351" ["range"]=> string(19) "222.5220 - 226.8400" } ["MSFT"]=> array(11) { ["symbol"]=> string(4) "MSFT" ["tz"]=> string(10) "US/Eastern" ["last_refreshed"]=> string(19) "2018-09-14 00:00:00" ["last_open"]=> string(8) "113.3600" ["last_high"]=> string(8) "113.7300" ["last_low"]=> string(8) "112.4400" ["last_close"]=> string(8) "113.3700" ["last_volume"]=> string(8) "19122349" ["change"]=> string(6) "0.4600" ["changep"]=> string(6) "0.4074" ["range"]=> string(19) "112.4400 - 113.7300" } }`
stockticker_purge_cache
which allow unauthorised user to purge stock cache (from now purge stock cache by updating All Stock Symbols
or running Fetch Stock Data Now
on plugin settings page)number_format
has no effectAuto Refresh
to Auto Reload
to be clear what it is forwpaust
to stock-ticker
%ltrade%
with customizable date format like %ltrade|l, jS \of F Y%
get_symbol_to_fetch()
data_to_db()
get_stock_from_db()
public so user can access Stock data in DB from custom functionssanitize_symbols()
to main class and make it public static so user can access it from custom functions^DJBWR
Intraday
, Auto Refresh
, Load assets on all pages
). Thanks to @cmyee for reporting bug.Cache Timeout
can not be saved and always reset to zero on settings update.Uncaught ReferenceError: stock_tickers_load is not defined
reported by @wparoldBETA
Intraday
Refresh Timeout
option and rename to Auto Refresh Timeout
Cache Timeout
optionAll Stock Symbols
and Fetch Timeout
value.Stop Fetch
of forced fetching stock data on settings pageFetch Stock Data
on settings pageFetch Stock Data
on settings page with link to test symbol in case of error message Invalid API call
All Stock Symbols
and Stock Symbols
and display message about removed symbols on settings update