Skip to content

Commit

Permalink
fix: Incorrect documentation for timestamp property of PortfolioHisto…
Browse files Browse the repository at this point in the history
…ry 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_history with 1-hour granularity shows the cash deposit at timestamp 2025-01-22T14:00:00-08:00.
  • Loading branch information
fumoboy007 committed Jan 24, 2025
1 parent e2466ba commit c46d25c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion alpaca/trading/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ class PortfolioHistory(BaseModel):
Contains information about the value of a portfolio over time.
Attributes:
timestamp (List[int]): Time of each data element, left-labeled (the beginning of time window).
timestamp (List[int]): Time of each data element, right-labeled (the end of the time window).
equity (List[float]): Equity value of the account in dollar amount as of the end of each time window.
profit_loss (List[float]): Profit/loss in dollar from the base value.
profit_loss_pct (List[Optional[float]]): Profit/loss in percentage from the base value.
Expand Down

0 comments on commit c46d25c

Please sign in to comment.