intradayMarketMonitor {dang}R Documentation

Intra-day market monitor


Intra-day Market Monitor for Security Prices


intradayMarketMonitor(symbol = "^GSPC", defaultTZ = "America/Chicago")



A character variable with symbol understood by getQuote from package quantmod, default value is “^GSPC”.


A character variable with the (local) timezone used for displaying the data, default value is “America/Chicagp”.


This function periodically queries a public data source for a current price of given symbol and updates an intra-daily chart for that security. A working example is symbol “^GSPC” for the S&P500 index which can be obtained in real-time during (New York) trading hours. Other symbols may work.

An alternate version offering 24-hour coverage, for example for futures on Globex, is being prepared.

The function could be further generalized in numerous way and should be considered ‘alpha’. Current default values are a 15 second sleep, and fixed cut-off times for market open/close states corresponding to NYSE hours. The data history is reset to the two most recent days at the close, amd the data is snapshot to file (with the filename derived from the symbol, and the path given by tools::R_user_dir). These parameters might become configuration parameters in the future.


Nothing is returned, but a display of the current price and the recent history is updated, and the loops loops ‘forever’.


Dirk Eddelbuettel extending and refactoring the original code by Josh Ulrich

See Also


if (requireNamespace("quantmod", quietly)) {           # only suggested packages used
   suppressMessages({library(xts);library(quantmod)})  # dampen noise, add dang as needed

[Package dang version 0.0.15 Index]