Ngat Core
Overview
Drive ingestion-to-signal execution in the Python compute layer. Use this skill to safely modify actor loops, aggregation semantics, and core interface contracts.
Submodules
core/base.py: abstract interfaces for feed, aggregator, strategy, broker, storage.core/engine.py:Engine,SymbolWorker,OrderAndPositionWorker, Ray orchestration.core/aggregator.py: in-memory tick/candle store and timeframe resampling with parquet dump.core/timeframe_generator_worker.py: aggregate 1m Redis candles into derived frames.core/indicator_generator_worker.py: compute indicators from candles and write signal series.
Pros
- Keep modular boundaries through base interfaces.
- Keep symbol-level concurrency model explicit through dedicated workers.
- Keep caching path simple with Redis + optional parquet mirrors.
Cons
- Keep multiple infinite loops with no cooperative shutdown.
- Keep repeated full-range Redis scans (
-to+) that do not scale. - Keep some dead/commented paths (
on_tickflow mostly bypassed by sync workers).
Caveats
- Treat
indicator_generator_workertimestamp bookkeeping carefully:last_polledmixes millisecond comments with second-based fetches. - Treat
timeframe_generator_workerdata-loop control carefully:breakon missing data exits symbol loop early. - Treat resample rule normalization carefully; timeframe token mapping is duplicated and inconsistent across modules.
- Keep actor construction lightweight; current workers instantiate broker/session paths repeatedly.
Forward Features
- Add incremental window fetches keyed by last successful per-timeframe watermark.
- Add strict actor lifecycle management (
start,pause,shutdown, heartbeats). - Add deterministic replay mode for backtests using stored candles/signals.
- Add unified timeframe utility module used by aggregator, workers, API, and frontend.