mirror of
https://github.com/we-promise/sure.git
synced 2026-04-16 10:34:09 +00:00
Investment prices fixes (#559)
* Fix investments retrieval
Problem Summary
Stock prices for securities like European stocks become stale because:
1. sync_all_accounts runs at 2:22 UTC (before European markets open)
2. Provider doesn't have today's price yet, so importer gap-fills with LOCF (yesterday's price)
3. Later import_market_data at 22:00 UTC sees all prices exist and skips fetching
4. Real closing price is never retrieved
Solution Overview
Add a provisional boolean column to mark gap-filled prices that should be re-fetched.
* Update schema.rb
---------
Signed-off-by: Juan José Mata <juanjo.mata@gmail.com>
Co-authored-by: Juan José Mata <juanjo.mata@gmail.com>
This commit is contained in:
2
test/fixtures/security/prices.yml
vendored
2
test/fixtures/security/prices.yml
vendored
@@ -3,9 +3,11 @@ one:
|
||||
date: <%= Date.current %>
|
||||
price: 215
|
||||
currency: USD
|
||||
provisional: false
|
||||
|
||||
two:
|
||||
security: aapl
|
||||
date: <%= 1.day.ago.to_date %>
|
||||
price: 214
|
||||
currency: USD
|
||||
provisional: false
|
||||
|
||||
Reference in New Issue
Block a user