strand (version 0.1.3)

strand-package: 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.

Arguments

Examples

Run this code
# NOT RUN {
# Load up sample data
data(sample_secref)
data(sample_pricing)
data(sample_inputs)

# Load sample configuration
config <- example_strategy_config()

# 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("category_1") 
sim$plotFactorExposure(c("factor_1", "factor_2", "factor_3"))
sim$plotNumPositions()
# }

Run the code above in your browser using DataLab