Skip to content
MyStocks Developers
API v1

API v1

Current stable contract

Versioning policyRelease changelog
Sandbox console
Trading API

Portfolio Performance

Retrieve cash-flow-adjusted daily P&L, time-weighted returns, and optional benchmark comparisons for master and customer portfolios.

Use GET /portfolio/performance for the partner master account and GET /users/{userId}/portfolio/performance for a customer sub-account. These endpoints are distinct from /portfolio/history, which intentionally returns raw equity snapshots without cash-flow adjustment.

curl "https://mystocks.africa/api/v1/partner/users/usr_abc123/portfolio/performance?period=1Y&benchmark=SCOM.KE" \
  -H "Authorization: Bearer pk_live_<key>"
FieldTypeRequiredDescription
periodstringNo1M | 3M | 6M | 1Y | ALL. Defaults to 1Y.
fromdateNoOptional inclusive ISO date override.
todateNoOptional inclusive ISO date override.
benchmarkstringNoExchange-qualified symbol used for a rebased price-return comparison.

Each point includes equity, marketValue, netCashFlow, dailyPnl, dailyReturn, cumulativeReturn, and—when requested—benchmarkReturn plus excessReturn.

Methodology

  • Daily P&L is end equity - start equity - net external cash flow.
  • Each interval uses Modified Dietz, weighting completed cash flows by the time remaining in the interval.
  • Daily returns are geometrically linked to produce cumulative time-weighted return.
  • Sub-account DEPOSIT and WITHDRAWAL entries are external cash flows.
  • Master-account internal transfers and completed top-ups/payouts are adjusted so funding movement is not reported as investment return.
  • Benchmark comparison is price return rebased to the first available close. It excludes dividends and FX and must be labelled accordingly.

Performance is only as complete as the available daily valuation snapshots. Do not fabricate intraday returns from delayed quotes, and do not present the benchmark comparison as total return.

Was this page useful?

Your signal helps us tighten partner onboarding docs.

Send note

Last updated on

On this page