Repository navigation
Model EconomicModelStrategyDemo
All model results · Pinned source · Javadoc
A demo on running a fundamental factor model trading strategy.
Using this example. Builds a FactorStrategy using economic factors and a rolling data window, then schedules rebalancing and registers account measures. This example needs the configured Compustat/filesystem or SQL data source; public Yahoo prices alone do not supply its factor data. Keep calibration data earlier than the trade decisions when changing windows.
Model and publication. Fama–French is background for the market/size/value factor vocabulary. The linked author documentation defines SMB and HML; this application is not a reproduction of the original stock-and-bond empirical study.
Implementation in this tutorial. FactorExcessBenchmark, FactorSMB and FactorHML feed EconomicFactorModel, which estimates exposures/premia over the configured trailing window. FactorStrategy then uses a chosen optimizer and diversification layer to rebalance. Factor measurement, database construction and reporting dates must be consistent; financial statement availability dates matter. The code’s factor implementations, universe and optimizer choices define this experiment.
| Item | Value |
|---|---|
| Status | resource-limit |
| Run | 39114006111 |
| UTC publication | 2026-10-18 09:11 UTC |
| Source commit | 0097e73c040bdaaddac570e2fe694d9836b676ee |
| Data mode | original main defaults |
| Exit code | 1 |
| Elapsed seconds | 68.69 |
| Time limit seconds | 180 |
| Maximum Java heap | 1200m |
The original calculation exceeded the per-demo memory allocation.
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.factormodel.EconomicModelStrategyDemoThe 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:06:55,790 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
09:06:55,790 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
09:06:55,791 |-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:06:55,820 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@6ad5c04e - 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:06:56,228 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
09:06:56,230 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
09:06:56,247 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
09:06:56,258 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
09:06:56,310 |-INFO in ch.qos.logback.core.joran.action.TimestampAction - Using current interpretation time, i.e. now, as time reference.
09:06:56,312 |-INFO in ch.qos.logback.core.joran.action.TimestampAction - Adding property to the context with key="bySecond" and value="2026.10.18,09.06.56" to the LOCAL scope
09:06:56,312 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
09:06:56,322 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [FILE1]
09:06:56,333 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@6833ce2c - Will use zip compression
09:06:56,333 |-WARN in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@6833ce2c - Large window sizes are not allowed.
09:06:56,333 |-WARN in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@6833ce2c - MaxIndex reduced to 21
09:06:56,338 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
09:06:56,339 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE1] - Active log file name: log/algoquant.2026.10.18,09.06.56.log
09:06:56,339 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE1] - File property is set to [log/algoquant.2026.10.18,09.06.56.log]
09:06:56,341 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to DEBUG
09:06:56,341 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
09:06:56,342 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [FILE1] to Logger[ROOT]
09:06:56,342 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
09:06:56,343 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@725bef66 - Registering current configuration as safe fallback point
09:06:56.574 [main] INFO t.n.algoquant.util.config.AQConfig,194 - looking up configuration file: config.default.xml
09:06:56.585 [main] INFO t.n.algoquant.util.config.AQConfig,194 - looking up configuration file: config/config.default.xml
09:06:56.585 [main] INFO t.n.algoquant.util.config.AQConfig,209 - loading config file: file:/home/runner/work/algoquant-examples/algoquant-examples/target/model-results/EconomicModelStrategyDemo/work/config/config.default.xml
09:06:57.972 [main] INFO t.n.algoquant.util.config.AQConfig,148 - 09:06:55,790 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
09:06:55,790 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
09:06:55,791 |-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:06:55,820 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@6ad5c04e - 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:06:56,228 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
09:06:56,230 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
09:06:56,247 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
09:06:56,258 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
09:06:56,310 |-INFO in ch.qos.logback.core.joran.action.TimestampAction - Using current interpretation time, i.e. now, as time reference.
09:06:56,312 |-INFO in ch.qos.logback.core.joran.action.TimestampAction - Adding property to the context with key="bySecond" and value="2026.10.18,09.06.56" to the LOCAL scope
09:06:56,312 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
09:06:56,322 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [FILE1]
09:06:56,333 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@6833ce2c - Will use zip compression
09:06:56,333 |-WARN in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@6833ce2c - Large window sizes are not allowed.
09:06:56,333 |-WARN in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@6833ce2c - MaxIndex reduced to 21
09:06:56,338 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
09:06:56,339 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE1] - Active log file name: log/algoquant.2026.10.18,09.06.56.log
09:06:56,339 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE1] - File property is set to [log/algoquant.2026.10.18,09.06.56.log]
09:06:56,341 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to DEBUG
09:06:56,341 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
09:06:56,342 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [FILE1] to Logger[ROOT]
09:06:56,342 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
09:06:56,343 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@725bef66 - Registering current configuration as safe fallback point
09:06:57.972 [main] INFO t.n.algoquant.util.config.AQConfig,95 - current directory: /home/runner/work/algoquant-examples/algoquant-examples/target/model-results/EconomicModelStrategyDemo/work
09:06:57.972 [main] INFO t.n.algoquant.util.config.AQConfig,169 - current config:
09:06:57.994 [main] INFO t.n.algoquant.util.config.AQConfig,11 - nm.license: /home/runner/work/algoquant-examples/algoquant-examples/license/nm.lic
09:06:57.995 [main] INFO t.n.algoquant.util.config.AQConfig,11 - DATA_FOLDER: ./test-data
09:06:57.995 [main] INFO t.n.algoquant.util.config.AQConfig,11 - DATA_GAINCAPITAL: ${DATA_FOLDER}/processed/gaincapital/extracted-from-raw-arrange-by-dates
09:06:57.995 [main] INFO t.n.algoquant.util.config.AQConfig,11 - DATA_BLOOMBERG: ${DATA_FOLDER}/processed/bloomberg
09:06:57.995 [main] INFO t.n.algoquant.util.config.AQConfig,11 - DATA_YAHOO: ${DATA_FOLDER}/yahoo
09:06:57.996 [main] INFO t.n.algoquant.util.config.AQConfig,11 - DATA_SGX: ${DATA_FOLDER}/raw/sgx
09:06:57.996 [main] INFO t.n.algoquant.util.config.AQConfig,11 - DATA_HOLIDAYS: ./log/holidays
09:06:57.997 [main] INFO t.n.algoquant.util.config.AQConfig,11 - DATA_COMPUSTAT_HK: ${DATA_FOLDER}/[database configuration redacted]/hk
09:06:57.997 [main] INFO t.n.algoquant.util.config.AQConfig,11 - PDF_OUTPUT_FOLDER: ./log/
09:06:57.997 [main] INFO t.n.algoquant.util.config.AQConfig,11 - PDF_PLOT_WIDTH: 800
09:06:57.998 [main] INFO t.n.algoquant.util.config.AQConfig,11 - PDF_PLOT_HEIGHT: 600
09:06:58.014 [main] INFO t.n.a.d.h.c.z.CompustatZipCompanyData,232 - reading the company file: /home/runner/work/algoquant-examples/algoquant-examples/target/model-results/EconomicModelStrategyDemo/work/./test-data/[database configuration redacted]/hk/company.csv.zip
09:06:58.263 [main] INFO t.n.a.d.h.c.z.CompustatZipAccountingData,196 - reading the company accounting file: /home/runner/work/algoquant-examples/algoquant-examples/target/model-results/EconomicModelStrategyDemo/work/./test-data/[database configuration redacted]/hk/monthlyAccounting.1995.2010.csv.zip
09:07:00.241 [main] INFO t.n.a.d.h.c.z.CompustatZipTradingData,173 - reading the daily return file: /home/runner/work/algoquant-examples/algoquant-examples/target/model-results/EconomicModelStrategyDemo/work/./test-data/[database configuration redacted]/hk/dailyReturn.1995.2011.csv.zip
java.lang.OutOfMemoryError: GC overhead limit exceeded
at tech.nmfin.algoquant.data.historicaldata.[database configuration redacted].CompustatTradingData.parse(abb:114)
at tech.nmfin.algoquant.data.historicaldata.[database configuration redacted].zip.CompustatZipTradingData.load(wo:227)
at tech.nmfin.algoquant.data.historicaldata.[database configuration redacted].zip.CompustatZipTradingData.load(wo:169)
at tech.nmfin.algoquant.data.historicaldata.[database configuration redacted].zip.CompustatZipCompanyDB.<init>(imb:95)
at tech.nmfin.algoquant.data.historicaldata.[database configuration redacted].zip.CompustatZipCompanyDB.<init>(imb:26)
at tech.nmfin.algoquant.execution.datatype.product.stock.market.db.MarketDB_HK_Compustat.<init>(xz:152)
at tech.nmfin.algoquant.demo.model.factormodel.EconomicModelStrategyDemo.getMarketDB(EconomicModelStrategyDemo.java:356)
at tech.nmfin.algoquant.demo.model.factormodel.EconomicModelStrategyDemo.run(EconomicModelStrategyDemo.java:206)
at tech.nmfin.algoquant.demo.model.factormodel.EconomicModelStrategyDemo.main(EconomicModelStrategyDemo.java:188)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at ModelDemoRunner.main(ModelDemoRunner.java:35)
Download EconomicModelStrategyDemo.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.