@Demo public class SMA2Demo010 extends Object
--live for Yahoo history and
--charts for a desktop chart. The report is written to the console.
Using this example. Read this first for explicit simulator assembly: define the product and lags, load its order-book cache, construct SMA2, register measures and call simulator.run. The built-in strategy targets fixed long or short unit positions; withInitialCash does not turn it into full-equity sizing.
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 |
|---|
SMA2Demo010() |
| Modifier and Type | Method and Description |
|---|---|
static void |
main(String[] args) |
void |
run(Stock product) |
Copyright © 2026. All rights reserved.