@Demo public class SMA2DynamicDemo extends Object
--quick reduces both the date range and parameter grid for a smoke run.
Defaults to synthetic data; --live enables Yahoo downloads.
Performance, execution and trade CSV files are written by SimulationResultsExporter.
Using this example. Separates trailing-window calibration from subsequent strategy execution and exports results for multiple parameter combinations. Use --quick for the smaller example configuration. Repeated calibration requires fresh strategy state; report rows belong to their own parameter set and should not be concatenated into one account.
Model and publication. No single original research publication is claimed for this library/example policy.
Implementation in this tutorial. The signal compares a fast and a slow arithmetic mean of prices. A fast mean above or below the slow mean produces a directional target after the required history is available. Lag parameters count observations. SMA2DynamicDemo additionally recalibrates parameters on trailing windows; that procedure is separate from the crossover formula.
| Constructor and Description |
|---|
SMA2DynamicDemo() |
| Modifier and Type | Method and Description |
|---|---|
static void |
main(String[] args) |
void |
run(Stock stock,
dev.nm.misc.datastructure.time.LocalDateTimeInterval interval,
OrderBookCacheFactory<Stock> cacheFactory,
double capital0,
Collection<NamedParam> params) |
public void run(Stock stock, dev.nm.misc.datastructure.time.LocalDateTimeInterval interval, OrderBookCacheFactory<Stock> cacheFactory, double capital0, Collection<NamedParam> params) throws Exception
ExceptionCopyright © 2026. All rights reserved.