Skip to content

Hardcoded preload cache list diverges from TICKERS constant, misses SPY #28

@CarsonBurke

Description

@CarsonBurke

Summary

The preload cache in trading_bots/src/data/historical.rs:34-37 hardcodes 13 tickers that don't match the TICKERS constant defined in trading_bots/src/constants.rs:11-14 (7 tickers).

TICKERS constant (active): SPY, TSLA, AAPL, MSFT, AMD, INTC, NVDA

Preload cache list: TSLA, AAPL, MSFT, NVDA, INTC, AMD, ADBE, GOOG, META, NKE, DELL, CMCSA, FDX

Impact

  • SPY is in TICKERS but not in the preload list, so it is always loaded from disk on first access instead of being cached at startup.
  • 6 tickers (ADBE, GOOG, META, NKE, DELL, CMCSA, FDX) are preloaded into memory but never used, wasting memory and startup time.

Additional divergence

There are also hardcoded ticker lists in the environment modules that diverge from both:

  • trading_bots/src/torch/env/env.rs:29-32AVAILABLE_TICKERS (13 tickers, matches preload list)
  • trading_bots/src/torch/env/vec_env.rs:57AVAILABLE_TICKERS (6 tickers, a different subset)

All of these should likely reference the single TICKERS constant to stay in sync.

Suggested fix

Replace the hardcoded list in get_or_init_cache() with crate::constants::TICKERS, and similarly update the AVAILABLE_TICKERS constants in the env modules.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority: lowLow severity bug

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions