Skip to content

Model FundamentalModelStrategyDemo

github-actions[bot] edited this page Oct 18, 2026 · 8 revisions

FundamentalModelStrategyDemo — quantitative model reference

Wiki home · Quantitative model references · Execution records

This quantitative model reference is provided for study, further research and application within the AlgoQuant framework. Read the research idea and implementation choices separately from the execution record.

Tutorials and quantitative model references · Pinned source · Javadoc

Related paper introduction

Eugene F. Fama and Kenneth R. French, Common risk factors in the returns on stocks and bonds (1993) investigates whether a small set of common risk factors explains shared variation in stock and bond returns. The familiar equity factors are market excess return, size (SMB) and book-to-market value (HML); the paper also considers bond-market factors.

A factor model separates exposure to common factors from the residual specific to each asset. For portfolio construction, this can explain why apparently different assets still carry similar risks. Estimated factor loadings are not automatically return forecasts or profitable trade signals.

This is related context, not a claim that the demo recreates Fama–French portfolios or replicates the 1993 empirical study. The economic and fundamental demos choose their own inputs and estimators. The original publication abstract and Kenneth French's factor definitions were checked; the full article was not independently reviewed.

How this demo connects to the idea

The active FundamentalFactorModel uses FactorSize and FactorGrowth with SIMPLE returns. This differs from EconomicModelStrategyDemo’s market/SMB/HML factor-return specification. FactorStrategyParam supplies rebalance, risk and data-window settings, while the configured accounting dataset supplies characteristics; avoid treating a publication date or revised statement as information available earlier.

What this example teaches

A demo on running a fundamental factor model trading strategy.

Using this example. Builds a fundamental-factor portfolio using configured accounting, return and benchmark datasets. Relative and configured paths must resolve to compatible Compustat data; these inputs are distinct from public price downloads. Rebalance frequency and trailing estimation windows control when the model can trade.

Model and publication. Factor models separate asset characteristics/exposures from returns attributable to common drivers. Fama–French is related factor literature, not the source of every characteristic or estimation choice used here.

Implementation in this tutorial. The active FundamentalFactorModel uses FactorSize and FactorGrowth with SIMPLE returns. This differs from EconomicModelStrategyDemo’s market/SMB/HML factor-return specification. FactorStrategyParam supplies rebalance, risk and data-window settings, while the configured accounting dataset supplies characteristics; avoid treating a publication date or revised statement as information available earlier.

Verified execution record

Item Value
Status completed
Run 39122217560
UTC publication 2026-10-18 11:43 UTC
Source commit f497645628296f441e1e254127a7547d15106bbc
Data mode original main defaults
Exit code 0
Elapsed seconds 172.04
Time limit seconds 1800
Maximum Java heap 6g
AlgoQuant source commit aba178deb0e78dc72184546a1e0934c3abce74a1
NM Dev source commit 04c12d1640fb700f52a2f7dc5cadf560040490e6
Combined runtime SHA-256 c1199a1c204cc4ffdf937b756bceacaf30bb64f35a844770490fea268742379b

The original main returned successfully without a detected calculation error. Read its assumptions before interpreting it.

Reproduce the 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.factormodel.FundamentalModelStrategyDemo

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.

Observed output

11:14:54.018 [main] INFO  tech.nmfin.algoquant.util.config.AQConfig - looking up configuration file: config.default.xml
11:14:54.022 [main] INFO  tech.nmfin.algoquant.util.config.AQConfig - looking up configuration file: config/config.default.xml
11:14:54.022 [main] INFO  tech.nmfin.algoquant.util.config.AQConfig - loading config file: file:/home/runner/work/algoquant/algoquant/target/model-results/FundamentalModelStrategyDemo/work/config/config.default.xml


