agentsclimarketplace

Code review finance

Skill LisonEvf/finance-skills/skills/development/code-review-finance

Reviews code with awareness of financial domain pitfalls: lookahead bias, data leakage, proper decimal handling, survivorship bias, overfitting, and correct backtesting methodology. Trigger when the user requests code review of trading or financial code.From its SKILL.md

Install
npx -y skills add LisonEvf/finance-skills --skill code-review-finance

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

2.2 KB, as published. Nobody here has run it

Code Review (Finance-Aware)

Reviews code for financial-domain-specific correctness issues beyond general code quality.

Real Code Reference

  • tradinglearn/strategies/macd_strategy.py — generate_signals() uses .shift() to prevent lookahead; verify this is correct
  • tradinglearn/backtest/backtester.py — run_backtest() iterates bars sequentially; verify order
  • tradinglearn/pytdx2/backtest.py — BacktestEngine has its own execution loop; check for data leakage between train/test

What to Check

  • Lookahead bias: verify no future data used in signal calculation (.shift(1) is correct, raw access is suspicious)
  • Data leakage: train/test split must be temporal, not random — data[:split_date] train, data[split_date:] test
  • Decimal handling: prices in cents vs yuan — K-line returns /1000, quotes return /100
  • Survivorship bias: delisted stocks must be in historical universes
  • Overfitting: parameter count vs data points ratio, out-of-sample validation
  • Transaction costs: commission rate, slippage assumptions must be realistic
  • Bid/ask spread: execution at mid-price is unrealistic for illiquid stocks
  • Dividend handling: total return should include dividends

Review Process

  1. Read strategy logic, understand the core idea
  2. Trace data flow from raw prices → indicators → signals → trades
  3. Check temporal integrity — no peeking into future at any step
  4. Verify metric formulas against standard definitions
  5. Assess overfitting risk from parameter count and search space
  6. Report findings: critical / warning / suggestion

Keep looking

Skills are one crate of 609,689. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.