ShinyApp Graphs and Options

This vignette describes in detail graphing and data options available in av_runShiny(). Graphing options are typically set within the boxes to the side of the main screen, while all other options are set in the AVOPTS tab.

Application Options

Application defaults are initialized upon setup, and are saved persistently in a file ()avpf_constants.RD) within a cache directory chosen by tools::R_user_dir("alphavantagepf", which = "cache"). Data itself is stored in the same directory unless a Cache data directory is set up. The options can be categorized within three groups: required API options, data management options, and others.

Options
Options
Category Description
A: Keys and Data API keys and path to saved data
API connection is minimal requirement
B: Data Update Frequency How often to update prices/earnings
C: AV Capture Capture individual calls to API
D: Options Other binary options to control app behavior

Required API Options

This app is centered around the Alphavantage API, and requires a valid API key and entitlement status to function.

Field Description
av api key API key obtained form Alphavantage.
av entitlement Entitlement status, either delayed or realtime

Data Management Options

Data is stored in one or two directories, depending on whether a Dump directory is set.

The options associated with the dumping are given below:

Field Description
Cache Data Directory to store time series, earnings, and earnings estimates
AV dump directory Directory to store API call results. Must be set for dumping to occur.
Capture AV Data Capture individual API calls
None (default): Turn capture off, even if the directory is set.
nopricesonly: Capture anything but time series data.
all Capture all calls
Update or Cumulative update data captured by symbol, or (cum) capture every time with a timestamp.
Data Saving Options Manage capture file
SaveEveryAVCall: Save all calls cumulatively when the call is made.
CleanOnStart: Delete dump data on every startup of the app.
None: Keep dumped data in memory, avoiding IO overhead
SaveNowonOptUpdate

More detail on this feature is in the Data Vignette

Non-analytic Options

Non analytic features are set as check boxes in options section D, and are described in the following table. Note that any changes made only take effect when the Set Opts button is pressed.

Field Description
UseTotRtn Use total return data (i.e. adjusted for splits and dividends in price series)
UseLivePx Use separate Alphavantage calls to always have the most recent price point.
verbose Display (or not) informative messages in the console.
data2clipboard Copy select data from each analysis to the clipboard for pasting into other applications.
This is useful for other ad-hoc analysis without going through download boxes or extra buttons
persistOuput Keep analyses output (graphs, tables, etc) until replaced by new ones
showGeneralHelp Show (or not) a general help screen when AV.H is run.
showWarnings Suppress warnings from other packages (e.g. ggplot2)
useAbbreviations Abbreviate Ticker Names, dropping superfluous words in title
allDaysOnGraph Show non-equity business days if relevant2 on dygraphs

Analytics Options

These are default statistical parameters:

Field Description
HistVolParams Historical volatility parameters, see TTR::volatility
Regr Significance Significance level below which regression results are highlighted

Graphing Options

The default graphing package used is FinanceGraphs which provides finance-specific graphing functions based on dygraphs and ggplot2. Any of the features described there can be used, most notably:

Specific options for this app are described below, referencing this example:

GraphOptions
GraphOptions
TS Choice Description
last Add last value for each series at last point
splitts Split first series into separate axis
lastlabel Add label for series at last point
highlightfirst Make first series bolder
hilow Add high-low ranges if available
Scatter Choice Description
last Show last value as large point
tailhedge Split return scatter plot regressions into three piecewise regressions, one each for big negative returns, big positive returns, and everything else

Enhancements for this app.

A few enhancements have been added to the av_runShiny() set of options.

Event Description
earn Show EPS at report dates
surp Show earnings suprises at report dates, color coded by sign.
div Show dividends at ex-dates
divpct Show dividends as percent of close at ex-dates

As an example of how to use those events, here is a graph of JPM and XLF, with earnings surprise events:

earn_on_gpi.jpg
earn_on_gpi.jpg

  1. Live data is always retrieved if the option to do so is set in the options section D↩︎

  2. This matters, e.g. when plotting a 24hr asset (e.g. Cryptocurrencies) with equities. If selected, there will be noticeable gaps in the series of assets that aren’t trading when the 24hr asset is.↩︎