13.8 miliona feature redova za 412 od 413 parova. Cache-hit put 4.5x brži, auto-recompute zakačen na dnevni catchup, 4/4 validacije prošle.
Posle Faze 4, svi generatori automatski koriste precomputed features iz cache-a (RSI, EMA-20/50/200, ADX/+DI/-DI, BB width, ATR, supertrend, taker_buy_ratio, vol_z, BTC cross-features). Daily catchup automatski recompute-uje features za simbole sa novim klines-ima.
Pokrenut tools/history_cache/build_features_cache.py --all — preračunato compute_features() za sve (symbol, timeframe) iz klines_cache.db.
Rezultat:
btc_close, btc_ema_fast, btc_ret_pct) integrisani gde BTC klines postojalilist()-irala generator pre print-a)Patch-ovano build_features_cache.py da printuje progres live — future runs imaju vidljiv progres.
src/klines_cache_maintenance.py)daily_catchup() sad ima recompute_features=True flag (default ON):
_async_daily_catchup tracks touched set svih simbola sa novim klines insert-ima_recompute_features() poziva feature_store.compute_features() + persist_features() za poslednjih 500 rows po (symbol, interval) — pokriva EMA-200 warm-up sa rezervomSummary output:
{
"status": "finished",
"touched_symbols": ["..."],
"features_recompute": {"pairs_recomputed": N, "rows_written": M, "errors": 0}
}_build_context.get_features() u generator_manager.py već postoji od ranije (IMPROVEMENT_PLAN A.1). Cache-first sa fallback-om na compute:
if config is None:
conn = _features_conn()
if conn is not None:
cached = _feature_store.get_features(conn, symbol, tf, start=start_dt, end=end_dt)
if cached is not None and not cached.empty:
return cached # cache hit
# Fallback: compute on the fly
return _feature_store.compute_features(klines, config=config)Generator code (growth_threshold_quality_*) već poziva get_features(...) — bez izmena.
Skripta: tools/analysis/faza4_verify.py
get_features() canonical config (cache path): 180 rows u 6.6msget_features() non-canonical config (compute path): 180 rows u 29.5msfinishedema_fast: 0.000028 (na ~$60k BTC = 4.7e-10 relativno, machine precision)rsi: 0.000073 (na 0-100 skali = essentially zero)adx: 0.002188 (warm-up window razlika u EWM Wilder smoothing-u)Drift od 0.002 u ADX je posledica EWM beskonačne memorije: cached features su computed nad celom 5y istorijom, fresh compute samo nad 30-dnevnim test prozorom. Apsolutno neuticajno za signal generation.
klines → compute_features() na svaki pozivfeatures tabeli (idempotent kroz INSERT OR REPLACE)Backtest over 5y više ne mora da:
Promene parametara koje BIRAJU druge indikatore (canonical config) ne troše ništa — cache se koristi. Promene parametara koje MODIFIKUJU indikator parametre (npr. ema_fast=21 umesto 20) padaju na fallback compute, kao i pre.
Multi-exchange podrška kroz ccxt — Kraken, Bybit, OKX, Coinbase. Treba exchange kolonu u klines PRIMARY KEY, sanity-check eksperiment BTC tri-exchange compare, manifest per-generator "exchange" polje.
tools/history_cache/build_features_cache.py (live progress), src/klines_cache_maintenance.py (_recompute_features + touched tracking)src/feature_store.py (compute + persist), _build_context.get_features u GM, features tabela u klines_cache.dbtools/analysis/faza4_verify.pyIzvor: crypto_scanner/reports/analysis/2026-05-20_faza4_features_precompute.md