alpacahq / alpacahq/Alpaca-API

Include Cash Flow Data in portfolio_history API to Adjust for Daily Return Calculations

未关闭
#263 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
没有语言数据
星标
173
派生
17
PR 合并指标
30 天内没有已合并 PR

描述

**Is your feature request related to a problem? Please describe.**
Yes, the problem arises when there’s a significant deposit or withdrawal in an Alpaca account, which skews the daily return calculation retrieved through the portfolio_history API. To properly calculate daily returns based solely on portfolio performance, I need to exclude cash flows (deposits/withdrawals). However, the portfolio_history endpoint does not provide direct information about these cash flows, making it difficult to adjust calculations accurately.

**Describe the solution you'd like**
I would like the portfolio_history API to include fields or provide data for cash flows (deposits/withdrawals), so that I can automatically account for these in the daily return calculations without manual tracking. This would allow users to calculate returns that focus solely on portfolio performance, without distortions from cash movements.

**Describe alternatives you've considered**
The primary alternative is to manually track deposits and withdrawals outside of the account history, then subtract them from the equity to calculate adjusted returns. However, this approach is prone to errors. Another option would be to build external tools to log and integrate cash flows, but having this data available directly in the API would be far more efficient and accurate.

**Additional context**
This feature would be especially helpful for users who rely on the API to monitor portfolio performance daily and want to ensure accurate return calculations even when there are large cash inflows or outflows.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。