feat: Add improved local prompt with MultiIndex code examples (v3)

- Create prompts/local/factor_discovery_v3.yaml
- Add working MultiIndex code pattern (unstack/stack)
- Show WRONG patterns to avoid (KeyError fixes)
- Add volume warning (FX volume often 0)
- Update prompt_loader to check v3 first

This should fix ~540 code crashes caused by MultiIndex errors.

Also answers: What happens when fin_quant runs now?
1. LLM generates factor code using NEW v3 prompt (with examples)
2. Code is executed and validated
3. Qlib backtest runs in Docker
4. Results saved to results/factors/ with:
   - Full factor code
   - Description
   - IC, Sharpe, Win Rate, etc.
5. Results saved to SQLite database
This commit is contained in:
TPTBusiness
2026-04-04 22:59:46 +02:00
parent c049742df7
commit 86d415056e
+2 -2
View File
@@ -39,8 +39,8 @@ def get_local_prompt_path(name: str) -> Optional[Path]:
if not LOCAL_PROMPTS_DIR.exists():
return None
# Try versioned files first (v2, v1, etc.)
for version in ["v2", "v1"]:
# Try versioned files first (v3, v2, v1, etc.)
for version in ["v3", "v2", "v1"]:
for ext in ["yaml", "yml"]:
path = LOCAL_PROMPTS_DIR / f"{name}_{version}.{ext}"
if path.exists():