[GH-ISSUE #48] Calculation Portfolio Price History endpoint parametrize #7

Closed
opened 2026-03-03 11:58:21 +03:00 by kerem · 1 comment
Owner

Originally created by @sergeiosipov on GitHub (Jul 14, 2025).
Original GitHub issue: https://github.com/finmars-platform/finmars-core/issues/48

  1. "api/v1/portfolios/portfolio-register/calculate-price-history/"
    1. Change parameter "portfolios" to "registers" (so that we will have better control over what registers exactly are calculated for portfolios). Registers can be a list, if null -> take all registers.
    2. Make sure that existing parameter: "date_from" - used to filter out all transactions of date_accounting (trade date)>=date_from used to calculate Portfolio Price History records; used to delete all existing Portfolio Price History records of the register because changes will affect all following Portfolio Price History records. If null -> delete Portfolio Price History records since inception and calculate Portfolio Price History records since inception.
    3. Make sure that existing parameter: "date_to" - used to filter out all transactions of date_accounting (trade date)<=date_to used to calculate Portfolio Price History records to restrict calculation to a specific date (e.g. we plan to add more data and calculate other dates later. If null -> delete Portfolio Price History records until yesterday and calculate Portfolio Price History records until yesterday.
    4. Make sure that calculations are done NOT for all pricing policies of the workspace, but by pricing policies of registers from parameters. github.com/finmars-platform/finmars-core@baa4682a6d/poms/portfolios/tasks.py (L654) and github.com/finmars-platform/finmars-core@baa4682a6d/poms/portfolios/tasks.py (L679)
Originally created by @sergeiosipov on GitHub (Jul 14, 2025). Original GitHub issue: https://github.com/finmars-platform/finmars-core/issues/48 1) "api/v1/portfolios/portfolio-register/calculate-price-history/" 1) Change parameter "portfolios" to "registers" (so that we will have better control over what registers exactly are calculated for portfolios). Registers can be a list, if null -> take all registers. 1) Make sure that existing parameter: "date_from" - used to filter out all transactions of date_accounting (trade date)>=date_from used to calculate Portfolio Price History records; used to delete all existing Portfolio Price History records of the register because changes will affect all following Portfolio Price History records. If null -> delete Portfolio Price History records since inception and calculate Portfolio Price History records since inception. 1) Make sure that existing parameter: "date_to" - used to filter out all transactions of date_accounting (trade date)<=date_to used to calculate Portfolio Price History records to restrict calculation to a specific date (e.g. we plan to add more data and calculate other dates later. If null -> delete Portfolio Price History records until yesterday and calculate Portfolio Price History records until yesterday. 1) Make sure that calculations are done NOT for all pricing policies of the workspace, but by pricing policies of registers from parameters. https://github.com/finmars-platform/finmars-core/blob/baa4682a6db881750875ece6ae3cdfe2ebad54a4/poms/portfolios/tasks.py#L654 and https://github.com/finmars-platform/finmars-core/blob/baa4682a6db881750875ece6ae3cdfe2ebad54a4/poms/portfolios/tasks.py#L679
kerem closed this issue 2026-03-03 11:58:21 +03:00
Author
Owner

@falendary commented on GitHub (Jul 15, 2025):

https://github.com/finmars-platform/finmars-core/pull/51

<!-- gh-comment-id:3073994058 --> @falendary commented on GitHub (Jul 15, 2025): https://github.com/finmars-platform/finmars-core/pull/51
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/finmars-core#7
No description provided.