Repository navigation
Model SMA2Demo020
All model results · Pinned source · Javadoc
Demonstrates a fixed SMA crossover using a reusable simulation specification.
The template supplies products, dates, data, strategy, currency and measures;
SimTemplateUtils builds and runs the simulator from those specifications.
The data override keeps this example offline by default despite its Yahoo template.
Pass --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.
| Item | Value |
|---|---|
| Status | blocked-license |
| Run | 39114006111 |
| UTC publication | 2026-10-18 09:11 UTC |
| Source commit | 0097e73c040bdaaddac570e2fe694d9836b676ee |
| Data mode | synthetic --quick |
| Exit code | 1 |
| Elapsed seconds | 0.58 |
| Time limit seconds | 180 |
| Maximum Java heap | 1200m |
The external license was not accepted for this calculation.
Follow the repository setup for JDK 8, Maven credentials and an external NM license. From the repository root:
mvn -U -Dmaven.test.skip=true clean package
mvn exec:java -Dexec.mainClass=tech.nmfin.algoquant.demo.model.technical.SMA2Demo020 -Dexec.args="--quick"The automated run uses scripts/ModelDemoRunner.java to initialize the external license before the unchanged main, save JFreeChart windows as PNGs, and exit after main returns. It uses an isolated working directory with the repository datasets/configuration linked in. Running directly may leave desktop windows open.
This is an incomplete or blocked run. Output below is diagnostic or partial, not a verified strategy result.
09:07:59,831 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
09:07:59,832 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
09:07:59,832 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [jar:file:/home/runner/work/algoquant-examples/algoquant-examples/target/lib/algoquant-dist-3.3.0-SNAPSHOT.jar!/logback.xml]
09:07:59,859 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@7cdbc5d3 - URL [jar:file:/home/runner/work/algoquant-examples/algoquant-examples/target/lib/algoquant-dist-3.3.0-SNAPSHOT.jar!/logback.xml] is not of type file
09:07:59,904 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
09:07:59,905 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
09:07:59,914 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
09:07:59,922 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
09:07:59,969 |-INFO in ch.qos.logback.core.joran.action.TimestampAction - Using current interpretation time, i.e. now, as time reference.
09:07:59,970 |-INFO in ch.qos.logback.core.joran.action.TimestampAction - Adding property to the context with key="bySecond" and value="2026.10.18,09.07.59" to the LOCAL scope
09:07:59,970 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
09:07:59,974 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [FILE1]
09:07:59,982 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@3aa9e816 - Will use zip compression
09:07:59,983 |-WARN in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@3aa9e816 - Large window sizes are not allowed.
09:07:59,983 |-WARN in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@3aa9e816 - MaxIndex reduced to 21
09:07:59,986 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
09:07:59,988 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE1] - Active log file name: log/algoquant.2026.10.18,09.07.59.log
09:07:59,988 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE1] - File property is set to [log/algoquant.2026.10.18,09.07.59.log]
09:07:59,989 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to DEBUG
09:07:59,989 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
09:07:59,990 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [FILE1] to Logger[ROOT]
09:07:59,990 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
09:07:59,991 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@17d99928 - Registering current configuration as safe fallback point
dev.nm.misc.license.LicenseError: license has been loaded already (loaded license from: license file: /home/runner/work/algoquant-examples/algoquant-examples/license/nm.lic)
Download SMA2Demo020.zip contains stdout, stderr, the execution record, checksums and any exported CSV/chart files.
Use the first relevant exception and the source configuration to resolve the prerequisite or code issue, then rerun. A missing dataset requires the correct original schema and period; substituting synthetic values would be a different experiment. A timeout establishes only that this bounded attempt did not finish.
For model assumptions, original publications and adaptation limits, use the literature guide.