update#22
Merged
Merged
Conversation
gangtao
added a commit
that referenced
this pull request
May 21, 2026
Closes the alpha-101 demo's main goal: 10 alphas from the WorldQuant 101 paper, each chosen to demonstrate a different streaming-SQL pattern in Timeplus. Shared pipeline upgrade (additive, non-breaking): - v_bars now exposes high (max price/bucket), low (min price/bucket), vwap (sum(price*volume)/sum(volume)), in addition to the existing open, close, volume. - Reshaped v_bars's aggregation so vwap is computed in an outer SELECT after the GROUP BY — Timeplus 3.3.1 rejects `null_if(sum(volume),0)` in the same SELECT as `sum(volume)` with a "nested aggregate" error. Renamed the inner sum-of-volume alias to `vol_sum` to avoid alias collision with the column name. New alpha chains and the pattern each demonstrates: #3 rank-correlation(open, volume, 10) — cross-sectional rank of raw OHLC inputs + 10-bucket Pearson corr #4 ts_rank(rank(low), 9) — time-series rank within rolling window via array_count(x -> x <= current, lags(_, 0, 8)) #6 correlation(open, volume, 10) — raw-value rolling Pearson correlation (no rank step) for contrast #9 nested-if(ts_min/ts_max of delta-close) — array_min/array_max over lags(_, 0, 4) + multi_if conditionals #12 sign(Δvolume) × −Δclose — minimal alpha: single-step deltas via lags(_, 1, 1), sign, multiplication; tiny SQL footprint to contrast with the others #22 delta(corr(high, volume, 5), 5) × rank(stddev(close, 20)) — chained derived series: rolling corr → delta of derived signal × cross-sectional rank of rolling stddev #41 √(high × low) − vwap — VWAP derivation in v_bars + intra-bar nonlinear math #54 -1 × (low − close) × open⁵ / ((low − high) × close⁵) — pure intra-bar nonlinear OHLC, no lags or aggregation Naming follows the consistent _alpha_N suffix convention. Files numbered 013–035 in /ddl. Each alpha is a 1-4 file chain (features → ranks → alpha → backtest, with simpler alphas skipping intermediate views). Dashboards: extended the Alpha dropdown's inlineValues from "1,2" to "1,2,3,4,6,9,12,22,41,54". No new dashboard files needed — the {{filter_alpha}} substitution handles all 10 alphas. README rewritten with a per-alpha pattern table and updated pipeline diagram. End-to-end verified: fresh .tpapp install brings up all 35 DDL resources + 2 dashboards. Every v_alpha_N emits non-null values in streaming queries; v_backtest_alpha_N emits pnl. (Some longer- lookback alphas like #3 and #22 take more warmup before the correlation arrays fully populate — same pattern as Alpha #1.) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 tasks
gangtao
added a commit
that referenced
this pull request
May 21, 2026
The random source assigns each stock a fixed price band ([50, 80, 120, …] with only ±0.5% tick noise), so cross-sectional rank of raw price- level features is a constant per stock — bands never overlap. This makes alphas #3, #4, and #6 degenerate (alpha_4 always = -1 in steady state, etc.) — the math is correct, the data just has no rank information to extract. Documents which alphas DO produce meaningful varying signals on this synthetic feed (#1, #2, #9, #12, #22, #41, #54 — the ones operating on returns, deltas, or intra-bar quantities) versus which need real market data to demo properly. Caught when reviewer noticed alpha_4 = -1 everywhere. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.