# NOT RUN {
# 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()
# }
Run the code above in your browser using DataLab