11:14:54.346 [main] INFO  tech.nmfin.algoquant.util.config.AQConfig - current directory: /home/runner/work/algoquant/algoquant/target/model-results/FundamentalModelStrategyDemo/work
11:14:54.346 [main] INFO  tech.nmfin.algoquant.util.config.AQConfig - current config:
11:14:54.367 [main] INFO  tech.nmfin.algoquant.util.config.AQConfig - nm.license: /home/runner/work/algoquant/algoquant/license/nm.lic
11:14:54.367 [main] INFO  tech.nmfin.algoquant.util.config.AQConfig - logback.configurationFile: /home/runner/work/algoquant/algoquant/config/model-demo-logback.xml
11:14:54.368 [main] INFO  tech.nmfin.algoquant.util.config.AQConfig - DATA_FOLDER: ./test-data
11:14:54.368 [main] INFO  tech.nmfin.algoquant.util.config.AQConfig - DATA_GAINCAPITAL: ${DATA_FOLDER}/processed/gaincapital/extracted-from-raw-arrange-by-dates
11:14:54.368 [main] INFO  tech.nmfin.algoquant.util.config.AQConfig - DATA_BLOOMBERG: ${DATA_FOLDER}/processed/bloomberg
11:14:54.368 [main] INFO  tech.nmfin.algoquant.util.config.AQConfig - DATA_YAHOO: ${DATA_FOLDER}/yahoo
11:14:54.369 [main] INFO  tech.nmfin.algoquant.util.config.AQConfig - DATA_SGX: ${DATA_FOLDER}/raw/sgx
11:14:54.369 [main] INFO  tech.nmfin.algoquant.util.config.AQConfig - DATA_HOLIDAYS: ./log/holidays
11:14:54.370 [main] INFO  tech.nmfin.algoquant.util.config.AQConfig - DATA_COMPUSTAT_HK: ${DATA_FOLDER}/compustat/hk
11:14:54.370 [main] INFO  tech.nmfin.algoquant.util.config.AQConfig - PDF_OUTPUT_FOLDER: ./log/
11:14:54.370 [main] INFO  tech.nmfin.algoquant.util.config.AQConfig - PDF_PLOT_WIDTH: 800
11:14:54.370 [main] INFO  tech.nmfin.algoquant.util.config.AQConfig - PDF_PLOT_HEIGHT: 600
11:14:55.444 [main] INFO  t.n.a.d.h.compustat.zip.CompustatZipCompanyData - reading the company file: /home/runner/work/algoquant/algoquant/target/model-results/FundamentalModelStrategyDemo/work/./test-data/compustat/hk/company.csv.zip
11:14:55.628 [main] INFO  t.n.a.d.h.c.zip.CompustatZipAccountingData - reading the company accounting file: /home/runner/work/algoquant/algoquant/target/model-results/FundamentalModelStrategyDemo/work/./test-data/compustat/hk/monthlyAccounting.1995.2010.csv.zip
11:14:57.922 [main] INFO  t.n.a.d.h.compustat.zip.CompustatZipTradingData - reading the daily return file: /home/runner/work/algoquant/algoquant/target/model-results/FundamentalModelStrategyDemo/work/./test-data/compustat/hk/dailyReturn.1995.2011.csv.zip
11:15:13.413 [main] INFO  t.n.algoquant.data.historicaldata.hk.HSIReader - reading the HSI file: ./test-data/HSI.csv.zip
11:15:14.007 [main] WARN  t.n.a.d.h.compustat.zip.CompustatZipCompanyDB - price or trading data for company 20924002W was not found
11:15:14.008 [main] WARN  t.n.a.d.h.compustat.zip.CompustatZipCompanyDB - company history not found for id (20924002W)
11:15:14.038 [main] WARN  t.n.a.d.h.compustat.zip.CompustatZipCompanyDB - price or trading data for company 10042401W was not found
11:15:14.039 [main] WARN  t.n.a.d.h.compustat.zip.CompustatZipCompanyDB - company history not found for id (10042401W)
11:15:14.051 [main] WARN  t.n.a.d.h.compustat.zip.CompustatZipCompanyDB - price or trading data for company 10374502W was not found
11:15:14.051 [main] WARN  t.n.a.d.h.compustat.zip.CompustatZipCompanyDB - company history not found for id (10374502W)
11:15:14.068 [main] WARN  t.n.a.d.h.compustat.zip.CompustatZipCompanyDB - price or trading data for company 20872602W was not found
... excerpt shortened; complete stdout is in the release archive ...
2004-05-01: 0.0
2004-06-01: 0.0
2004-07-01: 0.0
2004-08-01: 0.0
2004-09-01: 0.0
2004-10-01: 0.0
2004-11-01: 0.0
2004-12-01: 0.0
2005-01-01: 0.0
2005-02-01: -38038.15937479159
2005-03-01: -32006.376354819393
2005-04-01: -42035.245177745106
2005-05-01: -40188.43118996655
2005-06-01: -67753.91611840493
2005-07-01: -47932.76321996348
2005-08-01: -74093.44181488677
2005-09-01: -57713.01957881951
2005-10-01: -68700.35978977325
2005-11-01: -4285.789049509176
2005-12-01: 77726.63657663352
2006-01-01: 234874.31979513672
2006-02-01: 557797.4566951722
2006-03-01: 140616.4603965352
2006-04-01: 289671.51015440037
2006-05-01: 58359.58958096466
2006-06-01: 9387.915957880448
2006-07-01: -15440.21509362263
2006-08-01: -215721.28366912404
2006-09-01: -287184.86164192477
2006-10-01: -288867.68609510944
2006-11-01: -302464.6434066296
2006-12-01: -297009.5307612395
2007-01-01: -296662.2510652071
2007-02-01: -172166.5159911979
2007-03-01: -57564.959174632895
2007-04-01: -26920.6800748956
2007-05-01: 32663.392131501314
2007-06-01: 18678.25159677198
2007-07-01: 26549.544786573184
2007-08-01: 62837.131715277996
2007-09-01: 60528.65983434904
2007-10-01: 60666.816553251156
2007-11-01: 298793.26024686295
2007-12-01: 164505.5824646191
2008-01-01: 151407.11025490248
2008-02-01: 135878.08266236476
2008-03-01: 134238.45286457308
2008-04-01: 79845.18609426843
2008-05-01: 83470.4088619209
2008-06-01: 87788.74040834447
2008-07-01: 85107.55042422458
2008-08-01: 86814.47684247582
2008-09-01: 86814.47684247582
2008-10-01: 86814.47684247582
2008-11-01: 86814.47684247588
2008-12-01: 86814.47684247588
2009-01-01: 86792.76765793131
2009-02-01: 65436.9378779199
2009-03-01: -178597.51105670416
2009-04-01: -146013.79546999157
2009-05-01: -150628.01419130043
2009-06-01: 66250.24832649504
2009-07-01: 66738.27778331717
2009-08-01: 115193.23381575846
2009-09-01: 125279.92312612344
2009-10-01: 146950.87383637863
2009-11-01: 143195.1204662911
2009-12-01: 143195.12046629097
2010-01-01: 246047.4975888041
2010-02-01: 245943.20504304353
2010-03-01: 245059.21352457267
2010-04-01: 287070.6947644625
2010-05-01: 503055.95435496507
2010-06-01: 184569.41780245648
2010-07-01: 119001.68142460164
2010-08-01: 119828.65400443308
2010-09-01: 119409.64157544757
2010-10-01: 119142.79892820521
2010-11-01: 119515.97626486263
2010-12-01: 214229.64594389516

Charts from this run

Printed daily account series

Uses only the values actually printed; a flat zero series remains flat and is not evidence of profitable trading.

Derived from stdout.log using the precision available in that file. Download plotted data. Undefined or malformed cells are omitted, never replaced by zero.

Chart 1

Downloadable evidence

Download FundamentalModelStrategyDemo.zip contains stdout, stderr, the execution record, checksums and any exported CSV/chart files.

Export Bytes
files/derived-charts/charts.json 511
files/derived-charts/derived-01.csv 5066
files/derived-charts/derived-01.png 80003

Interpreting the result

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.

Clone this wiki locally