all publishers

howard-lynn-ye

@howard-lynn-ye source repo

234 published skills · page 3 of 3

  1. ▌
    Intraday Microstructure · howard-lynn-ye
    Measure 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).
    1 repo stars
  2. ▌
    Limit Order Book Models · howard-lynn-ye
    Model 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).
    1 repo stars
  3. ▌
    Market Data Engineering · howard-lynn-ye bundle
    Store, 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.
    1 repo stars
  4. ▌
    Triple Barrier Labeling · howard-lynn-ye
    Label 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).
    1 repo stars
  5. ▌
    Sofr And Rfr Compounding · howard-lynn-ye
    Compute 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).
    1 repo stars
  6. ▌
    Cds Mechanics And Upfront · howard-lynn-ye
    Turn 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).
    1 repo stars
  7. ▌
    Crypto Data And Execution · howard-lynn-ye bundle
    Crypto 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).
    1 repo stars
  8. ▌
    Research Integrity Guards · howard-lynn-ye bundle
    Second-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.
    1 repo stars
  9. ▌
    China Ashare Trading Taxes · howard-lynn-ye
    A-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).
    1 repo stars
  10. ▌
    Covariance And Risk Models · howard-lynn-ye
    Estimate 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).
    1 repo stars
  11. ▌
    Fractional Differentiation · howard-lynn-ye
    Make 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).
    1 repo stars
  12. ▌
    Fundamental And Macro Data · howard-lynn-ye bundle
    Company 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).
    1 repo stars
  13. ▌
    Duration Convexity And Dv01 · howard-lynn-ye
    Get 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).
    1 repo stars
  14. ▌
    Finance Agent Architectures · howard-lynn-ye bundle
    How 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).
    1 repo stars
  15. ▌
    Real Time Macro Backtesting · howard-lynn-ye
    Run 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).
    1 repo stars
  16. ▌
    Seasonal Adjustment And X13 · howard-lynn-ye
    Seasonal 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).
    1 repo stars
  17. ▌
    Bond Conventions And Accrued · howard-lynn-ye
    Compute 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).
    1 repo stars
  18. ▌
    Feature Importance Financial · howard-lynn-ye
    Rank 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).
    1 repo stars
  19. ▌
    Futures Continuous Contracts · howard-lynn-ye
    Build 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).
    1 repo stars
  20. ▌
    Corporate Bond Data And Trace · howard-lynn-ye
    Use 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).
    1 repo stars
  21. ▌
    Gdp Nowcasting Dynamic Factor · howard-lynn-ye
    Nowcast 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).
    1 repo stars
  22. ▌
    Sample Weights And Uniqueness · howard-lynn-ye
    Overlapping 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).
    1 repo stars
  23. ▌
    Factor And Timeseries Research · howard-lynn-ye bundle
    Judge 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).
    1 repo stars
  24. ▌
    Libor Transition And Fallbacks · howard-lynn-ye
    Work 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).
    1 repo stars
  25. ▌
    Time Series Forecasting Models · howard-lynn-ye
    Score 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).
    1 repo stars
  26. ▌
    Yield Measures And Bill Quotes · howard-lynn-ye
    Turn 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).
    1 repo stars
  27. ▌
    Ex Dividend And Rebate Interest · howard-lynn-ye
    Handle 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).
    1 repo stars
  28. ▌
    Ois Discounting And Multi Curve · howard-lynn-ye
    Price 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).
    1 repo stars
  29. ▌
    Tax Lot Matching And Cost Basis · howard-lynn-ye
    The 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).
    1 repo stars
  30. ▌
    Section 1256 And Derivatives Tax · howard-lynn-ye
    Futures 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).
    1 repo stars
  31. ▌
    Ratings Transitions And Migration · howard-lynn-ye
    Estimate 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).
    1 repo stars
  32. ▌
    Macro Release Calendar And Embargo · howard-lynn-ye
    Build the timestamp at which a macro number becomes tradeable - release date, clock time, timezone - and know where the release mechanics changed under your sample. TRIGGER - release calendar, economic calendar, release date vs reference date, available_at, as-of join on a macro series, "when was this number published", 8:30 ET, embargo, press lock-up, media lockup, pre-release access, WASDE noon, EIA Wednesday 10:30, natural gas storage Thursday, holiday release schedule, "why is my macro feature one day early", forward-fill a monthly series onto daily bars, DST offset on a release timestamp, event-study window around a print. SKIP for vintages and revisions to the value itself (real-time-macro-backtesting), for where the series live (fundamental-and-macro-data), for exchange sessions and holidays (us-market-rules), and for measuring fills you already have (execution-cost-analysis).
    1 repo stars
  33. ▌
    Alpha Combination And Neutralization · howard-lynn-ye
    Score several alphas, combine them, and strip the exposures you did not mean to take. TRIGGER - information coefficient, IC, rank IC, ICIR, IC decay, "is my IC good", IC t-stat, Newey-West on IC, overlapping forward returns; combining alphas, blending signals, alpha weighting, z-score or rank combination, multi-factor signal; sector neutral, beta neutral, market neutral signal, industry neutralization, residualize the alpha, cross-sectional regression residuals, orthogonalize signals; winsorize, clip outliers, cross-sectional standardization; turnover-aware combination, signal smoothing, "my alpha dies after costs". SKIP for one time-series trend signal (trend-following-models), for the factor library and the alphalens forward-return convention (factor-and-timeseries-research, lib-alphalens), for weights under constraints (portfolio-and-risk), and for whether the survivor is real (backtest-validation).
    1 repo stars
  34. ▌
    Macro Regime And Recession Indicators · howard-lynn-ye
    Recession probabilities, the Sahm rule and yield-curve inversion - and the fact that the NBER label they are all scored against was assigned years after the fact. TRIGGER - USREC, NBER recession dates, recession indicator, recession probability, recession dummy, "recession-aware" strategy, regime flag from FRED, RECPROUSM156N, Sahm rule, SAHMREALTIME, SAHMCURRENT, "unemployment rose 0.5 points", yield curve inversion, T10Y3M, T10Y2Y, 2s10s, inverted curve recession signal, "how long after inversion", business cycle dating, "when did NBER announce", labelling recessions for a classifier. SKIP for fitting HMMs and the smoothed-versus-filtered timing of estimated regimes (regime-detection), for the vintage A/B on a macro strategy (real-time-macro-backtesting), for nowcasting GDP itself (gdp-nowcasting-dynamic-factor), and for where the underlying series live (fundamental-and-macro-data).
    1 repo stars