Skip to content

Add cached GetIndicators, SeedCandles helper#3

Merged
khavrks merged 1 commit into
mainfrom
cached-indicators-seed-candles
Apr 6, 2026
Merged

Add cached GetIndicators, SeedCandles helper#3
khavrks merged 1 commit into
mainfrom
cached-indicators-seed-candles

Conversation

@khavrks

@khavrks khavrks commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • GetIndicators caching: Worker recalculates technical.TechnicalIndicators on every candle update and caches the result. Exposed via Snapshot.Indicators and worker.GetIndicators() — zero computation on read.
  • SeedCandles: New worker.SeedCandles([]CandleHLCV) for bulk-loading historical candles without manual CandleMsg conversion.
  • Docs updated: Snapshot struct, convenience accessors, historical data seeding section.

Test plan

  • Build passes (go build ./...)
  • Vet passes (go vet ./...)
  • Run examples/basic — verify indicators populate after ~20 candles

- Cache technical indicators in SymbolWorker, recalculated on every
  candle update (>= 14 candles). Exposed via Snapshot.Indicators and
  worker.GetIndicators() — zero computation on read.
- Add SeedCandles([]CandleHLCV) for bulk-loading historical candles
  without manual CandleMsg conversion.
- Update documentation: Snapshot struct, convenience accessors,
  historical data seeding section.
@khavrks khavrks merged commit 960c825 into main Apr 6, 2026
2 checks passed
@khavrks khavrks deleted the cached-indicators-seed-candles branch April 6, 2026 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant