-
Notifications
You must be signed in to change notification settings - Fork 0
Config Resolution
Indicator windows come from embedded defaults (DEFAULT_CONFIG in src/indicators.py) or from an optional JSON file passed as -c / --config_json.
Each tunable family uses nested keys:
<family_key>[<period>][<timeframe_interval>]
Example: defaults["rsi_window"]["5y"]["1d"] → integer window length.
-
period: must match the period string for the current row (e.g.5yfromrun_main). -
timeframe_interval: must be the interval string for that run (e.g.1d,1wk), not the whole timeframe JSON object.
Canonical defaults also live in src/default_configs.json (kept in sync with the embedded string in code).
When config is not None, the code uses a per-family switch:
- If the top-level key exists (e.g.
"sma_window" in config), all lookups for that family useconfig["sma_window"][period][time_frame]. - If the key is absent, that family falls back entirely to
defaults[...].
There is no deep merge inside a family: you cannot override only 5y/1d for sma_window while leaving other period/timeframe cells to defaults unless you include the key and supply all cells you need, or omit the key and use defaults only.
Practical rule: either omit a family key to use defaults for that family, or supply a complete nested map for that family for every (period, time_frame) pair you will hit.
When -t points to a JSON file, run_main loads a dict mapping period → interval string. Fetch uses interval = timeframe[period].
calculate_indicators(..., time_frame=...) receives that same time_frame value from run_main. Window resolution uses defaults[...][period][time_frame]. For a dict timeframe, the inner key must be the interval string for that period (e.g. time_frame resolved to "1d"), not the full mapping. If the implementation passes the mapping dict through where a string key is expected, config/default lookup can raise TypeError or mis-key. Prefer a single string -t 1d when validating window behavior unless the codebase explicitly resolves the interval before lookup.
macd_short, macd_long, and macd_signal are resolved together from config or defaults per (period, time_frame).
Related pages:
- Getting Started
- CLI Reference
- Configuration & Templates
- Indicators (Overview)
- Output Formats
- Advanced Usage
- Troubleshooting
- Pipeline
- CLI Parsing
- Data Source (Yahoo Finance)
- Source Data Deep Dive
- Schema Normalization
- Data Shape Invariants
- Output Writing
- Write Output Deep Dive
- Config Resolution
- Polars Engine
- Source Modules
- Testing
- Performance
- Indicators Engine
- Reproducibility