Skip to content

Model Elliott2005StrategyDemo1

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

Elliott2005StrategyDemo1 — execution tutorial

All model results · Pinned source · Javadoc

What this example teaches

Demonstrates how to use Elliott2005Strategy and customize the strategy.

Using this example. Shows the explicit builder route: load two stock caches, choose a mean-reversion customization, construct Elliott2005Strategy and register report measures. The coefficient vector defines the spread and the calibration window counts observations. Yahoo data and a desktop plotter are required.

Model and publication. The publication describes a latent mean-reverting Gaussian Markov spread observed with noise, allowing state estimation and comparison with the observed spread. Full-text access was unavailable in this audit; this explanation uses the publication abstract and the implementation, not a line-by-line paper verification.

Implementation in this tutorial. The active customization uses fixed coefficients (1,-1), a long-term-mean reference and entry/exit settings 0.4/0.25 on XOM/CVX with 50 calibration observations. The posterior-state and cointegration variants are commented alternatives. Selecting different customization changes what “fair spread” means; the class name does not guarantee that the active rule reproduces the paper’s estimator.

Verified execution record

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 8.98
Time limit seconds 180
Maximum Java heap 1200m

The original main returned successfully. Read the output and model 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.elliott2005.Elliott2005StrategyDemo1

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

09:06:56,049 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
09:06:56,049 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
09:06:56,050 |-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:56,079 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@6adca536 - 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,533 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
09:06:56,534 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
09:06:56,546 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
09:06:56,556 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
09:06:56,614 |-INFO in ch.qos.logback.core.joran.action.TimestampAction - Using current interpretation time, i.e. now, as time reference.
09:06:56,616 |-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,616 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
09:06:56,620 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [FILE1]
09:06:56,629 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@357246de - Will use zip compression
09:06:56,630 |-WARN in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@357246de - Large window sizes are not allowed.
09:06:56,630 |-WARN in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@357246de - MaxIndex reduced to 21
09:06:56,634 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
09:06:56,635 |-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,635 |-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,637 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to DEBUG
09:06:56,637 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
09:06:56,638 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [FILE1] to Logger[ROOT]
09:06:56,638 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
09:06:56,639 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@28f67ac7 - Registering current configuration as safe fallback point

