Repository navigation
Model TutorialStrategyDemo
All model results · Pinned source · Javadoc
Demonstrates how to set up the simulator to simulate the tutorial strategy,
TutorialStrategy.
Using this example. End-to-end wiring for TutorialStrategy: Yahoo history is sampled monthly, wrapped in OrderBookCaches and passed to SimpleSimulatorBuilder. Initial capital is set to the first sampled price, while the strategy still targets one unit. Registered yearly measures use annual return periods even though the strategy receives monthly observations.
Model and publication. No single original research publication is claimed for this library/example policy.
Implementation in this tutorial. This is an event-handling lesson rather than a published econometric model. Price direction selects a fixed signed-unit target and the existing position determines the incremental order. See TutorialStrategy for equal-price behavior and the companion demo for monthly sampling.
| Item | Value |
|---|---|
| Status | completed |
| Run | 39114006111 |
| UTC publication | 2026-10-18 09:11 UTC |
| Source commit | 0097e73c040bdaaddac570e2fe694d9836b676ee |
| Data mode | original main defaults |
| Exit code | 0 |
| Elapsed seconds | 3.72 |
| Time limit seconds | 180 |
| Maximum Java heap | 1200m |
The original main returned successfully. Read the output and model assumptions before interpreting it.
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.tutorial.TutorialStrategyDemoThe 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.
09:07:03,470 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
09:07:03,470 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
09:07:03,471 |-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:03,499 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@2b80d80f - 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:03,567 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
09:07:03,568 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
09:07:03,584 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
09:07:03,593 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
09:07:03,642 |-INFO in ch.qos.logback.core.joran.action.TimestampAction - Using current interpretation time, i.e. now, as time reference.
09:07:03,643 |-INFO in ch.qos.logback.core.joran.action.TimestampAction - Adding property to the context with key="bySecond" and value="2026.10.18,09.07.03" to the LOCAL scope
09:07:03,644 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
09:07:03,647 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [FILE1]
09:07:03,655 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@3ab39c39 - Will use zip compression
09:07:03,655 |-WARN in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@3ab39c39 - Large window sizes are not allowed.
09:07:03,655 |-WARN in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@3ab39c39 - MaxIndex reduced to 21
09:07:03,659 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
09:07:03,661 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE1] - Active log file name: log/algoquant.2026.10.18,09.07.03.log
09:07:03,661 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE1] - File property is set to [log/algoquant.2026.10.18,09.07.03.log]
09:07:03,662 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to DEBUG
09:07:03,662 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
09:07:03,663 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [FILE1] to Logger[ROOT]
09:07:03,663 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
09:07:03,664 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@2eee9593 - Registering current configuration as safe fallback point
09:07:03.776 [main] INFO t.n.algoquant.util.config.AQConfig,194 - looking up configuration file: config.default.xml
09:07:03.779 [main] INFO t.n.algoquant.util.config.AQConfig,194 - looking up configuration file: config/config.default.xml
09:07:03.780 [main] INFO t.n.algoquant.util.config.AQConfig,209 - loading config file: file:/home/runner/work/algoquant-examples/algoquant-examples/target/model-results/TutorialStrategyDemo/work/config/config.default.xml
09:07:03.929 [main] INFO t.n.algoquant.util.config.AQConfig,148 - 09:07:03,470 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
09:07:03,470 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
09:07:03,471 |-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:03,499 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@2b80d80f - 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:03,567 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
09:07:03,568 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
09:07:03,584 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
09:07:03,593 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
09:07:03,642 |-INFO in ch.qos.logback.core.joran.action.TimestampAction - Using current interpretation time, i.e. now, as time reference.
09:07:03,643 |-INFO in ch.qos.logback.core.joran.action.TimestampAction - Adding property to the context with key="bySecond" and value="2026.10.18,09.07.03" to the LOCAL scope
09:07:03,644 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
09:07:03,647 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [FILE1]
09:07:03,655 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@3ab39c39 - Will use zip compression
09:07:03,655 |-WARN in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@3ab39c39 - Large window sizes are not allowed.
09:07:03,655 |-WARN in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@3ab39c39 - MaxIndex reduced to 21
09:07:03,659 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
09:07:03,661 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE1] - Active log file name: log/algoquant.2026.10.18,09.07.03.log
09:07:03,661 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE1] - File property is set to [log/algoquant.2026.10.18,09.07.03.log]
09:07:03,662 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to DEBUG
09:07:03,662 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
09:07:03,663 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [FILE1] to Logger[ROOT]
09:07:03,663 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
09:07:03,664 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@2eee9593 - Registering current configuration as safe fallback point
09:07:03.929 [main] INFO t.n.algoquant.util.config.AQConfig,95 - current directory: /home/runner/work/algoquant-examples/algoquant-examples/target/model-results/TutorialStrategyDemo/work
09:07:03.929 [main] INFO t.n.algoquant.util.config.AQConfig,169 - current config:
09:07:03.942 [main] INFO t.n.algoquant.util.config.AQConfig,11 - nm.license: /home/runner/work/algoquant-examples/algoquant-examples/license/nm.lic
09:07:03.942 [main] INFO t.n.algoquant.util.config.AQConfig,11 - DATA_FOLDER: ./test-data
09:07:03.943 [main] INFO t.n.algoquant.util.config.AQConfig,11 - DATA_GAINCAPITAL: ${DATA_FOLDER}/processed/gaincapital/extracted-from-raw-arrange-by-dates
09:07:03.943 [main] INFO t.n.algoquant.util.config.AQConfig,11 - DATA_BLOOMBERG: ${DATA_FOLDER}/processed/bloomberg
09:07:03.943 [main] INFO t.n.algoquant.util.config.AQConfig,11 - DATA_YAHOO: ${DATA_FOLDER}/yahoo
09:07:03.944 [main] INFO t.n.algoquant.util.config.AQConfig,11 - DATA_SGX: ${DATA_FOLDER}/raw/sgx
09:07:03.944 [main] INFO t.n.algoquant.util.config.AQConfig,11 - DATA_HOLIDAYS: ./log/holidays
09:07:03.944 [main] INFO t.n.algoquant.util.config.AQConfig,11 - DATA_COMPUSTAT_HK: ${DATA_FOLDER}/[database configuration redacted]/hk
09:07:03.945 [main] INFO t.n.algoquant.util.config.AQConfig,11 - PDF_OUTPUT_FOLDER: ./log/
09:07:03.945 [main] INFO t.n.algoquant.util.config.AQConfig,11 - PDF_PLOT_WIDTH: 800
09:07:03.945 [main] INFO t.n.algoquant.util.config.AQConfig,11 - PDF_PLOT_HEIGHT: 600
09:07:04.941 [main] INFO t.n.a.d.h.yahoo.YahooEODCacheFactory,237 - failed to load from file, reason: no data read from file; load from web
09:07:04.941 [main] INFO t.n.a.d.h.yahoo.YahooEODCacheFactory,196 - reading Yahoo! data for ^HSI from the Internet from 2000-01-01T00:00 to 2012-01-01T16:00
09:07:05.123 [main] INFO t.n.a.d.h.y.YahooEODCsvZipFileWriter,30 - writing csv.zip file ./log/Yahoo/^HSI.csv.zip
09:07:05.292 [main] INFO t.n.a.d.h.y.YahooEODCsvZipFileWriter,81 - finished writing ./log/Yahoo/^HSI.csv.zip
09:07:06.081 [main] INFO t.n.a.d.m.t.TutorialStrategyDemo,134 - report = Performance Report:
Product Profit Loss Information Ratio For Periods Omega For Periods
^HSI 19853.2607421875 0.5442994541313131 4.05182187620248
Total 19853.2607421875 0.5647991796134995 3.9432123012583498
Download TutorialStrategyDemo.zip contains stdout, stderr, the execution record, checksums and any exported CSV/chart files.
| Export | Bytes |
|---|---|
files/charts/chart-01.png |
103983 |
Read the reported units: optimizer weights, model-fit coefficients, forecast correlations and simulated P/L are different outputs. Synthetic runs demonstrate the API rather than historical market returns. Inspect undefined values and open positions instead of replacing them with zero. Chart exports visualize exactly this run.
For model assumptions, original publications and adaptation limits, use the literature guide.