@Demo public class SMA2Demo020 extends Object
--live to request Yahoo data. Results are printed to the console.
Using this example. Use this after SMA2Demo010 to see the same setup expressed through template overrides. SimTemplateUtils.run creates the simulation from the specification. The built-in SMA2 remains fixed-unit sized even when the template supplies a large initial cash balance.
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 |
|---|
SMA2Demo020() |
public static void main(String[] args)
Copyright © 2026. All rights reserved.