howard-lynn-ye
- 103 skills
- 0 followers
- 17 hours ago last updated
- ▌ Lib Arch · howard-lynn-yeThe reference GARCH implementation in Python, and the home of SPA/StepM/MCS - which all take LOSSES, so passing returns silently inverts the test and names your worst strategy as the best. TRIGGER - arch, arch_model, arch.bootstrap, arch.univariate, SPA, RealityCheck, StepM, MCS, optimal_block_length, StationaryBootstrap, superior_models, spa.pvalues, mcs.included, arch.unitroot, GARCH, EGARCH, GJR-GARCH, TARCH, APARCH, FIGARCH, HARCH, HAR-RV, skewt, conditional_volatility, or a GARCH fit emitting convergence warnings. Memory is stale on licence and version - it is 8.0.0 (2025-10-21) under NCSA, not one of the three usual permissive licences. SKIP for PSR and DSR (backtest-validation), for PBO and CPCV (lib-purgedcv) and for reporting Sharpe (lib-quantstats). SKIP for choosing between libraries, or when no library is named - the domain skill's job.
- ▌ Lib Ccxt · howard-lynn-yeThe unified MIT client for 100+ crypto venues - and not a backtester, with an OHLCV endpoint that silently truncates and returns an unclosed final bar. TRIGGER - import ccxt, import ccxt.pro, import ccxt.async_support, pip install ccxt, fetch_ohlcv, fetchOHLCV, load_markets, fetch_markets, create_order, watchOrderBook, watchTicker, watchMyTrades, set_sandbox_mode, enableRateLimit, amount_to_precision, price_to_precision, exchange.has, options defaultType, parse8601, implicit methods like fapiPrivateGetPositionRisk, CCXT Pro subscription expiry, funding rate history; an order rejected on precision or min-notional, fewer candles returned than requested. Memory is stale here: CCXT Pro was merged into the free MIT package at v1.95, prediction markets landed at 4.5.66, and 4.5.77 shipped 2026-09-01. SKIP for equity and futures brokers (broker-execution-apis). SKIP when the question is WHICH library to choose, or names no library at all - both belong to the domain skill.
- ▌ Lib Qlib · howard-lynn-yeMicrosoft Qlib (pip name pyqlib, imported as qlib) ships Alpha158/Alpha360 and a default normalizer that leaks your test set into training, silently. TRIGGER - qlib, pyqlib, "pip install pyqlib", qlib.init, provider_uri, REG_CN, Alpha158, Alpha360, DataHandlerLP, ZScoreNorm, CSZScoreNorm, fit_start_time, fit_end_time, qrun, workflow_config yaml, "qlib_data --region cn", LABEL0, "Ref($close, -2)", qlib expression engine, qlib .bin dataset, investment_data qlib_bin. Wheels are cp38-cp312 with no sdist so it fails outright on Python 3.13+, packaging lags the repo by about a year, and the official China dataset was switched off. SKIP for lib-alphalens, which is the skill for scoring a factor you already have. SKIP when the question is WHICH library to choose, or names no library at all - both belong to the domain skill.
- ▌ Lib Talib · howard-lynn-yeThe C reference implementation of technical indicators, where every pure-Python port disagrees during warm-up and none of them say so. TRIGGER - import talib, pip install TA-Lib, ta-lib-python, talib.RSI, talib.MACD, talib.ATR, talib.ADX, talib.BBANDS, talib.OBV, from talib import abstract, talib.get_functions, unstable period, indicator warm-up, an indicator differing between two libraries or between backtest and live; "Exception: input array type is not double", a failed ta-lib C build or missing ta_libc.h. Memory is stale here: the install pain is solved - 0.7.1 (2026-07-16) ships 54 prebuilt wheels bundling the C library, including cp311-win_amd64 - while pandas-ta's repo, homepage and release history are all gone. SKIP for whether a signal actually predicts returns (factor-and-timeseries-research) and for leak-free signal construction generally (signal-construction). SKIP for choosing between libraries, or when no library is named - the domain skill's job.
- ▌ Bet Sizing · howard-lynn-yeTurn a predicted probability into a position - the 2*Phi(z)-1 size curve, averaging concurrent bets instead of adding them, discretising to buy turnover, and the concurrency budget whose divisor is usually a look-ahead. TRIGGER - bet sizing, getSignal, get_signal, getBetSize, bet size from probability, avgActiveSignals, average active bets, discreteSignal, discrete signal, step size, position from predict_proba, "how big should this trade be", "my positions flip every bar", turnover from a probability, concurrent bets leverage, budgeting bets, Lopez de Prado chapter 10, AFML bet sizing. SKIP for the Kelly fraction and how large the book should be overall (position-sizing-kelly - it owns Kelly, do not repeat it), for the secondary model that produces the probability (meta-labeling), for volatility targeting and risk budgets (portfolio-and-risk), and for the execution schedule once the size is chosen (execution-algorithms).
- ▌ Fx Markets · howard-lynn-yeTrade and backtest FX correctly — quote conventions, pip sizing, and the carry that a spot-only backtest silently omits. TRIGGER - forex, FX, currency pair, EURUSD, USDJPY, GBPUSD, AUDUSD, USDCHF, USDCAD, NZDUSD; pip, pipette, lot sizing on a currency pair; carry trade, swap points, rollover, interest rate parity, covered or uncovered parity; NDF, forward points, T+2 value date; "there is no official FX close"; DukasCopy or free tick FX; forex-python or a similar package. SKIP for crypto pairs, which have funding rather than swap (crypto-data-and-execution), and for FX options and vol surfaces (derivatives-pricing).
- ▌ Lib Polars · howard-lynn-yeThe polars wheel is now an empty 865 KB py3-none-any shim hard-pinned to polars-runtime-32, so a lockfile listing only polars does not pin the engine. TRIGGER - polars, "import polars as pl", LazyFrame, scan_parquet, collect(), pl.col, join_asof, group_by, with_columns, polars-runtime-32, polars-runtime-64, polars-lts-cpu, polars 2.0.0rc1, "pip download polars", vendored or air-gapped polars install, polars wheel has no compiled code, porting pandas merge_asof to polars.join_asof, polars sortedness. The runtime split landed at 1.34.0b2 on 2025-09-26, so install matrices, wheel audits and lockfiles written from memory are wrong. SKIP for market-data-engineering, the skill for storage formats and time-series stores. SKIP when the question is WHICH library to choose, or names no library at all - both belong to the domain skill.
- ▌ Lib Vollib · howard-lynn-yeMachine-precision implied volatility with no bracketing, behind a package name restructured in 2026 - py_vollib is now a DEAD SHIM with four files and zero library code, and every pre-2026 tutorial installs it. TRIGGER - vollib, py_vollib, py_vollib_vectorized, lets_be_rational, "Let's Be Rational", Jaeckel, black_scholes, black_scholes_merton, implied_volatility, greeks.analytical, BelowIntrinsicException, AboveMaximumException, "py_vollib is deprecated", or implied volatility returning 0.0. Memory is stale on the package name, on the C++ dependency (it is now pure Python) and on the Greek scaling. SKIP for American exercise, exotics, curves or conventions (lib-quantlib). SKIP when the question is WHICH library to choose, or names no library at all - both belong to the domain skill.
- ▌ Lib Akshare · howard-lynn-yeakshare is the widest free Chinese-market scraper (1,103 public interfaces) and it purges its own PyPI history, so you cannot pin it. TRIGGER - akshare, "import akshare as ak", pip install akshare, stock_zh_a_hist, stock_zh_a_daily, index_stock_cons_csindex, stock_zt_pool_em, stock_zh_a_stop_em, adjust="qfq"/"hfq", 复权, 前复权, 后复权, 涨跌停, 东方财富, 新浪财经, A股数据, 沪深300成分股, "No matching distribution found for akshare==", akshare 报错, akshare 封 IP. akshare ships roughly 2.3 releases a week and deletes the old ones, so any signature, column name or version pin you remember is probably already gone. SKIP for lib-tushare, which is the skill for point-in-time fundamentals and dated index membership. SKIP when the question is WHICH library to choose, or names no library at all - both belong to the domain skill.
- ▌ Lib Fredapi · howard-lynn-yefredapi wraps FRED/ALFRED and is the primary anti-look-ahead tool in macro - and three of its four vintage methods are buggy in source. TRIGGER - fredapi, "from fredapi import Fred", Fred(api_key=), FRED_API_KEY, get_series, get_series_all_releases, get_series_as_of_date, get_series_first_release, get_series_vintage_dates, realtime_start, realtime_end, ALFRED, vintage, data revision, revised GDP, CPI or payrolls, Philadelphia Fed Real-Time Data Set, full-fred, DBnomics, "Bad Request. The value for variable api_key is not registered". Frozen at 0.5.2 since 2024-05, so these bugs are current behaviour, not history you remember from an old version. SKIP for lib-edgartools, which is the skill for company filings and fundamentals. SKIP when the question is WHICH library to choose, or names no library at all - both belong to the domain skill.
- ▌ Lib Skfolio · howard-lynn-yeThe sklearn-compatible portfolio estimator library whose CombinatorialPurgedCV breaks sklearn's own split() contract - it yields (train, [test_0, ...]), and normal two-variable unpacking mis-partitions your data without raising. TRIGGER - skfolio, skfolio.optimization, MeanRisk, RiskBudgeting, HierarchicalRiskParity, HierarchicalEqualRiskContribution, NestedClustersOptimization, skfolio.moments, DenoiseCovariance, GerberCovariance, ImpliedCovariance, EmpiricalPrior, EntropyPooling, VineCopula, CombinatorialPurgedCV, WalkForward, purged_size, embargo_size, RiskMeasure. Memory is stale and will break code - 1.0.0 landed 2026-08-23, so every recalled snippet predates the API stability commitment. SKIP for the widest risk-measure menu (lib-riskfolio) and for a strictly sklearn-compliant purged splitter (lib-purgedcv). SKIP for choosing between libraries, or when no library is named - the domain skill's job.
- ▌ Lib Tushare · howard-lynn-yetushare is the cheapest source of genuinely point-in-time A-share fundamentals, and it sends your token over plaintext HTTP. TRIGGER - tushare, tushare pro, "import tushare as ts", ts.pro_api, pro_bar, adj="qfq", stock_basic, list_status, daily_basic, adj_factor, income, balancesheet, f_ann_date, ann_date, update_flag, 报告期, 公告日, tushare token, 积分, waditu, api.waditu.com, "抱歉,您没有接口访问权限", tushare 权限不够. The public GitHub repo has been idle since 2024-03 while PyPI kept shipping through 2026, so recalled behaviour does not match the installed wheel. SKIP for lib-akshare, which is the skill for breadth of free Chinese coverage rather than PIT. SKIP when the question is WHICH library to choose, or names no library at all - both belong to the domain skill.
- ▌ Lib Ib Async · howard-lynn-yeThe maintained Interactive Brokers Python client - successor to the archived ib_insync - where one digit of the port number is all that separates paper from live. TRIGGER - import ib_async, from ib_async import IB, pip install ib_async, ib.connect, clientId, ports 7496 7497 4001 4002, TWS, IB Gateway, reqHistoricalData, reqMktData, reqTickersAsync, placeOrder, managedAccounts, reqPositions, reqOpenOrders, reqExecutions, Master Client ID, Read-Only API, orderRef, ibflex, ibapi, ib_insync; "Enable ActiveX and Socket Clients", pacing violations, error 1102, a DU or U account prefix. Memory is stale here: ib_insync was archived 2024-03-14 after its author died, ib_async 2.1.0 (2025-12-08) is the successor and does not wrap ibapi, its main branch has been static about nine months, and ib_fut does not exist. SKIP for non-IB brokers and for the general order-safety patterns (broker-execution-apis). SKIP for choosing between libraries, or when no library is named - the domain skill's job.
- ▌ Lib Purgedcv · howard-lynn-yeThe only genuinely sklearn-protocol-compliant purged and embargoed splitter, and the one that refuses to run until you state when each label resolved - understate evaluation_times and it silently reintroduces the leak while reporting clean folds. TRIGGER - purgedcv, PurgedKFold, PBO, CPCV, probability of backtest overfitting, CombinatorialPurgedCV, PurgedGroupKFold, WalkForwardSplit, prediction_times, evaluation_times, purge_horizon, embargo, audit_splitter, reconstruct_paths, path_metrics, overlapping labels, triple-barrier touch time, mlfinlab.cross_validation. Memory is stale or absent - this package first shipped 2026-05-16 and is at 0.1.6. SKIP for CPCV over portfolio models (lib-skfolio) and for SPA/StepM/MCS (lib-arch). SKIP when the question is WHICH library to choose, or names no library at all - both belong to the domain skill.
- ▌ Lib Quantlib · howard-lynn-yeThe only broadly-permissive, mature, full-coverage derivatives library in Python, whose global evaluationDate returns an NPV of exactly 0.0 with no warning once it is past expiry. TRIGGER - QuantLib, "import QuantLib as ql", QuantLib-SWIG, QuantLib-Python, Settings.instance(), evaluationDate, ql.Date, YieldTermStructureHandle, VanillaOption, AmericanExercise, QdFpAmericanEngine, FdBlackScholesVanillaEngine, BinomialVanillaEngine, BaroneAdesiWhaleyApproximationEngine, SABRInterpolation, SviSmileSection, thetaPerDay, "NPV is zero". Memory is stale on packaging and engine names - it is at 1.43 and ships 26 wheels but no sdist. SKIP for vanilla European IV and Greeks in pure Python (lib-vollib). SKIP for bond accrued and the 30/360 family (bond-conventions-and-accrued), for OIS versus projection discounting (ois-discounting-and-multi-curve), and for choosing between libraries or when no library is named - the domain skill's job.
- ▌ Lib Vectorbt · howard-lynn-yeVectorized Numba/Rust backtester built for parameter sweeps, whose from_signals fills at the signal's own bar close by default. TRIGGER - import vectorbt as vbt, pip install vectorbt, vbt.Portfolio.from_signals, from_orders, from_holding, ma_crossed_above, vbt.MA.run, vbt.IndicatorFactory, .vbt.signals.fshift, price=np.inf, reject_prob, allow_partial, stop_conflict_mode, cash_sharing, FlexArray, vectorbt[rust], VectorBT PRO, "this PRO example does not work"; a 10,000-combination grid, "my backtest looks too good", an equity curve that dies live. Memory is stale here: v1.0 (2026-04-22) was a breaking rewrite with an optional Rust engine, 1.1.0 shipped 2026-07-05, and the licence is Apache-2.0 plus Commons Clause - not OSI open source. SKIP for choosing among engines (backtesting-engines) and for judging a finished result (backtest-validation). SKIP when the question is WHICH library to choose, or names no library at all - both belong to the domain skill.
- ▌ Lib Yfinance · howard-lynn-yeThe default free Yahoo Finance downloader, whose yf.download() now returns pre-adjusted OHLC with no Adj Close column at all. TRIGGER - import yfinance as yf, pip install yfinance, yf.download, yf.Ticker, Ticker.history, auto_adjust, multi_level_index, ignore_tz, repair=True, get_shares_full, yf.Search, yf.Lookup, yf.WebSocket, yfinance-cache; errors "KeyError: 'Adj Close'", YFRateLimitError, "Too Many Requests. Rate limited", YFTickerMissingError, "possibly delisted", curl_cffi pin conflicts, one ticker returning MultiIndex columns. Memory is stale here: auto_adjust flipped at 0.2.51 and hardened at 1.0, intraday timezones changed at 1.4.0, the proxy= constructor kwarg is gone, and 1.7.0 shipped 2026-08-26. SKIP for choosing between data vendors (market-data-sourcing) and for A-share data (china-ashare-data). SKIP when the question is WHICH library to choose, or names no library at all - both belong to the domain skill.
- ▌ Etf Mechanics · howard-lynn-yeWhy an ETF's price series does not behave like the index it tracks - daily-reset leverage, NAV vs price, distributions, holdings files and fees. TRIGGER - "why is my 3x ETF down when the index is flat", TQQQ decay, SQQQ, leveraged ETF long term, inverse ETF, volatility drag, daily reset; premium to NAV, discount to NAV, iNAV, creation/redemption, "bond ETF trading below NAV"; ETF distribution, capital gains distribution, return of capital, "ETF dropped on the ex-date", phantom drop; ETF holdings file, constituents CSV, index reconstitution, Russell rebalance, "I used today's holdings for the backtest"; expense ratio drag, tracking difference vs tracking error, "ETF returned less than the index". SKIP for downloading price series and vendor adjustment defaults (market-data-sourcing) - holdings files stay here, for UNG, USO or VIXY roll yield and contango (futures-continuous-contracts), for auditing a finished backtest (research-integrity-guards), and for weights, Sharpe or drawdown (portfolio-and-risk).
- ▌ Factor Models · howard-lynn-ye bundleBuild long-short factor portfolios from a characteristic panel and test the alpha with standard errors that survive serial correlation. TRIGGER - factor model, Fama-French, Fama-MacBeth, cross-sectional regression, decile or quintile long-short sort, 2x3 sort, SMB and HML, value- weight vs equal-weight portfolio, characteristic panel, alpha t-stat, Newey-West, HAC standard errors, cov_type="HAC" maxlags, Ken French Data Library, F-F_Research_Data_Factors, book-to- market, 11-1 momentum; "my factor has a t-stat of 15", "should I lag the signal", "my HML does not match Ken French", "joining monthly factors to daily returns". SKIP for scoring one alpha signal with alphalens, IC decay or GARCH (factor-and-timeseries-research), for the covariance matrix a factor model implies (covariance-and-risk-models), for turning expected returns into weights (portfolio-optimizers), and for counting the specifications you tried (backtest-validation).
- ▌ Lib Alpaca Py · howard-lynn-yeAlpaca's current Python SDK, which defaults to the paper host but lets url_override silently send live orders from a client that believes it is in the sandbox. TRIGGER - import alpaca, pip install alpaca-py, TradingClient, StockHistoricalDataClient, CryptoHistoricalDataClient, submit_order, LimitOrderRequest, MarketOrderRequest, OrderSide, TimeInForce, client_order_id, url_override, paper=True, BaseURL.TRADING_PAPER, paper-api.alpaca.markets, bracket OCO OTO orders, trail_percent, IEX vs SIP feed, Algo Trader Plus, alpaca-trade-api, APCA_API_BASE_URL; an order rejected asynchronously for time-in-force or price precision. Memory is stale here: alpaca-trade-api was deprecated in 2024 and defaulted to LIVE, whereas alpaca-py 0.44.0 (2026-08-11) declares paper=True - the widely repeated warning is inverted. SKIP for Interactive Brokers and for the general order-safety patterns (broker-execution-apis). SKIP for choosing between libraries, or when no library is named - the domain skill's job.
- ▌ Lib Alphalens · howard-lynn-yealphalens-reloaded scores cross-sectional factors, and its forward return starts at date t's OWN price - it never lags your factor. TRIGGER - alphalens, alphalens-reloaded, "import alphalens as al", get_clean_factor_and_forward_returns, compute_forward_returns, factor_information_coefficient, mean_return_by_quantile, factor_returns, quantile_turnover, factor_rank_autocorrelation, create_full_tear_sheet, MaxLossExceededError, max_loss=0.35, cumulative_returns, information coefficient, IC decay, quantile spread, "pip install alphalens". The original quantopian package is dead at 0.4.0 (2020-04-27) and most snippets you recall target it or its removed pandas internals. SKIP for lib-qlib, which is the skill for the feature pipeline and model. SKIP when the question is WHICH library to choose, or names no library at all - both belong to the domain skill.
- ▌ Lib Freqtrade · howard-lynn-yefreqtrade is a live-first crypto bot with the best bias detectors in the field and a backtester that assumes zero slippage always. TRIGGER - freqtrade, "freqtrade backtesting", freqtrade trade/hyperopt/download-data, lookahead-analysis, recursive-analysis, startup_candle_count, IStrategy, populate_indicators, populate_entry_trend, populate_exit_trend, custom_stoploss, stoploss_on_exchange, minimal_roi, trailing_stop, VolumePairList, StaticPairList, dry_run, dry_run_wallet, config.json, user_data/strategies, FreqAI, freqtrade GPL. Monthly YYYY.M releases have renamed the strategy callbacks repeatedly, so remembered method names are usually the old ones. SKIP for backtesting-engines, the skill for equity and futures bar engines. SKIP when the question is WHICH library to choose, or names no library at all - both belong to the domain skill.
- ▌ Lib Riskfolio · howard-lynn-yeThe 26-risk-measure portfolio optimizer whose stateful API optimizes against stale or missing mu and Sigma - with no error - if you forget assets_stats(). TRIGGER - riskfolio, Riskfolio-Lib, "import riskfolio as rp", rp.Portfolio, rp.HCPortfolio, assets_stats, port.optimization, hcp.optimization, model="HRP"/"HERC"/"NCO", rm="CVaR"/"CDaR"/"EVaR"/"RLVaR"/"EDaR"/"RLDaR", denoiseCov, riskfolio.src.AuxFunctions, ParamsEstimation, entropy_pooling, OWA, MVSK, "solver did not converge". Memory is stale - it is at 7.3.0 (2026-05-31) with an unusual 18 open issues against 4,480 stars. SKIP for GridSearchCV over portfolio models (lib-skfolio) and for whole-share allocation (lib-pyportfolioopt). SKIP when the question is WHICH library to choose, or names no library at all - both belong to the domain skill.
- ▌ Meta Labeling · howard-lynn-yeA primary model picks the side, a secondary model trained on "was the primary right" decides whether to act - raising precision, lowering recall, and paying for itself in costs. The trap is training the secondary on rows the primary was fitted on. TRIGGER - meta-labeling, metalabeling, meta labels, secondary model, primary model side, get_events side_prediction, bin in {0,1}, "should I take this signal", precision vs recall trade-off in trading, F1 of a trading model, filter model, trade filter, "my model has high recall but loses money", "how do I improve a strategy without changing its signal", Lopez de Prado chapter 3 section 3.6, AFML meta-labeling. SKIP for producing the triple-barrier labels and the `side` argument itself (triple-barrier-labeling), for turning the secondary's probability into a position size (bet-sizing), for the Kelly fraction (position-sizing-kelly), for purged cross-validation of either model (lib-purgedcv), and for which features matter (feature-importance-financial).
- ▌ Lib Edgartools · howard-lynn-yeedgartools is the default free SEC EDGAR client - typed objects for 20+ form types, XBRL statements, no API key - and it 403s on every request until you call set_identity(). TRIGGER - edgartools, "from edgar import Company, set_identity", set_identity, Company("AAPL"), get_filings, filing.xbrl(), get_facts, get_financials, accession number, CIK, ticker-to-CIK, 10-K, 10-Q, 8-K, 13F, Forms 3/4/5, EDGAR full-text search, "HTTP 403" from sec.gov, SEC User-Agent required, SEC 10 requests per second, edgartools MCP server, edgartools[ai]. 442 releases have moved the API repeatedly and the classifier is still Beta, so any snippet recalled from memory is probably wrong for the installed version. SKIP for lib-fredapi, which is the skill for macro series and revisions. SKIP when the question is WHICH library to choose, or names no library at all - both belong to the domain skill.
- ▌ Lib Quantstats · howard-lynn-yeThe tearsheet library whose cagr(rf=...) accepts your risk-free rate and silently discards it - "cagr" sits on an exclusion list inside _prepare_returns, which dispatches on the caller's function name. TRIGGER - quantstats, "import quantstats as qs", qs.reports.html, qs.stats.sharpe, qs.stats.cagr, qs.stats.value_at_risk, expected_shortfall, gain_to_pain_ratio, rolling_volatility, qs.extend_pandas, tearsheet, quantstats-lumi; or a wildly negative Sharpe. Memory is stale on status and correctness - 0.0.81 shipped in a single-day hotfix burst on 2026-01-13 with no default-branch commits since, and the cagr bug survived it. SKIP for optimizing against these measures (lib-riskfolio, lib-skfolio) and for PSR/DSR, which it does not have (backtest-validation). SKIP when the question is WHICH library to choose, or names no library at all - both belong to the domain skill.
- ▌ Us Market Rules · howard-lynn-yeUS trading rules that decide whether a strategy is executable at all - short-sale restrictions, margin, settlement, day-trading limits, and what a data licence lets you keep. TRIGGER - can I short this, locate, hard to borrow, borrow fee, short interest, Reg SHO, uptick rule, SSR, short sale restricted; PDT, pattern day trader, day trade limit; Reg T, initial or maintenance margin, margin call, buying power, leverage limit; T+1, settlement, cash account; "can I redistribute this data"; may_cache, may_redistribute, market data licence; presenting or publishing backtested performance, Marketing Rule. Two of the most-cited rules moved in 2024-2026, so a training-prior answer is usually stale. US ONLY - SKIP for short-selling bans or calendars in Asia (asia-pacific-markets), for A-share T+1 and price limits (china-trading-stack) for the order-safety mechanics of sending an order (broker-execution-apis), and for tax arithmetic - wash sales, lot matching, after-tax returns - which the fin-tax-accounting skills own.
- ▌ Wash Sale Rules · howard-lynn-yeA wash sale defers a loss into the replacement's basis rather than destroying it, and a monthly-rebalanced strategy triggers one on almost every trade. TRIGGER - wash sale, wash sales, IRC 1091, section 1091, 30 day rule, 61 day window, substantially identical, disallowed loss, loss disallowed, basis adjustment, replacement shares, tax loss harvesting, harvesting rules, buy back within 30 days, "can I sell and rebuy", Form 8949 code W, 1099-B box 1g, wash sale in an IRA, Rev. Rul. 2008-5, holding period carryover, "my backtest books every loss", after-tax turnover penalty. Modelling assumptions for backtests, not tax advice. SKIP for choosing which lot to sell in the first place (tax-lot-matching-and-cost-basis), for futures and broad-based index options where the rule does not apply (section-1256-and-derivatives-tax), for wiring it into a backtest and reporting an after-tax Sharpe (after-tax-backtesting), and for the A-share tax code (china-ashare-trading-taxes).
- ▌ Hawkes Processes · howard-lynn-yeFit and test a self-exciting point process for clustered order arrivals - exponential-kernel Hawkes intensity, Ogata thinning, maximum likelihood, the branching ratio, and the random time change that tests the fit. TRIGGER - Hawkes process, self-exciting point process, order arrival clustering, trade clustering, order flow clustering, mutually exciting, branching ratio, alpha over beta, criticality, endogeneity of market activity; Ogata thinning, simulate a point process, tick, hawkeslib, conditional intensity; Hawkes MLE, log-likelihood recursion, random time change, residual analysis, "are my arrivals Poisson", overdispersed counts, Fano factor, "my Poisson confidence interval is too narrow". SKIP for the birth-death queue model of a single price level (limit-order-book-models), for measuring realised activity from a tape (intraday-microstructure), for GARCH and volatility clustering in returns rather than arrivals (volatility-models), and for regime switching (regime-detection).
- ▌ Regime Detection · howard-lynn-yeDetect and label market regimes without letting the labels see the future, and state regime coverage in the form the result gate demands. TRIGGER - detect market regimes, regime detection, bull bear regime labels, volatility regime, high-vol low-vol state, risk-on risk-off; hidden markov model on returns, HMM, hmmlearn, markov switching, MarkovRegression, smoothed vs filtered probabilities; change point detection, ruptures, structural break; turbulence index, Mahalanobis distance; "my strategy only works in one regime", "does it survive 2008 or 2020"; "result_manifest says no regime coverage", regimes_covered. SKIP for forecasting volatility itself with GARCH or arch (volatility-models), for whether a regime-conditional result survives the trials behind it (backtest-validation), for the full pre-report audit (research-integrity-guards), and for RL or deep-learning state models (rl-and-ml-trading).
- ▌ China Ashare Data · howard-lynn-ye bundleGet China A-share and Greater China market data without the ecosystem's silent traps. TRIGGER - A股, 沪深, 北交所, 科创板, 创业板; akshare, tushare, baostock, efinance, adata, qstock, mootdx, easyquotation, jqdatasdk, 聚宽, rqdatac, 米筐, Wind, 万得, Choice, 东方财富; 复权, qfq, hfq, 前复权, 后复权; ST, 退市, delisted A-share tickers, 退市股票列表; 停牌 suspension; 公告日 versus 报告期; CSI300, HS300, 中证 index membership. Three popular libraries default to forward-adjusted prices, which are rewritten retroactively and are therefore look-ahead contaminated. SKIP for backtesting or trading A-shares (china-trading-stack) and for Hong Kong, Taiwan, Japan or Korea (asia-pacific-markets).
- ▌ Rl And Ml Trading · howard-lynn-yeReinforcement learning and deep learning for trading: what installs, and what the evidence says. TRIGGER - reinforcement learning, RL agent, trading gym, custom trading environment, reward function, PPO or DQN for trading; FinRL, FinRL-Meta, ElegantRL, stable-baselines3, gymnasium, gym, gym-anytrading, TensorTrade; LSTM, GRU, TCN or Transformer for return prediction; "does deep learning beat a linear model"; FinRL or gym failing to import with ModuleNotFoundError. FinRL's published wheel declares no dependencies and cannot import, and linear models beat deep ones in the published return-prediction comparisons. SKIP for LLM agents specifically (llm-finance-agents).
- ▌ Structural Breaks · howard-lynn-yeSample events with the symmetric CUSUM filter instead of on a clock, and test for explosive behaviour with SADF instead of one full-sample ADF that has no power against a bubble in part of the sample. TRIGGER - CUSUM filter, cusum_filter, symmetric CUSUM, event-based sampling, t_events, event sampling for labels, SADF, supremum ADF, sup ADF, get_sadf, BSADF, backward SADF, Phillips-Shi-Yu, explosiveness test, bubble detection, structural break test, Chow test, "how do I pick the bars to label", "my ADF says nothing but the chart is obviously a bubble", "when did the regime change", Lopez de Prado chapter 17, AFML structural breaks. SKIP for labelling the events once they are sampled (triple-barrier-labeling), for making a feature stationary (fractional-differentiation), for the cointegration ADF table (stat-arb-cointegration), for hidden-state / volatility regime labels (regime-detection), and for unit-root and ARIMA selection generally (time-series-forecasting-models).
- ▌ Volatility Models · howard-lynn-yeFit and forecast volatility - GARCH, range-based realized variance, HAR-RV - without the two errors that silently move the answer: the units `arch` expects, and a range estimator used on bars that gap. TRIGGER - GARCH, GARCH(1,1), EGARCH, GJR-GARCH, arch_model, conditional_volatility, DataScaleWarning, "y is poorly scaled", rescale=True, res.scale, alpha + beta near 1, IGARCH, persistence; realized volatility, realized variance, Parkinson, Garman-Klass, Rogers-Satchell, Yang-Zhang, close-to-close, high-low volatility estimator; HAR-RV, Corsi; "my GARCH forecast says 1200% annualised vol", "which volatility estimator should I use", vol targeting input. SKIP for the arch package's API and its SPA/StepM/MCS bootstrap (lib-arch), for choosing a forecasting library (factor-and-timeseries-research), for discrete high-vol/low-vol state labels (regime-detection), for implied volatility (derivatives-pricing), and for turning a vol forecast into position size (portfolio-and-risk).
- ▌ Credit Risk Models · howard-lynn-yeEstimate a default probability and price credit, and keep the two probabilities apart - the risk-neutral one that prices and the physical one that forecasts. TRIGGER - Merton model, structural credit model, KMV, distance to default, asset value and asset volatility from equity, N(-d2), solve the two Merton equations; hazard rate, intensity, reduced form, survival probability, constant hazard, credit curve bootstrapping; CDS par spread, premium leg, protection leg, risky PV01, RPV01, accrual on default, "spread = lambda times one minus recovery", implied hazard from a CDS spread, recovery assumption, 40% recovery; risk-neutral vs physical default probability, rating agency default table, "my CDS spread is too low", credit spread from a bond price, expected loss, CVA default probability. SKIP for option pricing and Greeks (option-pricing-models, derivatives-pricing), for interest-rate curves and short-rate models (term-structure-models), and for portfolio risk and VaR (portfolio-and-risk).
- ▌ Lib Backtesting Py · howard-lynn-yeSingle-asset bar-loop backtester with honest next-open fills, an AGPL-3.0 licence, and an indicator API that computes over the entire series before slicing. TRIGGER - from backtesting import Backtest, Strategy; pip install backtesting, bt = Backtest(df, MyStrategy), bt.run(), bt.optimize(), self.I(), self.buy(), self.sell(), self.data.Close, trade_on_close, exclusive_orders, finalize_trades, commission, spread, backtesting.lib crossover, _OutOfMoneyError, "kernc"; wanting a portfolio, a universe or a second instrument inside it. Memory is stale here: it is alive at 0.6.6 (2026-07-22), it is AGPL-3.0-or-later rather than MIT, and trade_on_close fills at data.Close[-2] rather than the current bar's close. SKIP for multi-asset or cross-sectional work and for engine choice generally (backtesting-engines). SKIP when the question is WHICH library to choose, or names no library at all - both belong to the domain skill.
- ▌ Lib Pyportfolioopt · howard-lynn-yeTextbook mean-variance and Black-Litterman optimizer whose HRPOpt silently accepts a price matrix where it requires returns and returns plausible garbage. TRIGGER - pypfopt, PyPortfolioOpt, EfficientFrontier, HRPOpt, CovarianceShrinkage, DiscreteAllocation, BlackLittermanModel, EfficientCVaR, EfficientSemivariance, CLA, mean_historical_return, capm_return, clean_weights, max_sharpe, min_volatility, portfolio_performance, risk_models.risk_matrix, "efficient frontier", "whole-share allocation". Memory is stale - the repo moved to the PyPortfolio org and 1.6.0 shipped 2026-02-26 after three dormant years under a new maintainer. SKIP for Marcenko-Pastur denoising, HERC or NCO (lib-riskfolio) and for GridSearchCV over portfolio models (lib-skfolio). SKIP for choosing between libraries, or when no library is named - the domain skill's job.
- ▌ LLM Finance Agents · howard-lynn-ye bundleWhat the published evidence says about LLM trading agents, and the real status of the frameworks. TRIGGER - TradingAgents, FinGPT, FinRobot, FinMem, FinCON, FinAgent, AlphaAgent, RD-Agent, AI4Finance; evaluating an LLM-driven trading system, a multi-agent trader, or a news-sentiment-to-signal pipeline; "does AI trading work"; FinBERT and financial sentiment models; reproducing a Sharpe from an LLM-trading paper; whether a backtest window overlaps a model's training cutoff. No credible evidence exists that any of it produces alpha net of costs. SKIP for how the systems are built and how to stage the pipeline (finance-agent-architectures), for reinforcement learning and deep learning specifically (rl-and-ml-trading), and for MCP servers (finance-mcp-servers).
- ▌ Portfolio And Risk · howard-lynn-ye bundleTurn signals into weights, and compute performance metrics that are actually correct. TRIGGER - portfolio weights, allocation, rebalancing, mean-variance, Black-Litterman, risk parity, HRP, HERC, NCO, efficient frontier, covariance shrinkage or denoising, PyPortfolioOpt, riskfolio, skfolio, cvxportfolio; or computing Sharpe, Sortino, Calmar, CAGR, annualized volatility, max drawdown, VaR, CVaR, beta, alpha, a tearsheet, quantstats, pyfolio, empyrical, ffn, or performance attribution. Load before quoting any performance number: popular libraries disagree on identical input, one silently discards the risk-free rate you pass it, and an absurdly negative Sharpe has one known cause. SKIP for the optimizer's own mathematics and what it does to estimation error (portfolio-optimizers), and for whether the result survives multiple testing (backtest-validation).
- ▌ Quant Stack Router · howard-lynn-yeEntry router for Python quantitative finance: names the right library and flags where the model's training prior is stale. TRIGGER - read this FIRST when a quant task names no specific sub-domain, when asked "which library should I use" for anything financial, or when a plan spans several of data, backtest, risk and execution. Also read it before importing any finance package whose status you are assuming from memory - several widely used ones are dead, relicensed, or have flipped a default since training. SKIP when the task already names its own domain - go straight to market-data-sourcing, backtesting-engines, broker-execution-apis, portfolio-and-risk, factor-and-timeseries-research, china-ashare-data or crypto-data-and-execution rather than routing through here.
- ▌ Backtest Validation · howard-lynn-ye bundleDecide whether a result survives the number of things you tried. TRIGGER - "I tried N strategies or parameters and the best one..."; overfitting, p-hacking, data snooping, multiple testing, "is this result real", "is this statistically significant"; deflated Sharpe, DSR, PSR, probability of backtest overfitting, PBO; purged or combinatorial cross-validation, embargo, walk-forward, "cross validation on time series without leaking"; a grid search, hyperopt or AutoML picked a winner; triple-barrier labeling, meta-labeling, fractional differentiation, mlfinlab. Load whenever a Sharpe ratio is about to be offered as evidence for trading. SKIP only for plain performance metrics - Sharpe, Sortino, CAGR, drawdown (portfolio-and-risk); the deflated and probabilistic Sharpe ratios are computed HERE.
- ▌ Backtesting Engines · howard-lynn-ye bundleChoose a backtesting engine and know what it silently models wrong. TRIGGER - "backtest this", backtest a crossover or a moving-average strategy, simulate a strategy, walk-forward, parameter sweep, "test this trading idea"; comparing or choosing backtest frameworks; vectorbt, backtesting.py, backtrader, zipline, PyBroker, bt, nautilus_trader, LEAN, freqtrade, jesse; how an engine models fills, slippage, commissions; what slippage to assume, partial fills, margin, shorting or delistings; taking a strategy from backtest to live; "my backtest looks too good"; "works in backtest but loses money live". Several popular engines fill at the signal's own bar close by default. SKIP for judging whether a finished result is real (backtest-validation) for A-share rules (china-trading-stack), for crypto funding and perpetuals (crypto-data-and-execution), for options, which need assignment and settlement no engine here models (options-backtesting), and for measuring fills you already have (execution-cost-analysis).
- ▌ China Trading Stack · howard-lynn-ye bundleBacktest and execute Chinese-market strategies under the rules a Western engine gets wrong. TRIGGER - T+1 settlement, 涨跌停 price limits, 印花税 stamp duty, 夜盘 night session, 集合竞价, the lunch break, 240 minute bars; vnpy, CTP, QMT, miniQMT, easytrader, tqsdk, 天勤, RQAlpha, wondertrader, 掘金; Microsoft Qlib's China dataset; backtesting or live-trading A-shares, Chinese futures, options or convertible bonds; porting a US strategy to China. SKIP for sourcing the data itself (china-ashare-data).
- ▌ Derivatives Pricing · howard-lynn-ye bundleChoose a derivatives pricing library and get its Greek units and conventions right. TRIGGER - option pricing, implied volatility, IV, Greeks, delta, gamma, vega, theta, rho; which pricing library, exotics coverage; QuantLib, vollib, py_vollib, financepy, rateslib, optionlab; option chains. Greek scaling differs by 100x and 365x between the three common libraries, and one popular fixed-income package is not open source. SKIP for option lifecycle events - assignment, pin risk, expiry - live or backtested, and for historical option chains and vendors (options-backtesting). SKIP for the models themselves - implementing one (option-pricing-models), fitting a smile (implied-vol-surface), building a curve (term-structure-models), bond accrued and the 30/360 family (bond-conventions-and-accrued), duration and DV01 (duration-convexity-and-dv01), and projection-versus-discount choice on a swap (ois-discounting-and-multi-curve).
- ▌ Fin Skills As Tools · howard-lynn-yeHow to hand this library to an agent as TOOLS rather than as reading - the MCP server, the exported Anthropic and OpenAI tool definitions, the JSON payload conventions, and the four guards that cannot cross a JSON boundary. TRIGGER - expose fin-skills to an LLM agent; run the fin-skills MCP server; "python -m fin_skills.mcp"; fin-skills-mcp; import the guards as function-calling tools; generate tool schemas for the Messages API or the OpenAI Responses API; send a pandas Series or DataFrame through a tool call; check_backtest, bundle_coverage, describe_guard, read_skill; why assert_causal or warmup_probe is missing from the tool list; payload size limits for a tool call; 把 guard 挂成 agent 工具. SKIP for how to design the agent pipeline itself (finance-agent-architectures), which third-party finance MCP servers exist and which can move money (finance-mcp-servers), and whether an LLM strategy makes money at all (llm-finance-agents).
- ▌ Finance MCP Servers · howard-lynn-yePick a finance MCP server, and know its licence and blast radius before connecting it. TRIGGER - an MCP server for market data, filings, macro data, brokerage or trading; adding, choosing, comparing or debugging a finance MCP; Alpaca MCP, Alpha Vantage MCP, Polygon or Massive MCP, OpenBB MCP, SEC EDGAR MCP, FRED MCP, yfinance MCP, QuantConnect MCP; "which finance MCP should I install"; granting an MCP server the ability to place orders. Several are AGPL-3.0, one places real trades, and the most-starred one is over a year stale. SKIP for the Python libraries behind them (market-data-sourcing).
- ▌ Implied Vol Surface · howard-lynn-yeBuild a volatility surface that is not silently arbitrageable - invert prices to implied vols, fit a smile, check butterfly and calendar arbitrage, and interpolate between maturities. TRIGGER - implied volatility solver, Newton diverges, bisection bracket, "implied vol returns 0.001", "no implied volatility for this option", price below intrinsic, BelowIntrinsicException; SVI, raw SVI, Gatheral, svi calibration, a b rho m sigma, SviSmileSection; volatility smile, skew, surface fitting, total variance, log-moneyness; butterfly arbitrage, negative implied density, Durrleman g(k), calendar spread arbitrage, static arbitrage check, Gatheral and Jacquier 2014; interpolating the vol surface, "my interpolated surface has arbitrage", "vol interpolation between expiries". SKIP for pricing one option and the models themselves - Heston, CRR, SABR, Monte Carlo (option-pricing-models), for library choice, Greek units and licences (derivatives-pricing), and for option chain data and historical chains (options-backtesting).
- ▌ Lib Nautilus Trader · howard-lynn-yeEvent-driven Rust-core engine with the strongest execution modelling in open source, gated to Python 3.12-3.14, where a wrong ts_init silently makes every bar visible one interval early. TRIGGER - import nautilus_trader, pip install nautilus_trader, BacktestEngine, BacktestNode, TradingNode, Strategy.on_bar, ts_init, ts_event, FillModel, prob_fill_on_limit, prob_slippage, LatencyModel, base_latency_nanos, RiskEngine, OmsType NETTING HEDGING, BookType.L1_MBP, bar_execution, bar_adaptive_high_low_ordering, high-precision build, ClientOrderId; "could not find a version that satisfies nautilus_trader", a Rust source build on an Intel Mac or Alpine. Memory is stale here: 1.231.0 shipped 2026-08-02, a 2.0 line is in release candidates that moves the fill model to nautilus_trader.execution, and the licence is LGPL-3.0-or-later. SKIP for choosing among engines generally (backtesting-engines). SKIP when the question is WHICH library to choose, or names no library at all - both belong to the domain skill.
- ▌ Monte Carlo Methods · howard-lynn-yeMake a Monte Carlo converge to the RIGHT number - variance reduction with measured factors, Longstaff-Schwartz for American options, scrambled-Sobol QMC, and the discretisation bias a standard error cannot see. TRIGGER - variance reduction, antithetic variates, control variate, stratified sampling, importance sampling, "how many paths do I need", standard error of a Monte Carlo price; Longstaff-Schwartz, LSM, least-squares Monte Carlo, American option by simulation, regression on in-the-money paths, continuation value; quasi-Monte Carlo, QMC, Sobol, scipy.stats.qmc, scrambling, low discrepancy, "power of 2" warning; discretely monitored barrier, continuity correction, "my error bar is tiny but the price is wrong", "more paths did not help". SKIP for the model itself - Heston, SABR, trees, Euler bias on a GBM (option-pricing-models), for VaR and expected shortfall from simulated portfolios (risk-measures-var-cvar), and for the dependence structure you simulate from (copulas-and-dependence).
- ▌ Options Backtesting · howard-lynn-ye bundleOptions positions end in ways you do not control - live or in a backtest: assignment, expiry settlement, pin risk, multi-leg lifecycle, historical chain assembly, and the margin that decides whether the position fits. TRIGGER - backtest a covered call, cash-secured put, wheel, credit spread, iron condor, butterfly, calendar, diagonal, straddle, strangle, PMCC; short option assigned, early exercise, exercise by exception, expires in the money, pin risk, pinned at the strike; historical option chain, options history, chain panel, OSI symbol, adjusted option, non-standard deliverable; 0DTE, weeklies, third Friday, AM vs PM settlement, cash settled index options; option margin, naked margin requirement, portfolio margin, SPAN, buying power reduction; "my options backtest returns look too good"; optopsy, optionlab, an options backtesting library. SKIP for pricing a single option or fitting a vol surface (derivatives-pricing) and for futures rolls (futures-continuous-contracts).
- ▌ Signal Construction · howard-lynn-ye bundleCompute technical indicators and engineered features without leaking the future. TRIGGER - RSI, MACD, moving average, Bollinger, ATR, ADX, Ichimoku, PSAR, stochastic or any named technical indicator; TA-Lib, pandas-ta, pandas-ta-classic, ta, talipp, finta; choosing an indicator library or reconciling two that disagree; "does this indicator repaint"; warm-up, unstable period, or an indicator differing between backtest and live; zigzag, fractals, swing highs. SKIP for judging whether a finished signal predicts returns (factor-and-timeseries-research) and for the backtest that consumes it (backtesting-engines).
- ▌ Asia Pacific Markets · howard-lynn-yeData and trading for Asia-Pacific outside mainland China. TRIGGER - Hong Kong, HKEX, 港股, Stock Connect, VCM, per-stock lot sizes; Taiwan, TWSE, 台股, shioaji, FinMind, twstock; Japan, TSE, JPX, J-Quants, jquants-api-client, the 2022 TSE restructuring; Korea, KRX, KOSPI, KOSDAQ, pykrx, FinanceDataReader, CSAT, Korean short-selling ban dates, Korean delisted-stock lists; India, NSE, BSE, kiteconnect, Zerodha, Upstox, STT, Muhurat; Singapore SGX, Australia ASX; futu-api, tigeropen. Also documents four verified exchange_calendars defects that affect US work too. SKIP for mainland A-shares (china-ashare-data, china-trading-stack).
- ▌ Execution Algorithms · howard-lynn-yeBuild the schedule that works an order - VWAP, TWAP, POV, Almgren-Chriss - and know what each one is optimizing. TRIGGER - VWAP algo, TWAP algo, POV, percentage of volume, participation rate, child order slicing, execution schedule, order scheduling, "how should I work this order", intraday volume profile, U-shaped volume curve; Almgren-Chriss, optimal execution, optimal liquidation, trading trajectory, efficient frontier of execution, risk aversion lambda, trade half-life, kappa, market impact model, temporary vs permanent impact, square root law; implementation shortfall, Perold, arrival price, decision price, delay cost, opportunity cost, unfilled shares. SKIP for measuring fills you already have and choosing a benchmark after the fact (execution-cost-analysis), for spreads, trade classification and order-flow measures (intraday-microstructure), for quoting rather than taking (market-making-models), and for broker order types and routing (broker-execution-apis).
- ▌ External Skill Index · howard-lynn-yeA verified index of every public finance Agent Skill repository — 139 repos, 4,851 SKILL.md files — so you can find what already exists instead of rebuilding it, and avoid the third that is legally unusable. TRIGGER - looking for an existing skill, plugin or marketplace for anything financial; "is there already a skill for X"; choosing between competing finance skill packs; before writing a new finance skill; checking whether a skill repo's licence permits use; or asked what the Claude/agent finance skill ecosystem contains. Also load before recommending any third-party finance skill repository, because 44 of the 139 declare no usable licence and 12 advertise skills while shipping none.
- ▌ Market Data Sourcing · howard-lynn-ye bundleChoose a market price or reference data vendor and use it without silently corrupting the numbers. TRIGGER - download, fetch, pull or load OHLCV, prices, quotes, bars or a ticker universe; compare vendors on cost, coverage or free-tier limits; need delisted US or global tickers, or a survivorship-free universe; two sources disagree; hitting 429 or rate limits; "KeyError: Adj Close"; split and dividend adjustment; trading calendars and holidays. Covers yfinance, yahooquery, defeatbeta, EODHD, Tiingo, Twelve Data, Finnhub, Alpha Vantage, Polygon/Massive, Databento, openbb, findatapy, financetoolkit, exchange_calendars, and alternative data. Also covers 美股 and global 行情数据 requests. SKIP for historical option chains (options-backtesting), Asian calendars and lot sizes (asia-pacific-markets), storing, partitioning or as-of joining data you already hold (market-data-engineering); for EDGAR filings, XBRL, CIK and macro vintages (fundamental-and-macro-data); and for A-share, 沪深 or 退市 queries (china-ashare-data).
- ▌ Market Making Models · howard-lynn-yeQuote a two-sided market and survive the inventory - Avellaneda-Stoikov reservation price and optimal spread, and the adverse selection the model does not price. TRIGGER - Avellaneda Stoikov, market making model, optimal market making, reservation price, indifference price, inventory skew, optimal bid ask spread, quoting strategy, "how wide should I quote", skew my quotes, inventory risk, gamma risk aversion market maker; order arrival intensity, A exp(-k delta), Poisson fill model, fill probability vs distance from mid; adverse selection, informed flow, toxic flow, getting picked off, Glosten-Milgrom, order flow toxicity, VPIN. SKIP for measuring realized and effective spreads from your own tape (intraday-microstructure), for working a parent order by taking liquidity (execution-algorithms), for what a fill cost you after the fact (execution-cost-analysis), and for exchange connectivity and order types (broker-execution-apis).
- ▌ Portfolio Optimizers · howard-lynn-yeTurn expected returns and a covariance matrix into weights, and measure what the optimizer did to your estimation error on the way. TRIGGER - portfolio optimization, mean-variance, Markowitz, efficient frontier, tangency or max-Sharpe portfolio, minimum-variance portfolio, long-only and budget constraints, scipy SLSQP or linprog for weights, Black-Litterman, BlackLittermanModel, tau, Omega, market-implied prior, views matrix P and Q, risk parity, equal risk contribution, ERC, inverse volatility, minimum CVaR, Rockafellar-Uryasev linear program, 1/N benchmark, DeMiguel Garlappi Uppal, weight turnover; "my optimizer puts 90% in one asset", "the weights change completely every month". SKIP for choosing between optimizer libraries and reporting the result (portfolio-and-risk), for the covariance matrix and its N > T failure (covariance-and-risk-models), for expected returns (factor-models), for VaR and ES (risk-measures-var-cvar), and for HRP and PyPortfolioOpt's API traps (lib-pyportfolioopt).
- ▌ After Tax Backtesting · howard-lynn-yeAttach lot matching, wash sales and section 1256 to an existing backtest and report after-tax Sharpe beside pre-tax - and refuse to report one that does not state its rate, jurisdiction and lot method. TRIGGER - after-tax return, after tax Sharpe, tax drag, tax-aware backtest, tax alpha, tax-managed strategy, turnover penalty, "what does this strategy return after tax", tax cost of rebalancing, taxable account backtest, tax-efficient turnover, pre-tax vs post-tax performance, capital gains netting, loss carryforward, "should I hold this in an IRA". Modelling assumptions for backtests, not tax advice. SKIP for the lot rules themselves (tax-lot-matching-and-cost-basis), for the wash-sale mechanics (wash-sale-rules), for futures and index options (section-1256-and-derivatives-tax), for A-share taxes (china-ashare-trading-taxes), and for transaction costs, which are a different drag entirely (execution-cost-analysis).
- ▌ Broker Execution Apis · howard-lynn-ye bundleConnect to a broker and place orders without accidentally trading live money. TRIGGER - connect to Interactive Brokers, TWS, IB Gateway, ib_async, ib_insync, ibapi, Alpaca, Schwab, schwab-py, Tastytrade, Tradier or Robinhood; place, modify or cancel an order; read positions or balances; set up paper trading; order types, time-in-force, bracket or OCO orders, client order ID; FIX, quickfix, simplefix; "make sure I don't send a live order"; a broker connection being refused. Load before any code that can transmit an order. SKIP for crypto exchanges and ccxt (crypto-data-and-execution), and for vnpy, CTP, QMT or any Chinese broker gateway (china-trading-stack). This skill answers TWS/Gateway port and connection failures on its own - the fin-libraries deep dive is optional and most installs will not have it.
- ▌ Option Pricing Models · howard-lynn-yeImplement an option pricing model correctly - closed form, tree, characteristic function, Monte Carlo - and the four places each silently returns a plausible wrong number. TRIGGER - Black-Scholes-Merton with dividend yield, binomial tree, CRR, Cox-Ross-Rubinstein, American early exercise, Richardson extrapolation; Heston, "the little Heston trap", branch cut, complex log, AnalyticHestonEngine, Gatheral vs BranchCorrection; SABR, Hagan 2002, sabrVolatility, ATM 0/0, z/x(z); antithetic variates, standard error, Euler discretisation bias; "my Heston price is wrong at long maturity", "my Heston price is NaN", "my binomial tree will not converge", "my Monte Carlo error bar is tiny but the price is wrong", "my tree does not match QuantLib". SKIP for choosing a pricing library, Greek units and licences (derivatives-pricing), for fitting a whole surface and its no-arbitrage checks (implied-vol-surface), and for assignment, expiry and option lifecycle (options-backtesting).
- ▌ Position Sizing Kelly · howard-lynn-yeDecide how much to bet given an edge - Kelly, fractional Kelly, and volatility targeting - and the drawdown each implies. TRIGGER - Kelly criterion, Kelly fraction, f star, optimal bet size, "how much should I bet", "how much capital per trade", position sizing, bet sizing, fractional Kelly, half Kelly, quarter Kelly, over-betting, geometric growth rate, expected log wealth, log utility, growth-optimal portfolio; volatility targeting as a sizing rule, size to 10% vol, inverse-vol sizing, leverage from a Sharpe ratio, risk of ruin, probability of a 50% drawdown, drawdown under leverage, "how much leverage can I take". SKIP for the signal that produces the edge (trend-following-models, alpha-combination-and-neutralization), for optimizers and constrained portfolio weights (portfolio-and-risk), for whether the edge is real at all (backtest-validation), and for working the resulting order (execution-algorithms).
- ▌ Term Structure Models · howard-lynn-yeBuild and fit a yield curve, and price a zero-coupon bond in a short-rate model, without the convention and identification traps. TRIGGER - bootstrap a zero curve, par rates to zero rates, discount factors to zero rates, par bond reprice, curve stripping; day count ACT/365 ACT/360 30/360, annual vs semiannual vs continuous compounding, "my zero rate is off by a few basis points", "which day count did this curve use"; Nelson-Siegel, Svensson, Diebold-Li, lambda 0.0609, beta0 beta1 beta2 level slope curvature, "my Nelson-Siegel lambda jumps around"; Vasicek, CIR, Cox-Ingersoll-Ross, Hull-White one factor, A(t,T) B(t,T), affine bond price, Feller condition, "sqrt of a negative rate", NaN in my CIR simulation. SKIP for option pricing and implied vol (option-pricing-models, implied-vol-surface), for QuantLib's evaluationDate global (lib-quantlib), and for macro rate data sourcing such as FRED and Treasury series (fundamental-and-macro-data).
- ▌ Copulas And Dependence · howard-lynn-yeSeparate the marginals from the dependence - Gaussian, Student t, Clayton and Gumbel copulas, Kendall's tau, tail dependence coefficients, and what fitting the wrong family costs in the joint tail. TRIGGER - copula, Gaussian copula, t copula, Student t copula, Clayton copula, Gumbel copula, Archimedean copula, Sklar's theorem; tail dependence, lower tail dependence, upper tail dependence, lambda_U, "correlation is not dependence", "correlations go to one in a crisis", joint tail probability, joint exceedance; Kendall's tau, Spearman rho, rank correlation, pseudo-observations, inversion of Kendall's tau, copula MLE, copulas python, copulae, statsmodels copula; diversification benefit, "my VaR says the portfolio is safe". SKIP for estimating a covariance matrix and shrinkage (covariance-and-risk-models), for VaR/CVaR methods and their backtests (risk-measures-var-cvar), and for GARCH marginals (volatility-models).
- ▌ Credit Spread Measures · howard-lynn-yeWork out which spread a corporate bond quote actually is and what it was measured against, so two "spreads" on the same bond stop disagreeing. TRIGGER - Z-spread, I-spread, G-spread, benchmark spread, spread to Treasuries, asset swap spread, ASW, par/par asset swap, discount margin, DM on a floater, quoted margin, OAS, option-adjusted spread, option cost, static spread, zero-volatility spread, "my Z-spread and my G-spread disagree", "is this spread over Treasuries or over swaps", "YTM minus the 5-year Treasury", BondFunctions.zSpread, "why is my OAS lower than my Z-spread", spread on a callable bond. SKIP for CDS spreads, points upfront and the ISDA model (cds-mechanics-and-upfront), for hazard rates, Merton and default probability (credit-risk-models), for building, bootstrapping or interpolating the underlying curve (term-structure-models), and for where the price and the trade came from (corporate-bond-data-and-trace).
- ▌ Risk Measures Var Cvar · howard-lynn-yeCompute Value-at-Risk and Expected Shortfall by the four estimators that disagree in the tail, and backtest them properly. TRIGGER - VaR, value at risk, CVaR, expected shortfall, ES, tail risk, 99% VaR, 95% VaR, historical simulation VaR, parametric normal VaR, Cornish-Fisher expansion, EVT, peaks over threshold, generalized Pareto, scipy genpareto, tail index xi, Kupiec proportion of failures, Christoffersen independence, conditional coverage, VaR exceptions or breaches, traffic light test, square root of time scaling, 10-day VaR, Basel, filtered historical simulation, quantstats value_at_risk sign; "how many exceptions should I see", "is my VaR model backtesting ok". SKIP for estimating the covariance matrix a parametric VaR needs (covariance-and-risk-models), for minimising CVaR to choose weights (portfolio-optimizers), for GARCH fitting itself (volatility-models), and for Sharpe, drawdown and tearsheet conventions (portfolio-and-risk).
- ▌ Stat Arb Cointegration · howard-lynn-yeScreen, test and trade a cointegrated pair without counting the trials wrong, applying the single-series ADF table to a fitted residual, or estimating the hedge ratio on the window you score it in. TRIGGER - cointegration, Engle-Granger, statsmodels coint, coint_johansen, Johansen, trace statistic, max eigenvalue, VECM, cointegrating vector; pairs trading, statistical arbitrage, stat arb, spread, hedge ratio, spread z-score, entry and exit thresholds, half-life, Ornstein-Uhlenbeck, OU mean reversion; adfuller on the residual, CollinearityWarning, "my screen found 30 cointegrated pairs", "the spread stopped mean reverting", "in-sample Sharpe 2 and it lost money live". SKIP for a time-varying hedge ratio by Kalman filter (state-space-and-kalman), for the multiple-testing machinery itself and PSR/DSR (backtest-validation), for regime labels (regime-detection), and for the cost of trading two legs (execution-cost-analysis).
- ▌ State Space And Kalman · howard-lynn-yeEstimate a time-varying hedge ratio or beta with a Kalman filter, and know which of its three state series you are allowed to trade - the smoothed one has read the whole sample. TRIGGER - Kalman filter, Kalman smoother, RTS smoother, state space model, local level, local linear trend, time-varying beta, dynamic hedge ratio, dynamic linear model, DLM, process noise Q, observation noise R, signal-to-noise ratio; statsmodels.tsa.statespace, KalmanSmoother, MLEModel, UnobservedComponents, RecursiveLS, recursive_coefficients, smoothed_state, filtered_state, predicted_state, states.smoothed, pykalman, filterpy, simdkalman; "my Kalman beta is beautifully smooth", "how do I pick Q", "the beta path looks flat". SKIP for discrete regime labels and Markov switching (regime-detection), for the cointegrating hedge ratio and spread z-scores (stat-arb-cointegration), for GARCH conditional variance (volatility-models), and for ARIMA/ETS point forecasts (time-series-forecasting-models).
- ▌ Trend Following Models · howard-lynn-ye bundleBuild a trend-following or time-series-momentum strategy the way the paper defines it, and measure the two look-aheads that flatter its backtest. TRIGGER - time series momentum, TSMOM, Moskowitz Ooi Pedersen, 12-month momentum, trend following, managed futures, CTA replication; Donchian channel, turtle rules, breakout system, 20-day high, moving average crossover, golden cross, 50/200 MA; volatility targeting, vol scaling, ex-ante volatility, 40% vol target, risk parity across futures, inverse-vol sizing, ATR sizing; "my trend backtest has a Sharpe of 3", "should I skip the most recent month", "do I trade the close or the next open". SKIP for computing the indicator itself and whether it repaints (signal-construction), for cross-sectional ranking of many names (factor-and-timeseries-research), for combining several alphas into one (alpha-combination-and-neutralization), for how much to bet given an edge (position-sizing-kelly), and for the engine that runs the loop (backtesting-engines).
- ▌ Execution Cost Analysis · howard-lynn-yeMeasure what your execution actually cost instead of assuming a number - implementation shortfall, benchmark choice, impact models, and the gap between the cost you assumed and the cost you paid. TRIGGER - transaction cost analysis, TCA, implementation shortfall, arrival price, decision price, slippage analysis, execution quality, fill quality, did I get a good fill; VWAP or TWAP benchmark, beat VWAP, participation rate, POV, percentage of volume, child orders, order slicing; market impact, temporary vs permanent impact, square-root law, Almgren-Chriss, price reversion after my order; "how much size can this strategy take", capacity, alpha decay with size; is my cost assumption realistic, "is 2 bps plausible", what book a stated cost supports. SKIP for a slippage assumption inside a backtest and for "works in backtest, loses live" with no measured fills (backtesting-engines), for whether the edge survives it (backtest-validation), and for broker order types (broker-execution-apis).
- ▌ Intraday Microstructure · howard-lynn-yeMeasure the market at the tick level and know when the measure is lying. TRIGGER - build dollar bars, volume bars, tick bars, imbalance bars; classify trades as buyer or seller initiated, Lee-Ready, tick rule, bulk volume classification, BVC; quoted vs effective vs realized spread, price impact, Kyle's lambda, Amihud illiquidity, order flow imbalance, OFI, VPIN; reconstruct the order book from MBO, market by order, L2 vs L3, queue position, NBBO, odd lots, dark prints; "my tick strategy works on bars but not on ticks", exchange clock vs vendor clock, the 5-second rule. SKIP for downloading tick data or picking a vendor (market-data-sourcing), for as-of joins and tick storage (market-data-engineering), for the cost of your own fills (execution-cost-analysis), for indicator look-ahead on bars (signal-construction), for how an engine fills orders or what spread to assume in a bar backtest (backtesting-engines) and for short-sale or margin rules (us-market-rules).
- ▌ Limit Order Book Models · howard-lynn-yeModel the order book as a queueing system - Cont-Stoikov-Talreja birth-death queues, the probability the mid moves up before down given the two queue sizes, and the fill probability and adverse selection of a passive order at a given queue position. TRIGGER - Cont Stoikov Talreja, stochastic model for order book dynamics, birth-death queue model, limit order book model, probability of an up move given queue sizes, queue imbalance, order book imbalance; queue position, "will my limit order get filled", passive fill model, queue-position backtest, hftbacktest queue model, "the level traded 3x my size so I was filled", order arrival rate lambda mu theta. SKIP for measuring spreads, Kyle lambda, Amihud or OFI on your own tape and for reconstructing a book from MBO data (intraday-microstructure), for how wide to quote and inventory risk (market-making-models), for working a parent order by taking liquidity (execution-algorithms), and for what fills cost after the fact (execution-cost-analysis).
- ▌ Market Data Engineering · howard-lynn-ye bundleStore, join and parallelize market data you already hold, without corrupting it. TRIGGER - as-of join, merge_asof, join_asof, ASOF JOIN, "join quotes to trades", aligning signals to prices; reading or writing Parquet, Feather, HDF5 or CSV of market data; choosing between pandas, polars, DuckDB, pyarrow, dask or ray; a time-series store such as ArcticDB, QuestDB, ClickHouse, TimescaleDB or kdb; storing years of minute bars for thousands of tickers; a dataset too big for memory; partitioning; timestamps or timezones coming back wrong; float precision on prices or volume; "different numbers when I parallelise". SKIP for choosing a data VENDOR (market-data-sourcing) - this skill starts once the bytes are yours.
- ▌ Triple Barrier Labeling · howard-lynn-yeLabel a trade by which of profit-taking, stop loss and the holding-period limit is hit FIRST, with barriers scaled to the volatility at the event - instead of by the sign of the return N bars later, which describes a path you would have been stopped out of. TRIGGER - triple barrier, triple-barrier method, getEvents, get_events, getBins, get_bins, barrier_touched, add_vertical_barrier, pt_sl, vertical barrier, t1 touch time, getDailyVol, get_daily_vol, meta-label 0/1, fixed-time horizon labeling, fixed horizon labels, "label = sign of the 5-day forward return", "my classifier is 90 % accurate but loses money", "how do I label financial data for ML", Lopez de Prado chapter 3, AFML labeling. SKIP for weighting the overlapping labels (sample-weights-and-uniqueness), for cross-validating them (lib-purgedcv), for the secondary model (meta-labeling), for the CUSUM event sampler (structural-breaks), and for stationary features (fractional-differentiation).
- ▌ Sofr And Rfr Compounding · howard-lynn-yeCompute a compounded-in-arrears overnight rate correctly - SOFR, SONIA, ESTR, TONA, SARON - including the lookback, lockout and observation-shift conventions. TRIGGER - SOFR compounded in arrears, SOFR Index, SOFR Averages, 30-day 90-day 180-day SOFR average, compounded RFR, daily compounding of an overnight rate, lookback, rate shift, observation shift, lockout, payment delay, "my SOFR coupon is a few basis points off", "compounded vs simple average SOFR", ACT/360 vs ACT/365 on SONIA, SONIA Compounded Index, ESTR, TONA, SARON, OvernightIndexedCoupon, RateAveraging.Compound, applyObservationShift, SOFRINDEX, SOFR30DAYAVG. SKIP for what a LIBOR contract falls back TO and the statutory spreads (libor-transition-and-fallbacks), for building an OIS discount curve (ois-discounting-and-multi-curve), for a floater's duration (duration-convexity-and-dv01), and for bond accrued interest and day counts (bond-conventions-and-accrued).
- ▌ Cds Mechanics And Upfront · howard-lynn-yeTurn a CDS quote into the cash that actually changes hands - standard coupons, points upfront, the risky annuity, the IMM roll and the accrual rebate. TRIGGER - points upfront, upfront payment on a CDS, convert spread to upfront, conventional spread, quoted spread vs par spread, ISDA CDS Standard Model, cdsmodel.com, CDS converter, flat hazard quoting convention, RPV01, risky PV01, risky annuity, "upfront = spread difference times duration", 100bp or 500bp coupon, SNAC, IMM dates, CDS roll, 20 Mar/Jun/Sep/Dec, "why is my 5y CDS maturing in June", accrual on default, accrual rebate, accrued coupon on a CDS, cdsMaturity, IsdaCdsEngine, MidPointCdsEngine, ISDA standard rate curve, rfr.spglobal.com. SKIP for hazard-rate and default-probability modelling, Merton and recovery sensitivity (credit-risk-models), for bond Z-spreads, G-spreads and OAS (credit-spread-measures), for the bond tape and TRACE (corporate-bond-data-and-trace), and for building the discount curve itself (term-structure-models).
- ▌ Crypto Data And Execution · howard-lynn-ye bundleCrypto market data and execution, and how a 24/7 market breaks equity tooling. TRIGGER - crypto, Bitcoin, BTC, Ethereum, ETH, digital assets, perpetuals, perps, funding rate, basis or cash-and-carry, liquidation price, maintenance margin, inverse or coin-margined contract, Deribit, crypto options, crypto order book; ccxt, cryptofeed, python-binance, freqtrade, jesse, hummingbot, OctoBot; a crypto exchange, testnet or sandbox; annualizing crypto returns, 365 vs 252; porting an equity strategy to crypto. Annualization is 365 not 252, funding is a carry that spot backtests omit, liquidation is not a stop-loss, and exchange pair lists are chronically survivorship-biased. SKIP for equity and futures brokers (broker-execution-apis), for RL or deep-learning agents even on crypto (rl-and-ml-trading), and for ccxt or freqtrade specifics once the library is named (lib-ccxt, lib-freqtrade).
- ▌ Research Integrity Guards · howard-lynn-ye bundleSecond-pass audit that decides whether a finance result is real, applied after the work exists. TRIGGER - about to REPORT, publish or act on a backtest, factor test or model score; a result that looks good ("Sharpe 3.5", "beats SPY", "85% accuracy") and needs challenging; asked to validate, verify, sanity-check or critique a research design; asked "what should I check". Covers five gates: universe survivorship, availability timestamps, label leakage, cost realism, trial count. SKIP when the task is to BUILD something rather than judge it - go to the domain skill first (market-data-sourcing, backtesting-engines, factor-and-timeseries-research) and return here before reporting a number.
- ▌ China Ashare Trading Taxes · howard-lynn-yeA-share stamp duty is charged to the seller only and halved on 2023-08-28, and dividend tax is a step function of holding period - a turnover penalty written into the tax code that a flat symmetric cost model cannot express. TRIGGER - A股印花税, 证券交易印花税, stamp duty, stamp tax, seller side only, 单边征收, 印花税减半, 0.05%, 2023-08-28, A股股息红利税, 股息红利差别化, dividend tax by holding period, 持股期限, 一个月, 一年, 财税〔2015〕101号, dividend capture China, A-share transaction cost model, "what does an A-share round trip actually cost", backtesting Chinese equities net of tax. Modelling assumptions for backtests, not tax advice, and for an individual resident investor only. SKIP for US wash sales and lot matching (wash-sale-rules, tax-lot-matching-and-cost-basis), for reporting an after-tax Sharpe (after-tax-backtesting), and for A-share data, T+1 and price limits (china-trading-stack).
- ▌ Covariance And Risk Models · howard-lynn-yeEstimate a covariance matrix an optimizer can actually invert, and report how much variance it hides. TRIGGER - covariance matrix estimation, sample covariance singular, "matrix is not positive definite", np.cov more assets than observations, N > T, condition number, Ledoit-Wolf shrinkage, sklearn LedoitWolf, CovarianceShrinkage, shrinkage intensity or delta, RiskMetrics EWMA, lambda 0.94 or 0.97, exponentially weighted covariance, exp_cov span, PCA or statistical factor risk model, Marchenko-Pastur, Barra fundamental factor model, specific risk, predicted vs realized volatility, risk model bias test; "my minimum-variance portfolio has 90x leverage", "the optimizer says 0% risk". SKIP for turning a covariance into weights and the optimizers themselves (portfolio-optimizers), for VaR, Expected Shortfall and their backtests (risk-measures-var-cvar), for GARCH and univariate volatility forecasting (volatility-models), and for Sharpe and drawdown conventions (portfolio-and-risk).
- ▌ Fractional Differentiation · howard-lynn-yeMake a price series stationary without throwing away the memory a model needs - the weight recursion, the fixed-width window, and the scan for the smallest d that passes ADF. TRIGGER - fractional differentiation, fractional differencing, fracdiff, frac_diff, frac_diff_ffd, get_weights_ffd, plotMinFFD, plot_min_ffd, "minimum d", ARFIMA, long memory, (1-B)^d, binomial weights, fixed-width window fracdiff; "my model only sees returns", "prices are non-stationary so I differenced them", "ADF says my feature is non-stationary", "should I feed prices or returns to the model", Lopez de Prado chapter 5, AFML fracdiff. SKIP for the cointegration ADF table and the fitted-residual null (stat-arb-cointegration), for unit-root and ARIMA model selection generally (time-series-forecasting-models), for making a feature causal and its warm-up (signal-construction), and for labels rather than features (triple-barrier-labeling).
- ▌ Fundamental And Macro Data · howard-lynn-ye bundleCompany fundamentals and macro series with correct point-in-time semantics. TRIGGER - 10-K, 10-Q, 8-K, 13F, Forms 3/4/5, filings, EDGAR, XBRL, accession number, CIK, "which CIK is this ticker", ticker-to-CIK mapping, edgartools; parsing an income statement or balance sheet out of a filing; revenue, EPS or balance-sheet history as it was known on a past date; restatements; earnings dates; or CPI, GDP, payrolls, unemployment, interest rates, FRED, ALFRED, data vintages and revisions. Load before joining ANY fundamental or macro series to prices: the obvious join is a look-ahead bug, and the SEC frames API cannot be made point-in-time. SKIP for price and OHLCV vendors (market-data-sourcing) and Chinese filings (china-ashare-data).
- ▌ Duration Convexity And Dv01 · howard-lynn-yeGet the right duration number and the right DV01, for a bond, a floater or a hedge ratio. TRIGGER - Macaulay vs modified duration, effective duration, spread duration, key rate duration, DV01, PV01, BPV, dollar duration, basis point value, convexity, "my hedge ratio is off by a few percent", "duration says the price should be X but it is Y", duration times spread, floating rate note duration, FRN duration, "why is my floater duration almost zero", BondFunctions.duration, Duration.Macaulay vs Duration.Modified vs Duration.Simple, basisPointValue sign. SKIP for turning a price into a yield in the first place (yield-measures-and-bill-quotes), for accrued interest and day counts (bond-conventions-and-accrued), for the swap annuity and PV01 under OIS discounting (ois-discounting-and-multi-curve), and for portfolio VaR and risk aggregation (../../../fin-core/skills/portfolio-and-risk).
- ▌ Finance Agent Architectures · howard-lynn-ye bundleHow the mainstream finance agent systems are built, and how to stage a research-to-execution pipeline whose gates are code. TRIGGER - build a multi-agent trading system; TradingAgents architecture; the ai-hedge-fund repo; RD-Agent for quant; Vibe-Trading; FinRobot vs FinGPT; FinMem layered memory; a LangGraph, CrewAI, AutoGen or Claude Agent SDK pipeline for stock research; analyst, researcher, trader and risk-manager agents, bull-bear debate; an agent that reads 10-Ks and trades; "how should the pipeline be staged", where the LLM sits, human-in-the-loop gates, prompt injection through scraped filings, agent reproducibility; 交易 agent 架构, 多智能体 pipeline. SKIP for whether any of it makes money or whether you should build one at all (llm-finance-agents), choosing an MCP server (finance-mcp-servers), RL agents (rl-and-ml-trading), and order safety at the broker (broker-execution-apis).
- ▌ Real Time Macro Backtesting · howard-lynn-yeRun a macro strategy twice - once on today's revised series and once on the vintage that existed at each decision date - and report both Sharpes. TRIGGER - real-time data, vintage data, data vintages, point-in-time macro, ALFRED, realtime_start, realtime_end, vintage_dates, get_series_as_of_date, first release vs latest, initial estimate, "my macro backtest uses revised data", "does this have look-ahead", payroll revisions, GDP revisions, annual benchmark revision, QCEW benchmark, restated macro history, as-of join on a macro series, "which number did I actually see on the day". SKIP for where to GET the series and the fredapi bugs (fundamental-and-macro-data), for release times and embargo mechanics (macro-release-calendar-and-embargo), for seasonal-adjustment revisions specifically (seasonal-adjustment-and-x13), for recession labels assigned after the fact (macro-regime-and-recession-indicators), and for company fundamentals rather than macro (fundamental-and-macro-data).
- ▌ Seasonal Adjustment And X13 · howard-lynn-yeSeasonal adjustment is a second, silent vintage - the published seasonally adjusted history keeps changing with no new data. TRIGGER - seasonally adjusted, SA vs NSA, "why did last year's number change", concurrent seasonal adjustment, seasonal factors, X-13ARIMA-SEATS, X-13, X-12-ARIMA, x13_arima_analysis, X13NotFoundError, "x12a and x13as not found on path", X13PATH, statsmodels seasonal_decompose, STL, ratio to moving average, annual re-adjustment, benchmark revision, "the seasonal factors were revised", residual seasonality, seasonally adjusting a series myself. SKIP for revisions to the underlying unadjusted value (real-time-macro-backtesting), for release timing (macro-release-calendar-and-embargo), for where the series live (fundamental-and-macro-data), and for general time-series decomposition and forecasting (time-series-forecasting-models).
- ▌ Bond Conventions And Accrued · howard-lynn-yeCompute accrued interest, clean and dirty prices and day-count year fractions on a bond without silently picking the wrong convention. TRIGGER - accrued interest, day count, daycount, ACT/ACT ICMA vs ISMA vs ISDA, ACT/365F, ACT/360, 30/360, 30E/360, 30E/360 ISDA, Thirty360 BondBasis vs USA vs European vs NASD, year fraction, yearFraction, ActualActual(ISMA), "my accrued interest is off by a few hundred dollars", "which 30/360 is this", clean price vs dirty price vs invoice price, settlement amount, T+1 settlement, quasi-coupon date, first and last stub period. SKIP for negative accrued inside a gilt ex-dividend window (ex-dividend-and-rebate-interest), for turning a price into a yield (yield-measures-and-bill-quotes), for duration and DV01 (duration-convexity-and-dv01), for discount-curve conventions and compounding (../../../fin-models/skills/term-structure-models), and for QuantLib's evaluationDate global (../../../fin-libraries/skills/lib-quantlib).
- ▌ Feature Importance Financial · howard-lynn-yeRank features without believing MDI - it is in-sample, it favours columns with many distinct values, and it splits credit between substitutable features; MDA under-states collinear pairs and leaks outright on a shuffled k-fold. TRIGGER - feature_importances_, feature importance, MDI, mean decrease impurity, Gini importance, MDA, mean decrease accuracy, permutation importance, permutation_importance, single feature importance, SFI, clustered feature importance, "which features matter", "my random forest says this random column is important", "importance changes every run", correlated features importance, substitution effect, Lopez de Prado chapter 8, AFML feature importance. SKIP for purged and embargoed cross-validation itself (lib-purgedcv), for the overlapping-label weights (sample-weights-and-uniqueness), for feature construction and causality (signal-construction), for factor-return attribution (factor-models), and for the trials a feature search spends (backtest-validation).
- ▌ Futures Continuous Contracts · howard-lynn-yeBuild and use a futures price series correctly — a continuous contract does not exist in the market, it is stitched, and the stitching method changes your answer. TRIGGER - futures, continuous contract, back-adjusted, Panama adjustment, ratio adjustment, roll, roll yield, contango, backwardation, front month, expiry, first notice day, open interest roll, CME, Globex, ES, CL, NG, VX, GC, ZN; joining futures bars to an equity calendar; "my futures backtest returns look wrong"; negative prices in a price series; norgatedata, databento continuous symbols, yfinance CL=F or ES=F. SKIP for Chinese futures and 夜盘 (china-trading-stack) and for crypto perpetuals, which have funding rather than rolls, and for dated crypto futures and basis trades (crypto-data-and-execution).
- ▌ Corporate Bond Data And Trace · howard-lynn-yeUse FINRA TRACE corporate bond data without inheriting the two things it does not tell you - the 15-minute reporting window and the size caps that censor volume. TRIGGER - TRACE, FINRA trade reporting, corporate bond tape, bond transaction data, "how fast are bond trades reported", one-minute TRACE reporting, Rule 6730, 15-minute reporting, dissemination cap, "5MM+", "1MM+", capped trade size, bond volume, TRACE academic or historic files, bond turnover, Amihud illiquidity on bonds, bond VWAP, "why is my bond volume so low", corporate bond liquidity screen, WRDS bond data, PyBondLab. SKIP for turning a bond price into a spread (credit-spread-measures), for CDS quotes and upfronts (cds-mechanics-and-upfront), for the rating that put the bond in an index (ratings-transitions-and-migration), for equity tick data and TAQ (intraday-microstructure), and for choosing a market data vendor or API in general (market-data-sourcing).
- ▌ Gdp Nowcasting Dynamic Factor · howard-lynn-yeNowcast the quarter you are in from monthly data with a ragged edge, using statsmodels' DynamicFactorMQ - and score it against the benchmarks it has to beat. TRIGGER - nowcast, nowcasting, GDPNow, Atlanta Fed GDP tracker, New York Fed Staff Nowcast, DynamicFactorMQ, endog_quarterly, k_endog_monthly, fit_em, dynamic factor model, mixed frequency, monthly and quarterly in one model, ragged edge, jagged edge, unbalanced panel, Mariano-Murasawa, Banbura Modugno, bridge equation, MIDAS, "how do I combine monthly indicators into a GDP forecast", news decomposition of a data release. SKIP for the Kalman filter and smoother themselves (state-space-and-kalman), for univariate forecasting and its baselines (time-series-forecasting-models), for release timestamps (macro-release-calendar-and-embargo), and for vintages of the inputs (real-time-macro-backtesting).
- ▌ Sample Weights And Uniqueness · howard-lynn-yeOverlapping labels are not independent observations - compute concurrency, average uniqueness and return-attributed weights, and divide your t-statistics by the overlap factor before believing any of them. TRIGGER - sample weights, average uniqueness, concurrency, overlapping labels, numCoEvents, num_concurrent_events, getAvgUniqueness, tW, sample_weight in fit(), getWeightsByReturn, get_weights_by_return, time decay weights, getTimeDecay, sequential bootstrap, seq_bootstrap, indicator matrix, effective sample size, "my labels overlap", "my t-stat is 4 but it does not hold up", "overlapping forward returns", Lopez de Prado chapter 4, AFML sample weights. SKIP for purged and embargoed cross-validation of the same labels (lib-purgedcv owns it, do not re-implement), for producing the labels and their t1 touch times (triple-barrier-labeling), for feature importance under overlap (feature-importance-financial), and for Sharpe deflation (backtest-validation).
- ▌ Factor And Timeseries Research · howard-lynn-ye bundleJudge whether a cross-sectional factor predicts returns, and forecast financial series. TRIGGER - information coefficient, IC, quantile returns, factor decay, turnover, alphalens; Fama-French, Fama-MacBeth, PanelOLS, linearmodels, cross-sectional asset pricing; event study, abnormal returns, CAR, BHAR; Alpha101, Alpha158, symbolic alpha mining, gplearn; or forecasting with ARIMA, GARCH, volatility models, arch, Nixtla, statsforecast, mlforecast, sktime, darts, Prophet or a time-series foundation model. SKIP for computing the indicator itself (signal-construction) and for portfolio weights or Sharpe (portfolio-and-risk).
- ▌ Libor Transition And Fallbacks · howard-lynn-yeWork out what a US dollar LIBOR contract actually falls back to under the LIBOR Act, and why the spread everyone quotes is the easy half. TRIGGER - LIBOR fallback, LIBOR transition, Regulation ZZ, 12 CFR 253, LIBOR Act, Board-selected benchmark replacement, tenor spread adjustment, 26.161 bp, 0.26161, 11.448 bp, 71.513 bp, ISDA 2020 IBOR Fallbacks Protocol, Fallback Rate (SOFR), CME Term SOFR, 30-day Average SOFR, 90-day Average SOFR, FFELP ABS fallback, FHFA-regulated-entity contract, consumer loan LIBOR fallback, "what does 3-month LIBOR become", "SOFR plus 26 bp", legacy LIBOR swap repapering, synthetic LIBOR. SKIP for computing a compounded SOFR coupon and its lookback conventions (sofr-and-rfr-compounding), for building an OIS curve (ois-discounting-and-multi-curve), and for US settlement and calendar rules (../../../fin-core/skills/us-market-rules).
- ▌ Time Series Forecasting Models · howard-lynn-yeScore a forecast against the baseline it has to beat - naive, seasonal-naive, drift, mean - with MASE, rolling-origin evaluation and a Diebold-Mariano test, instead of an R^2 on a price level. TRIGGER - forecasting, ARIMA, SARIMA, SARIMAX, auto_arima, ETS, Holt-Winters, exponential smoothing, statsmodels ARIMA trend, walk-forward, rolling origin, expanding window; naive forecast, seasonal naive, drift method, MASE, sMAPE, MAPE, OWA, Diebold-Mariano, DM test; LSTM stock price prediction, N-BEATS, TFT, "my model predicts prices with 99% R^2", "is my forecast better than the naive one", M4 competition, M5 competition. SKIP for volatility forecasting and HAR-RV (volatility-models), for choosing a forecasting library (factor-and-timeseries-research), for cointegration and unit roots (stat-arb-cointegration), for correcting across many models (backtest-validation), and for turning a forecast into positions (signal-construction).
- ▌ Yield Measures And Bill Quotes · howard-lynn-yeTurn a bond or bill price into the right yield, and stop treating a discount rate as one. TRIGGER - yield to maturity, YTM, current yield, yield to call, yield to worst, YTW, running yield, redemption yield; Treasury bill discount rate vs bond-equivalent yield, BEY, coupon-equivalent yield, investment rate, "why is the 4-week bill rate different from the yield", DTB3 vs DGS3MO, 360 vs 365 on a bill, money-market yield, add-on rate, CD equivalent; "my yield does not match Bloomberg", BondFunctions.bondYield, brentq on a bond price, callable bond yield. SKIP for accrued interest and day-count choice (bond-conventions-and-accrued), for negative accrued in a gilt ex-dividend window (ex-dividend-and-rebate-interest), for duration DV01 and convexity (duration-convexity-and-dv01), for zero rates and bootstrapping (../../../fin-models/skills/term-structure-models), and for compounded RFR averages (sofr-and-rfr-compounding).
- ▌ Ex Dividend And Rebate Interest · howard-lynn-yeHandle bonds that trade ex-dividend, where accrued interest goes negative and the buyer is paid rebate interest instead of paying it. TRIGGER - gilt, UK gilt, ex-dividend, ex-div, ex-coupon, exCouponPeriod, rebate interest, negative accrued interest, "my accrued interest is negative", "accrued should be negative but isn't", seven business days before the coupon, quasi-coupon date, DMO formulae, "Formulae for Calculating Gilt Prices from Yields", ql.FixedRateBond exCouponPeriod, ql.Period(-7, ql.Days), record date vs ex-date on a bond, 3.5% War Loan, JGB and gilt settlement. SKIP for ordinary positive accrued and day-count choice (bond-conventions-and-accrued), for price-to-yield solving in general (yield-measures-and-bill-quotes), for index-linked gilt indexation lags (../../../fin-models/skills/term-structure-models), and for QuantLib's evaluationDate global (../../../fin-libraries/skills/lib-quantlib).
- ▌ Ois Discounting And Multi Curve · howard-lynn-yePrice a swap with separate projection and discount curves, and catch the single-curve bug that the standard par-reprice check cannot see. TRIGGER - OIS discounting, CSA discounting, collateral discounting, multi-curve, dual curve, projection curve vs discount curve, tenor basis, "my swap reprices at par but the PV01 is wrong", swap annuity, fixedLegBPS, DiscountingSwapEngine, RelinkableYieldTermStructureHandle, linkTo, "QuantLib NPV is exactly 0.0", exogenous discounting rate helpers, bootstrapping a SOFR curve against an OIS discount curve, swaption numeraire, forward premium. SKIP for computing the compounded SOFR fixing itself (sofr-and-rfr-compounding), for what a legacy LIBOR trade falls back to (libor-transition-and-fallbacks), for bond duration and DV01 (duration-convexity-and-dv01), and for curve bootstrapping and interpolation in general (../../../fin-models/skills/term-structure-models).
- ▌ Tax Lot Matching And Cost Basis · howard-lynn-yeThe same trades produce four different reported P&Ls depending on which lot you sold, and only one of the four methods is a statutory default. TRIGGER - tax lot, tax lots, lot matching, cost basis, cost basis method, which shares did I sell, FIFO, LIFO, HIFO, LOFO, tax lot optimizer, specific identification, specific share identification, adequate identification, average cost basis, average basis, short-term vs long-term capital gain split, holding period more than one year, Publication 550, Form 8949, 1099-B basis mismatch, "my broker says HIFO", "which lot method should the backtest use", after-tax P&L of a blotter. Modelling assumptions for backtests, not tax advice. SKIP for the loss you are not allowed to book at all (wash-sale-rules), for futures and index options that never use lots at all (section-1256-and-derivatives-tax), for wiring all of it onto a backtest and reporting an after-tax Sharpe (after-tax-backtesting), and for A-share stamp duty and dividend tax (china-ashare-trading-taxes).
- ▌ Section 1256 And Derivatives Tax · howard-lynn-yeFutures and broad-based index options are marked to market on the last business day of the year and split 60/40 long/short regardless of holding period, so two options with the same payoff can have different after-tax P&L. TRIGGER - section 1256, 1256 contract, 60/40, sixty forty, mark to market at year end, marked to market December 31, regulated futures contract, nonequity option, broad-based index option, narrow-based security index, SPX vs SPY tax, XSP, VIX options, futures tax treatment, Form 6781, blended rate on futures, "do I owe tax on an open position", net section 1256 loss carryback, qualified board or exchange. Modelling assumptions for backtests, not tax advice. SKIP for stock lots and cost basis (tax-lot-matching-and-cost-basis), for the wash-sale rule that does not reach these contracts (wash-sale-rules), for reporting an after-tax Sharpe (after-tax-backtesting), and for option pricing and lifecycle mechanics (options-backtesting).
- ▌ Ratings Transitions And Migration · howard-lynn-yeEstimate and use a credit rating transition matrix without producing negative probabilities or a five-year default rate that is five times the wrong number. TRIGGER - rating transition matrix, migration matrix, credit migration, cohort estimator, duration estimator, Aalen-Johansen, Nelson-Aalen generator, matrix power P^5, matrix root, square root of a transition matrix, six-month transition matrix, scipy.linalg.logm, expm, embedding problem, generator of a Markov chain, "negative probability in my transition matrix", "logm gave me a negative off-diagonal", structural zero, AAA never defaults, withdrawn rating, NR, rating withdrawal, notching, cumulative default rate, "5 times the one-year PD", transitionMatrix, pyratings. SKIP for pricing a default probability or a hazard rate (credit-risk-models), for CDS quotes and upfronts (cds-mechanics-and-upfront), for bond spreads (credit-spread-measures), and for regulatory PD floors and Basel calibration (banking-regulatory).