CODING CHALLENGES

代码题库

用接近 LeetCode 的题表进入训练:先筛选题目,再进入双栏题面和编辑器。每道题只展示它实际声明支持的语言。

继续刷题

题目列表

显示 68 / 646 道可提交题。 当前筛选:标签:Backtesting,难度:中等,语言:Rust

提交状态:未尝试未正确已正确
未尝试
coding-backtest-with-borrow-cost订阅锁定
含隔夜融券成本的日频回测

Daily Backtest with Overnight Borrow Cost

中等面试准备Python / C++ / Rust
未尝试
coding-basel-var-traffic-light-zone-and-multiplier可练习
Basel VaR 回溯检验:红绿灯分区与资本乘子加成

Basel VaR Backtest — Traffic-Light Zone and Capital Multiplier Add-On

中等免费版Python / C++ / Rust
未尝试
coding-best-pnl-state-with-cooldown可练习
二值仓位策略 —— 含离场后强制冷静期的最佳 PnL

Binary-State Strategy — Best PnL With Post-Exit Cooldown

中等免费版Python / C++ / Rust
未尝试
coding-blocked-cv-time-respecting订阅锁定
时序保留的分块 CV:连续折,train 严格早于 test

Blocked Time-Respecting CV: Contiguous Folds with Train-Before-Test

中等面试准备Python / C++ / Rust
未尝试
coding-bounded-trades-best-pnl-with-fee可练习
至多 K 段不重叠多头 round-trip 下的最佳已实现 PnL 上界(含每段冲击成本)

Best Realized PnL Bound Under K Disjoint Round-Trips with Per-Roundtrip Impact Cost

中等免费版Python / C++ / Rust
未尝试
coding-brinson-attribution-three-effects订阅锁定
Brinson-Hood-Beebower 三效应归因

Brinson-Hood-Beebower Three-Effect Attribution

中等面试准备Python / C++ / Rust
未尝试
coding-calmar-ratio-annualized-return-over-mdd订阅锁定
Calmar 比率——年化收益与最大回撤

Calmar Ratio — Annualized Return over Maximum Drawdown

中等面试准备Python / C++ / Rust
未尝试
coding-choueifaty-diversification-ratio订阅锁定
高斯组合的 Choueifaty 分散化比率

Choueifaty Diversification Ratio of a Gaussian Portfolio

中等面试准备Python / C++ / Rust
未尝试
coding-christoffersen-conditional-coverage-lr-cc可练习
Christoffersen 条件覆盖性 LR_cc 联合统计量:VaR 回溯检验

Christoffersen Conditional Coverage LR_cc Joint Statistic for VaR Backtesting

中等免费版Python / C++ / Rust
未尝试
coding-christoffersen-independence-lr-test可练习
Christoffersen LR_ind 独立性统计量:VaR 回溯检验

Christoffersen LR_ind Independence Statistic for VaR Backtesting

中等免费版Python / C++ / Rust
未尝试
coding-christoffersen-independence-test订阅锁定
Christoffersen 独立性检验(VaR 突破聚集)

Christoffersen Independence Test for VaR Breach Clustering

中等面试准备Python / C++ / Rust
未尝试
coding-conditional-drawdown-at-risk订阅锁定
条件回撤风险

Conditional Drawdown at Risk

中等面试准备Python / C++ / Rust
未尝试
coding-cross-gamma-pnl-attribution订阅锁定
Cross-Gamma 盈亏归因:双资产 Greek 分解

Cross-Gamma PnL Attribution: Two-Asset Greek Decomposition

中等面试准备Python / C++ / Rust
未尝试
coding-cumret-drawdown-flagged-indices可练习
累计 PnL 回撤告警:超过阈值的水下时刻下标

Cumulative PnL Drawdown Alert: Sorted Indices Underwater Beyond Threshold

中等免费版Python / C++ / Rust
未尝试
coding-cumret-zero-crossings可练习
累计 PnL 零交叉次数:回测净值曲线的符号翻转计数

Cumulative PnL Zero-Crossings: Count Sign Flips of the Backtest Equity Curve

