strand-package {strand} | R Documentation |
strand: a framework for investment strategy simulation
Description
The strand package provides a framework for performing discrete (share-level) simulations of investment strategies. Simulated portfolios optimize exposure to an input signal subject to constraints such as position size and factor exposure.
For an introduction to running simulations using the package, see
vignette("strand")
. For details on available methods see the
documentation for the Simulation
class.
Author(s)
Jeff Enos jeffrey.enos@gmail.com and David Kane dave.kane@gmail.com
Examples
# Load up sample data
data(sample_secref)
data(sample_pricing)
data(sample_inputs)
# Load sample configuration
config <- example_strategy_config()
# Override config file end date to run a one-week sim
config$to <- as.Date("2020-06-05")
# Create the Simulation object and run
sim <- Simulation$new(config,
raw_input_data = sample_inputs,
raw_pricing_data = sample_pricing,
security_reference_data = sample_secref)
sim$run()
# Print overall statistics
sim$overallStatsDf()
# Access tabular result data
head(sim$getSimSummary())
head(sim$getSimDetail())
head(sim$getPositionSummary())
head(sim$getInputStats())
head(sim$getOptimizationSummary())
head(sim$getExposures())
# Plot results
## Not run:
sim$plotPerformance()
sim$plotMarketValue()
sim$plotCategoryExposure("sector")
sim$plotFactorExposure(c("value", "size"))
sim$plotNumPositions()
## End(Not run)
[Package strand version 0.2.0 Index]