Plot Ichimoku Kinko Hyo cloud charts from ichimoku objects in R Shiny, allowing full customisation of chart elements in an interactive environment. Intuitive cursor infotip provides ready access to the data directly from the chart.

iplot(
x,
ticker,
subtitle,
theme = c("original", "dark", "solarized", "mono"),
strat = TRUE,
type = c("none", "r", "s", "bar", "line"),
custom,
...,
launch.browser = TRUE
)

Arguments

x an object of class 'ichimoku'. (optional) specify a ticker (or other text) to include in the chart heading. If not set, the ticker saved within the ichimoku object will be used. (optional) specify a subtitle to display under the chart title. [default 'original'] with alternative choices of 'dark', 'solarized' or 'mono'. [default TRUE] if the ichimoku object contains a strategy, the periods for which the strategy results in a position will be shaded, and the strategy printed as the chart subtitle (if not otherwise specified). Set to FALSE to turn off this behaviour. [default 'none'] type of sub-plot to display beneath the ichimoku cloud chart, with a choice of 'none', 'r' or 's' for the corresponding oscillator type, and 'bar' or 'line' for custom plots. (optional) character string (containing a regular expression) matching the column name of the variable to be displayed as sub-plot. Specify type = 'bar' or type = 'line', otherwise other type settings will take precedence. additional parameters passed along to the 'options' argument of shiny::shinyApp(). [default TRUE] If TRUE, the system's default web browser will be launched automatically after the app is started. The value of this argument can also be a function to call with the application's URL. To use the default Shiny viewer in RStudio, please specify getOption("shiny.launch.browser").

Value

A Shiny app object with class 'shiny.appobj'. With default arguments, the Shiny app is launched in the default browser.

Details

This function has a dependency on the 'shiny' package.

For further details please refer to the reference vignette by calling: vignette("reference", package = "ichimoku")

Examples

if (interactive()) {
# Only run examples in interactive R sessions
cloud <- ichimoku(sample_ohlc_data, ticker = "TKR")
iplot(cloud)

# To open in RStudio viewer instead of default browser
iplot(cloud, launch.browser = getOption("shiny.launch.browser"))
}