中等免费版Python / C++ / Rust
未尝试
coding-diebold-mariano-pinball-comparison可练习
基于 Pinball 损失差分的 Diebold-Mariano 两 VaR 预测对比检验

Diebold-Mariano Test for Two VaR Forecasts via Pinball-Loss Differential

中等免费版Python / C++ / Rust
未尝试
coding-es-exceedance-ratio-backtest可练习
Expected Shortfall 校准回溯:超额日比率检验

Expected Shortfall Calibration Backtest via Exceedance-Day Ratio

中等免费版Python / C++ / Rust
未尝试
coding-gamma-vega-pnl-attribution订阅锁定
Black-Scholes 盈亏归因:Delta、Gamma、Vega、Theta

Black-Scholes PnL Attribution: Delta, Gamma, Vega, Theta

中等面试准备Python / C++ / Rust
未尝试
coding-historical-scenario-replay-worst-k可练习
历史情景回放:滚动窗口最劣 K 条累计 PnL

Historical Scenario Replay: Worst-K Rolling-Window PnLs

中等免费版Python / C++ / Rust
未尝试
coding-information-ratio-active-return订阅锁定
主动收益序列的 Information Ratio

Information Ratio of an Active-Return Series

中等面试准备Python / C++ / Rust
未尝试
coding-inverse-percentile-rank-by-pnl可练习
日 PnL 在历史分布中的反向百分位排名

Inverse Percentile Rank of Daily PnL Against Reference Distribution

中等免费版Python / C++ / Rust
未尝试
coding-kupiec-pof-likelihood-ratio可练习
Kupiec POF 似然比统计量:VaR 回溯检验

Kupiec POF Likelihood-Ratio Statistic for VaR Backtesting

中等免费版Python / C++ / Rust
未尝试
coding-kupiec-pof-test订阅锁定
Kupiec 失败比例 (POF) 检验统计量

Kupiec Proportion-of-Failures (POF) Test Statistic

中等面试准备Python / C++ / Rust
未尝试
coding-limit-order-fill-simulation订阅锁定
基于高低价 bar 的限价单成交模拟

Limit-Order Fill Simulation against High-Low Bars

中等面试准备Python / C++ / Rust
未尝试
coding-longest-stairstep-cumret-with-min-gap可练习
最低增益门槛下的累积 PnL 报告期最长阶梯式子序列

Longest Stair-Stepping Subsequence Of Cumulative-PnL Reports Under A Minimum-Gain Gate

中等免费版Python / C++ / Rust
未尝试
coding-longest-streak可练习
击穿盈利目标的最长子窗口:单调栈解前缀和长度优化

Longest Sub-Window Beating a PnL Target via Monotonic-Stack on Prefix Sums

中等免费版Python / C++ / Rust
未尝试
coding-look-ahead-bias-detector订阅锁定
通过滞后相关比较检测前视偏差

Look-Ahead Bias Detector via Lagged-Correlation Comparison

中等面试准备Python / C++ / Rust
未尝试
coding-lopez-magnitude-loss-function-var-backtest可练习
Lopez I 量级损失函数:VaR 回溯检验

Lopez I Magnitude Loss Function for VaR Backtesting

中等免费版Python / C++ / Rust
未尝试
coding-max-cumret-with-bounded-skips可练习
至多跳过 K 期下的最大已实现累积收益

Maximum Realised Cumulative Return When Allowed To Skip At Most K Periods

中等免费版Python / C++ / Rust
未尝试
coding-max-drawdown-duration订阅锁定
累积净值曲线上的最长回撤期

Maximum Drawdown Duration on the Equity Curve

中等面试准备Python / C++ / Rust
未尝试
coding-min-hold-best-single-roundtrip可练习
最低持有期合规约束下单段多头 round-trip 的最佳已实现 PnL

Best Single Round-Trip Realized PnL Under a Minimum-Holding-Period Compliance Rule

中等免费版Python / C++ / Rust
未尝试
coding-min-hops-to-core-factor-set可练习
到核心因子集合的最少跳数:因子相似图上的多源 BFS

Min Hops to Core Factor Set: Multi-Source BFS on a Factor-Similarity Graph

