Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stock_position字段property提示,portfolio字段向前兼容 #100

Closed
handsomu opened this issue Apr 21, 2017 · 1 comment
Closed

stock_position字段property提示,portfolio字段向前兼容 #100

handsomu opened this issue Apr 21, 2017 · 1 comment
Assignees

Comments

@handsomu
Copy link
Contributor

handsomu commented Apr 21, 2017

stock_position有以下变更,应当在调用该property的时候打出warning,提示该字段已失效。

  • total_orders
  • total_trades
  • sold_quantity
  • sold_value
  • bought_quantity
  • bought_value

portfolio有以下变更需要注意

  • 加入pnl字段,计算逻辑为 (unit_net_value - 1) * units。调用时提示该字段deprecate
  • 加入starting_cash字段,值为units。在调用该property时候打出warning,提示该字段已失效,返回units字段
  • 加入frozen_cash字段,数值为下属account的frozen_cash加总。调用时候提示该字段deprecate。

stock_account, future_account为了与stock_portfolio, future_portfolio兼容,加入以下字段:

  • portfolio_value,该字段与total_value值一致。如果调用,提示该字段deprecate,使用total_value代替
  • pnl, daily_pnl, daily_returns, total_returns, starting_cash全部返回0,提示abandon停止使用
  • daily_holding_pnl, daily_realized_pnl分别重定向至holding_pnl, realized_pnl
@wh1100717
Copy link
Member

已实现

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants