AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified Apache-2.0 Self-run

Adjusted Vs Unadjusted Price Series Pitfalls

skill-himanshuj16-algo-trading-skills-adjusted-vs-unadjusted-price-series-pitfalls · by HimanshuJ16

>-

— No reviews yet
0 installs
20 views
0.0% view→install

Install

$ agentstack add skill-himanshuj16-algo-trading-skills-adjusted-vs-unadjusted-price-series-pitfalls

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • ✓ Prompt-injection patterns
  • ✓ Secret / credential exfiltration
  • ✓ Dangerous shell & filesystem operations
  • ✓ Untrusted network calls
  • ✓ Known-malicious package signatures

What it can access

  • ✓ Network access No
  • ✓ Filesystem access No
  • ✓ Shell / process execution No
  • ✓ Environment & secrets No
  • ✓ Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-himanshuj16-algo-trading-skills-adjusted-vs-unadjusted-price-series-pitfalls)

Reliability & compatibility

✓ Security review passed
0 installs to date
— no reviews yet
● 14d ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Adjusted Vs Unadjusted Price Series Pitfalls? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

When to Use

Invoke this skill before loading historical OHLCV data into a backtest when corporate actions, vendor adjustment factors, or mixed price-series conventions may affect signals, returns, liquidity, or universe comparisons.

Declare the intended SeriesAdjustmentMode explicitly:

  • UNADJUSTED: historical prices retain split and cash-dividend ex-date moves; model splits and dividends separately.
  • SPLIT_ADJUSTED: split history is normalized, while cash dividends remain explicit events unless the vendor contract says otherwise.
  • TOTAL_RETURN_ADJUSTED: split and dividend effects are embedded for return analysis; validate the factor methodology and point-in-time availability.
  • UNKNOWN: audit continuity and actions, but do not infer provenance merely because no discontinuity is found.

When NOT to Use

  • Do not infer vendor adjustment provenance from a smooth series alone; continuity is not evidence of correct adjustment factors.
  • Do not treat every ex-dividend price drop as look-ahead bias. A raw price series can legitimately drop by the cash dividend amount; the portfolio must separately receive the dividend.
  • Do not use a price-only audit to satisfy point-in-time or vendor-revision requirements. Those require as-of corporate-action snapshots and adjustment-factor history.
  • Do not apply split adjustment to data already adjusted by the vendor without recording the factor source and convention.
  • Do not use adjusted close as a substitute for executable OHLC, intraday prices, quotes, or volume without validating the vendor's field definitions.

Prerequisites

  • Historical dates, closes, volumes, and preferably actual next-session opens.
  • Corporate-action records with ISO dates, action type, and ratio convention: SPLIT ratio is post-split shares per pre-split share; DIVIDEND ratio is cash per share.
  • A declared SeriesAdjustmentMode and documented vendor/factor provenance.
  • A point-in-time policy for when corporate actions and adjustment factors become available to the backtest.
  • A tolerance policy for price, volume, and notional reconciliation.

Workflow

  1. Declare semantics: Select UNADJUSTED, SPLIT_ADJUSTED, TOTAL_RETURN_ADJUSTED, or UNKNOWN before auditing. Do not let the auditor guess the series mode.
  2. Validate inputs: Confirm strictly increasing ISO dates, aligned lengths, finite positive prices, non-negative volumes, and valid corporate-action records.
  3. Scan the correct boundary: Provide opens so discontinuities are measured from prior close to next open. If opens are unavailable, the auditor falls back to the next close, logs a warning, and records boundary_source="PRIOR_CLOSE_FALLBACK" on the report. Treat any audit carrying that value as provisional.
  4. Match actions: The auditor builds one composite expected price ratio per ex-date — split factors (1 / ratio) multiplied together and multiplied by the cash factor (prev_close - total_dividend) / prev_close — and compares it with the observed ratio using price_match_tolerance_pct (default 5%). Volume scaling is compared separately against the split ratio using volume_ratio_tolerance_pct (default 25%). Keep these two tolerances distinct: the ex-date price factor is mechanical, traded volume is not.
  5. Interpret the report:
  • is_consistent means no detected discontinuity, not that adjustment provenance is proven.
  • unexplained_discontinuities identifies jumps not explained by the declared mode and known actions.
  • expected_price_ratio on each event exposes the composite factor the jump was tested against; None means no expectation could be formed.
  • detected_adjustment_type reports only what the jumps prove: a matched split jump gives UNADJUSTED, a matched cash-dividend jump only gives NOT_TOTAL_RETURN_ADJUSTED (raw and split-adjusted remain indistinguishable), and no matched evidence gives UNKNOWN.
  • has_look_ahead_bias_risk is raised for dividend discontinuities that conflict with TOTAL_RETURN_ADJUSTED; point-in-time availability still requires an external audit.
  1. Transform only with provenance: Use apply_split_adjustment for a documented split ratio and index convention. It adjusts prices before the split by dividing by the ratio and volumes by multiplying by the ratio, without lossy rounding.
  2. Validate the universe: Run validate_universe_consistency and reject mixed declared series modes or incompatible detected types before calculating cross-asset signals.
  3. Persist evidence: Store raw data identifiers, action records, series mode, factor source/version, as-of timestamp, tolerance settings, audit report, and transformation parameters.

Common Pitfalls

  • Close-to-close substitution: Using a close value while labeling it next_open can miss overnight gaps and misclassify actions.
  • Dividend semantic collapse: Cash dividends, split-adjusted prices, and total-return prices answer different research questions.
  • Ratio convention mismatch: A 2.0 split means two post-split shares per old share; a 0.5 reverse split doubles historical prices under backward adjustment.
  • Lossy rounding: Rounding every adjusted bar to four decimals can accumulate tracking error in long histories and volume-weighted calculations.
  • Multiple same-day actions: A split and dividend can share an ex-date. Testing the jump against either action alone is wrong — the factors multiply, so a 2-for-1 split plus a $10 dividend on a $100 close expects 0.5 * 0.9 = 0.45, not 0.5. Same-date cash dividends are summed before the cash factor is formed.
  • Tolerance conflation: A loose volume tolerance applied to the price ratio silently explains away real data errors. At a 25% price tolerance a 42% overnight crash "matches" a 2-for-1 split; keep the price tolerance tight and reconcile against vendor factors rather than widening it.
  • False provenance: No detected jump does not prove a series is adjusted, correctly adjusted, or point-in-time safe.

Verification

Run the focused tests:

python -m unittest discover -s skills/adjusted-vs-unadjusted-price-series-pitfalls/scripts

The tests cover split and dividend semantics, close/open detection and boundary provenance, composite same-ex-date factors, price-match tolerance behavior, total-return risk, no-jump ambiguity, provenance inference limits, forward and reverse splits, precision, ISO date canonicalization, invalid inputs, and universe-mode consistency. Production sign-off additionally requires replaying vendor factors and comparing raw versus transformed price, volume, dividend, and total-return ledgers.

Related Skills

  • backtest-determinism-and-reproducibility
  • corporate-action-adjusted-backtesting

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.