中等免费版Python / C++ / Rust
未尝试
coding-mincer-zarnowitz-var-forecast-regression可练习
Mincer-Zarnowitz OLS Regression for VaR-Forecast Unbiasedness

Mincer-Zarnowitz OLS Regression for VaR-Forecast Unbiasedness

中等免费版Python / C++ / Rust
未尝试
coding-modigliani-m-squared-ratio订阅锁定
Modigliani M² — 波动率等价化的风险调整后收益

Modigliani M-Squared — Vol-Rescaled Risk-Adjusted Return

中等面试准备Python / C++ / Rust
未尝试
coding-net-position-from-trade-events可练习
由原始成交流水计算日终净头寸

End-of-Day Net Positions from a Raw Trade Tape

中等免费版Python / C++ / Rust
未尝试
coding-next-all-time-high-index可练习
距离下一次新高的索引:首个严格高于「累积最高水位」的未来 tick

Time-to-New-All-Time-High: First Future Index Strictly Above the Running Peak

中等免费版Python / C++ / Rust
未尝试
coding-omega-ratio-at-threshold订阅锁定
收益序列在阈值处的 Omega 比率

Omega Ratio of a Return Series at a Threshold

中等面试准备Python / C++ / Rust
未尝试
coding-pinball-loss-var-quantile-backtest可练习
VaR 预测回溯检验:Pinball(分位)损失评分

Pinball (Quantile) Loss for VaR Forecast Backtesting

中等免费版Python / C++ / Rust
未尝试
coding-pit-standardized-var-forecast-residual可练习
标准化 VaR 预测残差流:先去均值再除以波动率

Standardized VaR-Forecast Residual Stream — De-Mean Then Divide By Vol

中等免费版Python / C++ / Rust
未尝试
coding-pnl-attribution-greeks订阅锁定
基于 Greeks 的盈亏归因

Greek-Based PnL Attribution

中等面试准备Python / C++ / Rust
未尝试
coding-position-cap-clamp订阅锁定
单资产与组合层级敞口上限的目标权重夹取

Per-Asset and Portfolio Cap Clamping for Target Weights

中等面试准备Python / C++ / Rust
未尝试
coding-position-pnl-with-fees订阅锁定
含手续费的持仓盈亏

Position P&L With Transaction Fees

中等面试准备Python / C++ / Rust
未尝试
coding-purged-cv-folds订阅锁定
带禁运区的 Purged K 折交叉验证

Purged k-Fold CV with Embargo

中等面试准备Python / C++ / Rust
未尝试
coding-rank-inversion-count可练习
排名失配对数:期望榜单与实测榜单的两两逆序对计数

Rank-Disagreement Count: Pairwise Inversions Between Expected and Realized Strategy Rankings

中等免费版Python / C++ / Rust
未尝试
coding-rebalance-on-signal-change订阅锁定
按整数桶变化触发再平衡的低换手回测

Turnover-Aware Rebalance on Bucketed-Signal Change

中等面试准备Python / C++ / Rust
未尝试
coding-recovery-distance-after-each-day可练习
前向恢复距离:累计增益重新越过阈值所需天数

Forward Recovery Distance: Days Until Cumulative Gain Clears Delta

中等免费版Python / C++ / Rust
未尝试
coding-running-max-drawdown-stream可练习
流式对数收益 NAV 路径的运行最大回撤

Running Maximum Drawdown of a Streamed Log-Return NAV Path

中等免费版Python / C++ / Rust
未尝试
coding-sector-day-return-rect-queries可练习
行业-交易日 收益方块:矩形区间求和的批量查询

Sector-Day Return Cube: Batched Rectangular Range Sums

中等免费版Python / C++ / Rust
未尝试
coding-size-weighted-median-fillprice可练习
成交量加权中位数成交价

Size-Weighted Median Fill Price

中等免费版Python / C++ / Rust
未尝试
coding-sortino-ratio-with-target订阅锁定
带目标收益的收益序列 Sortino 比率

Sortino Ratio of a Return Series with Target Return

