Skip to content

Learn

Stock Factor Research

What changes when a stock factor uses a VWAP proxy

A stock formula that requires VWAP is not fully specified by an OHLC file. Identify the original field, establish its volume and currency units, and give any substitute a separate implementation name. Then compare factor values, selected members and independent account ledgers. Code running successfully does not establish that the original formula was reproduced.

This guide uses Alpha 41 from a primary paper and two tiny synthetic trade tapes. It compares actual volume-weighted prices calculated from those tapes with an author-defined typical-price proxy. CoTrading formula tools remain planned or unverified. No historical provider, model or real trading account was tested.

Read the formula before selecting a proxy

The original 101 Formulaic Alphas paper lists Alpha 41 as the square root of high times low, minus VWAP. We use that expression only. The paper’s presence in a catalog does not mean the data available for a particular stock study contain the required VWAP field or reproduce the author’s complete trading process.

High, low and VWAP must refer to compatible instruments, sessions, currencies and price-adjustment conventions. The square root of a product of two prices has price units, so the subtraction is dimensionally meaningful only when VWAP has the same unit. Mixing adjusted high/low with an unadjusted weighted price can create a factor that looks numeric but measures a different object.

Our proxy is (high + low + close) / 3. Call its implementation alpha41_typical_price_proxy, while the tape-derived calculation is alpha41_tape_vwap. These labels distinguish input semantics without claiming either is a complete replication of a paper’s portfolio returns. The higher-score preference used below is another explicitly author-chosen selection rule.

Establish the VWAP field’s lineage

For a complete compatible trade set, VWAP is the sum of price times share quantity divided by total share quantity. Verify what the vendor includes: a regular session, a whole day or another interval; the same interval must define high, low and close. Do not infer completeness just because turnover and volume columns are both nonempty.

Save whether turnover is in currency units, thousands or millions, and whether volume is shares, lots or another unit. Apply declared multipliers before division. If both fields use different scaling conventions, the ratio can be wrong by orders of magnitude. A unit check should precede any ranking rather than rely on later portfolio performance to reveal the mistake.

Zero volume provides no weighted average under this definition. Preserve an unavailable status instead of substituting the close automatically. A ratio outside a consistently defined session’s high-low range is a useful diagnostic, but passing that range check alone does not prove correct units or coverage; two compensating errors can still produce a plausible number.

Rebuild the two synthetic sessions

Stock A trades ninety shares at twelve and then ten at eight. Stock B trades ninety at eight and then ten at twelve. Both sessions have high twelve, low eight and total volume one hundred. A closes at eight and B at twelve. These trade tapes are deliberately complete within the fixture, not a claim about any external feed.

A’s turnover is 1,160 and its tape VWAP 11.6. B’s turnover is 840 and its VWAP 8.4. The common geometric price component is square root of 96, approximately 9.797959. The tape-based Alpha 41 scores are approximately minus 1.802041 for A and plus 1.397959 for B, selecting B under the fixed higher-score rule.

The typical-price proxies are approximately 9.333333 for A and 10.666667 for B. Subtracting them gives scores approximately plus 0.464626 and minus 0.868708 respectively, selecting A. The member reversal comes from the distribution of traded quantity across prices. OHLC endpoints alone do not preserve that volume distribution.

Keep field substitution separate from execution

The factor is formed after its synthetic session is complete. Its session VWAP is an input measurement, not a guaranteed price at which the later strategy can trade. Both comparison accounts receive a separately supplied next execution open of ten. That separation prevents the factor calculation from silently granting an impossible fill at a past weighted price.

Use a starting account of 1,000 and buy forty shares of the selected stock, paying a fictional fee of one. Cash after entry is 599. The tape-VWAP account buys B; the proxy account buys A. Their quantities, cost assumptions and holding interval are identical so the changed member remains the visible decision difference.

At the supplied exit, B is 10.2 and A 9.8. Sell forty shares and pay one more fee. The tape account ends with 1,006 cash; the proxy account ends with 990. Both are flat and have paid two. These values are synthetic bookkeeping consequences, not evidence that true VWAP is profitable or that typical price is inferior in real markets.

Trigger unit and availability counterexamples

Pass turnover 1.16 and volume one hundred with a declared price range eight to twelve. The ratio 0.0116 is outside that compatible session range, so the example rejects it as a unit-or-window inconsistency. It does not proceed with an enormous apparent Alpha 41 score. A second negative case passes zero volume and is also rejected.

These failures differ from the valid proxy. The proxy is a named alternative measurement that can be studied, while the scaled ratio is an invalid implementation under the declared metadata. Do not fix the latter by relabeling it a proxy after seeing a bad result. Repair or reject the input according to its provenance first.

Execute the implementation comparison

Download the complete example, save it as R568.py and run python R568.py with Python 3.12 or later. The standard-library source is docs/growth/research/round-5/examples/R568.py. Python’s math reference documents the square-root and approximate-equality tools used by this independent calculation.

Assertions verify the tape-derived prices, formula scores, B/A selection disagreement, exact ending cash and rejection of scaled-turnover and zero-volume inputs. The output includes both score dictionaries rather than only a final difference. A reviewer can recompute each result from the two-trade tapes without a vendor account or hidden notebook state.

State what can and cannot be reproduced

Create a field-lineage table with required original field, available source, unit, session, adjustment basis and chosen implementation. If actual compatible VWAP is absent, mark the original-field version unavailable. Study the proxy under its own name, with its own frozen selection and cost ledger. Do not call a running proxy “paper replication” solely because it uses the same formula number.

For historical extension, check a small set of sessions against original trade or turnover definitions before loading a large panel. Save exclusions and the point at which each session’s data became available. Update both implementation labels and artifacts when the provider changes volume coverage, units or price adjustment. Acceptance means the field substitution and its economic consequences are transparent; original portfolio-performance replication remains a separate, substantially broader task.

Make the lineage table actionable

For each implementation, retain the raw turnover, raw volume, declared multipliers and normalized price. A known thousands-of-currency field can be converted using its documentation; an unknown scale should remain unresolved rather than be inferred from whichever result ranks best. The synthetic range test is a guard against the particular wrong scale, not a universal automatic unit detector.

Also retain the formula expression and selection rule separately. Even with compatible VWAP, a formula value alone does not specify portfolio capacity, economic preference, holding interval or costs. Those are explicit choices of this experiment. If a later source supplies a different rule, create a new version and compare the resulting holdings rather than overwrite the earlier proxy study’s meaning. This keeps a genuine improvement in input fidelity distinguishable from a simultaneous strategy change.

FAQ

Can high, low and close recover exact VWAP?

Not generally. They do not identify how much volume traded at each price.

Can I still study a proxy?

Yes, with an explicit new implementation name, input assumptions and separate results rather than an original-replication claim.