hft-quant-expert

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

HFT Quant Expert

高频交易量化专家

Quantitative trading expertise for DeFi and crypto derivatives.
面向DeFi和加密货币衍生品的量化交易专业能力。

When to Use

适用场景

  • Building trading strategies and signals
  • Implementing risk management
  • Calculating position sizes
  • Backtesting strategies
  • Analyzing volatility and correlations
  • 构建交易策略与交易信号
  • 实施风险管理
  • 计算仓位规模
  • 回测交易策略
  • 分析波动率与相关性

Workflow

工作流程

Step 1: Define Signal

步骤1:定义信号

Calculate z-score or other entry signal.
计算Z-score或其他入场信号。

Step 2: Size Position

步骤2:确定仓位规模

Use Kelly Criterion (0.25x) for position sizing.
使用Kelly Criterion(0.25倍)来确定仓位大小。

Step 3: Validate Backtest

步骤3:验证回测

Check for lookahead bias, survivorship bias, overfitting.
检查前瞻偏差、幸存者偏差、过拟合问题。

Step 4: Account for Costs

步骤4:考虑成本因素

Include gas + slippage in profit calculations.

在利润计算中包含Gas费和滑点成本。

Quick Formulas

常用公式

python
undefined
python
undefined

Z-score

Z-score

zscore = (value - rolling_mean) / rolling_std
zscore = (value - rolling_mean) / rolling_std

Sharpe (annualized)

Sharpe (annualized)

sharpe = np.sqrt(252) * returns.mean() / returns.std()
sharpe = np.sqrt(252) * returns.mean() / returns.std()

Kelly fraction (use 0.25x)

Kelly fraction (use 0.25x)

kelly = (win_prob * win_loss_ratio - (1 - win_prob)) / win_loss_ratio
kelly = (win_prob * win_loss_ratio - (1 - win_prob)) / win_loss_ratio

Half-life of mean reversion

Half-life of mean reversion

half_life = -np.log(2) / lambda_coef
undefined
half_life = -np.log(2) / lambda_coef
undefined

Common Pitfalls

常见误区

  • Lookahead bias - Using future data
  • Survivorship bias - Only existing assets
  • Overfitting - Too many parameters
  • Ignoring costs - Gas + slippage
  • Wrong annualization - 252 daily, 365*24 hourly
  • 前瞻偏差 - 使用未来数据
  • 幸存者偏差 - 仅考虑现存资产
  • 过拟合 - 参数过多
  • 忽略成本 - Gas费 + 滑点
  • 错误的年化处理 - 日频数据用252,小时频数据用365*24