holds_performance

czsc.utils.holds_performance(df, **kwargs)[source]

组合持仓权重表现

Parameters:
  • df – pd.DataFrame, columns=[‘dt’, ‘symbol’, ‘weight’, ‘n1b’] 数据说明,dt: 交易时间,symbol: 标的代码,weight: 权重,n1b: 名义收益率 必须是每个时间点都有数据,如果某个时间点没有数据,可以增加一行数据,权重为0

  • kwargs

    • fee: float, 单边费率,BP

    • digits: int, 保留小数位数

Returns:

pd.DataFrame, columns=[‘date’, ‘change’, ‘edge_pre_fee’, ‘cost’, ‘edge_post_fee’]