中等面试准备Python / C++ / Rust
未尝试
coding-sticky-position-best-pnl-with-flip-tax可练习
黏性二值仓位策略 —— 含每次切换税与初始状态锚定的最佳 PnL

Sticky Binary-State Strategy — Best PnL With Per-Flip Tax And Initial-State Anchor

中等免费版Python / C++ / Rust
未尝试
coding-strategy-rank-by-sharpe-then-id可练习
策略排行榜:按 Sharpe 取前 K,同分按 strategy_id 字典序

Strategy Leaderboard: Top-K by Sharpe with Lexicographic Tie-Break

中等免费版Python / C++ / Rust
未尝试
coding-survivorship-aware-universe订阅锁定
考虑幸存者偏差的当日可交易股票池

Survivorship-Aware Tradeable Universe on a Date

中等面试准备Python / C++ / Rust
未尝试
coding-tracking-error-contribution-by-sector订阅锁定
各行业对跟踪误差方差的贡献

Tracking-Error Variance Contribution by Sector

中等面试准备Python / C++ / Rust
未尝试
coding-tracking-error-sample-stdev订阅锁定
主动收益序列的标量 Tracking Error

Scalar Tracking Error of an Active-Return Series

中等面试准备Python / C++ / Rust
未尝试
coding-treynor-ratio-systematic-risk-adjusted订阅锁定
Treynor 比率 — 系统性风险调整后的超额收益

Treynor Ratio — Systematic-Risk-Adjusted Excess Return

中等面试准备Python / C++ / Rust
未尝试
coding-up-down-capture-ratios订阅锁定
相对基准的上行捕获率与下行捕获率

Up-Capture and Down-Capture Ratios versus a Benchmark

中等面试准备Python / C++ / Rust
未尝试
coding-var-backtest-exceedance-cluster-count可练习
VaR 回溯检验:破口数与最长连续段

VaR Backtest Exceedance Count and Longest Cluster

中等免费版Python / C++ / Rust
未尝试
coding-var-breach-counter订阅锁定
统计并标注 VaR 突破日

Count and Timestamp VaR Breaches

中等面试准备Python / C++ / Rust
未尝试
coding-var-hit-residual-lag1-autocorrelation可练习
VaR 命中残差的 Lag-1 自相关

Lag-1 Autocorrelation of VaR Hit Indicators

中等免费版Python / C++ / Rust
未尝试
coding-vectorized-pnl-with-borrow-fee-rate-curve订阅锁定
含时变融券费率曲线的向量化 PnL

Vectorized PnL with Time-Varying Borrow Fee Curve

中等面试准备Python / C++ / Rust
未尝试
coding-vectorized-pnl-with-costs订阅锁定
含交易成本的向量化逐期 PnL

Vectorized Per-Period PnL with Transaction Costs

中等面试准备Python / C++ / Rust
未尝试
coding-vega-pnl-explain订阅锁定
按执行价网格的 Vega 分桶盈亏归因

Vega-Bucketed PnL Explain Across a Strike Grid

中等面试准备Python / C++ / Rust
未尝试
coding-vintage-cohort-period-default-rate可练习
期龄队列每期违约率:贷款 vintage 的条件风险率

Vintage Cohort Per-Period Default Rate: Conditional Hazard from a Loan Vintage

中等免费版Python / C++ / Rust
未尝试
coding-walk-forward-train-test-splits订阅锁定
步进式训练/测试切分(含 embargo 间隔)

Walk-Forward Train/Test Splits with Embargo

中等面试准备Python / C++ / Rust
未尝试
coding-walkforward-expanding-window-folds订阅锁定
走向前 CV:扩展窗口与滚动窗口折

Walk-forward CV: Expanding and Rolling-window Folds

中等面试准备Python / C++ / Rust
未尝试
coding-wilson-score-binomial-ci-var-exceedance可练习
VaR 突破率的 Wilson Score 二项置信区间

Wilson Score Binomial CI for VaR Exceedance Rate

中等免费版Python / C++ / Rust
未尝试
coding-windowed-positive-fraction可练习
定长滑窗内严格正收益占比

Rolling Hit-Rate of Strictly-Positive Returns over a Fixed-Size Window

中等免费版Python / C++ / Rust