Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/model-tutorials.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
run: |
mvn -B -ntp -U -Dmaven.test.skip=true clean package
mkdir -p target/model-runner
javac -cp 'target/classes:target/lib/*' -d target/model-runner scripts/ModelDemoRunner.java
javac -cp 'target/classes:target/lib/nmdev-dist-1.2.7.jar:target/lib/*' -d target/model-runner scripts/ModelDemoRunner.java
- uses: actions/upload-artifact@v4
with:
name: model-demo-runtime
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
- **[Tools directory](https://tools.nmfin.tech/)** — the front page for this and future applications.
- **[Web application setup and deployment](web/README.md)** — local execution, saved reports, exports, shared components and Cloud Run.

The public repository contains the example and application source. The underlying library is supplied by the obfuscated combined Maven artifact `tech.nmfin:algoquant-dist:3.3.2` and requires a valid NM license.
The public repository contains the example and application source. The underlying library is supplied by the obfuscated combined Maven artifact `tech.nmfin:algoquant-dist:3.3.2` and requires a valid NM license. The examples explicitly use `dev.nm:nmdev-dist:1.2.7` from the same public Maven repository.

NM Dev is declared before AlgoQuant in Maven and placed before `target/lib/*` in Java launch commands and the container classpath. This ensures NM Dev 1.2.7 takes precedence over the older classes embedded in AlgoQuant 3.3.2. Preserve this ordering in custom launch configurations; a wildcard alone has unspecified JAR order.

## AlgoQuant 3.3.2 historical-data tutorial

Expand Down Expand Up @@ -88,7 +90,7 @@ From the repository root:
```bash
mvn -U clean verify
java -Djava.awt.headless=true -Dlogback.configurationFile=web/logback.xml \
-cp 'target/classes:target/lib/*' tech.nmfin.algoquant.web.ToolsWeb
-cp 'target/classes:target/lib/nmdev-dist-1.2.7.jar:target/lib/*' tech.nmfin.algoquant.web.ToolsWeb
```

Open [http://localhost:8080/sma2/](http://localhost:8080/sma2/) for SMA2, or [http://localhost:8080/](http://localhost:8080/) for the tools directory. The command above uses Unix classpath separators; use `;` instead of `:` on Windows.
Expand Down Expand Up @@ -188,7 +190,7 @@ mvn -B -ntp -Dmaven.test.skip=true clean package
Run a selected class from the repository root with your NM license on the classpath:

```bash
java -cp 'license:target/classes:target/lib/*' tech.nmfin.algoquant.demo.model.tutorial.TutorialStrategyDemo
java -cp 'license:target/classes:target/lib/nmdev-dist-1.2.7.jar:target/lib/*' tech.nmfin.algoquant.demo.model.tutorial.TutorialStrategyDemo
```

The imported demos cover charts, historical data, IB execution, simulation,
Expand Down
4 changes: 3 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
<properties>
<maven.compiler.source>8</maven.compiler.source><maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<nmdev.version>1.2.7</nmdev.version>
<exec.mainClass>tech.nmfin.algoquant.demo.model.technical.SMA2Demo010</exec.mainClass>
</properties>
<repositories><repository><id>github-nm-packages</id><url>https://maven.pkg.github.com/nmltd/maven-packages</url>
<snapshots><enabled>true</enabled></snapshots></repository></repositories>
<dependencies><dependency><groupId>junit</groupId><artifactId>junit</artifactId><version>4.13.2</version><scope>test</scope></dependency><dependency><groupId>com.google.code.gson</groupId><artifactId>gson</artifactId><version>2.13.2</version></dependency><dependency><groupId>tech.nmfin</groupId><artifactId>algoquant-dist</artifactId><version>3.3.2</version></dependency></dependencies>
<!-- Keep NM Dev before AlgoQuant: the existing combined AlgoQuant JAR embeds older NM Dev classes. -->
<dependencies><dependency><groupId>dev.nm</groupId><artifactId>nmdev-dist</artifactId><version>${nmdev.version}</version></dependency><dependency><groupId>junit</groupId><artifactId>junit</artifactId><version>4.13.2</version><scope>test</scope></dependency><dependency><groupId>com.google.code.gson</groupId><artifactId>gson</artifactId><version>2.13.2</version></dependency><dependency><groupId>tech.nmfin</groupId><artifactId>algoquant-dist</artifactId><version>3.3.2</version></dependency></dependencies>
<build><plugins>
<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><version>3.14.1</version></plugin>
<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-jar-plugin</artifactId><version>3.4.2</version>
Expand Down
2 changes: 1 addition & 1 deletion scripts/MODEL_DEMOS.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ and a valid external license):

```bash
mkdir -p target/model-runner
javac -cp 'target/classes:target/lib/*' -d target/model-runner scripts/ModelDemoRunner.java
javac -cp 'target/classes:target/lib/nmdev-dist-1.2.7.jar:target/lib/*' -d target/model-runner scripts/ModelDemoRunner.java
export NM_LICENSE_FILE=/absolute/path/nm.lic
python3 scripts/run-model-demos.py --only SMA2Demo010 --seconds 180
```
Expand Down
2 changes: 1 addition & 1 deletion scripts/run-model-demos.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def execute(item, output, seconds, heap):
if (ROOT / name).exists(): (work / name).symlink_to(ROOT / name, target_is_directory=True)
(work / 'log').mkdir(exist_ok=True)
(work / 'log/demo').mkdir(exist_ok=True)
cp = os.pathsep.join([str(ROOT/'target/model-runner'), str(ROOT/'target/classes'), str(ROOT/'target/lib/*')])
cp = os.pathsep.join([str(ROOT/'target/model-runner'), str(ROOT/'target/classes'), str(ROOT/'target/lib/nmdev-dist-1.2.7.jar'), str(ROOT/'target/lib/*')])
command = ['xvfb-run', '-a', 'java', '-Xmx' + heap, '-Djava.awt.headless=false',
'-Dlogback.configurationFile=' + str(ROOT/'config/model-demo-logback.xml'),
'-Dsun.net.client.defaultConnectTimeout=20000', '-Dsun.net.client.defaultReadTimeout=30000',
Expand Down
2 changes: 1 addition & 1 deletion scripts/run-offline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ cd "$(dirname "$0")/.."
for example in SMA2Demo010 SMA2Demo011 SMA2Demo020 AccumulationDistributionLineDemo ChaikinMoneyFlowDemo SMA2DynamicDemo; do
echo "Running $example"
timeout 300 java -Djava.awt.headless=true -Dnm.license="${NM_LICENSE_FILE:-license/nm.lic}" \
-cp 'target/classes:target/lib/*' "tech.nmfin.algoquant.demo.model.technical.$example" --quick
-cp 'target/classes:target/lib/nmdev-dist-1.2.7.jar:target/lib/*' "tech.nmfin.algoquant.demo.model.technical.$example" --quick
done
2 changes: 1 addition & 1 deletion web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ COPY logback.xml /app/logback.xml
USER sma2
ENV PORT=8080 NM_LICENSE_FILE=/secrets/nm.lic SMA2_REPORT_DIRECTORY=/tmp/sma2-reports
EXPOSE 8080
ENTRYPOINT ["java", "-Xmx640m", "-Djava.awt.headless=true", "-Dlogback.configurationFile=/app/logback.xml", "-cp", "/app/classes:/app/lib/*", "tech.nmfin.algoquant.web.ToolsWeb"]
ENTRYPOINT ["java", "-Xmx640m", "-Djava.awt.headless=true", "-Dlogback.configurationFile=/app/logback.xml", "-cp", "/app/classes:/app/lib/nmdev-dist-1.2.7.jar:/app/lib/*", "tech.nmfin.algoquant.web.ToolsWeb"]
2 changes: 1 addition & 1 deletion web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Configure Maven authentication and an external NM license as described in the [r
```bash
mvn -U clean verify
java -Djava.awt.headless=true -Dlogback.configurationFile=web/logback.xml \
-cp 'target/classes:target/lib/*' tech.nmfin.algoquant.web.ToolsWeb
-cp 'target/classes:target/lib/nmdev-dist-1.2.7.jar:target/lib/*' tech.nmfin.algoquant.web.ToolsWeb
```

Open [http://localhost:8080/](http://localhost:8080/) for the tools directory or [http://localhost:8080/sma2/](http://localhost:8080/sma2/) for the app. On Windows, replace the classpath separator `:` with `;`.
Expand Down
2 changes: 1 addition & 1 deletion web/smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
if not live: env['SMA2_DATA_MODE'] = 'synthetic'
else: env.pop('SMA2_DATA_MODE', None)
proc = subprocess.Popen(['java','-Djava.awt.headless=true','-Dlogback.configurationFile=web/logback.xml',
'-cp','target/classes:target/lib/*','tech.nmfin.algoquant.web.ToolsWeb'], env=env)
'-cp','target/classes:target/lib/nmdev-dist-1.2.7.jar:target/lib/*','tech.nmfin.algoquant.web.ToolsWeb'], env=env)
base='http://127.0.0.1:'+port

def request(path, fields=None):
Expand Down
Loading