mirror of
https://github.com/0xrsydn/idx-cli.git
synced 2026-11-07 09:45:36 +00:00
fix(intraday): mark a chart from before the latest session
stocks intraday never set quote.behind_session, so on a holiday or when Stockbit lags, a past session's chart read as current. Mark it as quotes do and print the same note under the header. Claude-Session: https://claude.ai/code/session_01RqPPVeVDrnLoP7NUZmLRxY
This commit is contained in:
parent
570439369e
commit
6f8d3c071a
10 changed files with 20 additions and 9 deletions
|
|
@ -75,7 +75,7 @@ impl Market<'_> {
|
|||
let idx = self.idx;
|
||||
let resolved = idx.resolve(symbol)?;
|
||||
let provider = intraday_provider();
|
||||
cached_fetch(
|
||||
let mut day = cached_fetch(
|
||||
&idx.cache,
|
||||
CacheSpec {
|
||||
bucket: "stockbit-intraday",
|
||||
|
|
@ -87,7 +87,11 @@ impl Market<'_> {
|
|||
policy,
|
||||
|| provider.intraday(&resolved),
|
||||
Ok,
|
||||
)
|
||||
)?;
|
||||
// Stockbit's page keeps the last session's chart up after the close,
|
||||
// so a cached or lagging day reads as current unless it is marked.
|
||||
mark_behind_session(&mut day.data.quote, latest_session(Utc::now()));
|
||||
Ok(day)
|
||||
}
|
||||
|
||||
/// Resolves the history source for an optional `--history-provider`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue