optionstratlib-simulation
The simulation engine of OptionStratLib:
random walks, stochastic processes, simulators, exit policies and the generic
evaluation and statistics of simulated paths. The crate depends on
optionstratlib-core and optionstratlib-pricing, and on no option chain,
strategy, backtesting, plotting, I/O or terminal-presentation code.
| Module | Contents |
|---|---|
simulation |
WalkType (Brownian, geometric Brownian, log-returns, mean-reverting, jump diffusion, GARCH, Heston, telegraph, custom, historical) and WalkTypeAble; WalkParams, Step, Xstep, Ystep; walk_steps, walk_steps_par, generator_positive; RandomWalk, Simulator; generate_ou_process; ExitPolicy; PathEvaluator, PathOutcome, PathStatistics, evaluate_paths |
error |
SimulationError, SimulationResult |
Prices along a path are Positive, drifts and statistics
rust_decimal::Decimal; f64 stays inside the kernels. The evaluation of a
strategy over simulated paths, the charts of a walk and the chain and series
generators built on these walks stay with the backtesting, visualization and
synthetic layers; the optionstratlib facade provides them.
Place in the workspace
- Depends on
optionstratlib-coreandoptionstratlib-pricing. - Must not depend on
optionstratlib-market,-analytics,-strategies,-backtestand-visualization;make check-graphenforces the layering (ADR-0001 D9). - In the facade:
optionstratlib::simulationandSimulationError/SimulationResultinoptionstratlib::error, under the facade featuresimulation. The facade paths are the same types as the paths here; the ownership map lists every one with its feature.
Moving from 0.21? The 0.22 architecture and adoption guide maps each redesign to its replacement workflow; 0.22 keeps no compatibility with 0.21.
Minimal example
use SimulationError;
use pos_or_panic;
use generate_ou_process;
Runnable example
A runnable program that depends on this crate directly, with the smallest
dependency set and no facade, is osl-example-direct-simulation; make tree-example-direct-simulation
asserts its resolved graph.
Features
| Feature | Default | Effect |
|---|---|---|
schema |
no | Derives utoipa::ToSchema on simulation types and enables schema in core and pricing |
License
MIT