fix: Incorrect documentation for timestamp property of PortfolioHistory model
The timestamp is the end of the time window, not the start. I verified this by checking the API response against the timestamp of a cash deposit in my account.
For example:
- The actual timestamp of the cash deposit was
2025-01-22T13:49:48-08:00. -
get_portfolio_historywith 1-hour granularity shows the cash deposit at timestamp2025-01-22T14:00:00-08:00.
@fumoboy007 Thank you for the report. May I please ask the request parameters (GetPortfolioHistoryRequest) you are calling and approx time, also paper or live? The docstring is actually copied from API reference document [1]. Therefore, I would like to confirm the details.
*1 https://docs.alpaca.markets/reference/getaccountportfoliohistory-1
May I please ask the request parameters (
GetPortfolioHistoryRequest) you are calling and approx time, also paper or live?
https://api.alpaca.markets/v2/account/portfolio/history?timeframe=1H&intraday_reporting=continuous&start=2025-01-22T12%3A00%3A00-08%3A00&pnl_reset=per_day&end=2025-01-22T15%3A00%3A00-08%3A00&cashflow_types=ALL
The docstring is actually copied from API reference document.
Hmm interesting, I guess we need to update that documentation too. It would make more sense to be the end of the time window anyways because the equity property uses the value at the end of the time window.
(Probably a good idea to double-check the back-end code though.)
@fumoboy007 Thank you for the details. It really helps us to investigate. Agree to double-check the back-end code.
@hiohiohio Any updates?