Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
229 commits
Select commit Hold shift + click to select a range
7951854
Clean vendor price errors; tempered, label-stable HMM; real-data rese…
claude Oct 21, 2026
29a0d09
Research: fundamental and news signals, and trading only when the edg…
claude Oct 21, 2026
a14dd52
Size the book by the expected edge: regime-dependent IC and edge scaling
claude Oct 21, 2026
0284eb5
Research: which signal combinations stick
claude Oct 21, 2026
9dad27d
Keep only signals that have been consistent: walk-forward stable-sign…
claude Oct 21, 2026
8f14590
Research: Poisson models of jumps and news
claude Oct 21, 2026
cfdb9dc
Research: Hawkes processes and Poisson regressions for jumps and news
claude Oct 21, 2026
a572601
Research: GARCH volatility models and GLM / model-family comparison
claude Oct 21, 2026
f8e3025
Model zoo: hundreds of forecasting models judged out of sample
claude Oct 21, 2026
4f2efc0
Research: beyond reversal - a zoo of different kinds of strategy
claude Oct 21, 2026
2cfc2ac
Strategy zoo: fix the earnings-premium date arithmetic; isolate strat…
claude Oct 21, 2026
81ffc49
Model zoo, second wave: 13 more model families and a 63-day horizon
claude Oct 21, 2026
10ff82b
Ideas lab: candidate signals tested as they are written (wave 1)
claude Oct 21, 2026
906f7f8
Research backlog and overnight log
claude Oct 21, 2026
6e1ac87
Public data loaders and ideas wave 2
claude Oct 21, 2026
21df454
Survivorship-free universe, news events and novelty, index changes, i…
claude Oct 21, 2026
fb39572
Strategy zoo, wave 2: broad trend following, volatility premium, macr…
claude Oct 21, 2026
25ec1b1
Model zoo: sequence models, online model weighting and disagreement s…
claude Oct 21, 2026
8d9bcb9
Overnight research log (in docs/, since reports/ is not tracked)
claude Oct 21, 2026
e574229
Fix the event study's first day and the all-stocks download
claude Oct 21, 2026
0d4b16a
Research: combination signals (wave 4) and models on residual, vol-sc…
claude Oct 21, 2026
5ddc44b
Macro data: stop after two FRED timeouts and fall back to Yahoo marke…
claude Oct 21, 2026
6de5eb3
Overnight log: strategy zoo wave 2
claude Oct 21, 2026
06019fa
Strategy zoo: sector- and beta-neutral and vol-scaled factor books, E…
claude Oct 21, 2026
9e1406f
Intraday strategies: opening drive, late-day momentum, gap reversal, …
claude Oct 21, 2026
8b6c5a5
Model zoo: engineered inputs (sticky-pair products, best ideas) and l…
claude Oct 21, 2026
451d5df
Research: fix survivorship summary keys, S&P change-table lookup, and…
claude Oct 21, 2026
12d91a9
Ideas wave 5: news-event signals (buybacks, lawsuits, M&A, net upgrad…
claude Oct 21, 2026
0c25c91
Ideas: IC for 2015-20 and 2021-26 separately; post-2015 signals ranke…
claude Oct 21, 2026
f4a9f71
Snapshot of the zoo's best correlations and summary (4,690 rows so far)
claude Oct 21, 2026
405faab
Multi-strategy book: ETF sleeves traded next to the stock book
claude Oct 21, 2026
79cd69f
Shareable research data: research_data/ and a public-data release
claude Oct 21, 2026
d718b84
publish-public-data: run on push to working branches too (dispatch ne…
claude Oct 21, 2026
1983556
Handoff note for collaborators and their assistants
claude Oct 21, 2026
603cd13
Add overnight research labs and results (regime, jump, switch, invari…
claude Oct 21, 2026
b7f4084
Research night: robustness, book and ensemble results; draft report
claude Oct 21, 2026
58c4c90
Research night: pairs sweep, wider-composite check, macro regime patc…
claude Oct 21, 2026
a6576a2
Research night: macro regime patch for the live pipeline
claude Oct 21, 2026
78706e8
Research night: log dispersion-regime result
claude Oct 21, 2026
85c4326
Research night: live-pipeline comparison of the two regime models
claude Oct 21, 2026
28242a6
Research night: live-pipeline section in the report
claude Oct 21, 2026
d01ecda
Research night: switch leg decomposition
claude Oct 21, 2026
a197e1f
Research night: report notes on where the switch earns
claude Oct 21, 2026
7be5e95
Research night: long-losers leg vs market benchmark
claude Oct 21, 2026
3b4a45d
Research night: report caveat on long-only regime legs
claude Oct 21, 2026
51e8130
Research night: beta-hedged switch results
claude Oct 21, 2026
bdafc77
Research night: book with pairs and switch, capped
claude Oct 21, 2026
fbf5884
Research night: capped book table in report
claude Oct 21, 2026
5a72515
Research night: alpha decay by block, regime blind spot, current reading
claude Oct 21, 2026
3b4a26f
Research night: regime variants without the term-spread level
claude Oct 21, 2026
a39a2f2
Research night: term-spread trade-off in report
claude Oct 21, 2026
cd37501
Research night: return and drawdown columns in the book table
claude Oct 21, 2026
9237eea
Research night: make the report's recommendations consistent with the…
claude Oct 21, 2026
9b94591
Research night: concentrated-book option in switch_lab
claude Oct 21, 2026
537ac0d
Research night: concentrated switch results
claude Oct 21, 2026
5b8fbf2
Research night: small-account note in report
claude Oct 21, 2026
94be613
Research night: note that the GBM backtests timed out
claude Oct 21, 2026
9d8ec46
Research night: add the result files (were excluded by the reports/ g…
claude Oct 21, 2026
9c5ce3c
Research night: four-model live-pipeline comparison
claude Oct 21, 2026
88e0dcf
Research night: four-model table in report
claude Oct 21, 2026
b3cbf86
Research night: VIX-threshold regime rule vs the HMM
claude Oct 21, 2026
5d31246
Research night: VIX-median regime rule
claude Oct 21, 2026
7581a8e
Research night: report - the VIX rule beats the HMM
claude Oct 21, 2026
d1c63a1
Research night: VIX threshold sensitivity
claude Oct 21, 2026
47b91e0
Research night: hedged VIX>20 switch
claude Oct 21, 2026
428fd96
Research night: report headline on the VIX>20 switch
claude Oct 21, 2026
167d7ed
Research night: robustness battery for the VIX>20 switch
claude Oct 21, 2026
25e9b48
Research night: bootstrap and robustness of the VIX>20 switch in the …
claude Oct 21, 2026
e9b21b9
Research night: book with the VIX>20 switch
claude Oct 21, 2026
26ad0ab
Research night: VIX>20 book rows in report; execution-delay option
claude Oct 21, 2026
d573e18
Research night: execution-delay check and closing note
claude Oct 21, 2026
53beba3
Research night: final report wording and file index
claude Oct 21, 2026
bb90b43
Research night: pairs sized by VIX; fast-refit configs
claude Oct 21, 2026
edbc2e9
Research night: pairs sizing recommendation
claude Oct 21, 2026
aece29b
Research night: GBM runs stopped; light GBM configs
claude Oct 21, 2026
8f0d121
Trade the multi-strategy book by default; stop writing quote samples;…
claude Oct 21, 2026
dad84a1
Merge pull request #2 from ASCoding11/claude/keen-tesla-shs956
ASCoding11 Oct 21, 2026
4ee4c74
Research night: daily book by regime, long-only hedged version, switc…
claude Oct 21, 2026
36cd028
Research night: SPY-hedged long-losers line and its caveats
claude Oct 21, 2026
8763c6f
Research night: long-only hedged line in report
claude Oct 21, 2026
979fa73
Research night: timing within the crisis
claude Oct 21, 2026
2a5ee08
Research night: daily book by regime in report
claude Oct 21, 2026
8872391
Research night: the recommended book end to end
claude Oct 21, 2026
f268949
Research night: recommended book in report
claude Oct 21, 2026
3abf34f
Intraday model zoo: the largest gross edge on 5-minute bars
claude Oct 21, 2026
fce2f90
Research night: recommendation with the full book; cost-multiplier op…
claude Oct 21, 2026
89d7356
Research night: stock-level vs market-level regime for reversal
claude Oct 21, 2026
bd2d7c5
Research night: switch P&L concentration by stock and sector
claude Oct 21, 2026
7c8ea7f
Research night: concentration note in report
claude Oct 21, 2026
aafe8a9
Research night: cost stress of the switch
claude Oct 21, 2026
c3987d1
Research night: cost stress in report
claude Oct 21, 2026
94b2cde
Research night: fixed allocation rules beat the learned switch
claude Oct 21, 2026
b5c6780
Research night: the momentum flip, robustness and hedging
claude Oct 21, 2026
fbc7ff9
Research night: momentum flip as the headline; momentum_flip module
claude Oct 21, 2026
84a5951
Wire the intraday zoo's best model into the intraday trader
claude Oct 21, 2026
861f701
Research night: momentum flip report and the book with the flip
claude Oct 21, 2026
261dec5
Research night: book with the flip in the report
claude Oct 21, 2026
650bcf6
Research night: concentrated momentum flip
claude Oct 21, 2026
177f310
Research night: small-account flip in report
claude Oct 21, 2026
cd7046c
Make intraday the default scheduled trader
claude Oct 21, 2026
e1acf69
Research night: the flip does not apply to ETF trend; 2001-05 check
claude Oct 21, 2026
1b76cb1
Research night: generalisation checks in report
claude Oct 21, 2026
a7f9f91
Research night: implementable spec of the flip in the report
claude Oct 21, 2026
3ce40d4
Merge pull request #3 from ASCoding11/claude/keen-tesla-shs956
ASCoding11 Oct 21, 2026
595b7ae
Research night: start-day sensitivity of the flip
claude Oct 21, 2026
e9e0df0
Research night: correct the headline for start-day luck
claude Oct 21, 2026
ea810cb
Research night: staggered flip and the final book numbers
claude Oct 21, 2026
cfae887
Research night: final staggered-flip numbers throughout the report
claude Oct 21, 2026
638dd45
Research night: staggered concentrated flip
claude Oct 21, 2026
c922b22
Research night: small-account line updated to the staggered numbers
claude Oct 21, 2026
462c160
Interactive Brokers simulation of the intraday strategy
claude Oct 21, 2026
31accfc
Research night: report wording
claude Oct 21, 2026
1d5cb0d
Research night: half-universe splits of the flip
claude Oct 21, 2026
ea16260
Research night: sampling noise note in report
claude Oct 21, 2026
7c3d823
Research night: flip performance by VIX level
claude Oct 21, 2026
023305c
Research night: VIX-level note in report
claude Oct 21, 2026
7a74692
Research night: start-day caveat on the switch table
claude Oct 21, 2026
77a3a26
Research night: folder README
claude Oct 21, 2026
f3a8c2d
Research night: recent record of the flip
claude Oct 21, 2026
078b9cc
Research night: recent record in report
claude Oct 21, 2026
f3935fc
research_data: IBKR simulation of the intraday strategy (no fill prices)
claude Oct 21, 2026
d6ec8f9
Research night: light-GBM live backtest, macro arm
claude Oct 21, 2026
245ce56
Research night: light-GBM result in report
claude Oct 21, 2026
6826fa3
Intraday edge strategies on IBKR Lite and IBKR Pro
claude Oct 21, 2026
57d756f
Research night: light-GBM live backtest, both arms
claude Oct 21, 2026
9d1bdc8
Research night: final live-pipeline paragraph
claude Oct 21, 2026
b6d54a6
Research night: bootstrap of the staggered flip; closing note
claude Oct 21, 2026
55987b1
Research night: bootstrap intervals in report
claude Oct 21, 2026
9a71748
Research night: factor tilts of the flip
claude Oct 21, 2026
3150a65
Research night: factor tilts in report
claude Oct 21, 2026
a7b5afd
Intraday edge: auction-cost sensitivity (0, 0.5, 1 bp beyond the offi…
claude Oct 21, 2026
390fead
Research night: flip by liquidity tier
claude Oct 21, 2026
430898b
Research night: liquidity tiers in report
claude Oct 21, 2026
b0ab7d9
Research night: weighting-scheme check
claude Oct 21, 2026
c2afe86
Research night: weighting note in report
claude Oct 21, 2026
0c1aa51
Research night: stance-change frequency
claude Oct 21, 2026
750be94
Research night: headline numbers in one CSV
claude Oct 21, 2026
ff25611
Research night: final caveats
claude Oct 21, 2026
69b3ac9
Research night: which momentum signals the flip applies to
claude Oct 21, 2026
d201b0e
Research night: momentum-family note in report
claude Oct 21, 2026
d10e209
research_data: IBKR Lite / Pro simulation of the intraday edge strate…
claude Oct 21, 2026
8e436e1
Research night: hand-off note for Arjun; refreshed patch diff
claude Oct 21, 2026
960d6bb
Research night: test suite passes; ready to merge
claude Oct 21, 2026
f876c44
Research night: momentum_flip --today prints the standalone book's ta…
claude Oct 21, 2026
947a832
Live auction trader: market-on-close book, market-on-open exit, fill-…
claude Oct 21, 2026
db69cfa
Auction trader: a dry run during the session builds the book at once …
claude Oct 21, 2026
d95a0a1
Merge pull request #4 from ASCoding11/claude/keen-tesla-shs956
ASCoding11 Oct 21, 2026
f106c77
Auction trader: leave out a strategy whose signal is flat or missing …
claude Oct 21, 2026
2f5080c
Merge pull request #5 from ASCoding11/claude/keen-tesla-shs956
ASCoding11 Oct 21, 2026
8a47dd5
Auction trader: redundant schedules so a dropped GitHub run can't ski…
claude Oct 21, 2026
ed073e9
Merge pull request #6 from ASCoding11/claude/keen-tesla-shs956
ASCoding11 Oct 21, 2026
538700c
Independent check of Nico's momentum flip (replication + survivorship)
claude Oct 21, 2026
762c44f
Research: period 1 really is 2006-2014 in the edge, combos, condition…
claude Oct 21, 2026
a111434
Consumer earnings study: free alt data around earnings, auction execu…
claude Oct 21, 2026
68d5356
Auction trader: a self-renewing keeper instead of GitHub's late sched…
claude Oct 22, 2026
917f4ab
Merge pull request #7 from ASCoding11/claude/keen-tesla-shs956
ASCoding11 Oct 22, 2026
4df5229
Google Trends: weekly, incremental and paced, with SEC names for cove…
claude Oct 22, 2026
e5df5d1
Probe which free news, media and calendar endpoints a GitHub runner c…
claude Oct 22, 2026
5bf809f
Auction trader: add the earnings leg (last_reaction)
claude Oct 22, 2026
07741c6
News and media vs stock moves: data collectors and a correlation scan…
claude Oct 22, 2026
d3eb31d
Merge pull request #8 from ASCoding11/claude/keen-tesla-shs956
ASCoding11 Oct 22, 2026
98fa3fb
Asian markets: lead-lag with the US, ADRs vs home listings, strategie…
claude Oct 22, 2026
10bddb2
Asia study: tradable ETF opens and an ADR book without the FX peek [r…
claude Oct 22, 2026
4aaea71
Media collector: a throttled GDELT request is retried later, not expa…
claude Oct 22, 2026
222c9d7
Merge pull request #9 from ASCoding11/claude/keen-tesla-shs956
ASCoding11 Oct 22, 2026
4c26d8b
Auction trader: the ADR book for China, Japan, Korea and India; execu…
claude Oct 22, 2026
da6d795
Diagnostic workflow: list today's paper orders and positions (no prices)
claude Oct 22, 2026
cfdfcad
Auction trader: flatten after the open even when market-on-open order…
claude Oct 22, 2026
f96d587
Merge pull request #10 from ASCoding11/claude/keen-tesla-shs956
ASCoding11 Oct 22, 2026
7df142d
Trade ledger: every fill and every round trip's P&L, encrypted for th…
claude Oct 22, 2026
6e9cd38
Trade ledger: merge partial-fill lots back into one trade
claude Oct 22, 2026
46fefa1
High-frequency trading: tick-level study and a shadow trader that log…
claude Oct 22, 2026
345fefb
Shadow HFT: the sheet's assumptions - instant execution, 0 bp fees, n…
claude Oct 22, 2026
ccd52ef
Shadow HFT: hourly runs so the trade log reaches the sheet during the…
claude Oct 22, 2026
90ba893
Auction trader: switch the ADR book on (China, Japan, Korea, India; m…
claude Oct 22, 2026
ee239ee
Shadow HFT: event-driven with order latency, and live writes to the G…
claude Oct 22, 2026
cc28f19
Merge pull request #11 from ASCoding11/claude/keen-tesla-shs956
ASCoding11 Oct 22, 2026
0e2e535
Shadow HFT: don't trade on broken IEX quotes wider than 25 bp
claude Oct 22, 2026
9af03ce
Shadow HFT: a shared $10,000 book with dollar P&L, totals and a book …
claude Oct 22, 2026
b70ba0e
Merge pull request #12 from ASCoding11/claude/keen-tesla-shs956
ASCoding11 Oct 22, 2026
5176273
HFT rule set 2 (passive exits, fewer trades) and a data hoard every 3…
claude Oct 22, 2026
4a2ac3a
Merge pull request #13 from ASCoding11/claude/keen-tesla-shs956
ASCoding11 Oct 22, 2026
fa7a8ea
Momentum flip sleeve, HFT rules from a replay, and a top-1,000 HFT un…
claude Oct 22, 2026
fa017ff
Merge pull request #14 from ASCoding11/claude/keen-tesla-shs956
ASCoding11 Oct 22, 2026
4b69637
Switch the HFT off (no strategy passed the replay) and put the book i…
claude Oct 22, 2026
61c4520
Merge pull request #15 from ASCoding11/claude/keen-tesla-shs956
ASCoding11 Oct 22, 2026
3f4edcc
One $10,000 sheet book: auction strategies simulated in the sheet, Al…
claude Oct 23, 2026
081570b
Merge pull request #16 from ASCoding11/claude/keen-tesla-shs956
ASCoding11 Oct 23, 2026
1681517
Hoard: long-term storage in monthly releases, more sources; study of …
claude Oct 23, 2026
edd7659
Merge pull request #17 from ASCoding11/claude/keen-tesla-shs956
ASCoding11 Oct 23, 2026
3427bf5
European tickers keep their exchange suffix; the open check compares …
claude Oct 23, 2026
dbcc566
Merge pull request #18 from ASCoding11/claude/keen-tesla-shs956
ASCoding11 Oct 23, 2026
62f5a54
Foreign sleeve: overnight persistence on Asian exchanges in the sheet…
claude Oct 23, 2026
0cd5edf
Merge pull request #19 from ASCoding11/claude/keen-tesla-shs956
ASCoding11 Oct 23, 2026
b426ee8
Foreign sleeve adds the UK, Germany and France; never books an unfini…
claude Oct 23, 2026
c48f098
Merge pull request #20 from ASCoding11/claude/keen-tesla-shs956
ASCoding11 Oct 23, 2026
85fa17f
Minute-level (HFT) study on foreign exchanges; the hoard keeps foreig…
claude Oct 23, 2026
5254a13
Merge pull request #21 from ASCoding11/claude/keen-tesla-shs956
ASCoding11 Oct 23, 2026
48d5d3f
Foreign HFT tracker in the sheet ($0 allocated)
claude Oct 23, 2026
d274613
Merge pull request #22 from ASCoding11/claude/keen-tesla-shs956
ASCoding11 Oct 23, 2026
4347742
International research: universe builder, downloader, lab (work in pr…
claude Oct 23, 2026
e109987
International research: cross-market summary script
claude Oct 23, 2026
468e685
International research: first full results (21 markets)
claude Oct 23, 2026
d0f5ab7
International research: second-layer tests (universal rules, index-he…
claude Oct 23, 2026
2799224
International research: fix per-market choice matching, beta lag; add…
claude Oct 23, 2026
4e0adf2
International research: corrected second-layer results; flat-in-stres…
claude Oct 23, 2026
6d5dcd3
International research: point-in-time membership test for NIFTY 50 an…
claude Oct 23, 2026
4af890a
International research: point-in-time results, pooled Asian financial…
claude Oct 23, 2026
d449352
International research: 20 new exchanges (pre-registered test passes)…
claude Oct 23, 2026
94a02b6
International research: lottery-filter test (fails), conservative com…
claude Oct 23, 2026
706f320
International research: report, survivorship simulation, breadth chec…
claude Oct 23, 2026
c97b6e3
Remove committed bytecode cache
claude Oct 23, 2026
b226c05
International research: Asian financials pairs (pre-registered, fails…
claude Oct 23, 2026
fbc099f
International research: year-by-year returns of the conservative comb…
claude Oct 23, 2026
caff2dd
International research: broad Asia-Pacific universes (400 largest per…
claude Oct 23, 2026
56f4c61
Report: list the broad Asia-Pacific universe in the data table
claude Oct 23, 2026
b054d46
foreign-sheet: a tracker-only run (safe before Europe closes)
claude Oct 23, 2026
aadb8e2
Merge pull request #23 from ASCoding11/claude/keen-tesla-shs956
ASCoding11 Oct 23, 2026
9bd2b19
Foreign HFT tracker: keep the summary in place
claude Oct 23, 2026
839b430
Merge pull request #24 from ASCoding11/claude/keen-tesla-shs956
ASCoding11 Oct 23, 2026
79188c2
Foreign HFT tracker: a hypothetical $10,000 book split between the ma…
claude Oct 23, 2026
26acaf5
Merge pull request #25 from ASCoding11/claude/keen-tesla-shs956
ASCoding11 Oct 23, 2026
9e27e33
US HFT tab live again: a $0 tracker when no strategy passed the replay
claude Oct 23, 2026
e11efe0
Merge pull request #26 from ASCoding11/claude/keen-tesla-shs956
ASCoding11 Oct 23, 2026
85c91d0
Daily sleeves survive late or skipped GitHub schedules
claude Oct 23, 2026
74a161a
Merge pull request #27 from ASCoding11/claude/keen-tesla-shs956
ASCoding11 Oct 23, 2026
3543e31
International research: South America (Brazil, Chile, Argentina, Colo…
claude Oct 25, 2026
4e133af
Wrap the country-ETF table
claude Oct 25, 2026
e829c9f
Merge Arjun's latest main (ASCoding11/Quant-Trading) into the researc…
claude Oct 26, 2026
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
  •  
  •  
  •  
53 changes: 53 additions & 0 deletions .github/workflows/auction-sheet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: auction-sheet

# The auction strategies as a sleeve of the simulated $10,000 Google Sheet book
# (qtrade/intraday/auction_sheet.py). Once a day after the close: last night's book is
# closed at today's official open, today's ADR book is settled open -> close, and tonight's
# book is opened at today's official close - all in the sheet's "Auction book" and
# "Auction trades" tabs. Nothing is sent to Alpaca. The two crons cover ~16:25 New York in
# summer and winter time; the script itself only runs between 16:20 and midnight New York, once a day.

on:
schedule:
- cron: "26 20,21,22,23 * * 1-5" # GitHub often fires late or skips: several chances a day
- cron: "26 0,1,2,3 * * 2-6" # ... still the same New York evening
workflow_dispatch:
inputs:
force:
description: "run now even outside 16:20-24:00 New York"
default: "false"

permissions:
contents: read

concurrency:
group: auction-sheet
cancel-in-progress: false

jobs:
sleeve:
runs-on: ubuntu-latest
timeout-minutes: 40
env:
ALPACA_API_KEY: ${{ secrets.ALPACA_API_KEY }} # market data only
ALPACA_SECRET_KEY: ${{ secrets.ALPACA_SECRET_KEY }}
SEC_USER_AGENT: ${{ secrets.SEC_USER_AGENT }} # last_reaction: earnings dates
GOOGLE_SERVICE_ACCOUNT_JSON: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_JSON }}
HFT_SHEET_ID: ${{ secrets.HFT_SHEET_ID }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip
- run: pip install -r requirements.txt
- name: Universe and strategy directions
run: |
git fetch -q --depth 1 origin results
mkdir -p data
git show origin/results:intraday/latest/model.json > data/auction_tickers.json
git show origin/results:intraday/edge/signs.json > data/auction_signs.json 2>/dev/null || rm -f data/auction_signs.json
- name: Settle and rebalance the sleeve
run: |
if [ "${{ inputs.force }}" = "true" ]; then F=--force; else F=; fi
python -m qtrade.intraday.auction_sheet $F
109 changes: 109 additions & 0 deletions .github/workflows/auction-trade.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: auction-trade

# The auction trader on Alpaca paper (qtrade/intraday/auction_live.py):
# ~15:45 New York market-on-close orders for the overnight book (plus the earnings
# leg: names reporting tonight, by their last earnings reaction)
# 9:00-9:27 market-on-open orders that close everything
# (9:31-10:30: anything still open is closed with market orders)
# Each action first reports the previous auction's fills against the official
# open / close (the real cost; the backtest assumes 0 bp).
#
# GitHub starts scheduled runs hours late on busy days (on 2026-10-21 by 2.5-5
# hours, which missed the first close), so nothing here depends on the
# scheduler's timing. A "keeper" job stays up for ~5.4 hours polling the clock
# and acts at the right minute; before it ends it starts the next keeper, so
# one is always running. The hourly schedules are only a watchdog that starts a
# keeper if the chain ever breaks. Every action is guarded against repeats, so
# overlapping keepers can't double-trade.
#
# It owns the paper account overnight: it runs only while the repository
# variable TRADING_MODE is "auction" or unset ("daily" -> paper-trade,
# "intraday" -> intraday-trade). Changing the variable stops the chain.

on:
schedule:
- cron: "17 * * * 1-5" # watchdog only: start a keeper if none is running (it stops at once when flat)
workflow_dispatch:
inputs:
phase:
description: "keeper (stay up and trade at the right moments), close, open or report"
default: "keeper"
send:
description: "Send orders to the paper account (false = dry run)"
type: boolean
default: false

permissions:
contents: read
actions: write # the keeper starts its successor

concurrency:
group: paper-account
cancel-in-progress: false

jobs:
trade:
if: (vars.TRADING_MODE || 'auction') == 'auction' || (github.event_name == 'workflow_dispatch' && inputs.phase != 'keeper')
runs-on: ubuntu-latest
timeout-minutes: 350
env:
ALPACA_API_KEY: ${{ secrets.ALPACA_API_KEY }}
ALPACA_SECRET_KEY: ${{ secrets.ALPACA_SECRET_KEY }}
QTRADE_CONFIG: ${{ vars.AUCTION_CONFIG || 'config/auction_paper.yaml' }}
SEC_USER_AGENT: ${{ secrets.SEC_USER_AGENT }} # last_reaction: previous earnings releases from SEC
GH_TOKEN: ${{ github.token }}
steps:
- name: Which phase?
id: phase
run: |
PHASE="${{ inputs.phase || 'keeper' }}"
SEND="${{ inputs.send }}"
if [ "${{ github.event_name }}" = "schedule" ]; then
SEND=true
# watchdog: stand aside if a keeper is already running
RUNNING=$(gh run list -R "${{ github.repository }}" --workflow auction-trade.yml --status in_progress \
--json databaseId -q "[.[] | select(.databaseId != ${{ github.run_id }})] | length")
if [ "${RUNNING:-0}" -gt 0 ]; then echo "a keeper is running - nothing to do"; PHASE=none; fi
fi
echo "phase=$PHASE" >> "$GITHUB_OUTPUT"
echo "send=$SEND" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@v4
if: steps.phase.outputs.phase != 'none'
- uses: actions/setup-python@v5
if: steps.phase.outputs.phase != 'none'
with:
python-version: "3.11"
cache: pip
- if: steps.phase.outputs.phase != 'none'
run: pip install -r requirements.txt
- name: Universe and strategy directions
if: steps.phase.outputs.phase != 'none'
run: |
git fetch -q --depth 1 origin results
mkdir -p data
git show origin/results:intraday/latest/model.json > data/auction_tickers.json
git show origin/results:intraday/edge/signs.json > data/auction_signs.json 2>/dev/null \
|| { echo "no signs.json yet - using the default directions"; rm -f data/auction_signs.json; }
- name: Trade
if: steps.phase.outputs.phase != 'none'
run: |
SEND=""; [ "${{ steps.phase.outputs.send }}" = "true" ] && SEND="--send"
python -m qtrade ${QTRADE_CONFIG:+--config "$QTRADE_CONFIG"} auction-paper \
--phase "${{ steps.phase.outputs.phase }}" --hours 5.4 $SEND --out logs
- name: Start the next keeper
# only real (sending) keepers continue the chain; a manual dry run ends after one window
if: always() && steps.phase.outputs.phase == 'keeper' && steps.phase.outputs.send == 'true' && (vars.TRADING_MODE || 'auction') == 'auction'
run: |
if [ "$(cat logs/keeper_state.txt 2>/dev/null)" = "stop" ]; then
echo "the account is flat and the auction book now lives in the sheet - chain stopped"; exit 0
fi
gh workflow run auction-trade.yml -R "${{ github.repository }}" --ref "${{ github.ref_name }}" \
-f phase=keeper -f send=${{ steps.phase.outputs.send }}
echo "next keeper started"
- uses: actions/upload-artifact@v4
if: always() && steps.phase.outputs.phase != 'none'
with:
name: auction-${{ steps.phase.outputs.phase }}-${{ github.run_id }}
path: logs
retention-days: 30
if-no-files-found: ignore
70 changes: 70 additions & 0 deletions .github/workflows/data-hoard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: data-hoard

# Every 30 minutes, snapshots of many free data sources (qtrade/data/hoard.py) are added to the
# "data-hoard" branch, to analyse later. Open data is stored as gzipped JSON; market prices and
# other licensed data go into one tar per run, encrypted to config/ledger_public_key.pem.
# The once-a-day sources run in the first collection after 06:00 UTC each day.

on:
schedule:
- cron: "7,37 * * * *"
workflow_dispatch:

permissions:
contents: write

concurrency:
group: data-hoard
cancel-in-progress: false

jobs:
collect:
runs-on: ubuntu-latest
timeout-minutes: 20
env:
ALPACA_API_KEY: ${{ secrets.ALPACA_API_KEY }}
ALPACA_SECRET_KEY: ${{ secrets.ALPACA_SECRET_KEY }}
FRED_API_KEY: ${{ secrets.FRED_API_KEY }}
SEC_USER_AGENT: ${{ secrets.SEC_USER_AGENT }}
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip
- run: pip install -r requirements.txt
- name: Fetch the hoard branch (trees only)
run: |
mkdir -p "$RUNNER_TEMP/hoard" && cd "$RUNNER_TEMP/hoard" && git init -q
git remote add origin "https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
DAY=$(date -u +%F); DAILY=""
if git fetch -q --depth 1 --filter=blob:none origin data-hoard; then
git ls-tree -d FETCH_HEAD "hoard/$DAY/wiki_top" | grep -q . || DAILY="--daily"
else
DAILY="--daily"
fi
[ "$(date -u +%H)" -ge 6 ] || DAILY=""
echo "DAILY=$DAILY" >> "$GITHUB_ENV"
- name: Collect
run: python -m qtrade.data.hoard --out hoard_run $DAILY --public-key config/ledger_public_key.pem
- name: Store
run: |
find hoard_run -type f | head -50; du -sh hoard_run
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
cd "$RUNNER_TEMP/hoard"
for attempt in 1 2 3 4 5; do
rm -f .git/index
if git fetch -q --depth 1 --filter=blob:none origin data-hoard; then
git read-tree FETCH_HEAD; PARENT="-p FETCH_HEAD"
else
PARENT=""
fi
mkdir -p hoard && cp -r "$GITHUB_WORKSPACE"/hoard_run/. hoard/
git add --ignore-removal hoard
TREE=$(git write-tree)
COMMIT=$(git commit-tree $TREE $PARENT -m "Data hoard $(date -u +'%F %H:%M') (run ${GITHUB_RUN_ID})")
git push -q origin "$COMMIT:refs/heads/data-hoard" && break
sleep $((attempt * 7))
done
45 changes: 45 additions & 0 deletions .github/workflows/data-probe.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: data-probe

# Checks which free news / media / calendar endpoints answer from a GitHub runner
# (the development container can't reach them). Prints status and a sample of each.

on:
push:
branches: ["claude/**"]
paths: [".github/workflows/data-probe.yml"]
workflow_dispatch:

permissions:
contents: read

jobs:
probe:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Probe endpoints
run: |
UA="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124 Safari/537.36"
probe() {
echo "::group::$1"
code=$(curl -sS -m 40 -A "$UA" -H "Accept: application/json" -o /tmp/out -w "%{http_code}" "$2" || echo ERR)
echo "HTTP $code, $(wc -c < /tmp/out) bytes"
head -c 1200 /tmp/out; echo
echo "::endgroup::"
sleep 6
}
probe nasdaq_earnings "https://api.nasdaq.com/api/calendar/earnings?date=$(date -u +%F)"
probe gdelt_doc_vol_2017 "https://api.gdeltproject.org/api/v2/doc/doc?query=%22Tesla%22&mode=timelinevolraw&startdatetime=20170101000000&enddatetime=20170401000000&format=json"
probe gdelt_doc_vol_full "https://api.gdeltproject.org/api/v2/doc/doc?query=%22Tesla%22&mode=timelinevolraw&startdatetime=20170101000000&enddatetime=20261001000000&format=json"
probe gdelt_doc_tone "https://api.gdeltproject.org/api/v2/doc/doc?query=%22Tesla%22&mode=timelinetone&startdatetime=20200101000000&enddatetime=20200401000000&format=json"
probe gdelt_doc_theme "https://api.gdeltproject.org/api/v2/doc/doc?query=recession%20sourcecountry:US&mode=timelinevolraw&startdatetime=20170101000000&enddatetime=20261001000000&format=json"
probe gdelt_tv "https://api.gdeltproject.org/api/v2/tv/tv?query=%22Tesla%22%20market:%22National%22&mode=timelinevol&startdatetime=20170101000000&enddatetime=20171231000000&format=json"
probe hn_algolia "https://hn.algolia.com/api/v1/search_by_date?tags=story&numericFilters=created_at_i%3E1451606400,created_at_i%3C1452211200,points%3E50&hitsPerPage=1000"
probe guardian "https://content.guardianapis.com/search?q=Apple&section=business&from-date=2016-01-01&page-size=50&api-key=test"
probe reddit "https://www.reddit.com/r/wallstreetbets/top.json?t=all&limit=3"
probe stocktwits "https://api.stocktwits.com/api/2/streams/symbol/AAPL.json"
probe wiki_top "https://wikimedia.org/api/rest_v1/metrics/pageviews/top/en.wikipedia/all-access/2020/03/01"
probe wiki_search "https://en.wikipedia.org/w/api.php?action=query&list=search&srsearch=Costco%20Wholesale&format=json&srlimit=3"
probe gdelt_gkg_index "http://data.gdeltproject.org/gdeltv2/masterfilelist.txt"
probe sec_fulltext "https://efts.sec.gov/LATEST/search-index?q=%22going%20concern%22&dateRange=custom&startdt=2020-01-01&enddt=2020-01-31"
probe yahoo_calendar "https://query2.finance.yahoo.com/v1/finance/visualization?lang=en-US&region=US"
43 changes: 43 additions & 0 deletions .github/workflows/flip-sleeve.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: flip-sleeve

# Nico's momentum flip as a sleeve of the simulated $10,000 sheet book
# (qtrade/intraday/flip_sleeve.py): once a day near the close the sleeve is marked to the
# latest prices and rebalanced in the Google Sheet's "Momentum flip" tab. Nothing is sent
# to Alpaca. The two crons cover 15:44 New York in both summer and winter time; the script
# itself only runs between 15:40 and midnight New York, once a day (a day already booked is skipped);
# after the close the latest price is the official close.

on:
schedule:
- cron: "44 19,20,21,22,23 * * 1-5" # GitHub often fires late or skips: every hour until midnight UTC
workflow_dispatch:
inputs:
force:
description: "run now even outside 15:40-16:00 New York"
default: "false"

permissions:
contents: read

concurrency:
group: flip-sleeve
cancel-in-progress: false

jobs:
sleeve:
runs-on: ubuntu-latest
timeout-minutes: 30
env:
GOOGLE_SERVICE_ACCOUNT_JSON: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_JSON }}
HFT_SHEET_ID: ${{ secrets.HFT_SHEET_ID }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip
- run: pip install -r requirements.txt
- name: Mark and rebalance the sleeve
run: |
if [ "${{ inputs.force }}" = "true" ]; then F=--force; else F=; fi
python -m qtrade.intraday.flip_sleeve $F
56 changes: 56 additions & 0 deletions .github/workflows/foreign-research.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: foreign-research

# Foreign stock exchanges at the sheet's rules (qtrade/research/foreign.py): auction strategies in
# Asian and European markets at 0 bp and after real costs, plus checks that the overnight edge is
# not an artefact of stale Yahoo opening prices; and the minute-level version (foreign_hft.py:
# cross-sectional reversal / momentum on 5-minute bars, after an estimated spread). The report goes to the results branch under
# research/foreign/.

on:
workflow_dispatch:
inputs:
study:
description: "daily (auction strategies), minute (foreign_hft) or both"
default: "both"

permissions:
contents: write

jobs:
study:
runs-on: ubuntu-latest
timeout-minutes: 90
env:
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip
- run: pip install -r requirements.txt
- if: inputs.study != 'minute'
run: python -m qtrade.research.foreign --out reports/foreign
- if: inputs.study != 'daily'
run: python -m qtrade.research.foreign_hft --out reports/foreign
- name: Store the report
if: always()
run: |
ls reports/foreign/* >/dev/null 2>&1 || exit 0
cat reports/foreign/*.md >> "$GITHUB_STEP_SUMMARY"
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
for attempt in 1 2 3 4 5; do
RES=$(mktemp -d)
(
cd "$RES" && git init -q
git remote add origin "https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git fetch -q --depth 1 origin results && git checkout -q -B results FETCH_HEAD
mkdir -p research/foreign
cp "$GITHUB_WORKSPACE"/reports/foreign/* research/foreign/
git add -A research/foreign
git commit -q -m "Foreign exchanges study (run ${GITHUB_RUN_ID})" || exit 0
git push -q origin results
) && break
sleep $((attempt * 5))
done
Loading
Loading