[GH-ISSUE #50] Calculate Price History Endpoint #9

Closed
opened 2026-03-03 11:58:21 +03:00 by kerem · 2 comments
Owner

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

Originally assigned to: @paktusov on GitHub.

API Endpoint

/:realm_code:/:space_code:/api/v1/instruments/price-history/calculate/

Payload:

{
  date_from: required, YYYY-MM-DD
  date_to: required: YYYY-MM-DD
  instruments: [] array of Instrument user_code,  optional, if empty - all instruments 
  pricing_policies: [] array of Pricing Policy user_code, optional: if empty - all proicing_policies
}

Response:

{
   task_id: uuid
}

Problem:

Current implementation is part of csv_import, and its not clear how price history fields calculation works

Goal:

Separate Celery Task that will calculate fields like .ytm, .accrued_price etc in background

Originally created by @falendary on GitHub (Jul 15, 2025). Original GitHub issue: https://github.com/finmars-platform/finmars-core/issues/50 Originally assigned to: @paktusov on GitHub. ### API Endpoint /:realm_code:/:space_code:/api/v1/instruments/price-history/calculate/ Payload: ``` { date_from: required, YYYY-MM-DD date_to: required: YYYY-MM-DD instruments: [] array of Instrument user_code, optional, if empty - all instruments pricing_policies: [] array of Pricing Policy user_code, optional: if empty - all proicing_policies } ``` Response: ``` { task_id: uuid } ``` ### Problem: Current implementation is part of csv_import, and its not clear how price history fields calculation works ### Goal: Separate Celery Task that will calculate fields like .ytm, .accrued_price etc in background
kerem closed this issue 2026-03-03 11:58:21 +03:00
Author
Owner

@sergeiosipov commented on GitHub (Jul 18, 2025):

@paktusov sent you invite into the following workspace for you to check errors

  1. can't understand how the task processed - no info in options and in result of the task:

    1. https://eu-central.finmars.com/realm0v4ry/space0d25b/api/v1/tasks/task/52/
    2. https://eu-central.finmars.com/realm0v4ry/space0d25b/api/v1/tasks/task/51/
      Image
  2. status of imported prices is still "init" while "success" (or other actual) was expected:

    1. https://eu-central.finmars.com/realm0v4ry/space0d25b/api/v1/tasks/task/50/
      Image
<!-- gh-comment-id:3090266806 --> @sergeiosipov commented on GitHub (Jul 18, 2025): @paktusov sent you invite into the following workspace for you to check errors 1) can't understand how the task processed - no info in options and in result of the task: 1) https://eu-central.finmars.com/realm0v4ry/space0d25b/api/v1/tasks/task/52/ 1) https://eu-central.finmars.com/realm0v4ry/space0d25b/api/v1/tasks/task/51/ <img width="432" height="843" alt="Image" src="https://github.com/user-attachments/assets/4ca39f87-fad4-4364-af0d-39ac92d45500" /> 2) status of imported prices is still "init" while "success" (or other actual) was expected: 1) https://eu-central.finmars.com/realm0v4ry/space0d25b/api/v1/tasks/task/50/ <img width="703" height="703" alt="Image" src="https://github.com/user-attachments/assets/545b4003-91c3-47ea-a6d6-66096cd2050a" />
Author
Owner

@sergeiosipov commented on GitHub (Jul 19, 2025):

@paktusov 1) at least i need to understand how many items in which status and their error message, ideally have something like in the import results.

<!-- gh-comment-id:3092225333 --> @sergeiosipov commented on GitHub (Jul 19, 2025): @paktusov 1) at least i need to understand how many items in which status and their error message, ideally have something like in the import results.
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#9
No description provided.