09:06:56.833 [main] INFO  t.n.algoquant.util.config.AQConfig,194 - looking up configuration file: config.default.xml
09:06:56.837 [main] INFO  t.n.algoquant.util.config.AQConfig,194 - looking up configuration file: config/config.default.xml
09:06:56.837 [main] INFO  t.n.algoquant.util.config.AQConfig,209 - loading config file: file:/home/runner/work/algoquant-examples/algoquant-examples/target/model-results/Elliott2005StrategyDemo1/work/config/config.default.xml
09:06:57.155 [main] INFO  t.n.algoquant.util.config.AQConfig,148 - 09:06:56,049 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
09:06:56,049 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
09:06:56,050 |-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]
... excerpt shortened; complete stdout is in the release archive ...
98	2009-05-29T16:00	BUY	XOM	1.0	36.803890228271484
99	2009-08-31T16:00	BUY	CVX	1.0	35.548095703125
100	2009-08-31T16:00	SELL	XOM	1.0	36.92190933227539
101	2009-09-01T16:00	SELL	CVX	1.0	34.80602264404297
102	2009-09-01T16:00	BUY	XOM	1.0	36.526798248291016
103	2009-09-15T16:00	BUY	CVX	1.0	36.407066345214844
104	2009-09-15T16:00	SELL	XOM	1.0	37.10344314575195
105	2009-09-24T16:00	SELL	CVX	1.0	35.93946075439453
106	2009-09-24T16:00	BUY	XOM	1.0	36.804447174072266
107	2009-10-08T16:00	SELL	CVX	1.0	36.3155632019043
108	2009-10-08T16:00	BUY	XOM	1.0	36.86852264404297
109	2009-10-22T16:00	BUY	CVX	1.0	39.283836364746094
110	2009-10-22T16:00	SELL	XOM	1.0	39.7464485168457
111	2009-10-30T16:00	SELL	CVX	1.0	38.90263366699219
112	2009-10-30T16:00	BUY	XOM	1.0	38.2674446105957
113	2009-11-19T16:00	BUY	CVX	2.0	39.655235290527344
114	2009-11-19T16:00	SELL	XOM	2.0	40.0905647277832
115	2009-11-27T16:00	SELL	CVX	1.0	40.08082962036133
116	2009-11-27T16:00	BUY	XOM	1.0	40.20872116088867
117	2009-11-30T16:00	BUY	CVX	1.0	40.0141487121582
118	2009-11-30T16:00	SELL	XOM	1.0	40.31613540649414
119	2009-12-04T16:00	SELL	CVX	2.0	40.029537200927734
120	2009-12-04T16:00	BUY	XOM	2.0	39.8757438659668
121	2009-12-15T16:00	BUY	CVX	1.0	39.670631408691406
122	2009-12-15T16:00	SELL	XOM	1.0	37.147544860839844
123	2009-12-16T16:00	SELL	CVX	1.0	39.937252044677734
124	2009-12-16T16:00	BUY	XOM	1.0	36.75014877319336
125	2009-12-17T16:00	BUY	CVX	2.0	39.368099212646484
126	2009-12-17T16:00	SELL	XOM	2.0	36.63735580444336
127	2009-12-29T16:00	SELL	CVX	1.0	39.58858108520508
128	2009-12-29T16:00	BUY	XOM	1.0	36.970314025878906
129	2009-12-30T16:00	BUY	CVX	1.0	39.814186096191406
130	2009-12-30T16:00	SELL	XOM	1.0	36.9327278137207
131	2010-01-07T16:00	SELL	CVX	1.0	40.67559051513672
132	2010-01-07T16:00	BUY	XOM	1.0	37.48589324951172
133	2010-01-14T16:00	BUY	CVX	1.0	40.788394927978516
134	2010-01-14T16:00	SELL	XOM	1.0	37.42144775390625
135	2010-01-26T16:00	SELL	CVX	1.0	38.019588470458984
136	2010-01-26T16:00	BUY	XOM	1.0	35.40214538574219
137	2010-02-05T16:00	BUY	CVX	1.0	36.49676513671875
138	2010-02-05T16:00	SELL	XOM	1.0	34.80065155029297
139	2010-02-17T16:00	SELL	CVX	1.0	37.705360412597656
140	2010-02-17T16:00	BUY	XOM	1.0	35.5466194152832
141	2010-04-09T16:00	SELL	CVX	1.0	41.15286636352539
142	2010-04-09T16:00	BUY	XOM	1.0	37.16826629638672
143	2010-04-22T16:00	BUY	CVX	2.0	42.03287124633789
144	2010-04-22T16:00	SELL	XOM	2.0	37.06015396118164
145	2010-04-28T16:00	SELL	CVX	1.0	41.7326545715332
146	2010-04-28T16:00	BUY	XOM	1.0	37.40070724487305
147	2010-05-03T16:00	SELL	CVX	1.0	42.87665939331055
148	2010-05-03T16:00	BUY	XOM	1.0	36.67095184326172
149	2010-05-13T16:00	BUY	CVX	1.0	40.85264587402344
150	2010-05-13T16:00	SELL	XOM	1.0	35.23291015625
151	2010-11-09T16:00	BUY	CVX	1.0	44.06669616699219
152	2010-11-09T16:00	SELL	XOM	1.0	38.957176208496094
153	2010-11-10T16:00	SELL	CVX	1.0	44.915748596191406
154	2010-11-10T16:00	BUY	XOM	1.0	39.23297882080078
155	2010-11-19T16:00	SELL	CVX	1.0	44.645896911621094
156	2010-11-19T16:00	BUY	XOM	1.0	38.90755081176758
157	2010-12-02T16:00	BUY	CVX	1.0	44.94374465942383
158	2010-12-02T16:00	SELL	XOM	1.0	39.426021575927734
159	2011-03-17T16:00	SELL	CVX	1.0	54.78828430175781
160	2011-03-17T16:00	BUY	XOM	1.0	45.001094818115234
161	2011-04-12T16:00	BUY	CVX	1.0	55.8278694152832
162	2011-04-12T16:00	SELL	XOM	1.0	46.121150970458984
163	2011-07-07T16:00	SELL	CVX	1.0	57.56102752685547
164	2011-07-07T16:00	BUY	XOM	1.0	45.92547607421875
165	2011-07-08T16:00	BUY	CVX	1.0	57.18302536010742
166	2011-07-08T16:00	SELL	XOM	1.0	45.95893478393555
167	2011-08-01T16:00	SELL	CVX	1.0	56.9075813293457
168	2011-08-01T16:00	BUY	XOM	1.0	44.38644027709961
169	2011-08-02T16:00	BUY	CVX	2.0	55.86537551879883
170	2011-08-02T16:00	SELL	XOM	2.0	43.405029296875
171	2011-08-03T16:00	SELL	CVX	1.0	55.49273681640625
172	2011-08-03T16:00	BUY	XOM	1.0	43.33814239501953
09:07:02.016 [main] INFO  t.n.a.d.m.e.Elliott2005StrategyDemo1,178 - performance report:%nPerformance Report:
Product	Profit Loss	Information Ratio For Zero Investment	Omega For Periods
CVX	-11.293952941894531	-0.36540666105647307	-0.7865575643256599
XOM	4.641994476318359	0.26632602376857034	1.034963708641715
Total	-6.651958465576172	-0.377742554265227	-0.8015311070763715

Downloadable evidence

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

Export Bytes
files/charts/chart-01.png 178125

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