Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
374 commits
Select commit Hold shift + click to select a range
f54dced
Merge branch 'main' of github.com:lee101/stock-prediction
lee101 Jul 30, 2025
796493d
fx
lee101 Jul 30, 2025
ff3db48
training start
lee101 Aug 18, 2025
c03493f
try some other alg
lee101 Aug 18, 2025
ff4af9d
fx training
lee101 Aug 20, 2025
681d380
training
lee101 Aug 24, 2025
1e1aef1
wip
lee101 Aug 24, 2025
8f3bc0c
training
lee101 Aug 27, 2025
ecee554
fx
lee101 Sep 2, 2025
720aa0c
hfinference
lee101 Sep 2, 2025
25b6cd4
fx
lee101 Sep 6, 2025
28585db
tests - todo get better integ
lee101 Sep 6, 2025
76d0f15
wip training
lee101 Sep 6, 2025
51480bd
tools
lee101 Sep 6, 2025
05c8472
idk
lee101 Sep 6, 2025
1ae6dc1
pufferlib
lee101 Sep 6, 2025
377732d
fx
lee101 Sep 6, 2025
d5eae07
tests
lee101 Sep 6, 2025
a6ac864
trainin
lee101 Sep 6, 2025
ea10994
r jfinance
lee101 Sep 6, 2025
6f84196
todo fix this slop in totoembbedding
lee101 Sep 6, 2025
78181e3
todoREVIEWME
lee101 Sep 6, 2025
b6e5ba5
addtoto
lee101 Oct 10, 2025
cac7992
agen
lee101 Oct 10, 2025
a927701
fx idk
lee101 Oct 10, 2025
bae3554
wip
lee101 Oct 13, 2025
252e755
Merge branch 'training' of github.com:lee101/stock-prediction into tr…
lee101 Oct 13, 2025
e48bc2f
wip
lee101 Oct 16, 2025
ba93146
hyperparams
lee101 Oct 16, 2025
748b150
fx
lee101 Oct 16, 2025
e6eda3b
fixlogsand
lee101 Oct 16, 2025
30a4338
independnentagent
lee101 Oct 16, 2025
e20d5c3
Merge branch 'main' of github.com:lee101/stock-prediction
lee101 Oct 16, 2025
df619a8
fx
lee101 Oct 16, 2025
5e1a1d2
Merge branch 'main' of github.com:lee101/stock-prediction
lee101 Oct 16, 2025
b6dbd68
fx
lee101 Oct 16, 2025
32235b1
Merge branch 'main' of github.com:lee101/stock-prediction
lee101 Oct 16, 2025
e3e17ce
rname
lee101 Oct 17, 2025
e1fe2d2
fxsims
lee101 Oct 17, 2025
d063950
fx
lee101 Oct 17, 2025
79f87af
fx
lee101 Oct 17, 2025
43f8f1c
Merge branch 'main' of github.com:lee101/stock-prediction
lee101 Oct 17, 2025
99854f6
fx
lee101 Oct 17, 2025
de80409
Merge branch 'main' of github.com:lee101/stock-prediction
lee101 Oct 17, 2025
bae1bbf
fxtodo
lee101 Oct 17, 2025
6d4de2c
fxtodo
lee101 Oct 17, 2025
ca62e2a
fx
lee101 Oct 18, 2025
492d573
Merge branch 'main' of github.com:lee101/stock-prediction
lee101 Oct 18, 2025
031a7f0
syspronmpt
lee101 Oct 18, 2025
9440ddb
Merge branch 'origin/main'
lee101 Oct 18, 2025
0415fc2
Fix gymrl trading fee import fallback
lee101 Oct 18, 2025
c8e489b
improfveperf
lee101 Oct 18, 2025
a7bbaf2
fixes
lee101 Oct 19, 2025
af15b18
fx
lee101 Oct 19, 2025
241646f
fxup
lee101 Oct 19, 2025
a4ed4c8
fx
lee101 Oct 19, 2025
947ab65
pkg
lee101 Oct 19, 2025
d232115
Merge branch 'main' of github.com:lee101/stock-prediction
lee101 Oct 19, 2025
818a885
fxlock
lee101 Oct 19, 2025
b9d8819
nit
lee101 Oct 19, 2025
b0fe171
fxlock
lee101 Oct 19, 2025
6d04052
fx
lee101 Oct 19, 2025
54f3e11
Merge branch 'origin/main'
lee101 Oct 19, 2025
90eaaec
fsx
lee101 Oct 20, 2025
7a31e2d
Merge branch 'main' of github.com:lee101/stock-prediction
lee101 Oct 20, 2025
c239f0c
Add day-end deleveraging script and tests
lee101 Oct 20, 2025
10d2e43
fx
lee101 Oct 20, 2025
8efa18e
Merge branch 'main' of github.com:lee101/stock-prediction
lee101 Oct 20, 2025
46947b1
Resolve merge conflicts in workspace packages
lee101 Oct 20, 2025
cd1e35c
fx
lee101 Oct 20, 2025
fb4f689
fxwip
lee101 Oct 20, 2025
d3f29f9
various-differnetiablemarkethit99pctnice
lee101 Oct 21, 2025
dedadb0
kronosdifferentiabl74pctannual
lee101 Oct 21, 2025
dfb2928
interest
lee101 Oct 22, 2025
561cde5
Merge branch 'main' of github.com:lee101/stock-prediction
lee101 Oct 22, 2025
e5be13b
stockagentsn_fal
lee101 Oct 22, 2025
180d782
Merge branch 'main' of github.com:lee101/stock-prediction
lee101 Oct 22, 2025
4dbd89a
wips
lee101 Oct 23, 2025
b21468e
refactortests_prod
lee101 Oct 23, 2025
b51b130
leverage cpa for crypto - + - better silulation
lee101 Oct 23, 2025
c47031f
Merge branch 'main' of github.com:lee101/stock-prediction
lee101 Oct 23, 2025
a1b9717
Fix trade_stock_e2e fallback import closure
lee101 Oct 23, 2025
6131bc5
fx
lee101 Oct 24, 2025
c592482
simulatefalhmm
lee101 Oct 24, 2025
728934d
fx
lee101 Oct 24, 2025
898e2cc
fx
lee101 Oct 25, 2025
affb53b
Merge branch 'main' of github.com:lee101/stock-prediction
lee101 Oct 25, 2025
7a4c68b
Merge remote-tracking branch 'origin/main'
lee101 Oct 25, 2025
3eff6a7
tests: harden prod suites for kronos/toto merge
lee101 Oct 25, 2025
994f7a5
tests: add real marketsimulator gpu integration
lee101 Oct 25, 2025
3eaaf6d
lock
lee101 Oct 26, 2025
c039c26
wip_provisioning
lee101 Oct 26, 2025
26a8e7b
Merge remote-tracking branch 'origin/main'
lee101 Oct 26, 2025
a224efa
tests: stabilize marketsimulator gpu integration
lee101 Oct 26, 2025
f22f9b1
Add yfinance dependency for trading tests
lee101 Oct 26, 2025
34c7892
marketsimulator: handle multiindex prices and kronos gpu fallback
lee101 Oct 26, 2025
a0f51dd
Optimize calibration window forecasting
lee101 Oct 26, 2025
7a77079
fx
lee101 Oct 26, 2025
415cdd1
Merge branch 'main' of github.com:lee101/stock-prediction
lee101 Oct 26, 2025
0605ac4
fx
lee101 Oct 26, 2025
c74e110
fx
lee101 Oct 27, 2025
fff69ff
Merge branch 'main' of github.com:lee101/stock-prediction
lee101 Oct 27, 2025
f2a4a31
asdf
lee101 Oct 27, 2025
ba9aa47
fx
lee101 Oct 28, 2025
b26d3b9
fx
lee101 Oct 28, 2025
e51ba89
todo
lee101 Oct 28, 2025
d027ae6
fx
lee101 Oct 28, 2025
bae38d7
fx
lee101 Oct 28, 2025
d38fd02
idk
lee101 Oct 28, 2025
a8c5a2e
Merge branch 'main' of github.com:lee101/stock-prediction
lee101 Oct 28, 2025
e98f724
fx
lee101 Oct 28, 2025
bc24726
fx
lee101 Oct 28, 2025
00abc4c
Merge branch 'main' of github.com:lee101/stock-prediction
lee101 Oct 28, 2025
d074774
Add rlsys reinforcement learning system with tests
lee101 Oct 28, 2025
12d2635
fx
lee101 Oct 29, 2025
6c6f774
setupstuff
lee101 Oct 29, 2025
0bc5cee
Merge pull request #12 from lee101/codex/develop-rl-system-with-moder…
lee101 Oct 29, 2025
70192f7
experiments
lee101 Oct 29, 2025
715f499
fxgithub
lee101 Oct 29, 2025
b3c1978
fx
lee101 Oct 29, 2025
d63e078
fx
lee101 Oct 29, 2025
bbe0672
fx
lee101 Oct 30, 2025
2efdbf1
Merge branch 'main' of github.com:lee101/stock-prediction
lee101 Oct 30, 2025
9afbb68
fxmaxdiff
lee101 Oct 30, 2025
a41dbab
Merge remote-tracking branch 'origin/main' into main
lee101 Oct 30, 2025
281ee68
Make torch import optional in loss_utils and fix test isolation
lee101 Oct 30, 2025
d86ba6a
fx
lee101 Oct 30, 2025
6054367
wiprmdocs
lee101 Oct 30, 2025
dc5def3
fx
lee101 Oct 30, 2025
1e3093e
fxtrading
lee101 Oct 30, 2025
e232685
fx
lee101 Oct 31, 2025
2cb79cc
hparams
lee101 Oct 31, 2025
15ea410
docslop
lee101 Oct 31, 2025
dbedaaa
allsorts
lee101 Oct 31, 2025
4ed090f
Merge remote-tracking branch 'origin/main'
lee101 Oct 31, 2025
c026537
worsebutokifitstraining
lee101 Oct 31, 2025
699b519
maxdiffalwaysonstrat
lee101 Nov 1, 2025
559b5e9
wip
lee101 Nov 1, 2025
2c98c98
Enable priority scheduling for MaxDiff watchers
lee101 Nov 2, 2025
89047ed
Merge pull request #14 from lee101/codex/implement-global-state-for-m…
lee101 Nov 3, 2025
3643eb3
wipfixes
lee101 Nov 3, 2025
b81a168
Merge remote-tracking branch 'origin/main' into main
lee101 Nov 3, 2025
a327290
pynvmwarning
lee101 Nov 3, 2025
b41a002
addtests/fixpricingflips
lee101 Nov 3, 2025
94091cd
retrieswlowclosehigh_constraint
lee101 Nov 4, 2025
d71a26f
hyperparams
lee101 Nov 4, 2025
bf34c57
f
lee101 Nov 4, 2025
e6454b4
wipparams
lee101 Nov 5, 2025
ea1f30a
docslop
lee101 Nov 5, 2025
ab1dded
docslop
lee101 Nov 5, 2025
9b5c5ba
forecasterofpnl
lee101 Nov 5, 2025
80a081a
fix_adjusted_return_un
lee101 Nov 5, 2025
fe846f4
Merge branch 'main' of github.com:lee101/stock-prediction
lee101 Nov 5, 2025
70f396c
fx
lee101 Nov 5, 2025
e9d9da0
fx
lee101 Nov 5, 2025
7e345a1
fx
lee101 Nov 5, 2025
6d85435
Merge branch 'main' of github.com:lee101/stock-prediction
lee101 Nov 5, 2025
662cb5a
fx
lee101 Nov 5, 2025
64a5645
fx
lee101 Nov 5, 2025
7a53f8c
Merge branch 'main' of github.com:lee101/stock-prediction
lee101 Nov 5, 2025
0c092a0
fx
lee101 Nov 5, 2025
6a3c256
fx
lee101 Nov 5, 2025
9df8865
fximports
lee101 Nov 5, 2025
c97cb39
passthroughfees
lee101 Nov 5, 2025
8ad895a
paralleloptim
lee101 Nov 5, 2025
a5f0722
fx
lee101 Nov 5, 2025
6f1239c
Merge branch 'main' of github.com:lee101/stock-prediction
lee101 Nov 5, 2025
a491e9f
rmclosehparams
lee101 Nov 5, 2025
99a6f3e
optimization
lee101 Nov 5, 2025
f5527e4
Merge branch 'main' of github.com:lee101/stock-prediction
lee101 Nov 5, 2025
d32a88b
fx
lee101 Nov 5, 2025
a09153b
fxrmparallel
lee101 Nov 5, 2025
0733cf8
backtoavg
lee101 Nov 5, 2025
6b22836
fixoptimization
lee101 Nov 5, 2025
d3686a0
fx
lee101 Nov 5, 2025
ca27553
direct
lee101 Nov 5, 2025
810714f
bestforecast
lee101 Nov 5, 2025
1a3d059
fx
lee101 Nov 5, 2025
0d8b323
addtests
lee101 Nov 5, 2025
3125eee
rmci_guraerd
lee101 Nov 6, 2025
07e5fef
rmcigueard
lee101 Nov 6, 2025
53fe08f
fxlogsnsuchrmblocks
lee101 Nov 6, 2025
234afda
robustness-fullorders
lee101 Nov 7, 2025
ed07110
keepatitfixbug
lee101 Nov 7, 2025
6a9f5bf
strat
lee101 Nov 7, 2025
5afaab4
rmstarasdf
lee101 Nov 7, 2025
8309595
workstealing
lee101 Nov 7, 2025
812ecbf
stealing
lee101 Nov 7, 2025
349a477
fxsimulator
lee101 Nov 7, 2025
2ff846a
wipstrat
lee101 Nov 7, 2025
b1ef5bb
packing
lee101 Nov 7, 2025
c3983d2
fx
lee101 Nov 7, 2025
946f8f0
fx
lee101 Nov 7, 2025
ac4df0d
Merge branch 'main' into workstealing
lee101 Nov 7, 2025
d095843
fx
lee101 Nov 7, 2025
9b66da3
fxsimplesizing
lee101 Nov 7, 2025
b7c4f8f
packingmore
lee101 Nov 7, 2025
4d94566
stealingdocsperfdocs
lee101 Nov 7, 2025
ca723e2
fxprioritycoop
lee101 Nov 7, 2025
0472914
cancelnoncrypto
lee101 Nov 7, 2025
3909b3c
fx
lee101 Nov 7, 2025
2f80797
compilestuff
lee101 Nov 8, 2025
8c6b448
Merge branch 'main' of github.com:lee101/stock-prediction
lee101 Nov 8, 2025
418fa0f
fxlogsorders
lee101 Nov 11, 2025
95515a1
fx
lee101 Nov 11, 2025
73025c5
fx
lee101 Nov 11, 2025
35df1bf
fx
lee101 Nov 11, 2025
c3759d0
fx
lee101 Nov 11, 2025
d4dffd8
wip
lee101 Nov 11, 2025
8211742
hparamopt
lee101 Nov 11, 2025
459cd04
fxrates
lee101 Nov 11, 2025
5190c09
Merge branch 'main' of github.com:lee101/stock-prediction
lee101 Nov 11, 2025
0427226
Add comprehensive P&L and trading logic audit
claude Nov 12, 2025
176603c
scirpts
lee101 Nov 12, 2025
bcc4ee9
docs
lee101 Nov 12, 2025
298ebe7
Add CUDA market simulator sources and ignore build artifacts
lee101 Nov 12, 2025
40f1c98
Remove build artifacts from version control
lee101 Nov 12, 2025
3d98a75
hparams
lee101 Nov 12, 2025
c059b75
fx
lee101 Nov 12, 2025
606fddb
fxandretune
lee101 Nov 12, 2025
e4e3e8d
fx
lee101 Nov 12, 2025
7442438
addbench
lee101 Nov 12, 2025
5d6690b
Merge branch 'main' of github.com:lee101/stock-prediction
lee101 Nov 12, 2025
18d1bfc
Standardize crypto fees to 10 bps and add correlation risk management
claude Nov 13, 2025
72ff82d
Merge pull request #16 from lee101/claude/audit-trade-st-pnl-011CV3XM…
lee101 Nov 13, 2025
93f8faa
Merge branch 'main' of github.com:lee101/stock-prediction
lee101 Nov 13, 2025
3360c96
fxcompile
lee101 Nov 13, 2025
49f3ae7
fx
lee101 Nov 13, 2025
0f9aced
infmode
lee101 Nov 13, 2025
03a4e48
fx
lee101 Nov 13, 2025
a0703ea
fxpreaug
lee101 Nov 13, 2025
4b368a4
newstrat
lee101 Nov 13, 2025
90b2b99
optimize stock pick and find more stocks
lee101 Nov 13, 2025
394e306
fixespctdiff
lee101 Nov 13, 2025
7c25262
Merge branch 'main' of github.com:lee101/stock-prediction
lee101 Nov 13, 2025
87cf6c5
cachedbacktest
lee101 Nov 13, 2025
f6445f4
Merge branch 'main' of github.com:lee101/stock-prediction
lee101 Nov 13, 2025
a032cff
fx
lee101 Nov 13, 2025
9ff3531
datacache
lee101 Nov 13, 2025
a9af006
Merge branch 'main' of github.com:lee101/stock-prediction
lee101 Nov 13, 2025
66102be
datafx
lee101 Nov 13, 2025
f7a0417
Merge branch 'main' of github.com:lee101/stock-prediction
lee101 Nov 13, 2025
06c4a0a
params
lee101 Nov 13, 2025
7fdc1ab
fx
lee101 Nov 13, 2025
96481b8
fx
lee101 Nov 14, 2025
81a755a
fx
lee101 Nov 14, 2025
2f3e465
fxstuff
lee101 Nov 14, 2025
2e06150
rmfalstuff
lee101 Nov 14, 2025
d969aad
fx
lee101 Nov 14, 2025
95aefb6
Add batch market simulator runner
claude Nov 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 9 additions & 0 deletions .claude/settings.local.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"permissions": {
"allow": [
"Bash(ls:*)",
"Bash(grep:*)"
],
"deny": []
}
}
29 changes: 29 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[run]
source =
src
rlinference
hfinference
hftraining
hyperparamopt
totoembedding
omit =
tests/*
**/test_*.
**/*_test.py
**/.venv/*
**/venv/*
**/.tox/*
**/site-packages/*
**/experiments/*
**/reports/*

[report]
exclude_lines =
pragma: no cover
if __name__ == .__main__.
@overload
@abstractmethod
@abc.abstractmethod
precision = 1
skip_empty = True

24 changes: 24 additions & 0 deletions .cursorignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
data
lightning*
logs
optuna*
.idea

.env
.cache
data
results
env.py
env_real.py
logs
lightning_logs
lightning_logs*
lightning_logsminute


optuna_test
.pytest_cache

__pycache__
__pycache__*
logfile.log
9 changes: 9 additions & 0 deletions .cursorrules
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
you can use tools like bash:

git --no-pager diff --cached -p
git --no-pager diff -p

to look over the diff
testing/uv installing in the .venv
pytest .
uv pip compile requirements.in -o requirements.txt && uv pip install -r requirements.txt --python .venv/bin/python
15 changes: 15 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "PufferTank 5090",
"image": "pufferai/puffertank:latest",
"runArgs": ["--gpus=all"],
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"ms-toolsai.jupyter",
"github.vscode-pull-request-github"
]
}
},
"postCreateCommand": "uv pip install --upgrade pufferlib torch gymnasium"
}
37 changes: 37 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

# Ignore everything by default.
*

!.dockerignore
!Dockerfile.runpod
!pyproject.toml
!uv.lock
!runpodmarket/**
!falmarket/**
!fal_marketsimulator/**
!faltrain/**
!marketsimulator/Dockerfile
!marketsimulator/**
!src/**
!traininglib/**
!training/**
!rlinference/**
!gymrl/**
!analysis/**
!analysis_runner_funcs/**
!fal_utils/**
!utils/**
!stock/**
!toto/**
!trade_stock_e2e.py
!trade_stock_e2e_trained.py
!alpaca_wrapper.py
!backtest_test3_inline.py
!data_curate_daily.py
!env_real.py
!jsonshelve.py
!loss_utils.py

gymrl/artifacts/**
gymrl/cache/**
gymrl/runs/**
46 changes: 46 additions & 0 deletions .env.compile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Torch compile configuration - OPTIMIZED FOR RETURNS
#
# ★★★ DATA-DRIVEN DECISION: EAGER MODE (torch.compile DISABLED) ★★★
#
# Evidence from production logs (trade_stock_e2e.py):
# - Current (compiled): 8+ recompilations, CUDA graphs skipped
# - ETHUSD MaxDiff: 10.43% return, 18.24 Sharpe (PROFITABLE!)
# - Accuracy maintained even with recompilation issues
# - But performance is suboptimal (unstable latency)
#
# Decision: EAGER mode gives SAME returns with BETTER stability
#
# Expected after switch:
# - Eager: ~500ms per prediction, STABLE (no recompilations)
# - Memory: 650MB (vs 900MB compiled)
# - Returns: 10.43% maintained (proven in logs)
# - Stability: HIGH (no recompilation overhead)

# Toto model: EAGER mode (disabled compilation)
export TOTO_DISABLE_COMPILE=1

# Kronos model: EAGER mode (TESTED AND PROVEN)
# DECISION: Use EAGER mode - torch.compile has CRITICAL BUG
#
# ★★★ DATA-DRIVEN DECISION FROM BENCHMARK ★★★
# Benchmark results (scripts/benchmark_kronos_compile.py):
# EAGER: 5/5 iterations successful ✅
# COMPILED: 0/5 iterations successful ❌
# Error: "CUDA graphs tensor output reuse" bug
#
# Eager performance:
# - MAE: 36,160 ± 1,883 (consistent)
# - Time: ~3 seconds (acceptable)
# - Memory: 336MB (efficient)
# - Reliability: 100% (no crashes)
#
# DO NOT ENABLE KRONOS_COMPILE - it will crash!
# No flag needed - Kronos uses eager mode by default

# Bid/Ask data: Use real API data (not synthetic)
export ADD_LATEST=1

# To enable compiled mode in the future (after fixing recompilation issues):
# export TOTO_DISABLE_COMPILE=0
# export TOTO_COMPILE_MODE=max-autotune
# export TOTO_COMPILE_BACKEND=inductor
140 changes: 140 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
name: CI

on:
push:
branches: ["main"]
pull_request:

permissions:
contents: read

jobs:
quality:
runs-on: [self-hosted, stock-ci, gpu]
env:
MARKETSIM_ALLOW_MOCK_ANALYTICS: "1"
MARKETSIM_SKIP_REAL_IMPORT: "1"
ALP_PAPER: "1"
PYTHONUNBUFFERED: "1"
strategy:
fail-fast: false
matrix:
python-version: ["3.13"]

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for smart test detection

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Install dependencies
run: |
uv pip install --system --requirement requirements.txt
uv pip install --system ty ruff pyright

- name: Lint with Ruff
run: ruff check src

- name: Type check with ty
continue-on-error: true
run: ty check

- name: Type check with Pyright
continue-on-error: true
run: python -m pyright

- name: Run smart test suite (change-aware, fail-fast)
run: |
python scripts/smart_test_runner.py --verbose

- name: Run integration tests
run: |
python -m pytest tests/prod -m integration

- name: Run fast env benchmark
run: |
make fast-env-benchmark

- name: Report benchmark drift
run: |
. .venv/bin/activate && python analysis/fast_env_drift.py --csv results/bench_fast_vs_python.csv

- name: Fast PPO smoke run
run: |
. .venv/bin/activate && python training/run_fastppo.py \
--symbol AAPL \
--data-root trainingdata \
--context-len 32 \
--total-timesteps 512 \
--num-envs 1 \
--learning-rate 1e-4 \
--env-backend python \
--log-json results/fastppo_ci.json \
--plot \
--plot-path results \
--html-report \
--html-path results/fastppo_ci_report.html \
--sma-window 32 \
--ema-window 32 \
--device cpu

- name: Run simulator report
env:
MARKETSIM_ALLOW_MOCK_ANALYTICS: "1"
MARKETSIM_SKIP_REAL_IMPORT: "1"
MARKETSIM_FORCE_KRONOS: "1"
MARKETSIM_SYMBOL_SIDE_MAP: "NVDA:sell"
MARKETSIM_SYMBOL_KELLY_SCALE_MAP: "AAPL:0.2,MSFT:0.25,NVDA:0.01,AMZN:0.15,GOOG:0.2,XLK:0.15,SOXX:0.15"
MARKETSIM_SYMBOL_MAX_HOLD_SECONDS_MAP: "AAPL:10800,MSFT:10800,NVDA:7200,AMZN:10800,GOOG:10800,XLK:10800,SOXX:10800"
MARKETSIM_SYMBOL_MIN_COOLDOWN_MAP: "NVDA:360"
MARKETSIM_SYMBOL_FORCE_PROBE_MAP: "AAPL:true"
MARKETSIM_SYMBOL_MIN_MOVE_MAP: "AAPL:0.08,AMZN:0.06,GOOG:0.05,XLK:0.04,SOXX:0.04"
MARKETSIM_SYMBOL_MIN_STRATEGY_RETURN_MAP: "AAPL:-0.03,AMZN:-0.02,GOOG:0.02,XLK:0.015,SOXX:0.015"
MARKETSIM_TREND_SUMMARY_PATH: "marketsimulator/run_logs/trend_summary.json"
MARKETSIM_TREND_PNL_SUSPEND_MAP: "AAPL:-5000,GOOG:-100,XLK:-200,AMZN:-400,SOXX:-150,NVDA:-1500"
MARKETSIM_TREND_PNL_RESUME_MAP: "AAPL:-3000,GOOG:-50,XLK:-100,AMZN:-200,SOXX:-75,NVDA:-750"
MARKETSIM_SYMBOL_MAX_ENTRIES_MAP: "NVDA:1,MSFT:10,AAPL:10,AMZN:8,GOOG:6,XLK:6,SOXX:6"
CI_SIM_PREFIX: "ci-${{ github.run_id }}"
run: |
make sim-report

- name: Aggregate simulator trends
run: |
make sim-trend

- name: Check trend alerts
env:
CI_SIM_PREFIX: "ci-${{ github.run_id }}"
MARKETSIM_SYMBOL_SIDE_MAP: "NVDA:sell"
MARKETSIM_SYMBOL_KELLY_SCALE_MAP: "AAPL:0.3,MSFT:0.2,NVDA:0.05,AMZN:0.15,GOOG:0.2,XLK:0.15,SOXX:0.15"
MARKETSIM_SYMBOL_MAX_HOLD_SECONDS_MAP: "AAPL:7200,MSFT:10800,NVDA:7200,AMZN:10800,GOOG:10800,XLK:10800,SOXX:10800"
run: |
python scripts/check_trend_alerts.py \
marketsimulator/run_logs/trend_summary.json \
--min-sma -1200 \
--max-std 1400 \
--symbols AAPL,MSFT,NVDA,AMZN,GOOG,XLK,SOXX \
--trades-glob "marketsimulator/run_logs/${CI_SIM_PREFIX}_trades_summary.json" \
--max-trades-map NVDA@maxdiff:2,MSFT@maxdiff:20,AAPL@maxdiff:20,AMZN@maxdiff:16,GOOG@maxdiff:12,XLK@maxdiff:12,SOXX@maxdiff:12

- name: Upload simulator artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: sim-report-${{ github.run_id }}
path: |
marketsimulator/run_logs/${{ env.CI_SIM_PREFIX }}_*
marketsimulator/run_logs/trend_summary.json
results/bench_fast_vs_python.json
results/bench_fast_vs_python.csv
results/fastppo_ci.json
results/fastppo_ci_report.html
results/aapl_fastppo_trace.png
Loading
Loading