diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3dd0922f..3f273b32 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,4 +1,4 @@ -# Pre-commit hooks configuration for Predix +# Pre-commit hooks configuration for NexQuant # See https://pre-commit.com for more information repos: diff --git a/CHANGELOG.md b/CHANGELOG.md index bd692b42..5917c550 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,589 +1,589 @@ # Changelog -## [0.8.0](https://github.com/TPTBusiness/Predix/compare/v1.4.2...v0.8.0) (2026-05-04) +## [0.8.0](https://github.com/TPTBusiness/NexQuant/compare/v1.4.2...v0.8.0) (2026-05-04) ### Features -* [AutoRL-Bench] Update DeepSearchQA split and translate task instructions to English ([#1368](https://github.com/TPTBusiness/Predix/issues/1368)) ([ffb9491](https://github.com/TPTBusiness/Predix/commit/ffb9491c4703290a5b292baa6328ae06bc520f9b)) -* Add 'predix evaluate' command to CLI ([4308c25](https://github.com/TPTBusiness/Predix/commit/4308c257e7c83ab8ec5ef0a719b040f936bad0b3)) -* Add 'predix top' command + explain factor evaluation results ([ac3334c](https://github.com/TPTBusiness/Predix/commit/ac3334c17d8dce48a5081e45d407ccadedfec713)) -* Add 6 new CLI commands - all scripts integrated with local LLM ([e0dd07a](https://github.com/TPTBusiness/Predix/commit/e0dd07aa99ce33c2fc050d3d40b4520f245adb90)) -* add a rag mcp in proposal ([#1267](https://github.com/TPTBusiness/Predix/issues/1267)) ([dc7b732](https://github.com/TPTBusiness/Predix/commit/dc7b732b2c428e3cca3373e839a0e724a844c79b)) -* add a web UI server ([#1345](https://github.com/TPTBusiness/Predix/issues/1345)) ([1439548](https://github.com/TPTBusiness/Predix/commit/14395488b9c7ea476022a32211ea46de9925cf11)) -* Add advanced ML models (Transformer, TCN, PatchTST, CNN+LSTM) ([44760f8](https://github.com/TPTBusiness/Predix/commit/44760f83c3d3d38033f5d94f4ba37dc0c25b7f59)) -* Add AI Strategy Builder (StrategyCoSTEER) - Closed Source ([089189d](https://github.com/TPTBusiness/Predix/commit/089189d8ec058edefd0b81c2689b54f5180b9052)) -* Add beautiful CLI welcome screen for GitHub README ([9e4a97d](https://github.com/TPTBusiness/Predix/commit/9e4a97d3d7e6d5328c4ffa39ce833591f10ab731)) -* Add CLI model selection (local vs OpenRouter) ([c37935a](https://github.com/TPTBusiness/Predix/commit/c37935aa8c108a6bca393bcda274cda148101456)) -* Add complete ML pipeline with graceful degradation (closed source) ([ed6b906](https://github.com/TPTBusiness/Predix/commit/ed6b906248ac3068a4f188d01bcde403e93abc0c)) -* add daily log rotation, llama health wait, factor auto-fixer, and README updates ([2238fed](https://github.com/TPTBusiness/Predix/commit/2238fed701bd8a6ab1da1d3614d1c6d501e1ecbc)) -* Add factor code and description to saved results ([b6b378d](https://github.com/TPTBusiness/Predix/commit/b6b378da8abf6f15be0c91e83508dc21d27b5b14)) -* Add GitHub infrastructure, CI/CD pipelines, and examples ([26bd87e](https://github.com/TPTBusiness/Predix/commit/26bd87ed0a13da7190c8481356574bb710d00772)) -* add improve_mode to MultiProcessEvolvingStrategy for selective task implementation ([#1273](https://github.com/TPTBusiness/Predix/issues/1273)) ([03f22dc](https://github.com/TPTBusiness/Predix/commit/03f22dc7c72a039ee6f1a0e8d0393f35117ec3e1)) -* Add improved local prompt with MultiIndex code examples (v3) ([a729eb7](https://github.com/TPTBusiness/Predix/commit/a729eb715353961f71e92ddb679406c3c30b83d3)) -* add Kronos CLI commands, expand tests, document in README ([24a51e4](https://github.com/TPTBusiness/Predix/commit/24a51e4322ef80d5f882697a930f1d1985aa5779)) -* add LLM-finetune scenario ([#1314](https://github.com/TPTBusiness/Predix/issues/1314)) ([6e19c9e](https://github.com/TPTBusiness/Predix/commit/6e19c9e632cf07059c19993f2d4fbc772fb3cf13)) -* add mask inference in debug mode ([#1154](https://github.com/TPTBusiness/Predix/issues/1154)) ([b4117cf](https://github.com/TPTBusiness/Predix/commit/b4117cf58a5618e1d9e92abb46e1c1dd98af5f13)) -* Add model loader system (same as prompts) ([b7e397b](https://github.com/TPTBusiness/Predix/commit/b7e397b6f271e2cab5312f597cfbcb9652472298)) -* add option to enable hyperparameter tuning only in first eval loop ([#1211](https://github.com/TPTBusiness/Predix/issues/1211)) ([f82de4a](https://github.com/TPTBusiness/Predix/commit/f82de4a380fa31a04a8494b196a743333aadf096)) -* Add P5 ML Training Pipeline with LightGBM and 46 tests ([c934276](https://github.com/TPTBusiness/Predix/commit/c9342761ff8ab9adef69b65eb4cd8f206327fc97)) -* Add parallel run system with API key distribution ([31fb7d5](https://github.com/TPTBusiness/Predix/commit/31fb7d56e3b6530091bef2c16e057a249caf4a93)) -* add previous runner loops to runner history ([#1142](https://github.com/TPTBusiness/Predix/issues/1142)) ([2426a1d](https://github.com/TPTBusiness/Predix/commit/2426a1dc6700cc208360944cead9214a3da04889)) -* add reasoning attribute to DSRunnerFeedback for enhanced evaluation context ([#1162](https://github.com/TPTBusiness/Predix/issues/1162)) ([bfa4525](https://github.com/TPTBusiness/Predix/commit/bfa452541c1422c02f77491e70927ce43f21810c)) -* Add RL Trading Agent system with 99 tests ([0c4cb7a](https://github.com/TPTBusiness/Predix/commit/0c4cb7ad0c9842dd8fb73454bf554e9bedaf72f5)) -* add runtime backtest verification (10 invariant checks in <1ms) + 489 tests + README docs ([26db657](https://github.com/TPTBusiness/Predix/commit/26db65736431313bcdc27b6defde625db4133516)) -* add show_hard_limit option and update time limit handling in DataScience settings ([#1144](https://github.com/TPTBusiness/Predix/issues/1144)) ([8a3e42d](https://github.com/TPTBusiness/Predix/commit/8a3e42d7fe8c36324c7578ede661297f2af59a37)) -* Add simple factor evaluator with direct IC/Sharpe computation ([c7f23d0](https://github.com/TPTBusiness/Predix/commit/c7f23d026419060df3fcb3748740df8cc594bf39)) -* Add start_llama and start_loop CLI commands ([c1d1844](https://github.com/TPTBusiness/Predix/commit/c1d184442aac79ca69b1e366bff7311973459869)) -* add stdout into workspace for easier debugging ([#1236](https://github.com/TPTBusiness/Predix/issues/1236)) ([0daeb82](https://github.com/TPTBusiness/Predix/commit/0daeb82d6330e46edfeedc6b704b1a1c01d1a111)) -* add time ratio limit for hyperparameter tuning in Kaggle settin… ([#1135](https://github.com/TPTBusiness/Predix/issues/1135)) ([6a49981](https://github.com/TPTBusiness/Predix/commit/6a4998154d000d95d7a5ec7cfb5e59305d4cbd11)) -* Add Trading Protection System with 4 protections + comprehensive tests ([a9e0eff](https://github.com/TPTBusiness/Predix/commit/a9e0eff35d07c5b5223f64af343f8d2ece8d0053)) -* add user interaction in data science scenario ([#1251](https://github.com/TPTBusiness/Predix/issues/1251)) ([6e09dc6](https://github.com/TPTBusiness/Predix/commit/6e09dc6d692f3ae2fcc0ffddf620e8f3e8dc1bd9)) -* Auto-start dashboard for fin_quant ([3441604](https://github.com/TPTBusiness/Predix/commit/34416041c122b6a51ce94db1031f315c3639a4a5)) -* Auto-start dashboard for fin_quant ([52d2b89](https://github.com/TPTBusiness/Predix/commit/52d2b8914815fa97d6b53b7cc7e817828520817e)) -* **backtest:** add FTMO-realistic backtest mode with leverage, daily/total loss limits and realistic EUR/USD costs ([c5012e1](https://github.com/TPTBusiness/Predix/commit/c5012e1a1c7e5cff6c82bc42bd0ba34affb75c10)) -* **backtest:** add rolling walk-forward validation and Monte Carlo trade permutation test ([d284d3e](https://github.com/TPTBusiness/Predix/commit/d284d3e74610c5f8ed314fa870cfb7f28a7681d4)) -* **backtest:** add walk-forward OOS validation to backtest_signal_ftmo ([329841f](https://github.com/TPTBusiness/Predix/commit/329841f05a64ee9cdbaced2c4ec4de9436d3d42a)) -* Backtesting Engine + Risk Management + Results Database ([cce889a](https://github.com/TPTBusiness/Predix/commit/cce889a1b7ee58f0042bc6c8cf01f5631ad45fa7)) -* Backtesting Engine + Risk Management + Results DB ([86ef426](https://github.com/TPTBusiness/Predix/commit/86ef4269a350535871cb2f3f80d4d8e9e5c9258f)) -* **backtest:** use backtest_signal_ftmo in strategy orchestrator and optuna optimizer ([994080e](https://github.com/TPTBusiness/Predix/commit/994080ef36e572f688b1d3cc219170bb340fc175)) -* Beautiful CLI dashboard + corrected start command ([c2932cb](https://github.com/TPTBusiness/Predix/commit/c2932cb06904b041e1376d534309864d9d0e9122)) -* Centralize all prompts in prompts/ directory ([3ff1ef8](https://github.com/TPTBusiness/Predix/commit/3ff1ef8557ef41d96b48c43efc2fe5795869fed0)) -* CLI Commands for strategy generation (P4 complete) ([1f7ef1b](https://github.com/TPTBusiness/Predix/commit/1f7ef1b86f46153ff6e6cbde77e01c1ae08b905f)) -* Complete P6-P9 implementation (73 tests) ([6981e91](https://github.com/TPTBusiness/Predix/commit/6981e9141d1f1f0951647971c10c1b9db227134a)) -* continuous strategy generator (WF, MTF, stability, ML models, auto-ensemble) ([a206a31](https://github.com/TPTBusiness/Predix/commit/a206a31dbb831d6deed0492b73a9e246634fe074)) -* create Jupyter notebook pipeline file based on main.py file ([#1134](https://github.com/TPTBusiness/Predix/issues/1134)) ([f03b1b9](https://github.com/TPTBusiness/Predix/commit/f03b1b918d32ec5a0ace1443d9f22e0c0598b2fc)) -* Data Loader module with tests (P0 complete) ([af45cdf](https://github.com/TPTBusiness/Predix/commit/af45cdf074d7c3df02c535728ac55e69f214f1e3)) -* Diverse factor selection + improved prompt v3 ([ea47f75](https://github.com/TPTBusiness/Predix/commit/ea47f75eda41398699f376219ec2c883c9d67798)) -* enable finetune llm ([#1055](https://github.com/TPTBusiness/Predix/issues/1055)) ([35c209b](https://github.com/TPTBusiness/Predix/commit/35c209b09295d28d6d835c720fa1d300bdf43d13)) -* enable LLM‑based hypothesis selection with time‑aware prompt & colored logging ([#1122](https://github.com/TPTBusiness/Predix/issues/1122)) ([90dd2f7](https://github.com/TPTBusiness/Predix/commit/90dd2f7b9bf49f5e1620e9d2c2eedf6c21f3e839)) -* enable to inject diversity cross async multi-trace ([#1173](https://github.com/TPTBusiness/Predix/issues/1173)) ([b05a530](https://github.com/TPTBusiness/Predix/commit/b05a53012603c21847803e4709da10c5b868cab6)) -* enable walk-forward OOS validation by default in backtest_signal_ftmo ([8853f8e](https://github.com/TPTBusiness/Predix/commit/8853f8e8e14ddabe510cb0ca271092f965b5ea81)) -* enhance timeout handling in CoSTEER and DataScience scenarios ([#1150](https://github.com/TPTBusiness/Predix/issues/1150)) ([811d4e7](https://github.com/TPTBusiness/Predix/commit/811d4e7631dc83f228cd96a2a498803db46256a9)) -* enhance timeout management and knowledge base handling in CoSTEER components ([#1130](https://github.com/TPTBusiness/Predix/issues/1130)) ([305eff1](https://github.com/TPTBusiness/Predix/commit/305eff1c5e36f3da5e93dc165105f50ccb990e32)) -* EURUSD FX patches - prompts, factor spec, experiment settings ([b6cf687](https://github.com/TPTBusiness/Predix/commit/b6cf6874db995ea160457a1628a5691cbc8e5b97)) -* EURUSD model experiment setting + model simulator text patched ([9a17b25](https://github.com/TPTBusiness/Predix/commit/9a17b25d32729453a28dd36246be4c5fdbd3a667)) -* EURUSD Trading-Verbesserungen (Phase 2 & 3) ([05c4e1b](https://github.com/TPTBusiness/Predix/commit/05c4e1ba54b9259d6cc5f0af00a177d9295278a9)) -* EURUSD Trading-Verbesserungen implementiert (Phase 1) ([b95bbf5](https://github.com/TPTBusiness/Predix/commit/b95bbf5900a9e06194ab0e330b662e2b853006ea)) -* EURUSD walk-forward splits, bars terminology, README no $factor ([0eae7d0](https://github.com/TPTBusiness/Predix/commit/0eae7d0ababb422927dd0123118b97724d066ab0)) -* **factor-coder:** Add critical rules to prevent common factor implementation errors ([e5c5d34](https://github.com/TPTBusiness/Predix/commit/e5c5d34eb5d38dd4bd18e9cd06026ba0e5a43344)) -* fallback to acceptable results ([#1129](https://github.com/TPTBusiness/Predix/issues/1129)) ([7fc0916](https://github.com/TPTBusiness/Predix/commit/7fc09169bc5a779eeb650b799a43a36b44930a61)) -* Fast mode - CoSTEER goes to backtest after 1 iteration ([fc830a2](https://github.com/TPTBusiness/Predix/commit/fc830a23bd31a53dab188847b10bf60430d396a8)) -* **fin_quant:** auto-generate Kronos factor before loop start ([0daf7a8](https://github.com/TPTBusiness/Predix/commit/0daf7a8d2bdddd98a0c7d00959a39d4a38084a21)) -* Fix 1min data integration and centralize all prompts ([2e94a4c](https://github.com/TPTBusiness/Predix/commit/2e94a4ce72cd9d0a01eef38c40ce70db1d158bb2)) -* Fix realistic backtesting (Step 1+2) ([9b88ffb](https://github.com/TPTBusiness/Predix/commit/9b88ffbbd695d9486f25631ecf7f92457a23f6fc)) -* Full auto strategy generation in fin_quant loop ([6d2990d](https://github.com/TPTBusiness/Predix/commit/6d2990dfff103e0cb85c0edd092457333d00c19e)) -* Full system integration - RL + Protections + Backtesting + CLI ([60618d9](https://github.com/TPTBusiness/Predix/commit/60618d90f730470b7a9c57bf70c6f9fc45c36ad5)) -* FX feedback loop, EURUSD ticker examples, bars terminology ([781779a](https://github.com/TPTBusiness/Predix/commit/781779a1f8c853eb77253053e23bc10c46dcf402)) -* FX Multi-Agent Validator (TradingAgents-inspired) - Session/Macro/Bull-Bear/Trader ([cddfc53](https://github.com/TPTBusiness/Predix/commit/cddfc53ab07ca75b2364c30b9c2a794383633c2b)) -* improve fallback handling in CoSTEER and add GPU usage guidelin… ([#1165](https://github.com/TPTBusiness/Predix/issues/1165)) ([9c190e3](https://github.com/TPTBusiness/Predix/commit/9c190e3268b4515945dcf5531dbaa222e843ceef)) -* Improve predix portfolio command with robust error handling ([5051527](https://github.com/TPTBusiness/Predix/commit/505152793fe4a1629fa9ecdd8dc03ceb9bcd5db9)) -* Improved LLM prompt + Optuna integration (Step 3+5) ([f72b07c](https://github.com/TPTBusiness/Predix/commit/f72b07ca94acd2b004f4a5b99faa8bb9ca1c7c76)) -* init pydantic ai agent & context 7 mcp ([#1240](https://github.com/TPTBusiness/Predix/issues/1240)) ([5ba5e83](https://github.com/TPTBusiness/Predix/commit/5ba5e8356cbacb5e4bd9f24b26d6f9ac01784822)) -* Integrate critical features into fin_quant workflow (P0+P1) ([484377b](https://github.com/TPTBusiness/Predix/commit/484377bc6dbe3bb216b1ebebb54978db371971cb)) -* Integrate factor code/description saving into fin_quant process ([3b502e9](https://github.com/TPTBusiness/Predix/commit/3b502e9faeab4c7bbd185c9b107b7026b57330f0)) -* integrate Kronos-mini OHLCV foundation model (Option A + B) ([165c156](https://github.com/TPTBusiness/Predix/commit/165c15684c7efe3db7de80b67eb301384d926739)) -* Intelligent embedding chunking instead of truncation ([2d0584b](https://github.com/TPTBusiness/Predix/commit/2d0584b4cd7c1b3d9623acd6e141035d51f535fa)) -* **logging:** write complete LLM prompts and responses to daily JSONL log ([1f83410](https://github.com/TPTBusiness/Predix/commit/1f83410fdd7e242b6cf4eb3aac045d8e6e6b7c70)) -* **mcp:** cache with one-click toggle ([#1269](https://github.com/TPTBusiness/Predix/issues/1269)) ([4f493c8](https://github.com/TPTBusiness/Predix/commit/4f493c8d637dfda42f84af0dc08f8ecfc0501668)) -* mcts policy based on trace scheduler ([#1203](https://github.com/TPTBusiness/Predix/issues/1203)) ([ac6d8ed](https://github.com/TPTBusiness/Predix/commit/ac6d8edad4366b08b5caf75e9a5ee8da0061a078)) -* migrate to 1min EURUSD data (2020-2026) ([b39f2b7](https://github.com/TPTBusiness/Predix/commit/b39f2b7e46384c4fc56c1274c9120c470313262b)) -* ML Training Pipeline with 46 tests (P5 complete) ([8f2aa83](https://github.com/TPTBusiness/Predix/commit/8f2aa8341932327dba5e260645bcf96efd5ed548)) -* offline selector ([#1231](https://github.com/TPTBusiness/Predix/issues/1231)) ([d4c5399](https://github.com/TPTBusiness/Predix/commit/d4c539912abdb60e9d8950e7ea1186fd32bfeef3)) -* optimize strategy generator (cache OHLCV, min_sharpe 1.5, predix generate-strategies CLI) ([def3975](https://github.com/TPTBusiness/Predix/commit/def39755793b16920c877045dd6628cb6a9aa9e8)) -* **optimizer:** add max_positions parameter to Optuna search space ([f7b23b9](https://github.com/TPTBusiness/Predix/commit/f7b23b950f8f59b1b2efa66664ac2180ce136410)) -* Optuna Parameter Optimizer with 60 tests (P3 complete) ([5583bf8](https://github.com/TPTBusiness/Predix/commit/5583bf874ed36886fa0d24e3472b8062abbd0b86)) -* PDF performance reports for strategies (reportlab) ([b86e412](https://github.com/TPTBusiness/Predix/commit/b86e41209cd41e02de4ad3de3281b6558fdad059)) -* predix.py wrapper for dashboard support ([757c66c](https://github.com/TPTBusiness/Predix/commit/757c66cddb18254220db1d571d9b739380c57f44)) -* prob-based trace scheduler ([#1131](https://github.com/TPTBusiness/Predix/issues/1131)) ([7e15b5e](https://github.com/TPTBusiness/Predix/commit/7e15b5e2003628f40be12674a73197a956d86545)) -* Realistic backtesting with OHLCV data (P5 continued) ([1506439](https://github.com/TPTBusiness/Predix/commit/1506439a1950a2e87cd662dfeec9e8b5fa1baf20)) -* Realistic backtesting with OHLCV data and spread costs ([85a1e29](https://github.com/TPTBusiness/Predix/commit/85a1e2929acf0ea0f582a66f6261dd697f0260db)) -* Redirect RD-Agent workspace to results/ directory ([fd2def0](https://github.com/TPTBusiness/Predix/commit/fd2def052a02e0f818a7cc705bdc2caaee2f01d2)) -* refactor CoSTEER classes to use DSCoSTEER and update max seconds handling ([#1156](https://github.com/TPTBusiness/Predix/issues/1156)) ([c111966](https://github.com/TPTBusiness/Predix/commit/c111966d1975a4952c1266fb6d6af1c4f5fe83c1)) -* refine the logic of enabling hyperparameter tuning and add criteira ([#1175](https://github.com/TPTBusiness/Predix/issues/1175)) ([e77572f](https://github.com/TPTBusiness/Predix/commit/e77572fb5347e40506fb7b5b25dd861e5f9ebb2b)) -* **rl:** add AutoRL-Bench framework and benchmark integrations ([#1348](https://github.com/TPTBusiness/Predix/issues/1348)) ([7cd64a2](https://github.com/TPTBusiness/Predix/commit/7cd64a26fd84017042eb163e8eb4d3bd30c16de7)) -* Save all factor results to results/factors/ ([2abbec9](https://github.com/TPTBusiness/Predix/commit/2abbec9fde67f52bcf1f199e7d18f7d99f04805e)) -* Save factor results immediately after each evaluation ([72c5ec5](https://github.com/TPTBusiness/Predix/commit/72c5ec55f20964917fe9ed21a77f80e0394f61e8)) -* **scripts:** add full file logging to strategy generation and rebacktest scripts ([c629af5](https://github.com/TPTBusiness/Predix/commit/c629af5b19df26330a131f510154fb5543709a66)) -* show the summarized final difference between the final workspace and the base workspace ([#1281](https://github.com/TPTBusiness/Predix/issues/1281)) ([35a7ae5](https://github.com/TPTBusiness/Predix/commit/35a7ae5e1ff929b3ee3b77c04cb1f4a684a4b2d7)) -* **strategies:** make OOS validation mandatory in strategy generator ([0f4c7c4](https://github.com/TPTBusiness/Predix/commit/0f4c7c4f46d4fd2fb8ff7c4b1eea58538c7db1b3)) -* Strategy Generator working with local LLM (P0-P4) ([036edee](https://github.com/TPTBusiness/Predix/commit/036edeeb77d1a99a0a748a357038c6da3efdd5e7)) -* Strategy Orchestrator with 30 tests (P2 complete) ([9af5cdb](https://github.com/TPTBusiness/Predix/commit/9af5cdbde4996b05a98e59c5c577e487e2d535bd)) -* Strategy performance reports, CLI docs, and README update ([232e918](https://github.com/TPTBusiness/Predix/commit/232e918b48eabeed22e3b712048fb96089b99067)) -* Strategy Worker module with 41 tests (P1 complete) ([b8acf82](https://github.com/TPTBusiness/Predix/commit/b8acf82ed26ffd131ca32bf5272547ff11bd5eef)) -* **strategy:** Continuous optimization with Optuna parameter injection ([da90ae2](https://github.com/TPTBusiness/Predix/commit/da90ae271e46260910023f8a9e3798365b80b298)) -* streamline hyperparameter tuning checks and update evaluation g… ([#1167](https://github.com/TPTBusiness/Predix/issues/1167)) ([5866230](https://github.com/TPTBusiness/Predix/commit/586623084f5d59d88645e75ceab6d795ec497cab)) -* Support 25+ parallel runs with resource warnings ([7a4dd1a](https://github.com/TPTBusiness/Predix/commit/7a4dd1aa7454560d84993ee8827e005ee0795c37)) -* ui, support disable cache ([#1217](https://github.com/TPTBusiness/Predix/issues/1217)) ([70fd91c](https://github.com/TPTBusiness/Predix/commit/70fd91cd051b2006df876ef6aa47a616058af95f)) -* unified backtest engine, LLM error handling, strategy refactor ([1ddb114](https://github.com/TPTBusiness/Predix/commit/1ddb1142a2f21ed3a498292ac8f5af6bbc351e7c)) -* update README with latest paper acceptance to NeurIPS 2025 ([#1252](https://github.com/TPTBusiness/Predix/issues/1252)) ([12969b4](https://github.com/TPTBusiness/Predix/commit/12969b491eafab626ce71f7e530458dab6f43246)) -* zentrale data_config.yaml + apply_config.py für dynamische Datenkonfiguration ([b7c1e4d](https://github.com/TPTBusiness/Predix/commit/b7c1e4db8e29e960fe28393911d60fc0fd3ca413)) +* [AutoRL-Bench] Update DeepSearchQA split and translate task instructions to English ([#1368](https://github.com/TPTBusiness/NexQuant/issues/1368)) ([ffb9491](https://github.com/TPTBusiness/NexQuant/commit/ffb9491c4703290a5b292baa6328ae06bc520f9b)) +* Add 'nexquant evaluate' command to CLI ([4308c25](https://github.com/TPTBusiness/NexQuant/commit/4308c257e7c83ab8ec5ef0a719b040f936bad0b3)) +* Add 'nexquant top' command + explain factor evaluation results ([ac3334c](https://github.com/TPTBusiness/NexQuant/commit/ac3334c17d8dce48a5081e45d407ccadedfec713)) +* Add 6 new CLI commands - all scripts integrated with local LLM ([e0dd07a](https://github.com/TPTBusiness/NexQuant/commit/e0dd07aa99ce33c2fc050d3d40b4520f245adb90)) +* add a rag mcp in proposal ([#1267](https://github.com/TPTBusiness/NexQuant/issues/1267)) ([dc7b732](https://github.com/TPTBusiness/NexQuant/commit/dc7b732b2c428e3cca3373e839a0e724a844c79b)) +* add a web UI server ([#1345](https://github.com/TPTBusiness/NexQuant/issues/1345)) ([1439548](https://github.com/TPTBusiness/NexQuant/commit/14395488b9c7ea476022a32211ea46de9925cf11)) +* Add advanced ML models (Transformer, TCN, PatchTST, CNN+LSTM) ([44760f8](https://github.com/TPTBusiness/NexQuant/commit/44760f83c3d3d38033f5d94f4ba37dc0c25b7f59)) +* Add AI Strategy Builder (StrategyCoSTEER) - Closed Source ([089189d](https://github.com/TPTBusiness/NexQuant/commit/089189d8ec058edefd0b81c2689b54f5180b9052)) +* Add beautiful CLI welcome screen for GitHub README ([9e4a97d](https://github.com/TPTBusiness/NexQuant/commit/9e4a97d3d7e6d5328c4ffa39ce833591f10ab731)) +* Add CLI model selection (local vs OpenRouter) ([c37935a](https://github.com/TPTBusiness/NexQuant/commit/c37935aa8c108a6bca393bcda274cda148101456)) +* Add complete ML pipeline with graceful degradation (closed source) ([ed6b906](https://github.com/TPTBusiness/NexQuant/commit/ed6b906248ac3068a4f188d01bcde403e93abc0c)) +* add daily log rotation, llama health wait, factor auto-fixer, and README updates ([2238fed](https://github.com/TPTBusiness/NexQuant/commit/2238fed701bd8a6ab1da1d3614d1c6d501e1ecbc)) +* Add factor code and description to saved results ([b6b378d](https://github.com/TPTBusiness/NexQuant/commit/b6b378da8abf6f15be0c91e83508dc21d27b5b14)) +* Add GitHub infrastructure, CI/CD pipelines, and examples ([26bd87e](https://github.com/TPTBusiness/NexQuant/commit/26bd87ed0a13da7190c8481356574bb710d00772)) +* add improve_mode to MultiProcessEvolvingStrategy for selective task implementation ([#1273](https://github.com/TPTBusiness/NexQuant/issues/1273)) ([03f22dc](https://github.com/TPTBusiness/NexQuant/commit/03f22dc7c72a039ee6f1a0e8d0393f35117ec3e1)) +* Add improved local prompt with MultiIndex code examples (v3) ([a729eb7](https://github.com/TPTBusiness/NexQuant/commit/a729eb715353961f71e92ddb679406c3c30b83d3)) +* add Kronos CLI commands, expand tests, document in README ([24a51e4](https://github.com/TPTBusiness/NexQuant/commit/24a51e4322ef80d5f882697a930f1d1985aa5779)) +* add LLM-finetune scenario ([#1314](https://github.com/TPTBusiness/NexQuant/issues/1314)) ([6e19c9e](https://github.com/TPTBusiness/NexQuant/commit/6e19c9e632cf07059c19993f2d4fbc772fb3cf13)) +* add mask inference in debug mode ([#1154](https://github.com/TPTBusiness/NexQuant/issues/1154)) ([b4117cf](https://github.com/TPTBusiness/NexQuant/commit/b4117cf58a5618e1d9e92abb46e1c1dd98af5f13)) +* Add model loader system (same as prompts) ([b7e397b](https://github.com/TPTBusiness/NexQuant/commit/b7e397b6f271e2cab5312f597cfbcb9652472298)) +* add option to enable hyperparameter tuning only in first eval loop ([#1211](https://github.com/TPTBusiness/NexQuant/issues/1211)) ([f82de4a](https://github.com/TPTBusiness/NexQuant/commit/f82de4a380fa31a04a8494b196a743333aadf096)) +* Add P5 ML Training Pipeline with LightGBM and 46 tests ([c934276](https://github.com/TPTBusiness/NexQuant/commit/c9342761ff8ab9adef69b65eb4cd8f206327fc97)) +* Add parallel run system with API key distribution ([31fb7d5](https://github.com/TPTBusiness/NexQuant/commit/31fb7d56e3b6530091bef2c16e057a249caf4a93)) +* add previous runner loops to runner history ([#1142](https://github.com/TPTBusiness/NexQuant/issues/1142)) ([2426a1d](https://github.com/TPTBusiness/NexQuant/commit/2426a1dc6700cc208360944cead9214a3da04889)) +* add reasoning attribute to DSRunnerFeedback for enhanced evaluation context ([#1162](https://github.com/TPTBusiness/NexQuant/issues/1162)) ([bfa4525](https://github.com/TPTBusiness/NexQuant/commit/bfa452541c1422c02f77491e70927ce43f21810c)) +* Add RL Trading Agent system with 99 tests ([0c4cb7a](https://github.com/TPTBusiness/NexQuant/commit/0c4cb7ad0c9842dd8fb73454bf554e9bedaf72f5)) +* add runtime backtest verification (10 invariant checks in <1ms) + 489 tests + README docs ([26db657](https://github.com/TPTBusiness/NexQuant/commit/26db65736431313bcdc27b6defde625db4133516)) +* add show_hard_limit option and update time limit handling in DataScience settings ([#1144](https://github.com/TPTBusiness/NexQuant/issues/1144)) ([8a3e42d](https://github.com/TPTBusiness/NexQuant/commit/8a3e42d7fe8c36324c7578ede661297f2af59a37)) +* Add simple factor evaluator with direct IC/Sharpe computation ([c7f23d0](https://github.com/TPTBusiness/NexQuant/commit/c7f23d026419060df3fcb3748740df8cc594bf39)) +* Add start_llama and start_loop CLI commands ([c1d1844](https://github.com/TPTBusiness/NexQuant/commit/c1d184442aac79ca69b1e366bff7311973459869)) +* add stdout into workspace for easier debugging ([#1236](https://github.com/TPTBusiness/NexQuant/issues/1236)) ([0daeb82](https://github.com/TPTBusiness/NexQuant/commit/0daeb82d6330e46edfeedc6b704b1a1c01d1a111)) +* add time ratio limit for hyperparameter tuning in Kaggle settin… ([#1135](https://github.com/TPTBusiness/NexQuant/issues/1135)) ([6a49981](https://github.com/TPTBusiness/NexQuant/commit/6a4998154d000d95d7a5ec7cfb5e59305d4cbd11)) +* Add Trading Protection System with 4 protections + comprehensive tests ([a9e0eff](https://github.com/TPTBusiness/NexQuant/commit/a9e0eff35d07c5b5223f64af343f8d2ece8d0053)) +* add user interaction in data science scenario ([#1251](https://github.com/TPTBusiness/NexQuant/issues/1251)) ([6e09dc6](https://github.com/TPTBusiness/NexQuant/commit/6e09dc6d692f3ae2fcc0ffddf620e8f3e8dc1bd9)) +* Auto-start dashboard for fin_quant ([3441604](https://github.com/TPTBusiness/NexQuant/commit/34416041c122b6a51ce94db1031f315c3639a4a5)) +* Auto-start dashboard for fin_quant ([52d2b89](https://github.com/TPTBusiness/NexQuant/commit/52d2b8914815fa97d6b53b7cc7e817828520817e)) +* **backtest:** add FTMO-realistic backtest mode with leverage, daily/total loss limits and realistic EUR/USD costs ([c5012e1](https://github.com/TPTBusiness/NexQuant/commit/c5012e1a1c7e5cff6c82bc42bd0ba34affb75c10)) +* **backtest:** add rolling walk-forward validation and Monte Carlo trade permutation test ([d284d3e](https://github.com/TPTBusiness/NexQuant/commit/d284d3e74610c5f8ed314fa870cfb7f28a7681d4)) +* **backtest:** add walk-forward OOS validation to backtest_signal_ftmo ([329841f](https://github.com/TPTBusiness/NexQuant/commit/329841f05a64ee9cdbaced2c4ec4de9436d3d42a)) +* Backtesting Engine + Risk Management + Results Database ([cce889a](https://github.com/TPTBusiness/NexQuant/commit/cce889a1b7ee58f0042bc6c8cf01f5631ad45fa7)) +* Backtesting Engine + Risk Management + Results DB ([86ef426](https://github.com/TPTBusiness/NexQuant/commit/86ef4269a350535871cb2f3f80d4d8e9e5c9258f)) +* **backtest:** use backtest_signal_ftmo in strategy orchestrator and optuna optimizer ([994080e](https://github.com/TPTBusiness/NexQuant/commit/994080ef36e572f688b1d3cc219170bb340fc175)) +* Beautiful CLI dashboard + corrected start command ([c2932cb](https://github.com/TPTBusiness/NexQuant/commit/c2932cb06904b041e1376d534309864d9d0e9122)) +* Centralize all prompts in prompts/ directory ([3ff1ef8](https://github.com/TPTBusiness/NexQuant/commit/3ff1ef8557ef41d96b48c43efc2fe5795869fed0)) +* CLI Commands for strategy generation (P4 complete) ([1f7ef1b](https://github.com/TPTBusiness/NexQuant/commit/1f7ef1b86f46153ff6e6cbde77e01c1ae08b905f)) +* Complete P6-P9 implementation (73 tests) ([6981e91](https://github.com/TPTBusiness/NexQuant/commit/6981e9141d1f1f0951647971c10c1b9db227134a)) +* continuous strategy generator (WF, MTF, stability, ML models, auto-ensemble) ([a206a31](https://github.com/TPTBusiness/NexQuant/commit/a206a31dbb831d6deed0492b73a9e246634fe074)) +* create Jupyter notebook pipeline file based on main.py file ([#1134](https://github.com/TPTBusiness/NexQuant/issues/1134)) ([f03b1b9](https://github.com/TPTBusiness/NexQuant/commit/f03b1b918d32ec5a0ace1443d9f22e0c0598b2fc)) +* Data Loader module with tests (P0 complete) ([af45cdf](https://github.com/TPTBusiness/NexQuant/commit/af45cdf074d7c3df02c535728ac55e69f214f1e3)) +* Diverse factor selection + improved prompt v3 ([ea47f75](https://github.com/TPTBusiness/NexQuant/commit/ea47f75eda41398699f376219ec2c883c9d67798)) +* enable finetune llm ([#1055](https://github.com/TPTBusiness/NexQuant/issues/1055)) ([35c209b](https://github.com/TPTBusiness/NexQuant/commit/35c209b09295d28d6d835c720fa1d300bdf43d13)) +* enable LLM‑based hypothesis selection with time‑aware prompt & colored logging ([#1122](https://github.com/TPTBusiness/NexQuant/issues/1122)) ([90dd2f7](https://github.com/TPTBusiness/NexQuant/commit/90dd2f7b9bf49f5e1620e9d2c2eedf6c21f3e839)) +* enable to inject diversity cross async multi-trace ([#1173](https://github.com/TPTBusiness/NexQuant/issues/1173)) ([b05a530](https://github.com/TPTBusiness/NexQuant/commit/b05a53012603c21847803e4709da10c5b868cab6)) +* enable walk-forward OOS validation by default in backtest_signal_ftmo ([8853f8e](https://github.com/TPTBusiness/NexQuant/commit/8853f8e8e14ddabe510cb0ca271092f965b5ea81)) +* enhance timeout handling in CoSTEER and DataScience scenarios ([#1150](https://github.com/TPTBusiness/NexQuant/issues/1150)) ([811d4e7](https://github.com/TPTBusiness/NexQuant/commit/811d4e7631dc83f228cd96a2a498803db46256a9)) +* enhance timeout management and knowledge base handling in CoSTEER components ([#1130](https://github.com/TPTBusiness/NexQuant/issues/1130)) ([305eff1](https://github.com/TPTBusiness/NexQuant/commit/305eff1c5e36f3da5e93dc165105f50ccb990e32)) +* EURUSD FX patches - prompts, factor spec, experiment settings ([b6cf687](https://github.com/TPTBusiness/NexQuant/commit/b6cf6874db995ea160457a1628a5691cbc8e5b97)) +* EURUSD model experiment setting + model simulator text patched ([9a17b25](https://github.com/TPTBusiness/NexQuant/commit/9a17b25d32729453a28dd36246be4c5fdbd3a667)) +* EURUSD Trading-Verbesserungen (Phase 2 & 3) ([05c4e1b](https://github.com/TPTBusiness/NexQuant/commit/05c4e1ba54b9259d6cc5f0af00a177d9295278a9)) +* EURUSD Trading-Verbesserungen implementiert (Phase 1) ([b95bbf5](https://github.com/TPTBusiness/NexQuant/commit/b95bbf5900a9e06194ab0e330b662e2b853006ea)) +* EURUSD walk-forward splits, bars terminology, README no $factor ([0eae7d0](https://github.com/TPTBusiness/NexQuant/commit/0eae7d0ababb422927dd0123118b97724d066ab0)) +* **factor-coder:** Add critical rules to prevent common factor implementation errors ([e5c5d34](https://github.com/TPTBusiness/NexQuant/commit/e5c5d34eb5d38dd4bd18e9cd06026ba0e5a43344)) +* fallback to acceptable results ([#1129](https://github.com/TPTBusiness/NexQuant/issues/1129)) ([7fc0916](https://github.com/TPTBusiness/NexQuant/commit/7fc09169bc5a779eeb650b799a43a36b44930a61)) +* Fast mode - CoSTEER goes to backtest after 1 iteration ([fc830a2](https://github.com/TPTBusiness/NexQuant/commit/fc830a23bd31a53dab188847b10bf60430d396a8)) +* **fin_quant:** auto-generate Kronos factor before loop start ([0daf7a8](https://github.com/TPTBusiness/NexQuant/commit/0daf7a8d2bdddd98a0c7d00959a39d4a38084a21)) +* Fix 1min data integration and centralize all prompts ([2e94a4c](https://github.com/TPTBusiness/NexQuant/commit/2e94a4ce72cd9d0a01eef38c40ce70db1d158bb2)) +* Fix realistic backtesting (Step 1+2) ([9b88ffb](https://github.com/TPTBusiness/NexQuant/commit/9b88ffbbd695d9486f25631ecf7f92457a23f6fc)) +* Full auto strategy generation in fin_quant loop ([6d2990d](https://github.com/TPTBusiness/NexQuant/commit/6d2990dfff103e0cb85c0edd092457333d00c19e)) +* Full system integration - RL + Protections + Backtesting + CLI ([60618d9](https://github.com/TPTBusiness/NexQuant/commit/60618d90f730470b7a9c57bf70c6f9fc45c36ad5)) +* FX feedback loop, EURUSD ticker examples, bars terminology ([781779a](https://github.com/TPTBusiness/NexQuant/commit/781779a1f8c853eb77253053e23bc10c46dcf402)) +* FX Multi-Agent Validator (TradingAgents-inspired) - Session/Macro/Bull-Bear/Trader ([cddfc53](https://github.com/TPTBusiness/NexQuant/commit/cddfc53ab07ca75b2364c30b9c2a794383633c2b)) +* improve fallback handling in CoSTEER and add GPU usage guidelin… ([#1165](https://github.com/TPTBusiness/NexQuant/issues/1165)) ([9c190e3](https://github.com/TPTBusiness/NexQuant/commit/9c190e3268b4515945dcf5531dbaa222e843ceef)) +* Improve nexquant portfolio command with robust error handling ([5051527](https://github.com/TPTBusiness/NexQuant/commit/505152793fe4a1629fa9ecdd8dc03ceb9bcd5db9)) +* Improved LLM prompt + Optuna integration (Step 3+5) ([f72b07c](https://github.com/TPTBusiness/NexQuant/commit/f72b07ca94acd2b004f4a5b99faa8bb9ca1c7c76)) +* init pydantic ai agent & context 7 mcp ([#1240](https://github.com/TPTBusiness/NexQuant/issues/1240)) ([5ba5e83](https://github.com/TPTBusiness/NexQuant/commit/5ba5e8356cbacb5e4bd9f24b26d6f9ac01784822)) +* Integrate critical features into fin_quant workflow (P0+P1) ([484377b](https://github.com/TPTBusiness/NexQuant/commit/484377bc6dbe3bb216b1ebebb54978db371971cb)) +* Integrate factor code/description saving into fin_quant process ([3b502e9](https://github.com/TPTBusiness/NexQuant/commit/3b502e9faeab4c7bbd185c9b107b7026b57330f0)) +* integrate Kronos-mini OHLCV foundation model (Option A + B) ([165c156](https://github.com/TPTBusiness/NexQuant/commit/165c15684c7efe3db7de80b67eb301384d926739)) +* Intelligent embedding chunking instead of truncation ([2d0584b](https://github.com/TPTBusiness/NexQuant/commit/2d0584b4cd7c1b3d9623acd6e141035d51f535fa)) +* **logging:** write complete LLM prompts and responses to daily JSONL log ([1f83410](https://github.com/TPTBusiness/NexQuant/commit/1f83410fdd7e242b6cf4eb3aac045d8e6e6b7c70)) +* **mcp:** cache with one-click toggle ([#1269](https://github.com/TPTBusiness/NexQuant/issues/1269)) ([4f493c8](https://github.com/TPTBusiness/NexQuant/commit/4f493c8d637dfda42f84af0dc08f8ecfc0501668)) +* mcts policy based on trace scheduler ([#1203](https://github.com/TPTBusiness/NexQuant/issues/1203)) ([ac6d8ed](https://github.com/TPTBusiness/NexQuant/commit/ac6d8edad4366b08b5caf75e9a5ee8da0061a078)) +* migrate to 1min EURUSD data (2020-2026) ([b39f2b7](https://github.com/TPTBusiness/NexQuant/commit/b39f2b7e46384c4fc56c1274c9120c470313262b)) +* ML Training Pipeline with 46 tests (P5 complete) ([8f2aa83](https://github.com/TPTBusiness/NexQuant/commit/8f2aa8341932327dba5e260645bcf96efd5ed548)) +* offline selector ([#1231](https://github.com/TPTBusiness/NexQuant/issues/1231)) ([d4c5399](https://github.com/TPTBusiness/NexQuant/commit/d4c539912abdb60e9d8950e7ea1186fd32bfeef3)) +* optimize strategy generator (cache OHLCV, min_sharpe 1.5, nexquant generate-strategies CLI) ([def3975](https://github.com/TPTBusiness/NexQuant/commit/def39755793b16920c877045dd6628cb6a9aa9e8)) +* **optimizer:** add max_positions parameter to Optuna search space ([f7b23b9](https://github.com/TPTBusiness/NexQuant/commit/f7b23b950f8f59b1b2efa66664ac2180ce136410)) +* Optuna Parameter Optimizer with 60 tests (P3 complete) ([5583bf8](https://github.com/TPTBusiness/NexQuant/commit/5583bf874ed36886fa0d24e3472b8062abbd0b86)) +* PDF performance reports for strategies (reportlab) ([b86e412](https://github.com/TPTBusiness/NexQuant/commit/b86e41209cd41e02de4ad3de3281b6558fdad059)) +* nexquant.py wrapper for dashboard support ([757c66c](https://github.com/TPTBusiness/NexQuant/commit/757c66cddb18254220db1d571d9b739380c57f44)) +* prob-based trace scheduler ([#1131](https://github.com/TPTBusiness/NexQuant/issues/1131)) ([7e15b5e](https://github.com/TPTBusiness/NexQuant/commit/7e15b5e2003628f40be12674a73197a956d86545)) +* Realistic backtesting with OHLCV data (P5 continued) ([1506439](https://github.com/TPTBusiness/NexQuant/commit/1506439a1950a2e87cd662dfeec9e8b5fa1baf20)) +* Realistic backtesting with OHLCV data and spread costs ([85a1e29](https://github.com/TPTBusiness/NexQuant/commit/85a1e2929acf0ea0f582a66f6261dd697f0260db)) +* Redirect RD-Agent workspace to results/ directory ([fd2def0](https://github.com/TPTBusiness/NexQuant/commit/fd2def052a02e0f818a7cc705bdc2caaee2f01d2)) +* refactor CoSTEER classes to use DSCoSTEER and update max seconds handling ([#1156](https://github.com/TPTBusiness/NexQuant/issues/1156)) ([c111966](https://github.com/TPTBusiness/NexQuant/commit/c111966d1975a4952c1266fb6d6af1c4f5fe83c1)) +* refine the logic of enabling hyperparameter tuning and add criteira ([#1175](https://github.com/TPTBusiness/NexQuant/issues/1175)) ([e77572f](https://github.com/TPTBusiness/NexQuant/commit/e77572fb5347e40506fb7b5b25dd861e5f9ebb2b)) +* **rl:** add AutoRL-Bench framework and benchmark integrations ([#1348](https://github.com/TPTBusiness/NexQuant/issues/1348)) ([7cd64a2](https://github.com/TPTBusiness/NexQuant/commit/7cd64a26fd84017042eb163e8eb4d3bd30c16de7)) +* Save all factor results to results/factors/ ([2abbec9](https://github.com/TPTBusiness/NexQuant/commit/2abbec9fde67f52bcf1f199e7d18f7d99f04805e)) +* Save factor results immediately after each evaluation ([72c5ec5](https://github.com/TPTBusiness/NexQuant/commit/72c5ec55f20964917fe9ed21a77f80e0394f61e8)) +* **scripts:** add full file logging to strategy generation and rebacktest scripts ([c629af5](https://github.com/TPTBusiness/NexQuant/commit/c629af5b19df26330a131f510154fb5543709a66)) +* show the summarized final difference between the final workspace and the base workspace ([#1281](https://github.com/TPTBusiness/NexQuant/issues/1281)) ([35a7ae5](https://github.com/TPTBusiness/NexQuant/commit/35a7ae5e1ff929b3ee3b77c04cb1f4a684a4b2d7)) +* **strategies:** make OOS validation mandatory in strategy generator ([0f4c7c4](https://github.com/TPTBusiness/NexQuant/commit/0f4c7c4f46d4fd2fb8ff7c4b1eea58538c7db1b3)) +* Strategy Generator working with local LLM (P0-P4) ([036edee](https://github.com/TPTBusiness/NexQuant/commit/036edeeb77d1a99a0a748a357038c6da3efdd5e7)) +* Strategy Orchestrator with 30 tests (P2 complete) ([9af5cdb](https://github.com/TPTBusiness/NexQuant/commit/9af5cdbde4996b05a98e59c5c577e487e2d535bd)) +* Strategy performance reports, CLI docs, and README update ([232e918](https://github.com/TPTBusiness/NexQuant/commit/232e918b48eabeed22e3b712048fb96089b99067)) +* Strategy Worker module with 41 tests (P1 complete) ([b8acf82](https://github.com/TPTBusiness/NexQuant/commit/b8acf82ed26ffd131ca32bf5272547ff11bd5eef)) +* **strategy:** Continuous optimization with Optuna parameter injection ([da90ae2](https://github.com/TPTBusiness/NexQuant/commit/da90ae271e46260910023f8a9e3798365b80b298)) +* streamline hyperparameter tuning checks and update evaluation g… ([#1167](https://github.com/TPTBusiness/NexQuant/issues/1167)) ([5866230](https://github.com/TPTBusiness/NexQuant/commit/586623084f5d59d88645e75ceab6d795ec497cab)) +* Support 25+ parallel runs with resource warnings ([7a4dd1a](https://github.com/TPTBusiness/NexQuant/commit/7a4dd1aa7454560d84993ee8827e005ee0795c37)) +* ui, support disable cache ([#1217](https://github.com/TPTBusiness/NexQuant/issues/1217)) ([70fd91c](https://github.com/TPTBusiness/NexQuant/commit/70fd91cd051b2006df876ef6aa47a616058af95f)) +* unified backtest engine, LLM error handling, strategy refactor ([1ddb114](https://github.com/TPTBusiness/NexQuant/commit/1ddb1142a2f21ed3a498292ac8f5af6bbc351e7c)) +* update README with latest paper acceptance to NeurIPS 2025 ([#1252](https://github.com/TPTBusiness/NexQuant/issues/1252)) ([12969b4](https://github.com/TPTBusiness/NexQuant/commit/12969b491eafab626ce71f7e530458dab6f43246)) +* zentrale data_config.yaml + apply_config.py für dynamische Datenkonfiguration ([b7c1e4d](https://github.com/TPTBusiness/NexQuant/commit/b7c1e4db8e29e960fe28393911d60fc0fd3ca413)) ### Bug Fixes -* (to main) litellm's Timeout error is not picklable ([#1294](https://github.com/TPTBusiness/Predix/issues/1294)) ([315850e](https://github.com/TPTBusiness/Predix/commit/315850ea81761aa2478639ad32302d7a55f8181b)) -* 15 bug fixes across orchestrator, runner, backtest, and infrastructure ([5ec4516](https://github.com/TPTBusiness/Predix/commit/5ec4516ed7bdc44f2fd7d6e3ec9df0a88fc4fd10)) -* add a switch for ensemble_time_upper_bound and fix some bug in main ([#1226](https://github.com/TPTBusiness/Predix/issues/1226)) ([fc18942](https://github.com/TPTBusiness/Predix/commit/fc18942339b3ca59077ddc903f84b2d54193e5bc)) -* Add Bandit security scanning and fix critical vulnerabilities ([f47dcf1](https://github.com/TPTBusiness/Predix/commit/f47dcf1c58d33041bba2f705b270a7f9c4e7d572)) -* Add critical column name rules to factor generation prompt ([bf73725](https://github.com/TPTBusiness/Predix/commit/bf7372533e83da682f1ceefeddc70f142f8ccda2)) -* Add get_factor_count() to QuantTrace to prevent parallel run crashes ([a16db77](https://github.com/TPTBusiness/Predix/commit/a16db77def1ba7adb7bb6734629086a1b5a901cb)) -* add json format response fallback to prompt templates ([#1246](https://github.com/TPTBusiness/Predix/issues/1246)) ([694afd8](https://github.com/TPTBusiness/Predix/commit/694afd81331227d2be7f780f72023d00c0c9864e)) -* add metric in scores.csv and avoid reading sample_submission.csv ([#1152](https://github.com/TPTBusiness/Predix/issues/1152)) ([80c953d](https://github.com/TPTBusiness/Predix/commit/80c953d4053dff66d12e4cf400b069d0fac16cbd)) -* Add missing os import in factor_runner.py ([f201823](https://github.com/TPTBusiness/Predix/commit/f201823c44c724867163f3b2d3ecf49f384a8e35)) -* Add missing Panel import in predix evaluate command ([e21923b](https://github.com/TPTBusiness/Predix/commit/e21923bd13eac6236a2c25d550bae0b984575491)) -* add missing self parameter to instance methods in DSProposalV2ExpGen ([#1213](https://github.com/TPTBusiness/Predix/issues/1213)) ([c8bf617](https://github.com/TPTBusiness/Predix/commit/c8bf617aca57ea9c53d4a76d23806cb5ab5173ab)) -* add missing sys import and fix undefined acc_rate in factor eval ([34323f3](https://github.com/TPTBusiness/Predix/commit/34323f307da6924095efcdaef81f99b95e2820eb)) -* Add nosec comments for schema migration SQL in results_db.py ([3626b22](https://github.com/TPTBusiness/Predix/commit/3626b22482143466b0dec8b63ea0a4a36af06acf)) -* allow prev_out keys to be None in workspace cleanup assertion ([#1214](https://github.com/TPTBusiness/Predix/issues/1214)) ([f02dc5f](https://github.com/TPTBusiness/Predix/commit/f02dc5f47d5973673bcc314ada89933a5d807d21)) -* also catch ValueError in mean_variance for dimension mismatch ([daded85](https://github.com/TPTBusiness/Predix/commit/daded853b6370f0df6f83a6d1b3f04c0dd0757f0)) -* **auto-fixer:** add five new factor code fixes for groupby/apply errors ([d03bcf3](https://github.com/TPTBusiness/Predix/commit/d03bcf3505f1be696e7bddc40f33c4a97b3f7486)) -* **auto-fixer:** add four new factor code fixes for common runtime errors ([21ce0de](https://github.com/TPTBusiness/Predix/commit/21ce0def2dd8352a315e0688ebafc6d62cf0435e)) -* **auto-fixer:** add groupby([level=N,'date']) SyntaxError fix ([d58eba3](https://github.com/TPTBusiness/Predix/commit/d58eba364e6ea14513b64e6bc12256c72111669a)) -* **auto-fixer:** disable _fix_min_periods for intraday data ([665e490](https://github.com/TPTBusiness/Predix/commit/665e4903d8f6f3097a45d07060ab003ebea7f96b)) -* **auto-fixer:** fix chained groupby(level=N).groupby('date') pattern ([9869839](https://github.com/TPTBusiness/Predix/commit/9869839a2c676ddd83f4218e9ff5e50fb8d2d223)) -* **auto-fixer:** fix df.loc[instrument] DateParseError on MultiIndex frames ([87926dc](https://github.com/TPTBusiness/Predix/commit/87926dc41d795a3ab0670e585b99cc21dd09ae5f)) -* **auto-fixer:** fix df['instrument'] KeyError on MultiIndex frames ([63a348e](https://github.com/TPTBusiness/Predix/commit/63a348eb3ec20c209c2d060e086bc69019e92884)) -* **auto-fixer:** fix two assignment-target bugs in instrument column fixers ([a44eba9](https://github.com/TPTBusiness/Predix/commit/a44eba952e031e364050ee3d27a067d17fa01923)) -* **auto-fixer:** preserve date dimension in groupby(['instrument','date']) fix ([37a2f37](https://github.com/TPTBusiness/Predix/commit/37a2f37f74118a2707a6b128d55c45ddb89cc48a)) -* **auto-fixer:** remove ddof from rolling() args, not only from std()/var() ([daacbfd](https://github.com/TPTBusiness/Predix/commit/daacbfd141ae0da99c8c4cb01d5e500528eb7d80)) -* **auto-fixer:** replace zero \$volume with price-range proxy for FX data ([7fcec39](https://github.com/TPTBusiness/Predix/commit/7fcec39f1d8f0f7668435f51a1a9646abcd9c89f)) -* **auto-fixer:** strip spurious .reset_index() after .transform() calls ([c489616](https://github.com/TPTBusiness/Predix/commit/c489616d1a2fd71877a203d880e31281bc008cdf)) -* avoid triggering errors like "RuntimeError: dictionary changed s… ([#1285](https://github.com/TPTBusiness/Predix/issues/1285)) ([b180543](https://github.com/TPTBusiness/Predix/commit/b18054371c6ce08c6bc322a7b0de41b67fc60408)) -* **backtest:** replace broken MC permutation test with binomial win-rate test ([f284b7a](https://github.com/TPTBusiness/Predix/commit/f284b7a9751424201510c5938b4ebf6bd81842b6)) -* cancel tasks on resume and kill subprocesses on termination ([#1166](https://github.com/TPTBusiness/Predix/issues/1166)) ([0e3f4cf](https://github.com/TPTBusiness/Predix/commit/0e3f4cf08f08e27f9c483a5bbe069313d0d8014e)) -* change runner prompts ([#1223](https://github.com/TPTBusiness/Predix/issues/1223)) ([be3433f](https://github.com/TPTBusiness/Predix/commit/be3433f26b04054a482dfdc7cdd5c8c0a756a60c)) -* **ci:** fix closed-source asset check false positives in security workflow ([1473085](https://github.com/TPTBusiness/Predix/commit/14730856636735c17d704854e057fa6e1aea5940)) -* **ci:** lazy import logger in predix.py and cli.py to avoid ImportError in test env ([52d9ff0](https://github.com/TPTBusiness/Predix/commit/52d9ff0cd41d6fc6978e8af7f970cffd6a46f673)) -* **ci:** remove CodeQL workflow (conflicts with default setup), drop duplicate lint job ([ab73425](https://github.com/TPTBusiness/Predix/commit/ab734252f356ac97dea4f70477ebe2fdee30509c)) -* **ci:** remove env-print step to avoid leaking sensitive environment variables ([#1299](https://github.com/TPTBusiness/Predix/issues/1299)) ([c067ea6](https://github.com/TPTBusiness/Predix/commit/c067ea640030c67c549e3ca2dbad178f144e8b31)) -* **ci:** set JAVA_TOOL_OPTIONS UTF-8 in Codacy workflow ([a9c6ea9](https://github.com/TPTBusiness/Predix/commit/a9c6ea99c9ebae2794b1c3f4d1e9da1d4e41376a)) -* clear ws_ckp after extraction to reduce workspace object size ([#1137](https://github.com/TPTBusiness/Predix/issues/1137)) ([28ceb41](https://github.com/TPTBusiness/Predix/commit/28ceb41e1cdb603c4e0bd2fe7b72acef1b29ec47)) -* CLI dashboard in separate terminal window ([b72cca9](https://github.com/TPTBusiness/Predix/commit/b72cca98680bd8a87393bb4e5f7d17aae47ab5ed)) -* close log file handle, fix FTMO equity double-count, remove bare except ([4c76c85](https://github.com/TPTBusiness/Predix/commit/4c76c85b6509ddd7bbd5361f0823c5a41329591a)) -* **collect_info:** parse package names safely from requirements constraints ([#1313](https://github.com/TPTBusiness/Predix/issues/1313)) ([99a71bf](https://github.com/TPTBusiness/Predix/commit/99a71bf533211df743b5801f913de788259e64cb)) -* correct MaxDD to equity curve in strategy_builder; test: add 8 cross-validation tests for metric correctness ([7be98e8](https://github.com/TPTBusiness/Predix/commit/7be98e84c911c9ba08b444b33206553cbe60086d)) -* correct project root paths and subprocess handling in parallel runner and CLI ([1c35a22](https://github.com/TPTBusiness/Predix/commit/1c35a2277ff601553e4733a8e990217dc9d6f989)) -* correct Sharpe/MaxDD/WinRate in direct factor eval (was computing on raw factor, now on strategy returns) ([69122ee](https://github.com/TPTBusiness/Predix/commit/69122ee5c1819be6fababd701b88d0dbef993040)) -* **deps:** bump python-dotenv to >=1.2.2 (CVE symlink overwrite) ([f69333b](https://github.com/TPTBusiness/Predix/commit/f69333b27b9356f09e6cc2748cb45845732335c3)) -* **deps:** pin aiohttp>=3.13.4 to patch 4 CVEs ([a0b3b90](https://github.com/TPTBusiness/Predix/commit/a0b3b90bfdd1193f5b8be521f563d18ff17dd81c)) -* **deps:** relax aiohttp constraint to >=3.13.4 for litellm compatibility ([d3978fe](https://github.com/TPTBusiness/Predix/commit/d3978fec1305d7503a37ff576fdf953f75e1cd1d)) -* Disable ANSI color codes when not running in TTY ([9db0e59](https://github.com/TPTBusiness/Predix/commit/9db0e590a4e94f538712cfec79f6cd470155050c)) -* Disable Flask debug mode by default (Security Alert [#2](https://github.com/TPTBusiness/Predix/issues/2)) ([48c177f](https://github.com/TPTBusiness/Predix/commit/48c177fbafce7b111646c14a5c2e6e414414930b)) -* Display litellm messages as info instead of warnings ([bd9d672](https://github.com/TPTBusiness/Predix/commit/bd9d672997aff80b5ad5c616b6486c11c2570b80)) -* **dockerfile:** install coreutils to resolve timeout command error ([#1260](https://github.com/TPTBusiness/Predix/issues/1260)) ([35580cb](https://github.com/TPTBusiness/Predix/commit/35580cbdf87347d5d6105b2a9b5ad1694b695820)) -* **docs:** update rdagent ui with correct params ([#1249](https://github.com/TPTBusiness/Predix/issues/1249)) ([3b9ad11](https://github.com/TPTBusiness/Predix/commit/3b9ad1145769862a24cc7533a1828f750f72170d)) -* Embedding Context Length Error ([6d6c5ab](https://github.com/TPTBusiness/Predix/commit/6d6c5abd4ac7252257f88e13e263ecb2497fde3b)) -* enable embedding truncation ([#1188](https://github.com/TPTBusiness/Predix/issues/1188)) ([880a6c7](https://github.com/TPTBusiness/Predix/commit/880a6c70c41024cb51f9fc4349ac7f1d2dbda434)) -* end-timestamp 23:45, weg, SZ-beispiele weg ([6a9ccd5](https://github.com/TPTBusiness/Predix/commit/6a9ccd5ddbf95060a2847bd27bcdae762a46a19d)) -* enhance feedback handling in MultiProcessEvolvingStrategy for improved task evolution ([#1274](https://github.com/TPTBusiness/Predix/issues/1274)) ([afb575c](https://github.com/TPTBusiness/Predix/commit/afb575cc91114dbe41d8f582294dcc3692990695)) -* Ensure backtest results save to DB and JSON files ([ae7b35e](https://github.com/TPTBusiness/Predix/commit/ae7b35ea2e0c71c76e8e454f7845df461d65b99f)) -* evaluator erkennt 15min als valid (nicht daily) ([cf0f634](https://github.com/TPTBusiness/Predix/commit/cf0f634c17dce45400cc325ccd3ca45e769c15fd)) -* **factors:** detect and correct look-ahead bias in daily-constant factors ([dcad0d1](https://github.com/TPTBusiness/Predix/commit/dcad0d1f68608a4db3cfdabb75e66c22490643aa)) -* **factors:** extend look-ahead rules to session factors and add intraday-factor guidance ([8811dc0](https://github.com/TPTBusiness/Predix/commit/8811dc042a0a7a1ac385c7141ded9f56a434dced)) -* filter NaN in max(), remove redundant ternary, handle non-finite vbt results ([1acfe50](https://github.com/TPTBusiness/Predix/commit/1acfe508a9c327dce8eba7a2ad1f618052a3e8a5)) -* fix bug for hypo_select_with_llm when not support response_schema ([#1208](https://github.com/TPTBusiness/Predix/issues/1208)) ([d759ca9](https://github.com/TPTBusiness/Predix/commit/d759ca95e714a7a1476839a2a04bb652c0fbb863)) -* fix chat_max_tokens calculation method to show true input_max_tokens ([#1241](https://github.com/TPTBusiness/Predix/issues/1241)) ([7e99605](https://github.com/TPTBusiness/Predix/commit/7e996055f2c7fd37595573ebdb13aa57c425a6cc)) -* fix mcts ([#1270](https://github.com/TPTBusiness/Predix/issues/1270)) ([5003aff](https://github.com/TPTBusiness/Predix/commit/5003affb17505525336e6c30ba9c690b810c252b)) -* Fix parallel runner dashboard rendering error ([3e8c07e](https://github.com/TPTBusiness/Predix/commit/3e8c07e728076a951528c4eb5b429653a5c77d14)) -* fix some bugs in RD-Agent(Q) ([#1143](https://github.com/TPTBusiness/Predix/issues/1143)) ([7134a51](https://github.com/TPTBusiness/Predix/commit/7134a51afa71ab146b52987c194adace62f8b034)) -* fix type annotation, remove unused parameter, improve import_class errors ([1eb5849](https://github.com/TPTBusiness/Predix/commit/1eb5849dd44c5953f7198212a5ef0dbe8c8d4881)) -* Forward-fill daily factors to 1-min frequency ([20f4c21](https://github.com/TPTBusiness/Predix/commit/20f4c2140c397230fb56734b0e887b770db805ac)) -* generate.py nutzt rdagent4qlib env für Qlib-Datenzugriff ([b9007f7](https://github.com/TPTBusiness/Predix/commit/b9007f754ac682800aaf265c0f24c2028d387d84)) -* **graph:** using assignment expression to avoid repeated function call ([#1174](https://github.com/TPTBusiness/Predix/issues/1174)) ([b6fae75](https://github.com/TPTBusiness/Predix/commit/b6fae75cde256c9c8a84783dbd135a9bcca6ac8d)) -* Handle failed experiments in feedback step to prevent crashes ([979ef66](https://github.com/TPTBusiness/Predix/commit/979ef66dc612c7f589e097dcdc3a01b742b18970)) -* handle mixed str and dict types in code_list ([#1279](https://github.com/TPTBusiness/Predix/issues/1279)) ([32ecf92](https://github.com/TPTBusiness/Predix/commit/32ecf92afcf647f257b430c748cbe6bb5fa0fac4)) -* Handle negative/zero values in performance report charts ([f4a4c65](https://github.com/TPTBusiness/Predix/commit/f4a4c65ce9bc1c929526a20a852765b92709011c)) -* handle None output and conditional step dump in LoopBase execution ([#1212](https://github.com/TPTBusiness/Predix/issues/1212)) ([9de8d60](https://github.com/TPTBusiness/Predix/commit/9de8d6066994fcd7037fd03d9339b6590ab2fac9)) -* Handle Qlib Docker backtest failures gracefully (SECURITY FIX) ([59f4561](https://github.com/TPTBusiness/Predix/commit/59f45618229be08dba028dceda21433cc5d52b9f)) -* Handle timeout exceptions safely in predix_full_eval.py ([2738263](https://github.com/TPTBusiness/Predix/commit/27382635171482be2cee2e29d4793e63d14abce4)) -* handle ValueError in stdout shrinking and refactor shrink logic ([#1228](https://github.com/TPTBusiness/Predix/issues/1228)) ([6fc3877](https://github.com/TPTBusiness/Predix/commit/6fc3877a39baabbf26e0cc1cbd327b0f6e2e325e)) -* Harden _safe_resolve to fix CodeQL alert [#3](https://github.com/TPTBusiness/Predix/issues/3) ([0ed1a0a](https://github.com/TPTBusiness/Predix/commit/0ed1a0aa8faad6df36753a928f40a1cdbd606462)) -* Harden path validation in Job Summary UI to fix CodeQL alert [#17](https://github.com/TPTBusiness/Predix/issues/17) ([7fe15d4](https://github.com/TPTBusiness/Predix/commit/7fe15d46cb2a740b6ec0ee37d29acaf37476e8e6)) -* Harden path validation to fix CodeQL alert [#20](https://github.com/TPTBusiness/Predix/issues/20) ([59d06f6](https://github.com/TPTBusiness/Predix/commit/59d06f6588caadaa207bde1d135828c56169bff8)) -* ignore case when checking metric name ([#1160](https://github.com/TPTBusiness/Predix/issues/1160)) ([1b84f7b](https://github.com/TPTBusiness/Predix/commit/1b84f7b7546a9dee4f27e24e07c49fa8ee3a370d)) -* ignore RuntimeError for shared workspace double recovery ([#1140](https://github.com/TPTBusiness/Predix/issues/1140)) ([bd8a16d](https://github.com/TPTBusiness/Predix/commit/bd8a16d92f9176d835bbc27478f9259f0fe9a827)) -* Import pandas in predix portfolio_simple command ([2b6de06](https://github.com/TPTBusiness/Predix/commit/2b6de06a612c147c414bde3175b6f11af1762f4d)) -* Improve path traversal prevention with dedicated helper function ([50dc275](https://github.com/TPTBusiness/Predix/commit/50dc27566d886a4aea9ea56eaef2c08e794df770)) -* increase retry count in hypothesis_gen decorator to 10 ([#1230](https://github.com/TPTBusiness/Predix/issues/1230)) ([86ce4f1](https://github.com/TPTBusiness/Predix/commit/86ce4f135d649cfb12f2f88626cd31868cb447e7)) -* increase time default not controlled by LLM ([#1196](https://github.com/TPTBusiness/Predix/issues/1196)) ([e4bd647](https://github.com/TPTBusiness/Predix/commit/e4bd647d1b20cbaa26a00cf23c49bfbc0bc80477)) -* Initialize EnvController in QuantTrace.__init__ ([698a17e](https://github.com/TPTBusiness/Predix/commit/698a17ea61321c37c7fa0d69849a309d29474f80)) -* inject correct MultiIndex template into factor prompt ([49004db](https://github.com/TPTBusiness/Predix/commit/49004db027d699bacbb975f267daa95d1957ccd7)) -* inject MultiIndex warning into factor interface prompt (YAML valide) ([79e2915](https://github.com/TPTBusiness/Predix/commit/79e2915823801d3574920fa197cf9c57965f485f)) -* insert await asyncio.sleep(0) to yield control in loop ([#1186](https://github.com/TPTBusiness/Predix/issues/1186)) ([e0453e0](https://github.com/TPTBusiness/Predix/commit/e0453e0058e2a4ec74feb0b31883f45604a9bf0c)) -* jinja problem of enumerate ([#1216](https://github.com/TPTBusiness/Predix/issues/1216)) ([6725f15](https://github.com/TPTBusiness/Predix/commit/6725f15f30df30a3ce37024fded621354d8114a7)) -* kaggle competition metric direction ([#1195](https://github.com/TPTBusiness/Predix/issues/1195)) ([04878f9](https://github.com/TPTBusiness/Predix/commit/04878f9e703fee9caff9208ab23995586f165c95)) -* **kronos:** lazy torch import to fix CI ModuleNotFoundError ([9cd8ab5](https://github.com/TPTBusiness/Predix/commit/9cd8ab54656786cc04742695c9d2e650a1b124ae)) -* **kronos:** pass actual datetime Series to Kronos predictor timestamps ([7741408](https://github.com/TPTBusiness/Predix/commit/7741408c671b6fe943491b39d9fc5cac256b457e)) -* **kronos:** replace rdagent_logger with stdlib logging for CI compatibility ([1ee5ea7](https://github.com/TPTBusiness/Predix/commit/1ee5ea7792f9ea94ddd26a0828d9744d0e07baa6)) -* **loop:** compress old experiment history in proposal prompt to reduce context size ([bde37f0](https://github.com/TPTBusiness/Predix/commit/bde37f09d53a4f6582d071ed72d86491889bc573)) -* **loop:** prevent step_idx advance on unhandled exceptions + fix consecutive assistant messages ([881ca81](https://github.com/TPTBusiness/Predix/commit/881ca819cea90d8a60865296e6f416aab69a18c9)) -* merge candidates ([#1254](https://github.com/TPTBusiness/Predix/issues/1254)) ([46aad78](https://github.com/TPTBusiness/Predix/commit/46aad789ef710d9603e2330788dc66849cb6cab3)) -* model/factor experiment filtering in Qlib proposals ([#1257](https://github.com/TPTBusiness/Predix/issues/1257)) ([9e34b4e](https://github.com/TPTBusiness/Predix/commit/9e34b4e855cbd709cd077f529950b8e1f5c01486)) -* move snapshot saving after step index update in loop execution ([#1206](https://github.com/TPTBusiness/Predix/issues/1206)) ([774346d](https://github.com/TPTBusiness/Predix/commit/774346d92e3d9faa858f935bb2651d0f1aa12a6c)) -* move task cancellation to finally block and fix subprocess kill typo ([#1234](https://github.com/TPTBusiness/Predix/issues/1234)) ([a984f69](https://github.com/TPTBusiness/Predix/commit/a984f69f681dda1c6c58f45e2505d7b0e8d75cf0)) -* **optuna:** fix inverted parameter range in Stage 2/3 when signal_bias is negative ([f0be842](https://github.com/TPTBusiness/Predix/commit/f0be842a6c03f56cb209d1f8a0c5a0d9fa3baebf)) -* Override webshop's Werkzeug dependency to fix CVE-2026-27199 ([3a5aa0b](https://github.com/TPTBusiness/Predix/commit/3a5aa0ba43fd644ad1944994f3cd3d49e7ab633c)) -* preserve null end_time when rendering dataset segments template ([#1326](https://github.com/TPTBusiness/Predix/issues/1326)) ([6196ba3](https://github.com/TPTBusiness/Predix/commit/6196ba31f2e43db4761eeb482c3301e2238bc4cf)) -* prevent calendar index overflow when signal data ends early ([#1324](https://github.com/TPTBusiness/Predix/issues/1324)) ([3dbd703](https://github.com/TPTBusiness/Predix/commit/3dbd7038280f21793246e5354f083ba472772a10)) -* prevent JSON content from being added multiple times during retries ([#1255](https://github.com/TPTBusiness/Predix/issues/1255)) ([31b19de](https://github.com/TPTBusiness/Predix/commit/31b19dee80c5006c72a0a9698834a04a3acd4af9)) -* Prevent path injection in FT Job Summary UI ([e4393fb](https://github.com/TPTBusiness/Predix/commit/e4393fb3b1e95fa53f7d8e972da35e994402def8)) -* Prevent path injection in RL Job Summary UI ([b3e8cb8](https://github.com/TPTBusiness/Predix/commit/b3e8cb8cfe5fe74c5b893c6d0e401375630ee750)) -* Prevent path traversal in autorl_bench server.py ([6634e6e](https://github.com/TPTBusiness/Predix/commit/6634e6e5c55c07f41d3a37731d59f6e11b35610e)) -* Prevent path traversal in get_job_options() app.py ([7da2e57](https://github.com/TPTBusiness/Predix/commit/7da2e5706c7d7da8ffee3f04b42f8d3378af26ad)) -* Prevent path traversal in RL UI app.py ([d2c1516](https://github.com/TPTBusiness/Predix/commit/d2c1516416dbda6109f6d42245263ce5373ce957)) -* Prevent path traversal in Streamlit UI app.py ([0d0fd34](https://github.com/TPTBusiness/Predix/commit/0d0fd34573c0695c34431a6e9eb7b5c10a3a91f9)) -* **qlib:** correct indentation in except blocks in quant_proposal and factor_runner ([8f67ab6](https://github.com/TPTBusiness/Predix/commit/8f67ab61299b7fb7063f5ac363705a6687ecaea1)) -* Refactor path validation to fix CodeQL alert [#16](https://github.com/TPTBusiness/Predix/issues/16) ([a417ebc](https://github.com/TPTBusiness/Predix/commit/a417ebc41db5ad24b89f53e5f3c3ff6e5339ae18)) -* refine DSCoSTEER_eval prompts ([#1157](https://github.com/TPTBusiness/Predix/issues/1157)) ([5594ab4](https://github.com/TPTBusiness/Predix/commit/5594ab418b46422e2f2e2edc08f0aadd0e95af04)) -* refine prompts and add additional package info ([#1179](https://github.com/TPTBusiness/Predix/issues/1179)) ([5353bd3](https://github.com/TPTBusiness/Predix/commit/5353bd31f25a98cba552145709af743cd4e83cf5)) -* refine task scheduling logic in MultiProcessEvolvingStrategy for… ([#1275](https://github.com/TPTBusiness/Predix/issues/1275)) ([27d38af](https://github.com/TPTBusiness/Predix/commit/27d38af7bd7e1fdb73e3617e94435abe7901dd21)) -* remove $factor from prompt, update example count to EURUSD ([3adc5bf](https://github.com/TPTBusiness/Predix/commit/3adc5bf75e6820328991aa5a5456e6f68ccf8fd7)) -* remove all Chinese stock references, replace with EURUSD 1min FX ([44eeb01](https://github.com/TPTBusiness/Predix/commit/44eeb01ec4f95271a084e9d285e00959926923f3)) -* Remove API key from test_benchmark_api.py config ([16e8631](https://github.com/TPTBusiness/Predix/commit/16e86310bdd8d2af1539063957edebde97f88110)) -* Remove API key logging from eurusd_llm.py ([3f510be](https://github.com/TPTBusiness/Predix/commit/3f510be9daddf0b241925f605898e2e1d3a18cb7)) -* Remove API key parameter from generate_api_config() ([e6eeac9](https://github.com/TPTBusiness/Predix/commit/e6eeac93614a9d97d119696802c7a08153c70f59)) -* Remove API key presence detection from logging ([12b45e5](https://github.com/TPTBusiness/Predix/commit/12b45e50f2d7d41881c3028b3f2213e7e7c573d8)) -* Remove clear-text storage of API key (CodeQL alert [#8](https://github.com/TPTBusiness/Predix/issues/8)) ([4842311](https://github.com/TPTBusiness/Predix/commit/4842311d9193d665c27311e7efc9637b9f3e0519)) -* Remove hardcoded credentials from test_benchmark_api.py ([2523ee2](https://github.com/TPTBusiness/Predix/commit/2523ee213e35c03175da9512619b46f6e9069f88)) -* remove unused imports in data science scenario module ([#1136](https://github.com/TPTBusiness/Predix/issues/1136)) ([fd6cd39](https://github.com/TPTBusiness/Predix/commit/fd6cd3950c4d0463f2d1ccab63fa48be4de41a58)) -* Rename loader.py to prompt_loader.py to fix module conflict ([06f0c34](https://github.com/TPTBusiness/Predix/commit/06f0c3427c665063513ae097068be71069a733b2)) -* replace hardcoded ChromeDriver path with webdriver-manager ([#1271](https://github.com/TPTBusiness/Predix/issues/1271)) ([e3d2443](https://github.com/TPTBusiness/Predix/commit/e3d24437cf7842623fe27fd9221e36a07457d7f7)) -* Resolve 88% empty backtest results + path fixes ([8d1c70e](https://github.com/TPTBusiness/Predix/commit/8d1c70e679721b90c024bc747d2544ce9c151adf)) -* resolve dead code, shell injection risk, mutable defaults, and other bugs ([4267315](https://github.com/TPTBusiness/Predix/commit/4267315783ccbdaa3472c5f7fd4728cf656556c1)) -* Resolve FORWARD_BARS NameError in backtest script ([ad7f5e1](https://github.com/TPTBusiness/Predix/commit/ad7f5e1388ad2149d0c32a5febfed0b77b05ef47)) -* Resolve security vulnerabilities (Dependabot + Code Scanning) ([2c96828](https://github.com/TPTBusiness/Predix/commit/2c9682800e4ea30361561affbb747e4f2cc763f6)) -* resolve unbound variable, logger shadowing, withdraw_loop edge case, and other bugs in main scripts ([2fd4bc3](https://github.com/TPTBusiness/Predix/commit/2fd4bc3741bafc6778008b3ecc49ba01207f22e1)) -* revert 2 commits ([#1239](https://github.com/TPTBusiness/Predix/issues/1239)) ([2201a47](https://github.com/TPTBusiness/Predix/commit/2201a4762343f2cc2deb3dff2b70baf99f102292)) -* revert to v10 setting ([#1220](https://github.com/TPTBusiness/Predix/issues/1220)) ([51f5bc9](https://github.com/TPTBusiness/Predix/commit/51f5bc9e117c6bfcb50c29355d5e73381d40b511)) -* **security:** nosec for B608/B701 false positives in UI and template code ([8b73952](https://github.com/TPTBusiness/Predix/commit/8b739528e5679cb49989be7e0edd7ac404b5d993)) -* **security:** Patch 5 CodeQL path injection and clear-text logging alerts ([#22](https://github.com/TPTBusiness/Predix/issues/22)-[#25](https://github.com/TPTBusiness/Predix/issues/25), [#9](https://github.com/TPTBusiness/Predix/issues/9)) ([5aed2cf](https://github.com/TPTBusiness/Predix/commit/5aed2cf58a4a39d515bc81e5fd6835a138198b82)) -* **security:** Patch 5 CodeQL path injection and weak hashing alerts ([#25](https://github.com/TPTBusiness/Predix/issues/25)-[#30](https://github.com/TPTBusiness/Predix/issues/30)) ([e188333](https://github.com/TPTBusiness/Predix/commit/e1883331f18e7265aeb13145abaca4b295a15f6e)) -* **security:** Patch path injection and stack trace exposure (CodeQL [#31](https://github.com/TPTBusiness/Predix/issues/31), [#27](https://github.com/TPTBusiness/Predix/issues/27)) ([2b0525f](https://github.com/TPTBusiness/Predix/commit/2b0525f9b7ef68ecc04bfddd558184f06640fb0b)) -* **security:** real fix for B110 (logging in factor_proposal.py [#746](https://github.com/TPTBusiness/Predix/issues/746)) ([61656af](https://github.com/TPTBusiness/Predix/commit/61656afda75e77686952d847aec443c28e17b6d6)) -* **security:** real fix for B110 (logging in factor_runner.py [#744](https://github.com/TPTBusiness/Predix/issues/744)) ([5ac64e6](https://github.com/TPTBusiness/Predix/commit/5ac64e60e4e3977364ffd5ad8704fdf0c46bad75)) -* **security:** real fix for B110 (logging in quant_proposal.py [#741](https://github.com/TPTBusiness/Predix/issues/741)) ([bcfeb32](https://github.com/TPTBusiness/Predix/commit/bcfeb32958953ba07e980dce5feaffe5d53963e8)) -* **security:** real fix for B110 (logging in quant_proposal.py [#741](https://github.com/TPTBusiness/Predix/issues/741)) ([d865c82](https://github.com/TPTBusiness/Predix/commit/d865c824c98820b26e3d64b8c193445effb19667)) -* **security:** real fix for B404/B603 (sys.executable in factor_runner.py [#745](https://github.com/TPTBusiness/Predix/issues/745)) ([7894b8e](https://github.com/TPTBusiness/Predix/commit/7894b8e6ed1cb580d8909403eb166a2b418b2dd0)) -* **security:** replace eval() with ast.literal_eval and add request timeouts (B307, B113) ([ffb24fd](https://github.com/TPTBusiness/Predix/commit/ffb24fd5de724455aa77846c3f98fae35bc80430)) -* **security:** replace eval() with ast.literal_eval in finetune validator (B307) ([8d53b81](https://github.com/TPTBusiness/Predix/commit/8d53b81633965fd0ae2bf32081dacc91b121b77d)) -* **security:** replace os.path.realpath with pathlib.resolve in safe_resolve_path to fix path-injection alerts ([0d7af52](https://github.com/TPTBusiness/Predix/commit/0d7af52a2d32f1dbcc366b9f395c43ad47ddabb2)) -* **security:** replace relative_to() with realpath+startswith for CodeQL sanitization ([d7e2018](https://github.com/TPTBusiness/Predix/commit/d7e2018a7232c59a40d6e740111572a0da0cd384)) -* **security:** replace remaining assert statements with proper error handling ([d4d5baf](https://github.com/TPTBusiness/Predix/commit/d4d5bafd1eb8330f75917170520408b48d38f8c2)) -* **security:** replace shell=True subprocess calls with list args (B602) ([30887ac](https://github.com/TPTBusiness/Predix/commit/30887ac244f77a5edabc11dda7805b9bb789667f)) -* **security:** replace shell=True subprocess calls with list args in env.py (B602) ([1a4f1cf](https://github.com/TPTBusiness/Predix/commit/1a4f1cf6044842939bc5e7ed853c437cab591a26)) -* **security:** resolve all 30 Bandit security alerts (B301, B614, B104) ([00f400f](https://github.com/TPTBusiness/Predix/commit/00f400fe2efda375884234cd381401583a65f456)) -* **security:** resolve CodeQL path-injection alerts in UI data loaders ([7caab95](https://github.com/TPTBusiness/Predix/commit/7caab9545bd929909f4c7cae02fbcc2cc3a9893a)) -* **security:** resolve CodeQL path-injection and clear-text-logging alerts ([8701b8b](https://github.com/TPTBusiness/Predix/commit/8701b8bd75f82ceb326da4f105609f4228961666)) -* **security:** Resolve GitHub Security Scan alerts ([5af7f19](https://github.com/TPTBusiness/Predix/commit/5af7f19bd1656078991752d298c0f3c953f7af2c)) -* **security:** resolve path-injection and add nosec for safe temp paths (B108, py/path-injection) ([4133fff](https://github.com/TPTBusiness/Predix/commit/4133fffa7d97bd38beb4b99aa7f3ab3039d78103)) -* **security:** resolve path-injection, B701, B101, B112 Bandit alerts ([e87d612](https://github.com/TPTBusiness/Predix/commit/e87d61257fa4bb401415b62ff88c7ad75085d89c)) -* **security:** revert broken read_pickle encoding arg in kaggle template (B301) ([e16460c](https://github.com/TPTBusiness/Predix/commit/e16460c7bc5329c9752cd12b20fcee978b5f232b)) -* **security:** Upgrade vllm and transformers to patch 4 CVEs ([85915b3](https://github.com/TPTBusiness/Predix/commit/85915b3a20e9ceae6dd854ef4c64a61590a36d84)) -* **security:** validate SQL identifiers in _add_column_if_not_exists (B608) ([c40795b](https://github.com/TPTBusiness/Predix/commit/c40795bcb0dab5ceff9b56ec019b9be6f9d10203)) -* **security:** whitelist-validate metric column in get_top_factors (B608) ([db51417](https://github.com/TPTBusiness/Predix/commit/db51417cd4337e3b8b76420c93b1bb1ed3271b13)) -* set requires_documentation_search to None to disable feature in eval ([#1245](https://github.com/TPTBusiness/Predix/issues/1245)) ([ee8c119](https://github.com/TPTBusiness/Predix/commit/ee8c119f31b72de1002e5ad5d30c56d0f4b6c9b9)) -* Skip already evaluated factors in predix_full_eval.py ([8375213](https://github.com/TPTBusiness/Predix/commit/8375213629551605b4c401aa1ce71ed8d9f1e4db)) -* skip Kronos factor on GPUs < 20GB to avoid CUDA OOM (shared with llama-server) ([08fea7a](https://github.com/TPTBusiness/Predix/commit/08fea7a2809941d2b5f3feb5ba998dba132053bb)) -* skip res_ratio check if timer or res_time is None ([#1189](https://github.com/TPTBusiness/Predix/issues/1189)) ([dbe2142](https://github.com/TPTBusiness/Predix/commit/dbe214282e84f099512eeaf01925c7dee1b780a6)) -* **strategies:** guard against None IC in acceptance check, disable slow wf_rolling ([843cd9a](https://github.com/TPTBusiness/Predix/commit/843cd9ae017b05365e1bb353b9945e2fbce332dd)) -* **strategies:** handle None ic/sharpe/dd in rejected strategy log output ([0121c2c](https://github.com/TPTBusiness/Predix/commit/0121c2c1583b752622c69313e78ccbeedf6c8d1b)) -* **strategy:** Fix template variables, APIBackend import, and JSON extraction ([f0e813e](https://github.com/TPTBusiness/Predix/commit/f0e813ee48ae65e0ee78c27a8b971139dac5b552)) -* **strategy:** Re-evaluate Optuna-optimized strategies with full OHLCV backtest ([7da8bad](https://github.com/TPTBusiness/Predix/commit/7da8badbc1005bb1866631dc14daa815641b4271)) -* summary page bug ([#1219](https://github.com/TPTBusiness/Predix/issues/1219)) ([beab473](https://github.com/TPTBusiness/Predix/commit/beab473b40714fbd802ebb3b61c0dd3d3ba7d91a)) -* Switch to ThreadPoolExecutor for factor evaluation ([d0aa146](https://github.com/TPTBusiness/Predix/commit/d0aa1464ea1e3553e4b869c3429e5e394bcebda8)) -* Translate remaining German comment in eurusd_macro.py ([02b46d1](https://github.com/TPTBusiness/Predix/commit/02b46d1ffc3bfe87033714f71a9d22714a071f09)) -* ui bug ([#1192](https://github.com/TPTBusiness/Predix/issues/1192)) ([2f8261f](https://github.com/TPTBusiness/Predix/commit/2f8261f82bf25ad714eff22be2283c6e645b5314)) -* update fallback criterion ([#1210](https://github.com/TPTBusiness/Predix/issues/1210)) ([dbbe374](https://github.com/TPTBusiness/Predix/commit/dbbe374ac8b0cefcde9145a76b4cd5c0b40b3f92)) -* Update LICENSE badge link from main to master branch ([0dbace6](https://github.com/TPTBusiness/Predix/commit/0dbace6aa7aa1a7a250e45c96e71591edeed8f55)) -* update requirements.txt's streamlit ([#1133](https://github.com/TPTBusiness/Predix/issues/1133)) ([600d159](https://github.com/TPTBusiness/Predix/commit/600d159e86521cc0498df9df3756921e676e3332)) -* Update Werkzeug to 2.3.8 (latest secure 2.x version) ([d68a5ee](https://github.com/TPTBusiness/Predix/commit/d68a5ee47cba6f8d2ca0faba1ad89ba65f4fc94b)) -* update WF test for new default (wf_rolling=True) ([c906e00](https://github.com/TPTBusiness/Predix/commit/c906e00ac9731673f6386f8b3ce38f5d8e817992)) -* Use 96-bar forward returns in backtest (matching factor IC horizon) ([19c5b3d](https://github.com/TPTBusiness/Predix/commit/19c5b3d70633d5cc622328e57acd122120d47971)) -* Use num_api_keys instead of len(api_keys) for round-robin ([c91976e](https://github.com/TPTBusiness/Predix/commit/c91976e7968f54a065b4a5ee11228133b48db3e9)) -* weg, Timestamps mit Uhrzeit, kein SZ-Beispiel ([e9f6ac4](https://github.com/TPTBusiness/Predix/commit/e9f6ac48d97b1b57a0dde14562cd1b6f5d106edd)) +* (to main) litellm's Timeout error is not picklable ([#1294](https://github.com/TPTBusiness/NexQuant/issues/1294)) ([315850e](https://github.com/TPTBusiness/NexQuant/commit/315850ea81761aa2478639ad32302d7a55f8181b)) +* 15 bug fixes across orchestrator, runner, backtest, and infrastructure ([5ec4516](https://github.com/TPTBusiness/NexQuant/commit/5ec4516ed7bdc44f2fd7d6e3ec9df0a88fc4fd10)) +* add a switch for ensemble_time_upper_bound and fix some bug in main ([#1226](https://github.com/TPTBusiness/NexQuant/issues/1226)) ([fc18942](https://github.com/TPTBusiness/NexQuant/commit/fc18942339b3ca59077ddc903f84b2d54193e5bc)) +* Add Bandit security scanning and fix critical vulnerabilities ([f47dcf1](https://github.com/TPTBusiness/NexQuant/commit/f47dcf1c58d33041bba2f705b270a7f9c4e7d572)) +* Add critical column name rules to factor generation prompt ([bf73725](https://github.com/TPTBusiness/NexQuant/commit/bf7372533e83da682f1ceefeddc70f142f8ccda2)) +* Add get_factor_count() to QuantTrace to prevent parallel run crashes ([a16db77](https://github.com/TPTBusiness/NexQuant/commit/a16db77def1ba7adb7bb6734629086a1b5a901cb)) +* add json format response fallback to prompt templates ([#1246](https://github.com/TPTBusiness/NexQuant/issues/1246)) ([694afd8](https://github.com/TPTBusiness/NexQuant/commit/694afd81331227d2be7f780f72023d00c0c9864e)) +* add metric in scores.csv and avoid reading sample_submission.csv ([#1152](https://github.com/TPTBusiness/NexQuant/issues/1152)) ([80c953d](https://github.com/TPTBusiness/NexQuant/commit/80c953d4053dff66d12e4cf400b069d0fac16cbd)) +* Add missing os import in factor_runner.py ([f201823](https://github.com/TPTBusiness/NexQuant/commit/f201823c44c724867163f3b2d3ecf49f384a8e35)) +* Add missing Panel import in nexquant evaluate command ([e21923b](https://github.com/TPTBusiness/NexQuant/commit/e21923bd13eac6236a2c25d550bae0b984575491)) +* add missing self parameter to instance methods in DSProposalV2ExpGen ([#1213](https://github.com/TPTBusiness/NexQuant/issues/1213)) ([c8bf617](https://github.com/TPTBusiness/NexQuant/commit/c8bf617aca57ea9c53d4a76d23806cb5ab5173ab)) +* add missing sys import and fix undefined acc_rate in factor eval ([34323f3](https://github.com/TPTBusiness/NexQuant/commit/34323f307da6924095efcdaef81f99b95e2820eb)) +* Add nosec comments for schema migration SQL in results_db.py ([3626b22](https://github.com/TPTBusiness/NexQuant/commit/3626b22482143466b0dec8b63ea0a4a36af06acf)) +* allow prev_out keys to be None in workspace cleanup assertion ([#1214](https://github.com/TPTBusiness/NexQuant/issues/1214)) ([f02dc5f](https://github.com/TPTBusiness/NexQuant/commit/f02dc5f47d5973673bcc314ada89933a5d807d21)) +* also catch ValueError in mean_variance for dimension mismatch ([daded85](https://github.com/TPTBusiness/NexQuant/commit/daded853b6370f0df6f83a6d1b3f04c0dd0757f0)) +* **auto-fixer:** add five new factor code fixes for groupby/apply errors ([d03bcf3](https://github.com/TPTBusiness/NexQuant/commit/d03bcf3505f1be696e7bddc40f33c4a97b3f7486)) +* **auto-fixer:** add four new factor code fixes for common runtime errors ([21ce0de](https://github.com/TPTBusiness/NexQuant/commit/21ce0def2dd8352a315e0688ebafc6d62cf0435e)) +* **auto-fixer:** add groupby([level=N,'date']) SyntaxError fix ([d58eba3](https://github.com/TPTBusiness/NexQuant/commit/d58eba364e6ea14513b64e6bc12256c72111669a)) +* **auto-fixer:** disable _fix_min_periods for intraday data ([665e490](https://github.com/TPTBusiness/NexQuant/commit/665e4903d8f6f3097a45d07060ab003ebea7f96b)) +* **auto-fixer:** fix chained groupby(level=N).groupby('date') pattern ([9869839](https://github.com/TPTBusiness/NexQuant/commit/9869839a2c676ddd83f4218e9ff5e50fb8d2d223)) +* **auto-fixer:** fix df.loc[instrument] DateParseError on MultiIndex frames ([87926dc](https://github.com/TPTBusiness/NexQuant/commit/87926dc41d795a3ab0670e585b99cc21dd09ae5f)) +* **auto-fixer:** fix df['instrument'] KeyError on MultiIndex frames ([63a348e](https://github.com/TPTBusiness/NexQuant/commit/63a348eb3ec20c209c2d060e086bc69019e92884)) +* **auto-fixer:** fix two assignment-target bugs in instrument column fixers ([a44eba9](https://github.com/TPTBusiness/NexQuant/commit/a44eba952e031e364050ee3d27a067d17fa01923)) +* **auto-fixer:** preserve date dimension in groupby(['instrument','date']) fix ([37a2f37](https://github.com/TPTBusiness/NexQuant/commit/37a2f37f74118a2707a6b128d55c45ddb89cc48a)) +* **auto-fixer:** remove ddof from rolling() args, not only from std()/var() ([daacbfd](https://github.com/TPTBusiness/NexQuant/commit/daacbfd141ae0da99c8c4cb01d5e500528eb7d80)) +* **auto-fixer:** replace zero \$volume with price-range proxy for FX data ([7fcec39](https://github.com/TPTBusiness/NexQuant/commit/7fcec39f1d8f0f7668435f51a1a9646abcd9c89f)) +* **auto-fixer:** strip spurious .reset_index() after .transform() calls ([c489616](https://github.com/TPTBusiness/NexQuant/commit/c489616d1a2fd71877a203d880e31281bc008cdf)) +* avoid triggering errors like "RuntimeError: dictionary changed s… ([#1285](https://github.com/TPTBusiness/NexQuant/issues/1285)) ([b180543](https://github.com/TPTBusiness/NexQuant/commit/b18054371c6ce08c6bc322a7b0de41b67fc60408)) +* **backtest:** replace broken MC permutation test with binomial win-rate test ([f284b7a](https://github.com/TPTBusiness/NexQuant/commit/f284b7a9751424201510c5938b4ebf6bd81842b6)) +* cancel tasks on resume and kill subprocesses on termination ([#1166](https://github.com/TPTBusiness/NexQuant/issues/1166)) ([0e3f4cf](https://github.com/TPTBusiness/NexQuant/commit/0e3f4cf08f08e27f9c483a5bbe069313d0d8014e)) +* change runner prompts ([#1223](https://github.com/TPTBusiness/NexQuant/issues/1223)) ([be3433f](https://github.com/TPTBusiness/NexQuant/commit/be3433f26b04054a482dfdc7cdd5c8c0a756a60c)) +* **ci:** fix closed-source asset check false positives in security workflow ([1473085](https://github.com/TPTBusiness/NexQuant/commit/14730856636735c17d704854e057fa6e1aea5940)) +* **ci:** lazy import logger in nexquant.py and cli.py to avoid ImportError in test env ([52d9ff0](https://github.com/TPTBusiness/NexQuant/commit/52d9ff0cd41d6fc6978e8af7f970cffd6a46f673)) +* **ci:** remove CodeQL workflow (conflicts with default setup), drop duplicate lint job ([ab73425](https://github.com/TPTBusiness/NexQuant/commit/ab734252f356ac97dea4f70477ebe2fdee30509c)) +* **ci:** remove env-print step to avoid leaking sensitive environment variables ([#1299](https://github.com/TPTBusiness/NexQuant/issues/1299)) ([c067ea6](https://github.com/TPTBusiness/NexQuant/commit/c067ea640030c67c549e3ca2dbad178f144e8b31)) +* **ci:** set JAVA_TOOL_OPTIONS UTF-8 in Codacy workflow ([a9c6ea9](https://github.com/TPTBusiness/NexQuant/commit/a9c6ea99c9ebae2794b1c3f4d1e9da1d4e41376a)) +* clear ws_ckp after extraction to reduce workspace object size ([#1137](https://github.com/TPTBusiness/NexQuant/issues/1137)) ([28ceb41](https://github.com/TPTBusiness/NexQuant/commit/28ceb41e1cdb603c4e0bd2fe7b72acef1b29ec47)) +* CLI dashboard in separate terminal window ([b72cca9](https://github.com/TPTBusiness/NexQuant/commit/b72cca98680bd8a87393bb4e5f7d17aae47ab5ed)) +* close log file handle, fix FTMO equity double-count, remove bare except ([4c76c85](https://github.com/TPTBusiness/NexQuant/commit/4c76c85b6509ddd7bbd5361f0823c5a41329591a)) +* **collect_info:** parse package names safely from requirements constraints ([#1313](https://github.com/TPTBusiness/NexQuant/issues/1313)) ([99a71bf](https://github.com/TPTBusiness/NexQuant/commit/99a71bf533211df743b5801f913de788259e64cb)) +* correct MaxDD to equity curve in strategy_builder; test: add 8 cross-validation tests for metric correctness ([7be98e8](https://github.com/TPTBusiness/NexQuant/commit/7be98e84c911c9ba08b444b33206553cbe60086d)) +* correct project root paths and subprocess handling in parallel runner and CLI ([1c35a22](https://github.com/TPTBusiness/NexQuant/commit/1c35a2277ff601553e4733a8e990217dc9d6f989)) +* correct Sharpe/MaxDD/WinRate in direct factor eval (was computing on raw factor, now on strategy returns) ([69122ee](https://github.com/TPTBusiness/NexQuant/commit/69122ee5c1819be6fababd701b88d0dbef993040)) +* **deps:** bump python-dotenv to >=1.2.2 (CVE symlink overwrite) ([f69333b](https://github.com/TPTBusiness/NexQuant/commit/f69333b27b9356f09e6cc2748cb45845732335c3)) +* **deps:** pin aiohttp>=3.13.4 to patch 4 CVEs ([a0b3b90](https://github.com/TPTBusiness/NexQuant/commit/a0b3b90bfdd1193f5b8be521f563d18ff17dd81c)) +* **deps:** relax aiohttp constraint to >=3.13.4 for litellm compatibility ([d3978fe](https://github.com/TPTBusiness/NexQuant/commit/d3978fec1305d7503a37ff576fdf953f75e1cd1d)) +* Disable ANSI color codes when not running in TTY ([9db0e59](https://github.com/TPTBusiness/NexQuant/commit/9db0e590a4e94f538712cfec79f6cd470155050c)) +* Disable Flask debug mode by default (Security Alert [#2](https://github.com/TPTBusiness/NexQuant/issues/2)) ([48c177f](https://github.com/TPTBusiness/NexQuant/commit/48c177fbafce7b111646c14a5c2e6e414414930b)) +* Display litellm messages as info instead of warnings ([bd9d672](https://github.com/TPTBusiness/NexQuant/commit/bd9d672997aff80b5ad5c616b6486c11c2570b80)) +* **dockerfile:** install coreutils to resolve timeout command error ([#1260](https://github.com/TPTBusiness/NexQuant/issues/1260)) ([35580cb](https://github.com/TPTBusiness/NexQuant/commit/35580cbdf87347d5d6105b2a9b5ad1694b695820)) +* **docs:** update rdagent ui with correct params ([#1249](https://github.com/TPTBusiness/NexQuant/issues/1249)) ([3b9ad11](https://github.com/TPTBusiness/NexQuant/commit/3b9ad1145769862a24cc7533a1828f750f72170d)) +* Embedding Context Length Error ([6d6c5ab](https://github.com/TPTBusiness/NexQuant/commit/6d6c5abd4ac7252257f88e13e263ecb2497fde3b)) +* enable embedding truncation ([#1188](https://github.com/TPTBusiness/NexQuant/issues/1188)) ([880a6c7](https://github.com/TPTBusiness/NexQuant/commit/880a6c70c41024cb51f9fc4349ac7f1d2dbda434)) +* end-timestamp 23:45, weg, SZ-beispiele weg ([6a9ccd5](https://github.com/TPTBusiness/NexQuant/commit/6a9ccd5ddbf95060a2847bd27bcdae762a46a19d)) +* enhance feedback handling in MultiProcessEvolvingStrategy for improved task evolution ([#1274](https://github.com/TPTBusiness/NexQuant/issues/1274)) ([afb575c](https://github.com/TPTBusiness/NexQuant/commit/afb575cc91114dbe41d8f582294dcc3692990695)) +* Ensure backtest results save to DB and JSON files ([ae7b35e](https://github.com/TPTBusiness/NexQuant/commit/ae7b35ea2e0c71c76e8e454f7845df461d65b99f)) +* evaluator erkennt 15min als valid (nicht daily) ([cf0f634](https://github.com/TPTBusiness/NexQuant/commit/cf0f634c17dce45400cc325ccd3ca45e769c15fd)) +* **factors:** detect and correct look-ahead bias in daily-constant factors ([dcad0d1](https://github.com/TPTBusiness/NexQuant/commit/dcad0d1f68608a4db3cfdabb75e66c22490643aa)) +* **factors:** extend look-ahead rules to session factors and add intraday-factor guidance ([8811dc0](https://github.com/TPTBusiness/NexQuant/commit/8811dc042a0a7a1ac385c7141ded9f56a434dced)) +* filter NaN in max(), remove redundant ternary, handle non-finite vbt results ([1acfe50](https://github.com/TPTBusiness/NexQuant/commit/1acfe508a9c327dce8eba7a2ad1f618052a3e8a5)) +* fix bug for hypo_select_with_llm when not support response_schema ([#1208](https://github.com/TPTBusiness/NexQuant/issues/1208)) ([d759ca9](https://github.com/TPTBusiness/NexQuant/commit/d759ca95e714a7a1476839a2a04bb652c0fbb863)) +* fix chat_max_tokens calculation method to show true input_max_tokens ([#1241](https://github.com/TPTBusiness/NexQuant/issues/1241)) ([7e99605](https://github.com/TPTBusiness/NexQuant/commit/7e996055f2c7fd37595573ebdb13aa57c425a6cc)) +* fix mcts ([#1270](https://github.com/TPTBusiness/NexQuant/issues/1270)) ([5003aff](https://github.com/TPTBusiness/NexQuant/commit/5003affb17505525336e6c30ba9c690b810c252b)) +* Fix parallel runner dashboard rendering error ([3e8c07e](https://github.com/TPTBusiness/NexQuant/commit/3e8c07e728076a951528c4eb5b429653a5c77d14)) +* fix some bugs in RD-Agent(Q) ([#1143](https://github.com/TPTBusiness/NexQuant/issues/1143)) ([7134a51](https://github.com/TPTBusiness/NexQuant/commit/7134a51afa71ab146b52987c194adace62f8b034)) +* fix type annotation, remove unused parameter, improve import_class errors ([1eb5849](https://github.com/TPTBusiness/NexQuant/commit/1eb5849dd44c5953f7198212a5ef0dbe8c8d4881)) +* Forward-fill daily factors to 1-min frequency ([20f4c21](https://github.com/TPTBusiness/NexQuant/commit/20f4c2140c397230fb56734b0e887b770db805ac)) +* generate.py nutzt rdagent4qlib env für Qlib-Datenzugriff ([b9007f7](https://github.com/TPTBusiness/NexQuant/commit/b9007f754ac682800aaf265c0f24c2028d387d84)) +* **graph:** using assignment expression to avoid repeated function call ([#1174](https://github.com/TPTBusiness/NexQuant/issues/1174)) ([b6fae75](https://github.com/TPTBusiness/NexQuant/commit/b6fae75cde256c9c8a84783dbd135a9bcca6ac8d)) +* Handle failed experiments in feedback step to prevent crashes ([979ef66](https://github.com/TPTBusiness/NexQuant/commit/979ef66dc612c7f589e097dcdc3a01b742b18970)) +* handle mixed str and dict types in code_list ([#1279](https://github.com/TPTBusiness/NexQuant/issues/1279)) ([32ecf92](https://github.com/TPTBusiness/NexQuant/commit/32ecf92afcf647f257b430c748cbe6bb5fa0fac4)) +* Handle negative/zero values in performance report charts ([f4a4c65](https://github.com/TPTBusiness/NexQuant/commit/f4a4c65ce9bc1c929526a20a852765b92709011c)) +* handle None output and conditional step dump in LoopBase execution ([#1212](https://github.com/TPTBusiness/NexQuant/issues/1212)) ([9de8d60](https://github.com/TPTBusiness/NexQuant/commit/9de8d6066994fcd7037fd03d9339b6590ab2fac9)) +* Handle Qlib Docker backtest failures gracefully (SECURITY FIX) ([59f4561](https://github.com/TPTBusiness/NexQuant/commit/59f45618229be08dba028dceda21433cc5d52b9f)) +* Handle timeout exceptions safely in nexquant_full_eval.py ([2738263](https://github.com/TPTBusiness/NexQuant/commit/27382635171482be2cee2e29d4793e63d14abce4)) +* handle ValueError in stdout shrinking and refactor shrink logic ([#1228](https://github.com/TPTBusiness/NexQuant/issues/1228)) ([6fc3877](https://github.com/TPTBusiness/NexQuant/commit/6fc3877a39baabbf26e0cc1cbd327b0f6e2e325e)) +* Harden _safe_resolve to fix CodeQL alert [#3](https://github.com/TPTBusiness/NexQuant/issues/3) ([0ed1a0a](https://github.com/TPTBusiness/NexQuant/commit/0ed1a0aa8faad6df36753a928f40a1cdbd606462)) +* Harden path validation in Job Summary UI to fix CodeQL alert [#17](https://github.com/TPTBusiness/NexQuant/issues/17) ([7fe15d4](https://github.com/TPTBusiness/NexQuant/commit/7fe15d46cb2a740b6ec0ee37d29acaf37476e8e6)) +* Harden path validation to fix CodeQL alert [#20](https://github.com/TPTBusiness/NexQuant/issues/20) ([59d06f6](https://github.com/TPTBusiness/NexQuant/commit/59d06f6588caadaa207bde1d135828c56169bff8)) +* ignore case when checking metric name ([#1160](https://github.com/TPTBusiness/NexQuant/issues/1160)) ([1b84f7b](https://github.com/TPTBusiness/NexQuant/commit/1b84f7b7546a9dee4f27e24e07c49fa8ee3a370d)) +* ignore RuntimeError for shared workspace double recovery ([#1140](https://github.com/TPTBusiness/NexQuant/issues/1140)) ([bd8a16d](https://github.com/TPTBusiness/NexQuant/commit/bd8a16d92f9176d835bbc27478f9259f0fe9a827)) +* Import pandas in nexquant portfolio_simple command ([2b6de06](https://github.com/TPTBusiness/NexQuant/commit/2b6de06a612c147c414bde3175b6f11af1762f4d)) +* Improve path traversal prevention with dedicated helper function ([50dc275](https://github.com/TPTBusiness/NexQuant/commit/50dc27566d886a4aea9ea56eaef2c08e794df770)) +* increase retry count in hypothesis_gen decorator to 10 ([#1230](https://github.com/TPTBusiness/NexQuant/issues/1230)) ([86ce4f1](https://github.com/TPTBusiness/NexQuant/commit/86ce4f135d649cfb12f2f88626cd31868cb447e7)) +* increase time default not controlled by LLM ([#1196](https://github.com/TPTBusiness/NexQuant/issues/1196)) ([e4bd647](https://github.com/TPTBusiness/NexQuant/commit/e4bd647d1b20cbaa26a00cf23c49bfbc0bc80477)) +* Initialize EnvController in QuantTrace.__init__ ([698a17e](https://github.com/TPTBusiness/NexQuant/commit/698a17ea61321c37c7fa0d69849a309d29474f80)) +* inject correct MultiIndex template into factor prompt ([49004db](https://github.com/TPTBusiness/NexQuant/commit/49004db027d699bacbb975f267daa95d1957ccd7)) +* inject MultiIndex warning into factor interface prompt (YAML valide) ([79e2915](https://github.com/TPTBusiness/NexQuant/commit/79e2915823801d3574920fa197cf9c57965f485f)) +* insert await asyncio.sleep(0) to yield control in loop ([#1186](https://github.com/TPTBusiness/NexQuant/issues/1186)) ([e0453e0](https://github.com/TPTBusiness/NexQuant/commit/e0453e0058e2a4ec74feb0b31883f45604a9bf0c)) +* jinja problem of enumerate ([#1216](https://github.com/TPTBusiness/NexQuant/issues/1216)) ([6725f15](https://github.com/TPTBusiness/NexQuant/commit/6725f15f30df30a3ce37024fded621354d8114a7)) +* kaggle competition metric direction ([#1195](https://github.com/TPTBusiness/NexQuant/issues/1195)) ([04878f9](https://github.com/TPTBusiness/NexQuant/commit/04878f9e703fee9caff9208ab23995586f165c95)) +* **kronos:** lazy torch import to fix CI ModuleNotFoundError ([9cd8ab5](https://github.com/TPTBusiness/NexQuant/commit/9cd8ab54656786cc04742695c9d2e650a1b124ae)) +* **kronos:** pass actual datetime Series to Kronos predictor timestamps ([7741408](https://github.com/TPTBusiness/NexQuant/commit/7741408c671b6fe943491b39d9fc5cac256b457e)) +* **kronos:** replace rdagent_logger with stdlib logging for CI compatibility ([1ee5ea7](https://github.com/TPTBusiness/NexQuant/commit/1ee5ea7792f9ea94ddd26a0828d9744d0e07baa6)) +* **loop:** compress old experiment history in proposal prompt to reduce context size ([bde37f0](https://github.com/TPTBusiness/NexQuant/commit/bde37f09d53a4f6582d071ed72d86491889bc573)) +* **loop:** prevent step_idx advance on unhandled exceptions + fix consecutive assistant messages ([881ca81](https://github.com/TPTBusiness/NexQuant/commit/881ca819cea90d8a60865296e6f416aab69a18c9)) +* merge candidates ([#1254](https://github.com/TPTBusiness/NexQuant/issues/1254)) ([46aad78](https://github.com/TPTBusiness/NexQuant/commit/46aad789ef710d9603e2330788dc66849cb6cab3)) +* model/factor experiment filtering in Qlib proposals ([#1257](https://github.com/TPTBusiness/NexQuant/issues/1257)) ([9e34b4e](https://github.com/TPTBusiness/NexQuant/commit/9e34b4e855cbd709cd077f529950b8e1f5c01486)) +* move snapshot saving after step index update in loop execution ([#1206](https://github.com/TPTBusiness/NexQuant/issues/1206)) ([774346d](https://github.com/TPTBusiness/NexQuant/commit/774346d92e3d9faa858f935bb2651d0f1aa12a6c)) +* move task cancellation to finally block and fix subprocess kill typo ([#1234](https://github.com/TPTBusiness/NexQuant/issues/1234)) ([a984f69](https://github.com/TPTBusiness/NexQuant/commit/a984f69f681dda1c6c58f45e2505d7b0e8d75cf0)) +* **optuna:** fix inverted parameter range in Stage 2/3 when signal_bias is negative ([f0be842](https://github.com/TPTBusiness/NexQuant/commit/f0be842a6c03f56cb209d1f8a0c5a0d9fa3baebf)) +* Override webshop's Werkzeug dependency to fix CVE-2026-27199 ([3a5aa0b](https://github.com/TPTBusiness/NexQuant/commit/3a5aa0ba43fd644ad1944994f3cd3d49e7ab633c)) +* preserve null end_time when rendering dataset segments template ([#1326](https://github.com/TPTBusiness/NexQuant/issues/1326)) ([6196ba3](https://github.com/TPTBusiness/NexQuant/commit/6196ba31f2e43db4761eeb482c3301e2238bc4cf)) +* prevent calendar index overflow when signal data ends early ([#1324](https://github.com/TPTBusiness/NexQuant/issues/1324)) ([3dbd703](https://github.com/TPTBusiness/NexQuant/commit/3dbd7038280f21793246e5354f083ba472772a10)) +* prevent JSON content from being added multiple times during retries ([#1255](https://github.com/TPTBusiness/NexQuant/issues/1255)) ([31b19de](https://github.com/TPTBusiness/NexQuant/commit/31b19dee80c5006c72a0a9698834a04a3acd4af9)) +* Prevent path injection in FT Job Summary UI ([e4393fb](https://github.com/TPTBusiness/NexQuant/commit/e4393fb3b1e95fa53f7d8e972da35e994402def8)) +* Prevent path injection in RL Job Summary UI ([b3e8cb8](https://github.com/TPTBusiness/NexQuant/commit/b3e8cb8cfe5fe74c5b893c6d0e401375630ee750)) +* Prevent path traversal in autorl_bench server.py ([6634e6e](https://github.com/TPTBusiness/NexQuant/commit/6634e6e5c55c07f41d3a37731d59f6e11b35610e)) +* Prevent path traversal in get_job_options() app.py ([7da2e57](https://github.com/TPTBusiness/NexQuant/commit/7da2e5706c7d7da8ffee3f04b42f8d3378af26ad)) +* Prevent path traversal in RL UI app.py ([d2c1516](https://github.com/TPTBusiness/NexQuant/commit/d2c1516416dbda6109f6d42245263ce5373ce957)) +* Prevent path traversal in Streamlit UI app.py ([0d0fd34](https://github.com/TPTBusiness/NexQuant/commit/0d0fd34573c0695c34431a6e9eb7b5c10a3a91f9)) +* **qlib:** correct indentation in except blocks in quant_proposal and factor_runner ([8f67ab6](https://github.com/TPTBusiness/NexQuant/commit/8f67ab61299b7fb7063f5ac363705a6687ecaea1)) +* Refactor path validation to fix CodeQL alert [#16](https://github.com/TPTBusiness/NexQuant/issues/16) ([a417ebc](https://github.com/TPTBusiness/NexQuant/commit/a417ebc41db5ad24b89f53e5f3c3ff6e5339ae18)) +* refine DSCoSTEER_eval prompts ([#1157](https://github.com/TPTBusiness/NexQuant/issues/1157)) ([5594ab4](https://github.com/TPTBusiness/NexQuant/commit/5594ab418b46422e2f2e2edc08f0aadd0e95af04)) +* refine prompts and add additional package info ([#1179](https://github.com/TPTBusiness/NexQuant/issues/1179)) ([5353bd3](https://github.com/TPTBusiness/NexQuant/commit/5353bd31f25a98cba552145709af743cd4e83cf5)) +* refine task scheduling logic in MultiProcessEvolvingStrategy for… ([#1275](https://github.com/TPTBusiness/NexQuant/issues/1275)) ([27d38af](https://github.com/TPTBusiness/NexQuant/commit/27d38af7bd7e1fdb73e3617e94435abe7901dd21)) +* remove $factor from prompt, update example count to EURUSD ([3adc5bf](https://github.com/TPTBusiness/NexQuant/commit/3adc5bf75e6820328991aa5a5456e6f68ccf8fd7)) +* remove all Chinese stock references, replace with EURUSD 1min FX ([44eeb01](https://github.com/TPTBusiness/NexQuant/commit/44eeb01ec4f95271a084e9d285e00959926923f3)) +* Remove API key from test_benchmark_api.py config ([16e8631](https://github.com/TPTBusiness/NexQuant/commit/16e86310bdd8d2af1539063957edebde97f88110)) +* Remove API key logging from eurusd_llm.py ([3f510be](https://github.com/TPTBusiness/NexQuant/commit/3f510be9daddf0b241925f605898e2e1d3a18cb7)) +* Remove API key parameter from generate_api_config() ([e6eeac9](https://github.com/TPTBusiness/NexQuant/commit/e6eeac93614a9d97d119696802c7a08153c70f59)) +* Remove API key presence detection from logging ([12b45e5](https://github.com/TPTBusiness/NexQuant/commit/12b45e50f2d7d41881c3028b3f2213e7e7c573d8)) +* Remove clear-text storage of API key (CodeQL alert [#8](https://github.com/TPTBusiness/NexQuant/issues/8)) ([4842311](https://github.com/TPTBusiness/NexQuant/commit/4842311d9193d665c27311e7efc9637b9f3e0519)) +* Remove hardcoded credentials from test_benchmark_api.py ([2523ee2](https://github.com/TPTBusiness/NexQuant/commit/2523ee213e35c03175da9512619b46f6e9069f88)) +* remove unused imports in data science scenario module ([#1136](https://github.com/TPTBusiness/NexQuant/issues/1136)) ([fd6cd39](https://github.com/TPTBusiness/NexQuant/commit/fd6cd3950c4d0463f2d1ccab63fa48be4de41a58)) +* Rename loader.py to prompt_loader.py to fix module conflict ([06f0c34](https://github.com/TPTBusiness/NexQuant/commit/06f0c3427c665063513ae097068be71069a733b2)) +* replace hardcoded ChromeDriver path with webdriver-manager ([#1271](https://github.com/TPTBusiness/NexQuant/issues/1271)) ([e3d2443](https://github.com/TPTBusiness/NexQuant/commit/e3d24437cf7842623fe27fd9221e36a07457d7f7)) +* Resolve 88% empty backtest results + path fixes ([8d1c70e](https://github.com/TPTBusiness/NexQuant/commit/8d1c70e679721b90c024bc747d2544ce9c151adf)) +* resolve dead code, shell injection risk, mutable defaults, and other bugs ([4267315](https://github.com/TPTBusiness/NexQuant/commit/4267315783ccbdaa3472c5f7fd4728cf656556c1)) +* Resolve FORWARD_BARS NameError in backtest script ([ad7f5e1](https://github.com/TPTBusiness/NexQuant/commit/ad7f5e1388ad2149d0c32a5febfed0b77b05ef47)) +* Resolve security vulnerabilities (Dependabot + Code Scanning) ([2c96828](https://github.com/TPTBusiness/NexQuant/commit/2c9682800e4ea30361561affbb747e4f2cc763f6)) +* resolve unbound variable, logger shadowing, withdraw_loop edge case, and other bugs in main scripts ([2fd4bc3](https://github.com/TPTBusiness/NexQuant/commit/2fd4bc3741bafc6778008b3ecc49ba01207f22e1)) +* revert 2 commits ([#1239](https://github.com/TPTBusiness/NexQuant/issues/1239)) ([2201a47](https://github.com/TPTBusiness/NexQuant/commit/2201a4762343f2cc2deb3dff2b70baf99f102292)) +* revert to v10 setting ([#1220](https://github.com/TPTBusiness/NexQuant/issues/1220)) ([51f5bc9](https://github.com/TPTBusiness/NexQuant/commit/51f5bc9e117c6bfcb50c29355d5e73381d40b511)) +* **security:** nosec for B608/B701 false positives in UI and template code ([8b73952](https://github.com/TPTBusiness/NexQuant/commit/8b739528e5679cb49989be7e0edd7ac404b5d993)) +* **security:** Patch 5 CodeQL path injection and clear-text logging alerts ([#22](https://github.com/TPTBusiness/NexQuant/issues/22)-[#25](https://github.com/TPTBusiness/NexQuant/issues/25), [#9](https://github.com/TPTBusiness/NexQuant/issues/9)) ([5aed2cf](https://github.com/TPTBusiness/NexQuant/commit/5aed2cf58a4a39d515bc81e5fd6835a138198b82)) +* **security:** Patch 5 CodeQL path injection and weak hashing alerts ([#25](https://github.com/TPTBusiness/NexQuant/issues/25)-[#30](https://github.com/TPTBusiness/NexQuant/issues/30)) ([e188333](https://github.com/TPTBusiness/NexQuant/commit/e1883331f18e7265aeb13145abaca4b295a15f6e)) +* **security:** Patch path injection and stack trace exposure (CodeQL [#31](https://github.com/TPTBusiness/NexQuant/issues/31), [#27](https://github.com/TPTBusiness/NexQuant/issues/27)) ([2b0525f](https://github.com/TPTBusiness/NexQuant/commit/2b0525f9b7ef68ecc04bfddd558184f06640fb0b)) +* **security:** real fix for B110 (logging in factor_proposal.py [#746](https://github.com/TPTBusiness/NexQuant/issues/746)) ([61656af](https://github.com/TPTBusiness/NexQuant/commit/61656afda75e77686952d847aec443c28e17b6d6)) +* **security:** real fix for B110 (logging in factor_runner.py [#744](https://github.com/TPTBusiness/NexQuant/issues/744)) ([5ac64e6](https://github.com/TPTBusiness/NexQuant/commit/5ac64e60e4e3977364ffd5ad8704fdf0c46bad75)) +* **security:** real fix for B110 (logging in quant_proposal.py [#741](https://github.com/TPTBusiness/NexQuant/issues/741)) ([bcfeb32](https://github.com/TPTBusiness/NexQuant/commit/bcfeb32958953ba07e980dce5feaffe5d53963e8)) +* **security:** real fix for B110 (logging in quant_proposal.py [#741](https://github.com/TPTBusiness/NexQuant/issues/741)) ([d865c82](https://github.com/TPTBusiness/NexQuant/commit/d865c824c98820b26e3d64b8c193445effb19667)) +* **security:** real fix for B404/B603 (sys.executable in factor_runner.py [#745](https://github.com/TPTBusiness/NexQuant/issues/745)) ([7894b8e](https://github.com/TPTBusiness/NexQuant/commit/7894b8e6ed1cb580d8909403eb166a2b418b2dd0)) +* **security:** replace eval() with ast.literal_eval and add request timeouts (B307, B113) ([ffb24fd](https://github.com/TPTBusiness/NexQuant/commit/ffb24fd5de724455aa77846c3f98fae35bc80430)) +* **security:** replace eval() with ast.literal_eval in finetune validator (B307) ([8d53b81](https://github.com/TPTBusiness/NexQuant/commit/8d53b81633965fd0ae2bf32081dacc91b121b77d)) +* **security:** replace os.path.realpath with pathlib.resolve in safe_resolve_path to fix path-injection alerts ([0d7af52](https://github.com/TPTBusiness/NexQuant/commit/0d7af52a2d32f1dbcc366b9f395c43ad47ddabb2)) +* **security:** replace relative_to() with realpath+startswith for CodeQL sanitization ([d7e2018](https://github.com/TPTBusiness/NexQuant/commit/d7e2018a7232c59a40d6e740111572a0da0cd384)) +* **security:** replace remaining assert statements with proper error handling ([d4d5baf](https://github.com/TPTBusiness/NexQuant/commit/d4d5bafd1eb8330f75917170520408b48d38f8c2)) +* **security:** replace shell=True subprocess calls with list args (B602) ([30887ac](https://github.com/TPTBusiness/NexQuant/commit/30887ac244f77a5edabc11dda7805b9bb789667f)) +* **security:** replace shell=True subprocess calls with list args in env.py (B602) ([1a4f1cf](https://github.com/TPTBusiness/NexQuant/commit/1a4f1cf6044842939bc5e7ed853c437cab591a26)) +* **security:** resolve all 30 Bandit security alerts (B301, B614, B104) ([00f400f](https://github.com/TPTBusiness/NexQuant/commit/00f400fe2efda375884234cd381401583a65f456)) +* **security:** resolve CodeQL path-injection alerts in UI data loaders ([7caab95](https://github.com/TPTBusiness/NexQuant/commit/7caab9545bd929909f4c7cae02fbcc2cc3a9893a)) +* **security:** resolve CodeQL path-injection and clear-text-logging alerts ([8701b8b](https://github.com/TPTBusiness/NexQuant/commit/8701b8bd75f82ceb326da4f105609f4228961666)) +* **security:** Resolve GitHub Security Scan alerts ([5af7f19](https://github.com/TPTBusiness/NexQuant/commit/5af7f19bd1656078991752d298c0f3c953f7af2c)) +* **security:** resolve path-injection and add nosec for safe temp paths (B108, py/path-injection) ([4133fff](https://github.com/TPTBusiness/NexQuant/commit/4133fffa7d97bd38beb4b99aa7f3ab3039d78103)) +* **security:** resolve path-injection, B701, B101, B112 Bandit alerts ([e87d612](https://github.com/TPTBusiness/NexQuant/commit/e87d61257fa4bb401415b62ff88c7ad75085d89c)) +* **security:** revert broken read_pickle encoding arg in kaggle template (B301) ([e16460c](https://github.com/TPTBusiness/NexQuant/commit/e16460c7bc5329c9752cd12b20fcee978b5f232b)) +* **security:** Upgrade vllm and transformers to patch 4 CVEs ([85915b3](https://github.com/TPTBusiness/NexQuant/commit/85915b3a20e9ceae6dd854ef4c64a61590a36d84)) +* **security:** validate SQL identifiers in _add_column_if_not_exists (B608) ([c40795b](https://github.com/TPTBusiness/NexQuant/commit/c40795bcb0dab5ceff9b56ec019b9be6f9d10203)) +* **security:** whitelist-validate metric column in get_top_factors (B608) ([db51417](https://github.com/TPTBusiness/NexQuant/commit/db51417cd4337e3b8b76420c93b1bb1ed3271b13)) +* set requires_documentation_search to None to disable feature in eval ([#1245](https://github.com/TPTBusiness/NexQuant/issues/1245)) ([ee8c119](https://github.com/TPTBusiness/NexQuant/commit/ee8c119f31b72de1002e5ad5d30c56d0f4b6c9b9)) +* Skip already evaluated factors in nexquant_full_eval.py ([8375213](https://github.com/TPTBusiness/NexQuant/commit/8375213629551605b4c401aa1ce71ed8d9f1e4db)) +* skip Kronos factor on GPUs < 20GB to avoid CUDA OOM (shared with llama-server) ([08fea7a](https://github.com/TPTBusiness/NexQuant/commit/08fea7a2809941d2b5f3feb5ba998dba132053bb)) +* skip res_ratio check if timer or res_time is None ([#1189](https://github.com/TPTBusiness/NexQuant/issues/1189)) ([dbe2142](https://github.com/TPTBusiness/NexQuant/commit/dbe214282e84f099512eeaf01925c7dee1b780a6)) +* **strategies:** guard against None IC in acceptance check, disable slow wf_rolling ([843cd9a](https://github.com/TPTBusiness/NexQuant/commit/843cd9ae017b05365e1bb353b9945e2fbce332dd)) +* **strategies:** handle None ic/sharpe/dd in rejected strategy log output ([0121c2c](https://github.com/TPTBusiness/NexQuant/commit/0121c2c1583b752622c69313e78ccbeedf6c8d1b)) +* **strategy:** Fix template variables, APIBackend import, and JSON extraction ([f0e813e](https://github.com/TPTBusiness/NexQuant/commit/f0e813ee48ae65e0ee78c27a8b971139dac5b552)) +* **strategy:** Re-evaluate Optuna-optimized strategies with full OHLCV backtest ([7da8bad](https://github.com/TPTBusiness/NexQuant/commit/7da8badbc1005bb1866631dc14daa815641b4271)) +* summary page bug ([#1219](https://github.com/TPTBusiness/NexQuant/issues/1219)) ([beab473](https://github.com/TPTBusiness/NexQuant/commit/beab473b40714fbd802ebb3b61c0dd3d3ba7d91a)) +* Switch to ThreadPoolExecutor for factor evaluation ([d0aa146](https://github.com/TPTBusiness/NexQuant/commit/d0aa1464ea1e3553e4b869c3429e5e394bcebda8)) +* Translate remaining German comment in eurusd_macro.py ([02b46d1](https://github.com/TPTBusiness/NexQuant/commit/02b46d1ffc3bfe87033714f71a9d22714a071f09)) +* ui bug ([#1192](https://github.com/TPTBusiness/NexQuant/issues/1192)) ([2f8261f](https://github.com/TPTBusiness/NexQuant/commit/2f8261f82bf25ad714eff22be2283c6e645b5314)) +* update fallback criterion ([#1210](https://github.com/TPTBusiness/NexQuant/issues/1210)) ([dbbe374](https://github.com/TPTBusiness/NexQuant/commit/dbbe374ac8b0cefcde9145a76b4cd5c0b40b3f92)) +* Update LICENSE badge link from main to master branch ([0dbace6](https://github.com/TPTBusiness/NexQuant/commit/0dbace6aa7aa1a7a250e45c96e71591edeed8f55)) +* update requirements.txt's streamlit ([#1133](https://github.com/TPTBusiness/NexQuant/issues/1133)) ([600d159](https://github.com/TPTBusiness/NexQuant/commit/600d159e86521cc0498df9df3756921e676e3332)) +* Update Werkzeug to 2.3.8 (latest secure 2.x version) ([d68a5ee](https://github.com/TPTBusiness/NexQuant/commit/d68a5ee47cba6f8d2ca0faba1ad89ba65f4fc94b)) +* update WF test for new default (wf_rolling=True) ([c906e00](https://github.com/TPTBusiness/NexQuant/commit/c906e00ac9731673f6386f8b3ce38f5d8e817992)) +* Use 96-bar forward returns in backtest (matching factor IC horizon) ([19c5b3d](https://github.com/TPTBusiness/NexQuant/commit/19c5b3d70633d5cc622328e57acd122120d47971)) +* Use num_api_keys instead of len(api_keys) for round-robin ([c91976e](https://github.com/TPTBusiness/NexQuant/commit/c91976e7968f54a065b4a5ee11228133b48db3e9)) +* weg, Timestamps mit Uhrzeit, kein SZ-Beispiel ([e9f6ac4](https://github.com/TPTBusiness/NexQuant/commit/e9f6ac48d97b1b57a0dde14562cd1b6f5d106edd)) ### Performance Improvements -* **kronos:** batch GPU inference via predict_batch — 75x faster ([a93f940](https://github.com/TPTBusiness/Predix/commit/a93f940485eb92d747d5e6f966acb5c5e8d118c7)) -* **kronos:** batch GPU inference via predict_batch — 75x faster ([471b1f9](https://github.com/TPTBusiness/Predix/commit/471b1f9a4b22cfd2f473d28285a6c7390fe3d10c)) +* **kronos:** batch GPU inference via predict_batch — 75x faster ([a93f940](https://github.com/TPTBusiness/NexQuant/commit/a93f940485eb92d747d5e6f966acb5c5e8d118c7)) +* **kronos:** batch GPU inference via predict_batch — 75x faster ([471b1f9](https://github.com/TPTBusiness/NexQuant/commit/471b1f9a4b22cfd2f473d28285a6c7390fe3d10c)) ### Documentation -* Add ATTRIBUTION.md with clear usage guidelines ([c5bf3e4](https://github.com/TPTBusiness/Predix/commit/c5bf3e4e2b99074e54645328a399f8f6da0387ea)) -* Add CLI welcome screenshot to README ([4103ebe](https://github.com/TPTBusiness/Predix/commit/4103ebe1bfdc625af18711cf78ed19c808270227)) -* Add comprehensive CHANGELOG.md for v1.0.0 release ([569b72b](https://github.com/TPTBusiness/Predix/commit/569b72b2c9a154bf991d03ac078bf020ef1eab16)) -* Add comprehensive CLI help and update README with quick start ([8265462](https://github.com/TPTBusiness/Predix/commit/8265462cacb4e03c981ead1d6b6393a9070f729e)) -* Add comprehensive data setup guide to README ([ca30ed2](https://github.com/TPTBusiness/Predix/commit/ca30ed270ab36517604a9eb0f1ace0fdd58a917c)) -* Add comprehensive Git commit guidelines to QWEN.md ([d10d3a2](https://github.com/TPTBusiness/Predix/commit/d10d3a2c658bb77366baec13e922f0ed924b51d8)) -* Add conda requirement to README + fix predix CLI ([90e185a](https://github.com/TPTBusiness/Predix/commit/90e185a4986ff9a4838bd94cb7b4034fea573f87)) -* Add CRITICAL rule - NEVER commit closed-source/private assets ([a0ed4f7](https://github.com/TPTBusiness/Predix/commit/a0ed4f712ed4aa49eadaa5ced070c22f0146420a)) -* Add CRITICAL rule - NEVER commit trading strategies or JSON files ([cb0cb4c](https://github.com/TPTBusiness/Predix/commit/cb0cb4c1122b9aab23f2e2f4feb5b4a99ed05008)) -* add documentation for Data Science configurable options ([#1301](https://github.com/TPTBusiness/Predix/issues/1301)) ([d603d5a](https://github.com/TPTBusiness/Predix/commit/d603d5a5aa86e43cfc0ee3efedc5ab18919809f5)) -* add execution environment configuration guide (Docker vs Conda) ([#1288](https://github.com/TPTBusiness/Predix/issues/1288)) ([27ed3d1](https://github.com/TPTBusiness/Predix/commit/27ed3d1a75b15a5589af84d4f597a8484006e71e)) -* Add implementation summary ([649ed0c](https://github.com/TPTBusiness/Predix/commit/649ed0c3c0db823fb4fc984b9f6b6e7970d728ff)) -* Add live trading system documentation to QWEN.md ([49b15d9](https://github.com/TPTBusiness/Predix/commit/49b15d917828a3c1263da1785da5663c67d41b40)) -* Add Microsoft RD-Agent acknowledgment to README ([06c0b44](https://github.com/TPTBusiness/Predix/commit/06c0b44e4106a725a879932122d871041042ec2b)) -* Add professional badges to README header ([91d44dd](https://github.com/TPTBusiness/Predix/commit/91d44ddabd4b4cf82cb1e6f53c8f4547f52a50cb)) -* Add results/ directory README for storage documentation ([ba4e5d6](https://github.com/TPTBusiness/Predix/commit/ba4e5d6ece652e8c1c3b8a713a2e0ea2a0ab225c)) -* Add v2.0.0 release changelog ([c5e34ff](https://github.com/TPTBusiness/Predix/commit/c5e34ff7aaa2d30a159b05f4e6ecc853b8a4f79e)) -* Clean changelog of closed-source performance metrics ([7dc2ecd](https://github.com/TPTBusiness/Predix/commit/7dc2ecdc8dbf4ef0a2936ab1f1e0c0469ca95e9c)) -* Create changelog/ directory with v1.0.0.md release notes ([ddefcd4](https://github.com/TPTBusiness/Predix/commit/ddefcd420a9d98fc6548e14cfc94caffd2068963)) -* Final system completion - all 9 phases done ([ab541de](https://github.com/TPTBusiness/Predix/commit/ab541de9b3ca4cdf62f14f97d540460fc333fca9)) -* fix duplicate sections, add hardware requirements and data setup guide ([cc85cd4](https://github.com/TPTBusiness/Predix/commit/cc85cd482ac7169fbe98468539899a2ce561e70d)) -* improve README badges, fix llama-server flags, clean up structure ([7981a6a](https://github.com/TPTBusiness/Predix/commit/7981a6a4d1517950f4124a78642db3f15fde03ba)) -* Remove 'Inspired by' comments and add comprehensive Acknowledgments ([d5dc48a](https://github.com/TPTBusiness/Predix/commit/d5dc48a6bdd519d0ce159d21ca9bbc46b7996313)) -* Simplify README for git-clone-only installation ([a1e3bb9](https://github.com/TPTBusiness/Predix/commit/a1e3bb903c31cea3ea4c5e572bc639352e3215ae)) -* Translate all code comments to English ([cff6c2a](https://github.com/TPTBusiness/Predix/commit/cff6c2a55e0b465a3f30ab802f02e3b4583025bc)) -* Translate data_config.yaml to English ([b5221b7](https://github.com/TPTBusiness/Predix/commit/b5221b761f51bcf2b7b14c7bdfabfa2e9629a3b0)) -* Translate server.py comments to English ([7fd7592](https://github.com/TPTBusiness/Predix/commit/7fd75922f89d6358c1ce48fd886ffbca10537531)) -* Translate server.py docstring to English ([d5acaa0](https://github.com/TPTBusiness/Predix/commit/d5acaa0c036913776eef6bb01083cce2942dc16c)) -* update configuration docs ([#1155](https://github.com/TPTBusiness/Predix/issues/1155)) ([56ed919](https://github.com/TPTBusiness/Predix/commit/56ed919b2e44f4398ac304a4f6cdf099dd382096)) -* update license section from MIT to AGPL-3.0 ([ff441a4](https://github.com/TPTBusiness/Predix/commit/ff441a49fe0b45c31b1702b8bd22d5c8edd37abb)) -* Update QWEN.md with complete 5-phase architecture and results ([66e1798](https://github.com/TPTBusiness/Predix/commit/66e17981fd9241d9ee6f50be05142ee201b761a8)) -* Update QWEN.md with detailed Git history correction guide ([a972772](https://github.com/TPTBusiness/Predix/commit/a97277298d3d5f122905d7e02b58568224b86b40)) -* Update QWEN.md with implementation guide ([23af142](https://github.com/TPTBusiness/Predix/commit/23af142af0b127600c61ba3623f3538abf1c881c)) -* Update SECURITY.md and CONTRIBUTING.md ([e40f659](https://github.com/TPTBusiness/Predix/commit/e40f6594441e195041ccb58072483fe8704eac4c)) -* Update TODO.md with v1.0.0 completed items and future roadmap ([2d3ca5b](https://github.com/TPTBusiness/Predix/commit/2d3ca5bec66e81b37ce7bf4086f24556f6cad134)) +* Add ATTRIBUTION.md with clear usage guidelines ([c5bf3e4](https://github.com/TPTBusiness/NexQuant/commit/c5bf3e4e2b99074e54645328a399f8f6da0387ea)) +* Add CLI welcome screenshot to README ([4103ebe](https://github.com/TPTBusiness/NexQuant/commit/4103ebe1bfdc625af18711cf78ed19c808270227)) +* Add comprehensive CHANGELOG.md for v1.0.0 release ([569b72b](https://github.com/TPTBusiness/NexQuant/commit/569b72b2c9a154bf991d03ac078bf020ef1eab16)) +* Add comprehensive CLI help and update README with quick start ([8265462](https://github.com/TPTBusiness/NexQuant/commit/8265462cacb4e03c981ead1d6b6393a9070f729e)) +* Add comprehensive data setup guide to README ([ca30ed2](https://github.com/TPTBusiness/NexQuant/commit/ca30ed270ab36517604a9eb0f1ace0fdd58a917c)) +* Add comprehensive Git commit guidelines to QWEN.md ([d10d3a2](https://github.com/TPTBusiness/NexQuant/commit/d10d3a2c658bb77366baec13e922f0ed924b51d8)) +* Add conda requirement to README + fix nexquant CLI ([90e185a](https://github.com/TPTBusiness/NexQuant/commit/90e185a4986ff9a4838bd94cb7b4034fea573f87)) +* Add CRITICAL rule - NEVER commit closed-source/private assets ([a0ed4f7](https://github.com/TPTBusiness/NexQuant/commit/a0ed4f712ed4aa49eadaa5ced070c22f0146420a)) +* Add CRITICAL rule - NEVER commit trading strategies or JSON files ([cb0cb4c](https://github.com/TPTBusiness/NexQuant/commit/cb0cb4c1122b9aab23f2e2f4feb5b4a99ed05008)) +* add documentation for Data Science configurable options ([#1301](https://github.com/TPTBusiness/NexQuant/issues/1301)) ([d603d5a](https://github.com/TPTBusiness/NexQuant/commit/d603d5a5aa86e43cfc0ee3efedc5ab18919809f5)) +* add execution environment configuration guide (Docker vs Conda) ([#1288](https://github.com/TPTBusiness/NexQuant/issues/1288)) ([27ed3d1](https://github.com/TPTBusiness/NexQuant/commit/27ed3d1a75b15a5589af84d4f597a8484006e71e)) +* Add implementation summary ([649ed0c](https://github.com/TPTBusiness/NexQuant/commit/649ed0c3c0db823fb4fc984b9f6b6e7970d728ff)) +* Add live trading system documentation to QWEN.md ([49b15d9](https://github.com/TPTBusiness/NexQuant/commit/49b15d917828a3c1263da1785da5663c67d41b40)) +* Add Microsoft RD-Agent acknowledgment to README ([06c0b44](https://github.com/TPTBusiness/NexQuant/commit/06c0b44e4106a725a879932122d871041042ec2b)) +* Add professional badges to README header ([91d44dd](https://github.com/TPTBusiness/NexQuant/commit/91d44ddabd4b4cf82cb1e6f53c8f4547f52a50cb)) +* Add results/ directory README for storage documentation ([ba4e5d6](https://github.com/TPTBusiness/NexQuant/commit/ba4e5d6ece652e8c1c3b8a713a2e0ea2a0ab225c)) +* Add v2.0.0 release changelog ([c5e34ff](https://github.com/TPTBusiness/NexQuant/commit/c5e34ff7aaa2d30a159b05f4e6ecc853b8a4f79e)) +* Clean changelog of closed-source performance metrics ([7dc2ecd](https://github.com/TPTBusiness/NexQuant/commit/7dc2ecdc8dbf4ef0a2936ab1f1e0c0469ca95e9c)) +* Create changelog/ directory with v1.0.0.md release notes ([ddefcd4](https://github.com/TPTBusiness/NexQuant/commit/ddefcd420a9d98fc6548e14cfc94caffd2068963)) +* Final system completion - all 9 phases done ([ab541de](https://github.com/TPTBusiness/NexQuant/commit/ab541de9b3ca4cdf62f14f97d540460fc333fca9)) +* fix duplicate sections, add hardware requirements and data setup guide ([cc85cd4](https://github.com/TPTBusiness/NexQuant/commit/cc85cd482ac7169fbe98468539899a2ce561e70d)) +* improve README badges, fix llama-server flags, clean up structure ([7981a6a](https://github.com/TPTBusiness/NexQuant/commit/7981a6a4d1517950f4124a78642db3f15fde03ba)) +* Remove 'Inspired by' comments and add comprehensive Acknowledgments ([d5dc48a](https://github.com/TPTBusiness/NexQuant/commit/d5dc48a6bdd519d0ce159d21ca9bbc46b7996313)) +* Simplify README for git-clone-only installation ([a1e3bb9](https://github.com/TPTBusiness/NexQuant/commit/a1e3bb903c31cea3ea4c5e572bc639352e3215ae)) +* Translate all code comments to English ([cff6c2a](https://github.com/TPTBusiness/NexQuant/commit/cff6c2a55e0b465a3f30ab802f02e3b4583025bc)) +* Translate data_config.yaml to English ([b5221b7](https://github.com/TPTBusiness/NexQuant/commit/b5221b761f51bcf2b7b14c7bdfabfa2e9629a3b0)) +* Translate server.py comments to English ([7fd7592](https://github.com/TPTBusiness/NexQuant/commit/7fd75922f89d6358c1ce48fd886ffbca10537531)) +* Translate server.py docstring to English ([d5acaa0](https://github.com/TPTBusiness/NexQuant/commit/d5acaa0c036913776eef6bb01083cce2942dc16c)) +* update configuration docs ([#1155](https://github.com/TPTBusiness/NexQuant/issues/1155)) ([56ed919](https://github.com/TPTBusiness/NexQuant/commit/56ed919b2e44f4398ac304a4f6cdf099dd382096)) +* update license section from MIT to AGPL-3.0 ([ff441a4](https://github.com/TPTBusiness/NexQuant/commit/ff441a49fe0b45c31b1702b8bd22d5c8edd37abb)) +* Update QWEN.md with complete 5-phase architecture and results ([66e1798](https://github.com/TPTBusiness/NexQuant/commit/66e17981fd9241d9ee6f50be05142ee201b761a8)) +* Update QWEN.md with detailed Git history correction guide ([a972772](https://github.com/TPTBusiness/NexQuant/commit/a97277298d3d5f122905d7e02b58568224b86b40)) +* Update QWEN.md with implementation guide ([23af142](https://github.com/TPTBusiness/NexQuant/commit/23af142af0b127600c61ba3623f3538abf1c881c)) +* Update SECURITY.md and CONTRIBUTING.md ([e40f659](https://github.com/TPTBusiness/NexQuant/commit/e40f6594441e195041ccb58072483fe8704eac4c)) +* Update TODO.md with v1.0.0 completed items and future roadmap ([2d3ca5b](https://github.com/TPTBusiness/NexQuant/commit/2d3ca5bec66e81b37ce7bf4086f24556f6cad134)) ### Miscellaneous Chores -* release 0.8.0 ([8c15238](https://github.com/TPTBusiness/Predix/commit/8c1523802c3c0237eae27ebef3e155af2cddd05e)) +* release 0.8.0 ([8c15238](https://github.com/TPTBusiness/NexQuant/commit/8c1523802c3c0237eae27ebef3e155af2cddd05e)) -## [1.4.2](https://github.com/TPTBusiness/Predix/compare/v1.4.1...v1.4.2) (2026-05-03) +## [1.4.2](https://github.com/TPTBusiness/NexQuant/compare/v1.4.1...v1.4.2) (2026-05-03) ### Bug Fixes -* add missing sys import and fix undefined acc_rate in factor eval ([c45f990](https://github.com/TPTBusiness/Predix/commit/c45f9908ee321400f0a19c57f1482e4cd1394a50)) +* add missing sys import and fix undefined acc_rate in factor eval ([c45f990](https://github.com/TPTBusiness/NexQuant/commit/c45f9908ee321400f0a19c57f1482e4cd1394a50)) -## [1.4.1](https://github.com/TPTBusiness/Predix/compare/v1.4.0...v1.4.1) (2026-05-03) +## [1.4.1](https://github.com/TPTBusiness/NexQuant/compare/v1.4.0...v1.4.1) (2026-05-03) ### Bug Fixes -* 15 bug fixes across orchestrator, runner, backtest, and infrastructure ([163687d](https://github.com/TPTBusiness/Predix/commit/163687d7e1c278a085d7052a3f958a3edb501e77)) -* also catch ValueError in mean_variance for dimension mismatch ([ed73b72](https://github.com/TPTBusiness/Predix/commit/ed73b7253f7dc6459ee30dd81a1ce1194e46e9af)) -* close log file handle, fix FTMO equity double-count, remove bare except ([76219a5](https://github.com/TPTBusiness/Predix/commit/76219a53efddaafc2b8bd48a0f76c1d4325e6ea5)) -* correct project root paths and subprocess handling in parallel runner and CLI ([9735e3a](https://github.com/TPTBusiness/Predix/commit/9735e3a4d8f01e7b16fb9b185a002396a915cea4)) -* filter NaN in max(), remove redundant ternary, handle non-finite vbt results ([f89fbb3](https://github.com/TPTBusiness/Predix/commit/f89fbb3421faf6ccdc8e68a911fd9db2c166120f)) -* fix type annotation, remove unused parameter, improve import_class errors ([8b6ab73](https://github.com/TPTBusiness/Predix/commit/8b6ab735c05629bf6b76ddc2fd8b15617600cad7)) -* resolve dead code, shell injection risk, mutable defaults, and other bugs ([afff262](https://github.com/TPTBusiness/Predix/commit/afff26287f7c4df7ddfde4e816d280fe845e11eb)) -* resolve unbound variable, logger shadowing, withdraw_loop edge case, and other bugs in main scripts ([748cf9b](https://github.com/TPTBusiness/Predix/commit/748cf9b214a3e8447f1289fc4cf1e92ad6cc2f1a)) +* 15 bug fixes across orchestrator, runner, backtest, and infrastructure ([163687d](https://github.com/TPTBusiness/NexQuant/commit/163687d7e1c278a085d7052a3f958a3edb501e77)) +* also catch ValueError in mean_variance for dimension mismatch ([ed73b72](https://github.com/TPTBusiness/NexQuant/commit/ed73b7253f7dc6459ee30dd81a1ce1194e46e9af)) +* close log file handle, fix FTMO equity double-count, remove bare except ([76219a5](https://github.com/TPTBusiness/NexQuant/commit/76219a53efddaafc2b8bd48a0f76c1d4325e6ea5)) +* correct project root paths and subprocess handling in parallel runner and CLI ([9735e3a](https://github.com/TPTBusiness/NexQuant/commit/9735e3a4d8f01e7b16fb9b185a002396a915cea4)) +* filter NaN in max(), remove redundant ternary, handle non-finite vbt results ([f89fbb3](https://github.com/TPTBusiness/NexQuant/commit/f89fbb3421faf6ccdc8e68a911fd9db2c166120f)) +* fix type annotation, remove unused parameter, improve import_class errors ([8b6ab73](https://github.com/TPTBusiness/NexQuant/commit/8b6ab735c05629bf6b76ddc2fd8b15617600cad7)) +* resolve dead code, shell injection risk, mutable defaults, and other bugs ([afff262](https://github.com/TPTBusiness/NexQuant/commit/afff26287f7c4df7ddfde4e816d280fe845e11eb)) +* resolve unbound variable, logger shadowing, withdraw_loop edge case, and other bugs in main scripts ([748cf9b](https://github.com/TPTBusiness/NexQuant/commit/748cf9b214a3e8447f1289fc4cf1e92ad6cc2f1a)) -## [1.4.0](https://github.com/TPTBusiness/Predix/compare/v1.3.11...v1.4.0) (2026-05-01) +## [1.4.0](https://github.com/TPTBusiness/NexQuant/compare/v1.3.11...v1.4.0) (2026-05-01) ### Features -* **optimizer:** add max_positions parameter to Optuna search space ([fdb4be3](https://github.com/TPTBusiness/Predix/commit/fdb4be3b3ebd93325e7821f4251148424184a40d)) +* **optimizer:** add max_positions parameter to Optuna search space ([fdb4be3](https://github.com/TPTBusiness/NexQuant/commit/fdb4be3b3ebd93325e7821f4251148424184a40d)) -## [1.3.11](https://github.com/TPTBusiness/Predix/compare/v1.3.10...v1.3.11) (2026-05-01) +## [1.3.11](https://github.com/TPTBusiness/NexQuant/compare/v1.3.10...v1.3.11) (2026-05-01) ### Bug Fixes -* **ci:** lazy import logger in predix.py and cli.py to avoid ImportError in test env ([60763e8](https://github.com/TPTBusiness/Predix/commit/60763e8eae34f41865ba8e5e65bdfde13b564b4b)) +* **ci:** lazy import logger in nexquant.py and cli.py to avoid ImportError in test env ([60763e8](https://github.com/TPTBusiness/NexQuant/commit/60763e8eae34f41865ba8e5e65bdfde13b564b4b)) -## [1.3.10](https://github.com/TPTBusiness/Predix/compare/v1.3.9...v1.3.10) (2026-05-01) +## [1.3.10](https://github.com/TPTBusiness/NexQuant/compare/v1.3.9...v1.3.10) (2026-05-01) ### Bug Fixes -* **security:** replace remaining assert statements with proper error handling ([928533d](https://github.com/TPTBusiness/Predix/commit/928533d9a81bd5062f07458fbf94d3c7fe347775)) +* **security:** replace remaining assert statements with proper error handling ([928533d](https://github.com/TPTBusiness/NexQuant/commit/928533d9a81bd5062f07458fbf94d3c7fe347775)) -## [1.3.9](https://github.com/TPTBusiness/Predix/compare/v1.3.8...v1.3.9) (2026-05-01) +## [1.3.9](https://github.com/TPTBusiness/NexQuant/compare/v1.3.8...v1.3.9) (2026-05-01) ### Bug Fixes -* **security:** resolve path-injection, B701, B101, B112 Bandit alerts ([20b89a0](https://github.com/TPTBusiness/Predix/commit/20b89a061843b39836e975f158404e8e2d4627cd)) +* **security:** resolve path-injection, B701, B101, B112 Bandit alerts ([20b89a0](https://github.com/TPTBusiness/NexQuant/commit/20b89a061843b39836e975f158404e8e2d4627cd)) -## [1.3.8](https://github.com/TPTBusiness/Predix/compare/v1.3.7...v1.3.8) (2026-04-30) +## [1.3.8](https://github.com/TPTBusiness/NexQuant/compare/v1.3.7...v1.3.8) (2026-04-30) ### Bug Fixes -* **deps:** relax aiohttp constraint to >=3.13.4 for litellm compatibility ([34ab192](https://github.com/TPTBusiness/Predix/commit/34ab1923a887089eb36e5cbad6cb8df16f0333ca)) -* **qlib:** correct indentation in except blocks in quant_proposal and factor_runner ([8143451](https://github.com/TPTBusiness/Predix/commit/8143451e8c0ead01c4d86d19669268c7bfb15fac)) -* **security:** replace eval() with ast.literal_eval in finetune validator (B307) ([0508caf](https://github.com/TPTBusiness/Predix/commit/0508caf9140d210b823fefefa28ee535ec85a0ae)) -* **security:** replace shell=True subprocess calls with list args in env.py (B602) ([2012d5a](https://github.com/TPTBusiness/Predix/commit/2012d5ae4e77cc2f1ab9a48beaaac5a74695d083)) -* **security:** resolve path-injection and add nosec for safe temp paths (B108, py/path-injection) ([6727480](https://github.com/TPTBusiness/Predix/commit/67274803bd1d14e5d1df9a063f46b2edb8501a2b)) +* **deps:** relax aiohttp constraint to >=3.13.4 for litellm compatibility ([34ab192](https://github.com/TPTBusiness/NexQuant/commit/34ab1923a887089eb36e5cbad6cb8df16f0333ca)) +* **qlib:** correct indentation in except blocks in quant_proposal and factor_runner ([8143451](https://github.com/TPTBusiness/NexQuant/commit/8143451e8c0ead01c4d86d19669268c7bfb15fac)) +* **security:** replace eval() with ast.literal_eval in finetune validator (B307) ([0508caf](https://github.com/TPTBusiness/NexQuant/commit/0508caf9140d210b823fefefa28ee535ec85a0ae)) +* **security:** replace shell=True subprocess calls with list args in env.py (B602) ([2012d5a](https://github.com/TPTBusiness/NexQuant/commit/2012d5ae4e77cc2f1ab9a48beaaac5a74695d083)) +* **security:** resolve path-injection and add nosec for safe temp paths (B108, py/path-injection) ([6727480](https://github.com/TPTBusiness/NexQuant/commit/67274803bd1d14e5d1df9a063f46b2edb8501a2b)) -## [1.3.7](https://github.com/TPTBusiness/Predix/compare/v1.3.6...v1.3.7) (2026-04-30) +## [1.3.7](https://github.com/TPTBusiness/NexQuant/compare/v1.3.6...v1.3.7) (2026-04-30) ### Bug Fixes -* **security:** nosec for B608/B701 false positives in UI and template code ([5eb5d7e](https://github.com/TPTBusiness/Predix/commit/5eb5d7e8fdbe90e0dced83fef4e09f5a33e96b2b)) -* **security:** replace eval() with ast.literal_eval and add request timeouts (B307, B113) ([3301ada](https://github.com/TPTBusiness/Predix/commit/3301ada697ca7d3afa1a188d2a76a87ae98b4529)) -* **security:** replace shell=True subprocess calls with list args (B602) ([13c08f4](https://github.com/TPTBusiness/Predix/commit/13c08f4ce6813eb7c314087921ec8c0f40074bd7)) +* **security:** nosec for B608/B701 false positives in UI and template code ([5eb5d7e](https://github.com/TPTBusiness/NexQuant/commit/5eb5d7e8fdbe90e0dced83fef4e09f5a33e96b2b)) +* **security:** replace eval() with ast.literal_eval and add request timeouts (B307, B113) ([3301ada](https://github.com/TPTBusiness/NexQuant/commit/3301ada697ca7d3afa1a188d2a76a87ae98b4529)) +* **security:** replace shell=True subprocess calls with list args (B602) ([13c08f4](https://github.com/TPTBusiness/NexQuant/commit/13c08f4ce6813eb7c314087921ec8c0f40074bd7)) -## [1.3.6](https://github.com/TPTBusiness/Predix/compare/v1.3.5...v1.3.6) (2026-04-30) +## [1.3.6](https://github.com/TPTBusiness/NexQuant/compare/v1.3.5...v1.3.6) (2026-04-30) ### Bug Fixes -* **security:** real fix for B110 (logging in factor_proposal.py [#746](https://github.com/TPTBusiness/Predix/issues/746)) ([16624e0](https://github.com/TPTBusiness/Predix/commit/16624e0bd966ae4d24c4a3eb42bbc31c11da3136)) -* **security:** real fix for B110 (logging in factor_runner.py [#744](https://github.com/TPTBusiness/Predix/issues/744)) ([88cf0fb](https://github.com/TPTBusiness/Predix/commit/88cf0fb8828b11c97f2f3ae2881a4900b020c6f0)) -* **security:** real fix for B110 (logging in quant_proposal.py [#741](https://github.com/TPTBusiness/Predix/issues/741)) ([7cf2a64](https://github.com/TPTBusiness/Predix/commit/7cf2a644f553b054bd4b0607ea51e5372e68d90a)) -* **security:** real fix for B110 (logging in quant_proposal.py [#741](https://github.com/TPTBusiness/Predix/issues/741)) ([ef985f8](https://github.com/TPTBusiness/Predix/commit/ef985f86035d8dca707c60137e6508349a0c4ae6)) -* **security:** real fix for B404/B603 (sys.executable in factor_runner.py [#745](https://github.com/TPTBusiness/Predix/issues/745)) ([819655a](https://github.com/TPTBusiness/Predix/commit/819655aaa3efa76596d60501d0e8ca365df3e5e2)) -* **security:** revert broken read_pickle encoding arg in kaggle template (B301) ([3574907](https://github.com/TPTBusiness/Predix/commit/35749073c91e69f63ddaad61dae3f2b799327e63)) -* **security:** validate SQL identifiers in _add_column_if_not_exists (B608) ([e10dfa2](https://github.com/TPTBusiness/Predix/commit/e10dfa2576038e911f83595d3b466c261bc0cd54)) -* **security:** whitelist-validate metric column in get_top_factors (B608) ([e50519f](https://github.com/TPTBusiness/Predix/commit/e50519fe066e68aec2f19b83df4f643c3c22053d)) +* **security:** real fix for B110 (logging in factor_proposal.py [#746](https://github.com/TPTBusiness/NexQuant/issues/746)) ([16624e0](https://github.com/TPTBusiness/NexQuant/commit/16624e0bd966ae4d24c4a3eb42bbc31c11da3136)) +* **security:** real fix for B110 (logging in factor_runner.py [#744](https://github.com/TPTBusiness/NexQuant/issues/744)) ([88cf0fb](https://github.com/TPTBusiness/NexQuant/commit/88cf0fb8828b11c97f2f3ae2881a4900b020c6f0)) +* **security:** real fix for B110 (logging in quant_proposal.py [#741](https://github.com/TPTBusiness/NexQuant/issues/741)) ([7cf2a64](https://github.com/TPTBusiness/NexQuant/commit/7cf2a644f553b054bd4b0607ea51e5372e68d90a)) +* **security:** real fix for B110 (logging in quant_proposal.py [#741](https://github.com/TPTBusiness/NexQuant/issues/741)) ([ef985f8](https://github.com/TPTBusiness/NexQuant/commit/ef985f86035d8dca707c60137e6508349a0c4ae6)) +* **security:** real fix for B404/B603 (sys.executable in factor_runner.py [#745](https://github.com/TPTBusiness/NexQuant/issues/745)) ([819655a](https://github.com/TPTBusiness/NexQuant/commit/819655aaa3efa76596d60501d0e8ca365df3e5e2)) +* **security:** revert broken read_pickle encoding arg in kaggle template (B301) ([3574907](https://github.com/TPTBusiness/NexQuant/commit/35749073c91e69f63ddaad61dae3f2b799327e63)) +* **security:** validate SQL identifiers in _add_column_if_not_exists (B608) ([e10dfa2](https://github.com/TPTBusiness/NexQuant/commit/e10dfa2576038e911f83595d3b466c261bc0cd54)) +* **security:** whitelist-validate metric column in get_top_factors (B608) ([e50519f](https://github.com/TPTBusiness/NexQuant/commit/e50519fe066e68aec2f19b83df4f643c3c22053d)) -## [1.3.5](https://github.com/TPTBusiness/Predix/compare/v1.3.4...v1.3.5) (2026-04-27) +## [1.3.5](https://github.com/TPTBusiness/NexQuant/compare/v1.3.4...v1.3.5) (2026-04-27) ### Bug Fixes -* **auto-fixer:** add five new factor code fixes for groupby/apply errors ([449c8fd](https://github.com/TPTBusiness/Predix/commit/449c8fd70a327e604dcca122e4a134f0cca918e4)) -* **auto-fixer:** add four new factor code fixes for common runtime errors ([40484f6](https://github.com/TPTBusiness/Predix/commit/40484f6d300425da481f1edd325da4acbc06ec7d)) -* **auto-fixer:** add groupby([level=N,'date']) SyntaxError fix ([ca77c00](https://github.com/TPTBusiness/Predix/commit/ca77c005bea4abdd8854c1de2b0e8d03b7742161)) -* **auto-fixer:** disable _fix_min_periods for intraday data ([77b0740](https://github.com/TPTBusiness/Predix/commit/77b0740f059349df7e769a378af728aa33b2070e)) -* **auto-fixer:** fix chained groupby(level=N).groupby('date') pattern ([7d5fe32](https://github.com/TPTBusiness/Predix/commit/7d5fe32b31a19ce8b04bd8f5a430720fdb748f7a)) -* **auto-fixer:** fix df.loc[instrument] DateParseError on MultiIndex frames ([b7860ea](https://github.com/TPTBusiness/Predix/commit/b7860eafc0ad26384947ce0510ecf4e9f3425807)) -* **auto-fixer:** fix df['instrument'] KeyError on MultiIndex frames ([aad6bd1](https://github.com/TPTBusiness/Predix/commit/aad6bd1c7c720b3d486e0cf248337f32394773b1)) -* **auto-fixer:** fix two assignment-target bugs in instrument column fixers ([421eedf](https://github.com/TPTBusiness/Predix/commit/421eedffed4b883c24397dc5581c019a3985277f)) -* **auto-fixer:** preserve date dimension in groupby(['instrument','date']) fix ([b58fdd8](https://github.com/TPTBusiness/Predix/commit/b58fdd8be43720b5d4363e0f8de9a01591d4d2dc)) -* **auto-fixer:** remove ddof from rolling() args, not only from std()/var() ([b0fc328](https://github.com/TPTBusiness/Predix/commit/b0fc328d0d4a041c65d8eeb32cb3f2bb86568406)) -* **auto-fixer:** strip spurious .reset_index() after .transform() calls ([8708aae](https://github.com/TPTBusiness/Predix/commit/8708aae6e08728cda1875c775a76dc92e43576f3)) -* **loop:** prevent step_idx advance on unhandled exceptions + fix consecutive assistant messages ([5ec4ad1](https://github.com/TPTBusiness/Predix/commit/5ec4ad1b96b5b99ef42bea7bb828cb1ef709a688)) +* **auto-fixer:** add five new factor code fixes for groupby/apply errors ([449c8fd](https://github.com/TPTBusiness/NexQuant/commit/449c8fd70a327e604dcca122e4a134f0cca918e4)) +* **auto-fixer:** add four new factor code fixes for common runtime errors ([40484f6](https://github.com/TPTBusiness/NexQuant/commit/40484f6d300425da481f1edd325da4acbc06ec7d)) +* **auto-fixer:** add groupby([level=N,'date']) SyntaxError fix ([ca77c00](https://github.com/TPTBusiness/NexQuant/commit/ca77c005bea4abdd8854c1de2b0e8d03b7742161)) +* **auto-fixer:** disable _fix_min_periods for intraday data ([77b0740](https://github.com/TPTBusiness/NexQuant/commit/77b0740f059349df7e769a378af728aa33b2070e)) +* **auto-fixer:** fix chained groupby(level=N).groupby('date') pattern ([7d5fe32](https://github.com/TPTBusiness/NexQuant/commit/7d5fe32b31a19ce8b04bd8f5a430720fdb748f7a)) +* **auto-fixer:** fix df.loc[instrument] DateParseError on MultiIndex frames ([b7860ea](https://github.com/TPTBusiness/NexQuant/commit/b7860eafc0ad26384947ce0510ecf4e9f3425807)) +* **auto-fixer:** fix df['instrument'] KeyError on MultiIndex frames ([aad6bd1](https://github.com/TPTBusiness/NexQuant/commit/aad6bd1c7c720b3d486e0cf248337f32394773b1)) +* **auto-fixer:** fix two assignment-target bugs in instrument column fixers ([421eedf](https://github.com/TPTBusiness/NexQuant/commit/421eedffed4b883c24397dc5581c019a3985277f)) +* **auto-fixer:** preserve date dimension in groupby(['instrument','date']) fix ([b58fdd8](https://github.com/TPTBusiness/NexQuant/commit/b58fdd8be43720b5d4363e0f8de9a01591d4d2dc)) +* **auto-fixer:** remove ddof from rolling() args, not only from std()/var() ([b0fc328](https://github.com/TPTBusiness/NexQuant/commit/b0fc328d0d4a041c65d8eeb32cb3f2bb86568406)) +* **auto-fixer:** strip spurious .reset_index() after .transform() calls ([8708aae](https://github.com/TPTBusiness/NexQuant/commit/8708aae6e08728cda1875c775a76dc92e43576f3)) +* **loop:** prevent step_idx advance on unhandled exceptions + fix consecutive assistant messages ([5ec4ad1](https://github.com/TPTBusiness/NexQuant/commit/5ec4ad1b96b5b99ef42bea7bb828cb1ef709a688)) -## [1.3.4](https://github.com/TPTBusiness/Predix/compare/v1.3.3...v1.3.4) (2026-04-27) +## [1.3.4](https://github.com/TPTBusiness/NexQuant/compare/v1.3.3...v1.3.4) (2026-04-27) ### Bug Fixes -* **auto-fixer:** add five new factor code fixes for groupby/apply errors ([449c8fd](https://github.com/TPTBusiness/Predix/commit/449c8fd70a327e604dcca122e4a134f0cca918e4)) -* **auto-fixer:** add four new factor code fixes for common runtime errors ([40484f6](https://github.com/TPTBusiness/Predix/commit/40484f6d300425da481f1edd325da4acbc06ec7d)) -* **auto-fixer:** add groupby([level=N,'date']) SyntaxError fix ([ca77c00](https://github.com/TPTBusiness/Predix/commit/ca77c005bea4abdd8854c1de2b0e8d03b7742161)) -* **auto-fixer:** disable _fix_min_periods for intraday data ([77b0740](https://github.com/TPTBusiness/Predix/commit/77b0740f059349df7e769a378af728aa33b2070e)) -* **auto-fixer:** fix chained groupby(level=N).groupby('date') pattern ([7d5fe32](https://github.com/TPTBusiness/Predix/commit/7d5fe32b31a19ce8b04bd8f5a430720fdb748f7a)) -* **auto-fixer:** fix df.loc[instrument] DateParseError on MultiIndex frames ([b7860ea](https://github.com/TPTBusiness/Predix/commit/b7860eafc0ad26384947ce0510ecf4e9f3425807)) -* **auto-fixer:** fix df['instrument'] KeyError on MultiIndex frames ([aad6bd1](https://github.com/TPTBusiness/Predix/commit/aad6bd1c7c720b3d486e0cf248337f32394773b1)) -* **auto-fixer:** preserve date dimension in groupby(['instrument','date']) fix ([b58fdd8](https://github.com/TPTBusiness/Predix/commit/b58fdd8be43720b5d4363e0f8de9a01591d4d2dc)) -* **auto-fixer:** remove ddof from rolling() args, not only from std()/var() ([b0fc328](https://github.com/TPTBusiness/Predix/commit/b0fc328d0d4a041c65d8eeb32cb3f2bb86568406)) -* **backtest:** replace broken MC permutation test with binomial win-rate test ([c38d894](https://github.com/TPTBusiness/Predix/commit/c38d89478f586825bfca5715a96ca70ccd8791a3)) -* **factors:** detect and correct look-ahead bias in daily-constant factors ([eb490a4](https://github.com/TPTBusiness/Predix/commit/eb490a461b66cbd815ae53ac5205115754712432)) -* **factors:** extend look-ahead rules to session factors and add intraday-factor guidance ([c24c100](https://github.com/TPTBusiness/Predix/commit/c24c100442d6487686c0578de0b32d240fcbf215)) -* **loop:** compress old experiment history in proposal prompt to reduce context size ([4bf90a9](https://github.com/TPTBusiness/Predix/commit/4bf90a905ba8b2aba2a818191c19998088cccaaf)) -* **loop:** prevent step_idx advance on unhandled exceptions + fix consecutive assistant messages ([5ec4ad1](https://github.com/TPTBusiness/Predix/commit/5ec4ad1b96b5b99ef42bea7bb828cb1ef709a688)) +* **auto-fixer:** add five new factor code fixes for groupby/apply errors ([449c8fd](https://github.com/TPTBusiness/NexQuant/commit/449c8fd70a327e604dcca122e4a134f0cca918e4)) +* **auto-fixer:** add four new factor code fixes for common runtime errors ([40484f6](https://github.com/TPTBusiness/NexQuant/commit/40484f6d300425da481f1edd325da4acbc06ec7d)) +* **auto-fixer:** add groupby([level=N,'date']) SyntaxError fix ([ca77c00](https://github.com/TPTBusiness/NexQuant/commit/ca77c005bea4abdd8854c1de2b0e8d03b7742161)) +* **auto-fixer:** disable _fix_min_periods for intraday data ([77b0740](https://github.com/TPTBusiness/NexQuant/commit/77b0740f059349df7e769a378af728aa33b2070e)) +* **auto-fixer:** fix chained groupby(level=N).groupby('date') pattern ([7d5fe32](https://github.com/TPTBusiness/NexQuant/commit/7d5fe32b31a19ce8b04bd8f5a430720fdb748f7a)) +* **auto-fixer:** fix df.loc[instrument] DateParseError on MultiIndex frames ([b7860ea](https://github.com/TPTBusiness/NexQuant/commit/b7860eafc0ad26384947ce0510ecf4e9f3425807)) +* **auto-fixer:** fix df['instrument'] KeyError on MultiIndex frames ([aad6bd1](https://github.com/TPTBusiness/NexQuant/commit/aad6bd1c7c720b3d486e0cf248337f32394773b1)) +* **auto-fixer:** preserve date dimension in groupby(['instrument','date']) fix ([b58fdd8](https://github.com/TPTBusiness/NexQuant/commit/b58fdd8be43720b5d4363e0f8de9a01591d4d2dc)) +* **auto-fixer:** remove ddof from rolling() args, not only from std()/var() ([b0fc328](https://github.com/TPTBusiness/NexQuant/commit/b0fc328d0d4a041c65d8eeb32cb3f2bb86568406)) +* **backtest:** replace broken MC permutation test with binomial win-rate test ([c38d894](https://github.com/TPTBusiness/NexQuant/commit/c38d89478f586825bfca5715a96ca70ccd8791a3)) +* **factors:** detect and correct look-ahead bias in daily-constant factors ([eb490a4](https://github.com/TPTBusiness/NexQuant/commit/eb490a461b66cbd815ae53ac5205115754712432)) +* **factors:** extend look-ahead rules to session factors and add intraday-factor guidance ([c24c100](https://github.com/TPTBusiness/NexQuant/commit/c24c100442d6487686c0578de0b32d240fcbf215)) +* **loop:** compress old experiment history in proposal prompt to reduce context size ([4bf90a9](https://github.com/TPTBusiness/NexQuant/commit/4bf90a905ba8b2aba2a818191c19998088cccaaf)) +* **loop:** prevent step_idx advance on unhandled exceptions + fix consecutive assistant messages ([5ec4ad1](https://github.com/TPTBusiness/NexQuant/commit/5ec4ad1b96b5b99ef42bea7bb828cb1ef709a688)) -## [1.3.3](https://github.com/TPTBusiness/Predix/compare/v1.3.2...v1.3.3) (2026-04-25) +## [1.3.3](https://github.com/TPTBusiness/NexQuant/compare/v1.3.2...v1.3.3) (2026-04-25) ### Bug Fixes -* **backtest:** replace broken MC permutation test with binomial win-rate test ([c38d894](https://github.com/TPTBusiness/Predix/commit/c38d89478f586825bfca5715a96ca70ccd8791a3)) -* **factors:** detect and correct look-ahead bias in daily-constant factors ([eb490a4](https://github.com/TPTBusiness/Predix/commit/eb490a461b66cbd815ae53ac5205115754712432)) -* **factors:** extend look-ahead rules to session factors and add intraday-factor guidance ([c24c100](https://github.com/TPTBusiness/Predix/commit/c24c100442d6487686c0578de0b32d240fcbf215)) -* **loop:** compress old experiment history in proposal prompt to reduce context size ([4bf90a9](https://github.com/TPTBusiness/Predix/commit/4bf90a905ba8b2aba2a818191c19998088cccaaf)) -* **strategies:** guard against None IC in acceptance check, disable slow wf_rolling ([2197f52](https://github.com/TPTBusiness/Predix/commit/2197f52150a50ef38d9e70991d7e48c8c30caec4)) -* **strategies:** handle None ic/sharpe/dd in rejected strategy log output ([ad2ad3a](https://github.com/TPTBusiness/Predix/commit/ad2ad3ab3360ea75ed3bbc90c12098b9c5cc0114)) +* **backtest:** replace broken MC permutation test with binomial win-rate test ([c38d894](https://github.com/TPTBusiness/NexQuant/commit/c38d89478f586825bfca5715a96ca70ccd8791a3)) +* **factors:** detect and correct look-ahead bias in daily-constant factors ([eb490a4](https://github.com/TPTBusiness/NexQuant/commit/eb490a461b66cbd815ae53ac5205115754712432)) +* **factors:** extend look-ahead rules to session factors and add intraday-factor guidance ([c24c100](https://github.com/TPTBusiness/NexQuant/commit/c24c100442d6487686c0578de0b32d240fcbf215)) +* **loop:** compress old experiment history in proposal prompt to reduce context size ([4bf90a9](https://github.com/TPTBusiness/NexQuant/commit/4bf90a905ba8b2aba2a818191c19998088cccaaf)) +* **strategies:** guard against None IC in acceptance check, disable slow wf_rolling ([2197f52](https://github.com/TPTBusiness/NexQuant/commit/2197f52150a50ef38d9e70991d7e48c8c30caec4)) +* **strategies:** handle None ic/sharpe/dd in rejected strategy log output ([ad2ad3a](https://github.com/TPTBusiness/NexQuant/commit/ad2ad3ab3360ea75ed3bbc90c12098b9c5cc0114)) -## [1.3.2](https://github.com/TPTBusiness/Predix/compare/v1.3.1...v1.3.2) (2026-04-23) +## [1.3.2](https://github.com/TPTBusiness/NexQuant/compare/v1.3.1...v1.3.2) (2026-04-23) ### Bug Fixes -* **strategies:** guard against None IC in acceptance check, disable slow wf_rolling ([2197f52](https://github.com/TPTBusiness/Predix/commit/2197f52150a50ef38d9e70991d7e48c8c30caec4)) -* **strategies:** handle None ic/sharpe/dd in rejected strategy log output ([ad2ad3a](https://github.com/TPTBusiness/Predix/commit/ad2ad3ab3360ea75ed3bbc90c12098b9c5cc0114)) +* **strategies:** guard against None IC in acceptance check, disable slow wf_rolling ([2197f52](https://github.com/TPTBusiness/NexQuant/commit/2197f52150a50ef38d9e70991d7e48c8c30caec4)) +* **strategies:** handle None ic/sharpe/dd in rejected strategy log output ([ad2ad3a](https://github.com/TPTBusiness/NexQuant/commit/ad2ad3ab3360ea75ed3bbc90c12098b9c5cc0114)) -## [1.3.1](https://github.com/TPTBusiness/Predix/compare/v1.3.0...v1.3.1) (2026-04-21) +## [1.3.1](https://github.com/TPTBusiness/NexQuant/compare/v1.3.0...v1.3.1) (2026-04-21) ### Bug Fixes -* **deps:** bump python-dotenv to >=1.2.2 (CVE symlink overwrite) ([126ae7d](https://github.com/TPTBusiness/Predix/commit/126ae7d5fb556b677d09d10221862a0d648d697a)) +* **deps:** bump python-dotenv to >=1.2.2 (CVE symlink overwrite) ([126ae7d](https://github.com/TPTBusiness/NexQuant/commit/126ae7d5fb556b677d09d10221862a0d648d697a)) -## [1.3.0](https://github.com/TPTBusiness/Predix/compare/v1.2.2...v1.3.0) (2026-04-21) +## [1.3.0](https://github.com/TPTBusiness/NexQuant/compare/v1.2.2...v1.3.0) (2026-04-21) ### Features -* **backtest:** add rolling walk-forward validation and Monte Carlo trade permutation test ([637a94c](https://github.com/TPTBusiness/Predix/commit/637a94c1d987da763869f4f9b73372a3f37d873c)) +* **backtest:** add rolling walk-forward validation and Monte Carlo trade permutation test ([637a94c](https://github.com/TPTBusiness/NexQuant/commit/637a94c1d987da763869f4f9b73372a3f37d873c)) ### Bug Fixes -* **security:** resolve all 30 Bandit security alerts (B301, B614, B104) ([ce5983d](https://github.com/TPTBusiness/Predix/commit/ce5983d9d59c4c34341fb1ec749e44bbcfc4a1c4)) +* **security:** resolve all 30 Bandit security alerts (B301, B614, B104) ([ce5983d](https://github.com/TPTBusiness/NexQuant/commit/ce5983d9d59c4c34341fb1ec749e44bbcfc4a1c4)) -## [1.2.2](https://github.com/TPTBusiness/Predix/compare/v1.2.1...v1.2.2) (2026-04-19) +## [1.2.2](https://github.com/TPTBusiness/NexQuant/compare/v1.2.1...v1.2.2) (2026-04-19) ### Documentation -* **claude:** auto-merge release-please PR after every push ([f500917](https://github.com/TPTBusiness/Predix/commit/f500917b699ee78dc676e84e01574d49bdc8e796)) +* **claude:** auto-merge release-please PR after every push ([f500917](https://github.com/TPTBusiness/NexQuant/commit/f500917b699ee78dc676e84e01574d49bdc8e796)) -## [2.2.0](https://github.com/TPTBusiness/Predix/compare/v2.1.0...v2.2.0) (2026-04-18) +## [2.2.0](https://github.com/TPTBusiness/NexQuant/compare/v2.1.0...v2.2.0) (2026-04-18) ### Features -* add Kronos CLI commands, expand tests, document in README ([f911081](https://github.com/TPTBusiness/Predix/commit/f911081d1763d0dc4dd790b57dd97aae2dc62679)) -* **fin_quant:** auto-generate Kronos factor before loop start ([277063f](https://github.com/TPTBusiness/Predix/commit/277063f3e36cd071db859cdc77f69135c1f0763b)) -* integrate Kronos-mini OHLCV foundation model (Option A + B) ([4ae3b99](https://github.com/TPTBusiness/Predix/commit/4ae3b99f2450930f72e202a1a470c407bfde3328)) +* add Kronos CLI commands, expand tests, document in README ([f911081](https://github.com/TPTBusiness/NexQuant/commit/f911081d1763d0dc4dd790b57dd97aae2dc62679)) +* **fin_quant:** auto-generate Kronos factor before loop start ([277063f](https://github.com/TPTBusiness/NexQuant/commit/277063f3e36cd071db859cdc77f69135c1f0763b)) +* integrate Kronos-mini OHLCV foundation model (Option A + B) ([4ae3b99](https://github.com/TPTBusiness/NexQuant/commit/4ae3b99f2450930f72e202a1a470c407bfde3328)) ### Bug Fixes -* **kronos:** lazy torch import to fix CI ModuleNotFoundError ([ccc1d27](https://github.com/TPTBusiness/Predix/commit/ccc1d27dbe5ab06a57085a589d456ac7bf49cc08)) -* **kronos:** pass actual datetime Series to Kronos predictor timestamps ([dc6e7ce](https://github.com/TPTBusiness/Predix/commit/dc6e7ce207d21fbc21976f2af7691058530fac2f)) -* **kronos:** replace rdagent_logger with stdlib logging for CI compatibility ([b4558f2](https://github.com/TPTBusiness/Predix/commit/b4558f2456659c6109bd1b3cf100510491cd3e6c)) +* **kronos:** lazy torch import to fix CI ModuleNotFoundError ([ccc1d27](https://github.com/TPTBusiness/NexQuant/commit/ccc1d27dbe5ab06a57085a589d456ac7bf49cc08)) +* **kronos:** pass actual datetime Series to Kronos predictor timestamps ([dc6e7ce](https://github.com/TPTBusiness/NexQuant/commit/dc6e7ce207d21fbc21976f2af7691058530fac2f)) +* **kronos:** replace rdagent_logger with stdlib logging for CI compatibility ([b4558f2](https://github.com/TPTBusiness/NexQuant/commit/b4558f2456659c6109bd1b3cf100510491cd3e6c)) ### Performance Improvements -* **kronos:** batch GPU inference via predict_batch — 75x faster ([74611d0](https://github.com/TPTBusiness/Predix/commit/74611d071ac123a655eb15d0737bb73b8c1bd2b0)) -* **kronos:** batch GPU inference via predict_batch — 75x faster ([2babeb9](https://github.com/TPTBusiness/Predix/commit/2babeb95f42828e13a37dc16166c75538f33fd4b)) +* **kronos:** batch GPU inference via predict_batch — 75x faster ([74611d0](https://github.com/TPTBusiness/NexQuant/commit/74611d071ac123a655eb15d0737bb73b8c1bd2b0)) +* **kronos:** batch GPU inference via predict_batch — 75x faster ([2babeb9](https://github.com/TPTBusiness/NexQuant/commit/2babeb95f42828e13a37dc16166c75538f33fd4b)) ### Documentation -* fix duplicate sections, add hardware requirements and data setup guide ([6c771b3](https://github.com/TPTBusiness/Predix/commit/6c771b37e6f88526a896499e86929cfca2c199eb)) +* fix duplicate sections, add hardware requirements and data setup guide ([6c771b3](https://github.com/TPTBusiness/NexQuant/commit/6c771b37e6f88526a896499e86929cfca2c199eb)) -## [2.1.0](https://github.com/TPTBusiness/Predix/compare/v2.0.0...v2.1.0) (2026-04-18) +## [2.1.0](https://github.com/TPTBusiness/NexQuant/compare/v2.0.0...v2.1.0) (2026-04-18) ### Features -* add daily log rotation, llama health wait, factor auto-fixer, and README updates ([4ae4d6f](https://github.com/TPTBusiness/Predix/commit/4ae4d6f0f1388d229e44333130306ae05767f2e5)) -* Add GitHub infrastructure, CI/CD pipelines, and examples ([a0b5dc4](https://github.com/TPTBusiness/Predix/commit/a0b5dc464eaac831c76bdbf805cf60c9083e7d80)) -* **factor-coder:** Add critical rules to prevent common factor implementation errors ([a1edca8](https://github.com/TPTBusiness/Predix/commit/a1edca87dd5e75ee402ea555f1b7a07b45c4b1f0)) -* **logging:** write complete LLM prompts and responses to daily JSONL log ([803ef13](https://github.com/TPTBusiness/Predix/commit/803ef13052c645392e71aa5de24874aae83f62a7)) -* **strategy:** Continuous optimization with Optuna parameter injection ([4fda5ea](https://github.com/TPTBusiness/Predix/commit/4fda5eaa31bc570e295ad96380ee2c02b82db706)) -* unified backtest engine, LLM error handling, strategy refactor ([76b9341](https://github.com/TPTBusiness/Predix/commit/76b9341fe8ef0ff03fd911337c299cf0e8582f37)) +* add daily log rotation, llama health wait, factor auto-fixer, and README updates ([4ae4d6f](https://github.com/TPTBusiness/NexQuant/commit/4ae4d6f0f1388d229e44333130306ae05767f2e5)) +* Add GitHub infrastructure, CI/CD pipelines, and examples ([a0b5dc4](https://github.com/TPTBusiness/NexQuant/commit/a0b5dc464eaac831c76bdbf805cf60c9083e7d80)) +* **factor-coder:** Add critical rules to prevent common factor implementation errors ([a1edca8](https://github.com/TPTBusiness/NexQuant/commit/a1edca87dd5e75ee402ea555f1b7a07b45c4b1f0)) +* **logging:** write complete LLM prompts and responses to daily JSONL log ([803ef13](https://github.com/TPTBusiness/NexQuant/commit/803ef13052c645392e71aa5de24874aae83f62a7)) +* **strategy:** Continuous optimization with Optuna parameter injection ([4fda5ea](https://github.com/TPTBusiness/NexQuant/commit/4fda5eaa31bc570e295ad96380ee2c02b82db706)) +* unified backtest engine, LLM error handling, strategy refactor ([76b9341](https://github.com/TPTBusiness/NexQuant/commit/76b9341fe8ef0ff03fd911337c299cf0e8582f37)) ### Bug Fixes -* Add critical column name rules to factor generation prompt ([3e74410](https://github.com/TPTBusiness/Predix/commit/3e7441079f0f1c5867829a365c6e45cd7d2071df)) -* **ci:** fix closed-source asset check false positives in security workflow ([4b83c2b](https://github.com/TPTBusiness/Predix/commit/4b83c2bfe7e90c0c7a11116f07a1b989035b7a3f)) -* **ci:** remove CodeQL workflow (conflicts with default setup), drop duplicate lint job ([a671361](https://github.com/TPTBusiness/Predix/commit/a671361ee4de9a7e00ccc66d8fd5732c2ed1fee9)) -* **ci:** set JAVA_TOOL_OPTIONS UTF-8 in Codacy workflow ([e36721c](https://github.com/TPTBusiness/Predix/commit/e36721c765a02a325b8a7dfd3c262b2aca7b1652)) -* **deps:** pin aiohttp>=3.13.4 to patch 4 CVEs ([81adddc](https://github.com/TPTBusiness/Predix/commit/81adddcfcd14819a1f85c06288a663e7d222a8fb)) -* **optuna:** fix inverted parameter range in Stage 2/3 when signal_bias is negative ([eaf885e](https://github.com/TPTBusiness/Predix/commit/eaf885ec2d20ebd93e34d1e2cb445532d2fb0ed3)) -* **security:** Patch 5 CodeQL path injection and clear-text logging alerts ([#22](https://github.com/TPTBusiness/Predix/issues/22)-[#25](https://github.com/TPTBusiness/Predix/issues/25), [#9](https://github.com/TPTBusiness/Predix/issues/9)) ([d386af9](https://github.com/TPTBusiness/Predix/commit/d386af98205722d1ea6d1465f585e89cb8df47de)) -* **security:** Patch 5 CodeQL path injection and weak hashing alerts ([#25](https://github.com/TPTBusiness/Predix/issues/25)-[#30](https://github.com/TPTBusiness/Predix/issues/30)) ([0d4c3b7](https://github.com/TPTBusiness/Predix/commit/0d4c3b7d69fdbdaafab00940bf7346c8b664928e)) -* **security:** Patch path injection and stack trace exposure (CodeQL [#31](https://github.com/TPTBusiness/Predix/issues/31), [#27](https://github.com/TPTBusiness/Predix/issues/27)) ([b0b8432](https://github.com/TPTBusiness/Predix/commit/b0b84328d13dac5c2ef79961200b011c0b5778f1)) -* **security:** replace relative_to() with realpath+startswith for CodeQL sanitization ([6d70f1e](https://github.com/TPTBusiness/Predix/commit/6d70f1ed944180c44d0eb75c0e86b013e5888b60)) -* **security:** resolve CodeQL path-injection alerts in UI data loaders ([cced426](https://github.com/TPTBusiness/Predix/commit/cced426916cb726e95ad251dcbc0eb9ab6ec3591)) -* **security:** resolve CodeQL path-injection and clear-text-logging alerts ([ec50224](https://github.com/TPTBusiness/Predix/commit/ec50224c3580c5c82ddba02fe77af95efd9667ea)) -* **security:** Resolve GitHub Security Scan alerts ([6c85ba8](https://github.com/TPTBusiness/Predix/commit/6c85ba833a48326e39006e0f73c506b29a594bde)) -* **security:** Upgrade vllm and transformers to patch 4 CVEs ([6c9ba91](https://github.com/TPTBusiness/Predix/commit/6c9ba91d3bf7ce1ed389e544c68be55262bf4e28)) -* **strategy:** Fix template variables, APIBackend import, and JSON extraction ([8220faa](https://github.com/TPTBusiness/Predix/commit/8220faa3de6ea555717ac29ba90a3b68135fbf9e)) -* **strategy:** Re-evaluate Optuna-optimized strategies with full OHLCV backtest ([026edce](https://github.com/TPTBusiness/Predix/commit/026edce122284fb1da467e6e9de8a2b9116c7ace)) +* Add critical column name rules to factor generation prompt ([3e74410](https://github.com/TPTBusiness/NexQuant/commit/3e7441079f0f1c5867829a365c6e45cd7d2071df)) +* **ci:** fix closed-source asset check false positives in security workflow ([4b83c2b](https://github.com/TPTBusiness/NexQuant/commit/4b83c2bfe7e90c0c7a11116f07a1b989035b7a3f)) +* **ci:** remove CodeQL workflow (conflicts with default setup), drop duplicate lint job ([a671361](https://github.com/TPTBusiness/NexQuant/commit/a671361ee4de9a7e00ccc66d8fd5732c2ed1fee9)) +* **ci:** set JAVA_TOOL_OPTIONS UTF-8 in Codacy workflow ([e36721c](https://github.com/TPTBusiness/NexQuant/commit/e36721c765a02a325b8a7dfd3c262b2aca7b1652)) +* **deps:** pin aiohttp>=3.13.4 to patch 4 CVEs ([81adddc](https://github.com/TPTBusiness/NexQuant/commit/81adddcfcd14819a1f85c06288a663e7d222a8fb)) +* **optuna:** fix inverted parameter range in Stage 2/3 when signal_bias is negative ([eaf885e](https://github.com/TPTBusiness/NexQuant/commit/eaf885ec2d20ebd93e34d1e2cb445532d2fb0ed3)) +* **security:** Patch 5 CodeQL path injection and clear-text logging alerts ([#22](https://github.com/TPTBusiness/NexQuant/issues/22)-[#25](https://github.com/TPTBusiness/NexQuant/issues/25), [#9](https://github.com/TPTBusiness/NexQuant/issues/9)) ([d386af9](https://github.com/TPTBusiness/NexQuant/commit/d386af98205722d1ea6d1465f585e89cb8df47de)) +* **security:** Patch 5 CodeQL path injection and weak hashing alerts ([#25](https://github.com/TPTBusiness/NexQuant/issues/25)-[#30](https://github.com/TPTBusiness/NexQuant/issues/30)) ([0d4c3b7](https://github.com/TPTBusiness/NexQuant/commit/0d4c3b7d69fdbdaafab00940bf7346c8b664928e)) +* **security:** Patch path injection and stack trace exposure (CodeQL [#31](https://github.com/TPTBusiness/NexQuant/issues/31), [#27](https://github.com/TPTBusiness/NexQuant/issues/27)) ([b0b8432](https://github.com/TPTBusiness/NexQuant/commit/b0b84328d13dac5c2ef79961200b011c0b5778f1)) +* **security:** replace relative_to() with realpath+startswith for CodeQL sanitization ([6d70f1e](https://github.com/TPTBusiness/NexQuant/commit/6d70f1ed944180c44d0eb75c0e86b013e5888b60)) +* **security:** resolve CodeQL path-injection alerts in UI data loaders ([cced426](https://github.com/TPTBusiness/NexQuant/commit/cced426916cb726e95ad251dcbc0eb9ab6ec3591)) +* **security:** resolve CodeQL path-injection and clear-text-logging alerts ([ec50224](https://github.com/TPTBusiness/NexQuant/commit/ec50224c3580c5c82ddba02fe77af95efd9667ea)) +* **security:** Resolve GitHub Security Scan alerts ([6c85ba8](https://github.com/TPTBusiness/NexQuant/commit/6c85ba833a48326e39006e0f73c506b29a594bde)) +* **security:** Upgrade vllm and transformers to patch 4 CVEs ([6c9ba91](https://github.com/TPTBusiness/NexQuant/commit/6c9ba91d3bf7ce1ed389e544c68be55262bf4e28)) +* **strategy:** Fix template variables, APIBackend import, and JSON extraction ([8220faa](https://github.com/TPTBusiness/NexQuant/commit/8220faa3de6ea555717ac29ba90a3b68135fbf9e)) +* **strategy:** Re-evaluate Optuna-optimized strategies with full OHLCV backtest ([026edce](https://github.com/TPTBusiness/NexQuant/commit/026edce122284fb1da467e6e9de8a2b9116c7ace)) ### Documentation -* Add CLI welcome screenshot to README ([e6f2374](https://github.com/TPTBusiness/Predix/commit/e6f237437595745406c310b58a9bd7214ff914ae)) -* Add comprehensive data setup guide to README ([f721d53](https://github.com/TPTBusiness/Predix/commit/f721d53e5681be6997418c13acc3439897168048)) -* Add conda requirement to README + fix predix CLI ([df45698](https://github.com/TPTBusiness/Predix/commit/df45698b20e0a3e6e0079decf2b8eecb6983a175)) -* Clean changelog of closed-source performance metrics ([a0f6587](https://github.com/TPTBusiness/Predix/commit/a0f6587ab1724293924da07fe18c40891ca612a1)) -* improve README badges, fix llama-server flags, clean up structure ([336e1a5](https://github.com/TPTBusiness/Predix/commit/336e1a5afb4933ec13572ef050a3e5a2ca183400)) +* Add CLI welcome screenshot to README ([e6f2374](https://github.com/TPTBusiness/NexQuant/commit/e6f237437595745406c310b58a9bd7214ff914ae)) +* Add comprehensive data setup guide to README ([f721d53](https://github.com/TPTBusiness/NexQuant/commit/f721d53e5681be6997418c13acc3439897168048)) +* Add conda requirement to README + fix nexquant CLI ([df45698](https://github.com/TPTBusiness/NexQuant/commit/df45698b20e0a3e6e0079decf2b8eecb6983a175)) +* Clean changelog of closed-source performance metrics ([a0f6587](https://github.com/TPTBusiness/NexQuant/commit/a0f6587ab1724293924da07fe18c40891ca612a1)) +* improve README badges, fix llama-server flags, clean up structure ([336e1a5](https://github.com/TPTBusiness/NexQuant/commit/336e1a5afb4933ec13572ef050a3e5a2ca183400)) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 3b99702c..bf5134f5 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -52,7 +52,7 @@ an individual is officially representing the community in public spaces. Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at -nico@predix.io. +nico@nexquant.io. All complaints will be reviewed and investigated promptly and fairly. ## Attribution diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5a567cf4..a15f3856 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ -# Contributing to Predix +# Contributing to NexQuant -We welcome contributions and suggestions to improve Predix. Whether it's solving an issue, addressing a bug, enhancing documentation, or even correcting a typo, every contribution is valuable and helps improve the project. +We welcome contributions and suggestions to improve NexQuant. Whether it's solving an issue, addressing a bug, enhancing documentation, or even correcting a typo, every contribution is valuable and helps improve the project. ## Getting Started @@ -15,11 +15,11 @@ grep -r "TODO:" ```bash # Fork the repository on GitHub, then clone your fork -git clone https://github.com/YOUR-USERNAME/Predix.git -cd Predix +git clone https://github.com/YOUR-USERNAME/NexQuant.git +cd NexQuant # Add upstream remote -git remote add upstream https://github.com/TPTBusiness/Predix.git +git remote add upstream https://github.com/TPTBusiness/NexQuant.git ``` ### 2. Create a Branch @@ -141,7 +141,7 @@ All PRs are reviewed by maintainers. Expect: ## Project Structure ``` -Predix/ +NexQuant/ ├── rdagent/ # Core framework (open source) │ ├── app/ # CLI and scenario apps │ ├── components/ # Reusable agent components @@ -157,8 +157,8 @@ Predix/ ## Need Help? -- **Issues**: [GitHub Issues](https://github.com/TPTBusiness/Predix/issues) -- **Discussions**: [GitHub Discussions](https://github.com/TPTBusiness/Predix/discussions) +- **Issues**: [GitHub Issues](https://github.com/TPTBusiness/NexQuant/issues) +- **Discussions**: [GitHub Discussions](https://github.com/TPTBusiness/NexQuant/discussions) - **Documentation**: See `docs/` folder ## License diff --git a/README.md b/README.md index 0a0a2690..9bf27acc 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Predix +# NexQuant

Python @@ -27,17 +27,17 @@

- - CI Status + + CI Status - - Security Scan + + Security Scan - - Coverage + + Coverage - - License + + License Conventional Commits @@ -45,17 +45,17 @@ Ruff - - Stars + + Stars - - Forks + + Forks - - Issues + + Issues - - Last Commit + + Last Commit

@@ -64,18 +64,18 @@ ## 🖥️ CLI Dashboard ```bash -rdagent predix +rdagent nexquant ``` -![Predix CLI Welcome Screen](docs/cli-welcome-screen.png) +![NexQuant CLI Welcome Screen](docs/cli-welcome-screen.png) -*The Predix CLI shows system status, available commands, and quick start guide.* +*The NexQuant CLI shows system status, available commands, and quick start guide.* --- ## Overview -**Predix** is an autonomous AI agent for quantitative trading strategies in the EUR/USD forex market. Built on a multi-agent framework, Predix automates the full research and development cycle: +**NexQuant** is an autonomous AI agent for quantitative trading strategies in the EUR/USD forex market. Built on a multi-agent framework, NexQuant automates the full research and development cycle: - 📊 **Factor Generation** — LLM proposes novel alpha factors; Kronos foundation model generates OHLCV-based predictions - 💡 **Strategy Discovery** — Autopilot generates + backtests trading strategies 24/7 @@ -83,7 +83,7 @@ rdagent predix - 📈 **Backtesting** — Unified engine with 10 runtime invariants on 1-min EUR/USD data (2020–2026) - 🔄 **Auto-Restart** — All services run as daemons with automatic crash recovery -Predix is optimized for **1-minute EUR/USD FX data** (2020–2026) and supports both local LLMs (llama.cpp) and cloud backends (OpenRouter). +NexQuant is optimized for **1-minute EUR/USD FX data** (2020–2026) and supports both local LLMs (llama.cpp) and cloud backends (OpenRouter). > **Backtest Verification**: Every backtest result is automatically verified at runtime against mathematical invariants (MaxDD ∈ [-1,0], WinRate ∈ [0,1], Sharpe finite, sign consistency, etc.). 1125 collected tests with deep property-based, fuzzing, and hypothesis tests ensure metric correctness. See [Backtest Integrity](#backtest-integrity). @@ -99,7 +99,7 @@ Special thanks to: - **[ai-hedge-fund](https://github.com/virattt/ai-hedge-fund)** - Inspiration for macro analysis (Stanley Druckenmiller agent), risk management concepts, and market regime detection. -All code in Predix is originally written and implemented independently. Predix extends these frameworks with EUR/USD forex-specific features, 1-minute backtesting capabilities, comprehensive risk management, and trading dashboards. +All code in NexQuant is originally written and implemented independently. NexQuant extends these frameworks with EUR/USD forex-specific features, 1-minute backtesting capabilities, comprehensive risk management, and trading dashboards. --- @@ -129,12 +129,12 @@ All code in Predix is originally written and implemented independently. Predix e ```bash # Clone repository -git clone https://github.com/TPTBusiness/Predix -cd Predix +git clone https://github.com/TPTBusiness/NexQuant +cd NexQuant # Create and activate conda environment -conda create -n predix python=3.10 -y -conda activate predix +conda create -n nexquant python=3.10 -y +conda activate nexquant # Install in editable mode pip install -e . @@ -143,14 +143,14 @@ pip install -e . docker run --rm hello-world ``` -> **Important:** Predix requires a conda environment to manage dependencies properly. +> **Important:** NexQuant requires a conda environment to manage dependencies properly. > Using plain Python or other environment managers may cause conflicts. --- ## Data Setup -Predix requires **1-minute EUR/USD OHLCV data** in HDF5 format. This is a hard prerequisite — the system cannot run without it. +NexQuant requires **1-minute EUR/USD OHLCV data** in HDF5 format. This is a hard prerequisite — the system cannot run without it. ### Step 1: Get the data @@ -266,7 +266,7 @@ market_context: ## No GPU? Use OpenRouter -If you don't have a CUDA-capable GPU, you can run Predix using [OpenRouter](https://openrouter.ai) for LLM inference — no local model download required. +If you don't have a CUDA-capable GPU, you can run NexQuant using [OpenRouter](https://openrouter.ai) for LLM inference — no local model download required. **1. Set up `.env` for OpenRouter:** @@ -293,7 +293,7 @@ rdagent fin_quant --model openrouter **4. Parallel runs** (uses API concurrency instead of GPU slots): ```bash -python predix_parallel.py --runs 5 --api-keys 1 -m openrouter +python nexquant_parallel.py --runs 5 --api-keys 1 -m openrouter ``` > Ollama is still required for embeddings even in the OpenRouter path. Install from [ollama.com](https://ollama.com) and run `ollama pull nomic-embed-text` once. @@ -318,7 +318,7 @@ curl http://localhost:8081/health ### 1. Run Trading Loop ```bash -conda activate predix +conda activate nexquant rdagent fin_quant # or with explicit options: rdagent fin_quant --loop-n 5 --step-n 2 @@ -332,7 +332,7 @@ rdagent server_ui --port 19899 --log-dir git_ignore_folder/RD-Agent_workspace/ # then open http://127.0.0.1:19899 # Best strategies so far -python predix.py best +python nexquant.py best ``` ### 3. Run Continuously (Auto-Restart) @@ -344,7 +344,7 @@ python predix.py best nohup bash -c 'while true; do rdagent fin_quant --loop-n 10 --model local >> /tmp/fin_quant_daemon.log 2>&1; sleep 10; done' & # Autopilot — 24/7 strategy generator (Kronos factors auto-selected) -nohup python scripts/predix_autopilot.py >> /tmp/autopilot_daemon.log 2>&1 & +nohup python scripts/nexquant_autopilot.py >> /tmp/autopilot_daemon.log 2>&1 & # Live Trader — FTMO FIX API (requires credentials) nohup python git_ignore_folder/live_trading/ftmo_live_trader.py >> ftmo_live_trader.log 2>&1 & @@ -369,13 +369,13 @@ nohup python git_ignore_folder/live_trading/ftmo_live_trader.py >> ftmo_live_tra | Command | Description | |---------|-------------| -| `python predix.py best` | Show top strategies by composite score | -| `python predix.py best -n 20 -m sharpe` | Top 20 by Sharpe ratio | -| `python predix.py best --show NAME` | Full metadata for one strategy | -| `python predix_gen_strategies_real_bt.py 10` | Generate 10 strategies with LLM + real OHLCV backtest | -| `python predix_gen_strategies_real_bt.py 20` | Generate 20 strategies (parallel workers) | -| `python scripts/predix_autopilot.py` | 24/7 Auto-Pilot: endless strategy generation | -| `python predix_continuous_strategies.py` | Continuous generation with ML training +| `python nexquant.py best` | Show top strategies by composite score | +| `python nexquant.py best -n 20 -m sharpe` | Top 20 by Sharpe ratio | +| `python nexquant.py best --show NAME` | Full metadata for one strategy | +| `python nexquant_gen_strategies_real_bt.py 10` | Generate 10 strategies with LLM + real OHLCV backtest | +| `python nexquant_gen_strategies_real_bt.py 20` | Generate 20 strategies (parallel workers) | +| `python scripts/nexquant_autopilot.py` | 24/7 Auto-Pilot: endless strategy generation | +| `python nexquant_continuous_strategies.py` | Continuous generation with ML training ### Kronos Foundation Model @@ -390,16 +390,16 @@ Kronos runs automatically — no separate command needed. Factors are regenerate | Command | Description | |---------|-------------| -| `python predix.py evaluate --all` | Evaluate all generated factors | -| `python predix.py top -n 20` | Show top 20 factors by IC | -| `python predix.py portfolio-simple` | Simple portfolio optimization | +| `python nexquant.py evaluate --all` | Evaluate all generated factors | +| `python nexquant.py top -n 20` | Show top 20 factors by IC | +| `python nexquant.py portfolio-simple` | Simple portfolio optimization | ### Parallel Execution | Command | Description | |---------|-------------| -| `python predix_parallel.py --runs 5 --api-keys 1 -m openrouter` | Run 5 parallel factor evolutions | -| `python predix_parallel.py --runs 20 --api-keys 2 -m openrouter` | Run 20 runs with 2 API keys | +| `python nexquant_parallel.py --runs 5 --api-keys 1 -m openrouter` | Run 5 parallel factor evolutions | +| `python nexquant_parallel.py --runs 20 --api-keys 2 -m openrouter` | Run 20 runs with 2 API keys | ### Monitoring & Debug @@ -407,8 +407,8 @@ Kronos runs automatically — no separate command needed. Factors are regenerate |---------|-------------| | `rdagent server_ui --port 19899 --log-dir ` | Start web dashboard | | `rdagent health_check` | Validate environment setup | -| `python predix_batch_backtest.py` | Batch backtest multiple factors | -| `python predix_rebacktest_strategies.py` | Re-backtest existing strategies | +| `python nexquant_batch_backtest.py` | Batch backtest multiple factors | +| `python nexquant_rebacktest_strategies.py` | Re-backtest existing strategies | --- @@ -416,7 +416,7 @@ Kronos runs automatically — no separate command needed. Factors are regenerate ### 🔄 Iterative Factor Evolution -Predix continuously proposes, implements, and validates new alpha factors: +NexQuant continuously proposes, implements, and validates new alpha factors: - Learns from backtest feedback - Avoids overfitting through walk-forward validation @@ -458,7 +458,7 @@ Real-time dashboard for monitoring: ### 🤖 Kronos Foundation Model Integration -Predix integrates Kronos — an OHLCV foundation model from the NeoQuasar team (AAAI 2026, **MIT License**) — for alpha factor generation: +NexQuant integrates Kronos — an OHLCV foundation model from the NeoQuasar team (AAAI 2026, **MIT License**) — for alpha factor generation: | Model | Params | p24 IC | Best For | |-------|--------|--------|----------| @@ -496,7 +496,7 @@ Automated quality assurance: ## Project Structure ``` -predix/ +nexquant/ ├── rdagent/ # Core agent framework │ ├── app/ # CLI and scenario apps │ │ └── qlib_rd_loop/ # Quant R&D loop (factor + model generation) @@ -518,12 +518,12 @@ predix/ │ ├── scenarios/ # Domain-specific scenarios (qlib, kaggle, rl) │ └── utils/ # Utilities ├── scripts/ # Daily operation scripts -│ ├── predix_autopilot.py # 24/7 auto strategy generator -│ ├── predix_gen_strategies_real_bt.py # Parallel strategy generation -│ ├── predix_parallel.py # Multi-instance parallel R&D -│ ├── predix_continuous_strategies.py # Continuous strategy generation -│ ├── predix_fast_rebacktest.py # Fast strategy re-evaluation -│ └── predix_rebacktest_parent.py # Parallel rebacktest orchestrator +│ ├── nexquant_autopilot.py # 24/7 auto strategy generator +│ ├── nexquant_gen_strategies_real_bt.py # Parallel strategy generation +│ ├── nexquant_parallel.py # Multi-instance parallel R&D +│ ├── nexquant_continuous_strategies.py # Continuous strategy generation +│ ├── nexquant_fast_rebacktest.py # Fast strategy re-evaluation +│ └── nexquant_rebacktest_parent.py # Parallel rebacktest orchestrator ├── test/ # Test suite (1,125+ collected) │ ├── backtesting/ # Backtest engine deep tests │ ├── qlib/ # Quant loop, factor, model tests @@ -581,7 +581,7 @@ For major changes, please open an issue first to discuss your approach. ## Citation -If you use Predix in your research, please cite the underlying framework: +If you use NexQuant in your research, please cite the underlying framework: ```bibtex @misc{yang2025rdagentllmagentframeworkautonomous, @@ -598,7 +598,7 @@ If you use Predix in your research, please cite the underlying framework: ## Support -- **Issues**: [GitHub Issues](https://github.com/TPTBusiness/Predix/issues) +- **Issues**: [GitHub Issues](https://github.com/TPTBusiness/NexQuant/issues) --- @@ -630,7 +630,7 @@ pytest test/backtesting/ -q # backtest engine deep tests ## Disclaimer -Predix is provided "as is" for **research and educational purposes only**. It is **not** intended for: +NexQuant is provided "as is" for **research and educational purposes only**. It is **not** intended for: - Live trading or financial advice - Production use without thorough testing diff --git a/SECURITY.md b/SECURITY.md index cb392753..7a29b133 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,13 +2,13 @@ ## Reporting a Vulnerability -We take the security of Predix seriously. If you believe you have found a security vulnerability, please report it responsibly. +We take the security of NexQuant seriously. If you believe you have found a security vulnerability, please report it responsibly. **Please do not report security vulnerabilities through public GitHub issues.** ### How to Report -1. **Open a private security advisory** on GitHub: https://github.com/TPTBusiness/Predix/security/advisories +1. **Open a private security advisory** on GitHub: https://github.com/TPTBusiness/NexQuant/security/advisories 2. Provide a detailed description of the vulnerability 3. Include steps to reproduce if possible 4. We will respond within 48 hours diff --git a/SUPPORT.md b/SUPPORT.md index 7ac94861..ef368747 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -6,12 +6,12 @@ This project uses GitHub Issues to track bugs and feature requests. Please searc issues before filing new issues to avoid duplicates. For new issues, file your bug or feature request as a new Issue. -- **Issues**: [https://github.com/PredixAI/predix/issues](https://github.com/PredixAI/predix/issues) +- **Issues**: [https://github.com/NexQuantAI/nexquant/issues](https://github.com/NexQuantAI/nexquant/issues) For help and questions about using this project, please reach out via: -- **Email**: nico@predix.io -- **GitHub Discussions**: [https://github.com/PredixAI/predix/discussions](https://github.com/PredixAI/predix/discussions) +- **Email**: nico@nexquant.io +- **GitHub Discussions**: [https://github.com/NexQuantAI/nexquant/discussions](https://github.com/NexQuantAI/nexquant/discussions) ## Community Support diff --git a/changelog/v1.0.0.md b/changelog/v1.0.0.md index e463031c..4d1486c5 100644 --- a/changelog/v1.0.0.md +++ b/changelog/v1.0.0.md @@ -1,4 +1,4 @@ -# Predix v1.0.0 Release Notes +# NexQuant v1.0.0 Release Notes **Release Date:** 2026-04-02 @@ -8,7 +8,7 @@ ## 🎉 Overview -Initial release of Predix - an autonomous AI-powered quantitative trading agent for EUR/USD forex markets. +Initial release of NexQuant - an autonomous AI-powered quantitative trading agent for EUR/USD forex markets. --- @@ -75,8 +75,8 @@ Initial release of Predix - an autonomous AI-powered quantitative trading agent ## 🔧 Changed -- Rebranded from RD-Agent to Predix for EUR/USD quantitative trading -- Updated project metadata for PredixAI organization +- Rebranded from RD-Agent to NexQuant for EUR/USD quantitative trading +- Updated project metadata for NexQuantAI organization - All code comments translated to English - Removed 'Inspired by' comments, added comprehensive Acknowledgments - Enhanced .gitignore for better file management @@ -137,7 +137,7 @@ This release builds upon and is inspired by: - **TradingAgents** (Apache 2.0 License) - Multi-agent debate patterns - **ai-hedge-fund** - Macro analysis and risk management concepts -**All code in Predix v1.0.0 is originally written and independently implemented.** +**All code in NexQuant v1.0.0 is originally written and independently implemented.** --- @@ -149,7 +149,7 @@ This release builds upon and is inspired by: If you use this code or concepts in your project, you **must**: 1. Include the MIT License text -2. Keep the copyright notice: "Copyright (c) 2025 Predix Team" +2. Keep the copyright notice: "Copyright (c) 2025 NexQuant Team" 3. Provide attribution to the original project See [ATTRIBUTION.md](../ATTRIBUTION.md) for detailed guidelines. @@ -158,7 +158,7 @@ See [ATTRIBUTION.md](../ATTRIBUTION.md) for detailed guidelines. ## 🔗 Links -- **GitHub Release:** https://github.com/TPTBusiness/Predix/releases/tag/v1.0.0 +- **GitHub Release:** https://github.com/TPTBusiness/NexQuant/releases/tag/v1.0.0 - **Main Changelog:** ../CHANGELOG.md - **Attribution Guidelines:** ../ATTRIBUTION.md - **Installation Guide:** ../README.md#installation @@ -168,7 +168,7 @@ See [ATTRIBUTION.md](../ATTRIBUTION.md) for detailed guidelines.
-**Made with ❤️ by Predix Team** +**Made with ❤️ by NexQuant Team** For detailed usage guidelines, see [README.md](../README.md) diff --git a/changelog/v2.0.0.md b/changelog/v2.0.0.md index 931be303..5f62f4bb 100644 --- a/changelog/v2.0.0.md +++ b/changelog/v2.0.0.md @@ -1,4 +1,4 @@ -# Predix v2.0.0 Release Notes +# NexQuant v2.0.0 Release Notes **Release Date:** 2026-04-10 @@ -8,7 +8,7 @@ ## 🎉 Overview -Major update adding AI-powered strategy generation, realistic backtesting, and comprehensive CLI tooling. Predix now autonomously generates, evaluates, and optimizes trading strategies using local LLMs. +Major update adding AI-powered strategy generation, realistic backtesting, and comprehensive CLI tooling. NexQuant now autonomously generates, evaluates, and optimizes trading strategies using local LLMs. --- @@ -28,7 +28,7 @@ Major update adding AI-powered strategy generation, realistic backtesting, and c - **Proper Annualization**: sqrt(252*1440) for 1-min data ### CLI Commands -- `rdagent predix` - Show beautiful welcome screen (perfect for screenshots!) +- `rdagent nexquant` - Show beautiful welcome screen (perfect for screenshots!) - `rdagent start_llama` - Start llama.cpp server - `rdagent start_loop` - Start strategy generator loop with auto-restart - `rdagent generate_strategies` - Generate strategies from factors @@ -65,8 +65,8 @@ Major update adding AI-powered strategy generation, realistic backtesting, and c ## 📦 Installation ```bash -git clone https://github.com/TPTBusiness/Predix -cd Predix +git clone https://github.com/TPTBusiness/NexQuant +cd NexQuant pip install -e . ``` @@ -74,7 +74,7 @@ pip install -e . ```bash # Show welcome screen -rdagent predix +rdagent nexquant # Start LLM server rdagent start_llama diff --git a/constraints/.bandit.yml b/constraints/.bandit.yml index 9a6d2cb6..5115fbb7 100644 --- a/constraints/.bandit.yml +++ b/constraints/.bandit.yml @@ -1,7 +1,7 @@ # Bandit Security Scanner Configuration # Documentation: https://bandit.readthedocs.io/ -title: Bandit Security Scan for Predix +title: Bandit Security Scan for NexQuant # Tests to skip (known false positives or acceptable risks) skips: diff --git a/constraints/data_config.yaml b/constraints/data_config.yaml index 7710c5cd..c08513f9 100644 --- a/constraints/data_config.yaml +++ b/constraints/data_config.yaml @@ -1,5 +1,5 @@ # ============================================================ -# Predix Data Configuration +# NexQuant Data Configuration # Change instrument, frequency, and time periods here # All other components read from this file # ============================================================ diff --git a/docs/ATTRIBUTION.md b/docs/ATTRIBUTION.md index e010da21..a66e9520 100644 --- a/docs/ATTRIBUTION.md +++ b/docs/ATTRIBUTION.md @@ -1,6 +1,6 @@ # Attribution Guidelines -## Using Predix in Your Project +## Using NexQuant in Your Project If you use code, concepts, or ideas from this project, you **must**: @@ -11,8 +11,8 @@ Include the full MIT License text in your project's LICENSE file or documentatio ### 2. Include Copyright Notice ``` -Copyright (c) 2025 Predix Team -Original Project: https://github.com/TPTBusiness/Predix +Copyright (c) 2025 NexQuant Team +Original Project: https://github.com/TPTBusiness/NexQuant ``` ### 3. Provide Attribution @@ -22,7 +22,7 @@ Add a notice in your documentation or README: ```markdown ## Acknowledgments -This project uses code/concepts from [Predix](https://github.com/TPTBusiness/Predix), +This project uses code/concepts from [NexQuant](https://github.com/TPTBusiness/NexQuant), licensed under the [MIT License](https://opensource.org/licenses/MIT). ``` @@ -33,7 +33,7 @@ If you modified the code: ```markdown ## Modifications -Based on Predix (original by Predix Team). +Based on NexQuant (original by NexQuant Team). Modified by [Your Name/Organization] on [Date]. Changes: [Brief description of changes] ``` @@ -63,13 +63,13 @@ Changes: [Brief description of changes] ```markdown # My Trading Project -This project uses factor generation concepts from [Predix](https://github.com/TPTBusiness/Predix). +This project uses factor generation concepts from [NexQuant](https://github.com/TPTBusiness/NexQuant). ## License MIT License - see LICENSE file for details. ## Credits -- Original Predix code by Predix Team (MIT License) +- Original NexQuant code by NexQuant Team (MIT License) - Modified by John Doe, 2025 ``` diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 8d72b46c..6dc5df30 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -All notable changes to Predix will be documented in this file. +All notable changes to NexQuant will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). diff --git a/docs/conf.py b/docs/conf.py index 97ca8c58..78de44fe 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -10,9 +10,9 @@ import subprocess latest_tag = subprocess.check_output(["git", "describe", "--tags", "--abbrev=0"], text=True).strip() -project = "Predix" -copyright = "2025, Predix Team" -author = "Predix Team" +project = "NexQuant" +copyright = "2025, NexQuant Team" +author = "NexQuant Team" # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration @@ -66,7 +66,7 @@ html_static_path = ["_static"] html_favicon = "_static/favicon.ico" html_theme_options = { - "source_repository": "https://github.com/PredixAI/predix", + "source_repository": "https://github.com/NexQuantAI/nexquant", "source_branch": "main", "source_directory": "docs/", } diff --git a/docs/parallel_runs.md b/docs/parallel_runs.md index e55f5f80..fac5afe4 100644 --- a/docs/parallel_runs.md +++ b/docs/parallel_runs.md @@ -1,4 +1,4 @@ -# Predix Parallel Run System +# NexQuant Parallel Run System ## Overview @@ -10,8 +10,8 @@ The Parallel Run System enables concurrent execution of 5+ factor generation exp | File | Purpose | |------|---------| -| `predix.py` | Extended with `--run-id` parameter for isolated single runs | -| `predix_parallel.py` | Parallel runner manager with Rich live dashboard | +| `nexquant.py` | Extended with `--run-id` parameter for isolated single runs | +| `nexquant_parallel.py` | Parallel runner manager with Rich live dashboard | | `factor_runner.py` | Modified to use `PARALLEL_RUN_ID` for path isolation | | `CoSTEER/__init__.py` | Modified to use `PARALLEL_RUN_ID` for intermediate results | @@ -57,26 +57,26 @@ RD-Agent_workspace_run2/ # Parallel run #2 ```bash # Run with isolated results -predix quant --run-id 1 -m openrouter +nexquant quant --run-id 1 -m openrouter ``` ### CLI - Parallel Runner (Direct) ```bash # Run 5 experiments with 2 API keys -python predix_parallel.py --runs 5 --api-keys 2 +python nexquant_parallel.py --runs 5 --api-keys 2 # Run 3 experiments with local model -python predix_parallel.py --runs 3 --model local +python nexquant_parallel.py --runs 3 --model local # Custom configuration -python predix_parallel.py -n 10 -k 2 -m openrouter +python nexquant_parallel.py -n 10 -k 2 -m openrouter ``` ### Programmatic Usage ```python -from predix_parallel import main +from nexquant_parallel import main result = main(runs=5, api_keys=2, model="openrouter") print(f"Success: {result['success']}/{result['total']}") @@ -132,7 +132,7 @@ The parallel runner shows a Rich-based live dashboard: ``` ┌─────────────────────────────────────────────────────────┐ -│ 🔀 Predix Parallel Run Dashboard │ +│ 🔀 NexQuant Parallel Run Dashboard │ ├──────┬──────────┬──────────┬─────────┬──────────┬───────┤ │ Run │ Status │ Elapsed │ API Key │ Model │ Exit │ ├──────┼──────────┼──────────┼─────────┼──────────┼───────┤ @@ -222,10 +222,10 @@ if parallel_run_id != "0": pytest test/integration/test_all_features.py -v # Test parallel runner imports -python -c "from predix_parallel import ParallelRunner, main; print('✅ OK')" +python -c "from nexquant_parallel import ParallelRunner, main; print('✅ OK')" # Test CLI options -predix quant --help # Should show --run-id option +nexquant quant --help # Should show --run-id option ``` ## Future Enhancements diff --git a/docs/security/SECURITY_RUNBOOK.md b/docs/security/SECURITY_RUNBOOK.md index 9df2d4e8..2b252ab1 100644 --- a/docs/security/SECURITY_RUNBOOK.md +++ b/docs/security/SECURITY_RUNBOOK.md @@ -1,4 +1,4 @@ -# Security Runbook für Predix +# Security Runbook für NexQuant ## Bandit Security Scanner diff --git a/examples/README.md b/examples/README.md index 50428884..defe5c7b 100644 --- a/examples/README.md +++ b/examples/README.md @@ -127,8 +127,8 @@ jupyter notebook examples/notebooks/quickstart.ipynb - **Dokumentation:** `docs/` oder [README.md](../README.md) - **CLI Hilfe:** `rdagent COMMAND --help` -- **Issues:** [GitHub Issues](https://github.com/nico/Predix/issues) -- **Community:** [Discussions](https://github.com/nico/Predix/discussions) +- **Issues:** [GitHub Issues](https://github.com/nico/NexQuant/issues) +- **Community:** [Discussions](https://github.com/nico/NexQuant/discussions) ## ⚠️ Wichtige Hinweise diff --git a/models/README.md b/models/README.md index 1c3e4cc4..66d6270a 100644 --- a/models/README.md +++ b/models/README.md @@ -1,6 +1,6 @@ -# Predix Models +# NexQuant Models -This directory contains all ML model definitions for Predix trading factors. +This directory contains all ML model definitions for NexQuant trading factors. --- diff --git a/predix.py b/nexquant.py similarity index 90% rename from predix.py rename to nexquant.py index 67de876b..25842342 100644 --- a/predix.py +++ b/nexquant.py @@ -1,12 +1,12 @@ #!/usr/bin/env python """ -Predix CLI - Wrapper for rdagent with LLM model selection. +NexQuant CLI - Wrapper for rdagent with LLM model selection. Usage: - predix quant # Local llama.cpp (default) - predix quant --model local # Explicit local - predix quant --model openrouter # OpenRouter cloud model - predix quant -d # With web dashboard + nexquant quant # Local llama.cpp (default) + nexquant quant --model local # Explicit local + nexquant quant --model openrouter # OpenRouter cloud model + nexquant quant -d # With web dashboard """ import os import sys @@ -26,7 +26,7 @@ except ImportError: logger = logging.getLogger(__name__) -app = typer.Typer(help="Predix - AI Quantitative Trading Agent") +app = typer.Typer(help="NexQuant - AI Quantitative Trading Agent") console = Console() @@ -178,13 +178,13 @@ def quant( 0 = single run mode (default: 0) Examples: - $ predix quant # Local llama.cpp, single run - $ predix quant -m openrouter # OpenRouter cloud model - $ predix quant -d # With web dashboard on :5000 - $ predix quant -m openrouter -d # Cloud model + web dashboard - $ predix quant --run-id 1 # Parallel run #1 (isolated) - $ predix quant --run-id 2 --loop-n 50 # Parallel run #2, 50 loops - $ predix quant --log-file custom.log # Custom log file path + $ nexquant quant # Local llama.cpp, single run + $ nexquant quant -m openrouter # OpenRouter cloud model + $ nexquant quant -d # With web dashboard on :5000 + $ nexquant quant -m openrouter -d # Cloud model + web dashboard + $ nexquant quant --run-id 1 # Parallel run #1 (isolated) + $ nexquant quant --run-id 2 --loop-n 50 # Parallel run #2, 50 loops + $ nexquant quant --log-file custom.log # Custom log file path Expected Output: - Generated alpha factors saved to results/factors/ as JSON files @@ -197,9 +197,9 @@ def quant( Local models are faster but may have lower quality than cloud models. See Also: - predix evaluate - Evaluate existing factors with full 1min data - predix top - Show top-performing factors by IC or Sharpe - predix health - Check system health and configuration + nexquant evaluate - Evaluate existing factors with full 1min data + nexquant top - Show top-performing factors by IC or Sharpe + nexquant health - Check system health and configuration """ import subprocess import sys @@ -323,7 +323,7 @@ def quant( if cli_dashboard: def start_cli_dash(): - from rdagent.log.ui.predix_dashboard import run_dashboard + from rdagent.log.ui.nexquant_dashboard import run_dashboard run_dashboard(log_path="fin_quant.log", refresh_interval=3) threading.Thread(target=start_cli_dash, daemon=True).start() @@ -408,11 +408,11 @@ def evaluate( when recalculating with updated methodology. (default: False) Examples: - $ predix evaluate # Evaluate 100 NEW factors - $ predix evaluate --top 500 # Evaluate 500 NEW factors - $ predix evaluate --all # Evaluate all remaining factors - $ predix evaluate --force --top 50 # Re-evaluate 50 factors - $ predix evaluate -p 8 # Use 8 parallel workers + $ nexquant evaluate # Evaluate 100 NEW factors + $ nexquant evaluate --top 500 # Evaluate 500 NEW factors + $ nexquant evaluate --all # Evaluate all remaining factors + $ nexquant evaluate --force --top 50 # Re-evaluate 50 factors + $ nexquant evaluate -p 8 # Use 8 parallel workers Expected Output: - Updated JSON files in results/factors/ with IC, Sharpe, Max DD, Win Rate @@ -424,22 +424,22 @@ def evaluate( With --parallel 4, expect ~30-60 seconds per factor wall-clock time. See Also: - predix top - Show top-performing factors by IC or Sharpe - predix portfolio - Select a diversified portfolio of uncorrelated factors - predix quant - Generate new factors via LLM trading loop + nexquant top - Show top-performing factors by IC or Sharpe + nexquant portfolio - Select a diversified portfolio of uncorrelated factors + nexquant quant - Generate new factors via LLM trading loop """ from rdagent.log.daily_log import session as _daily_session from rich.panel import Panel console.print(Panel( - "[bold cyan]📊 Predix Factor Evaluator[/bold cyan]\n" + "[bold cyan]📊 NexQuant Factor Evaluator[/bold cyan]\n" "Evaluating factors with FULL 1min data (2020-2026)\n" "Skips already evaluated factors automatically", border_style="cyan", )) # Import and run the evaluator - from predix_full_eval import main as eval_main + from nexquant_full_eval import main as eval_main _eval_ctx = {"top": "all" if all_factors else top, "workers": parallel} if force: @@ -490,10 +490,10 @@ def top( (default: "ic") Examples: - $ predix top # Top 20 factors by absolute IC - $ predix top -n 50 # Top 50 factors by absolute IC - $ predix top -m sharpe # Top 20 factors by absolute Sharpe - $ predix top -n 100 -m sharpe # Top 100 factors by Sharpe + $ nexquant top # Top 20 factors by absolute IC + $ nexquant top -n 50 # Top 50 factors by absolute IC + $ nexquant top -m sharpe # Top 20 factors by absolute Sharpe + $ nexquant top -n 100 -m sharpe # Top 100 factors by Sharpe Expected Output: - Formatted table showing Factor name, IC, Sharpe, Annualized Return, @@ -505,9 +505,9 @@ def top( May take a few seconds with thousands of factor files. See Also: - predix evaluate - Evaluate factors to generate performance metrics - predix portfolio - Select diversified portfolio from top factors - predix build-strategies - Combine factors into trading strategies + nexquant evaluate - Evaluate factors to generate performance metrics + nexquant portfolio - Select diversified portfolio from top factors + nexquant build-strategies - Combine factors into trading strategies """ import glob as glob_module import json @@ -639,10 +639,10 @@ def portfolio( high-IC factors. Typical range: 0.2-0.5. (default: 0.3) Examples: - $ predix portfolio # Select top 10 from top 50 candidates - $ predix portfolio -n 100 -t 20 # Select top 20 from top 100 - $ predix portfolio -c 0.5 # Allow higher correlation (0.5) - $ predix portfolio -n 200 -t 15 -c 0.2 # Strict diversification + $ nexquant portfolio # Select top 10 from top 50 candidates + $ nexquant portfolio -n 100 -t 20 # Select top 20 from top 100 + $ nexquant portfolio -c 0.5 # Allow higher correlation (0.5) + $ nexquant portfolio -n 200 -t 15 -c 0.2 # Strict diversification Expected Output: - Formatted table showing selected factors with IC, Sharpe, and max correlation @@ -654,9 +654,9 @@ def portfolio( Each factor must be re-evaluated to compute time-series values for correlation. See Also: - predix portfolio-simple - Faster category-based diversification - predix top - View top factors before portfolio selection - predix build-strategies - Build strategies from selected factors + nexquant portfolio-simple - Faster category-based diversification + nexquant top - View top factors before portfolio selection + nexquant build-strategies - Build strategies from selected factors """ import glob as glob_module import json @@ -939,9 +939,9 @@ def portfolio_simple( the chance of finding factors in all categories. (default: 100) Examples: - $ predix portfolio-simple # Top factors from different categories - $ predix portfolio-simple -n 200 # Consider top 200 factors - $ predix portfolio-simple -n 50 # Quick selection from top 50 + $ nexquant portfolio-simple # Top factors from different categories + $ nexquant portfolio-simple -n 200 # Consider top 200 factors + $ nexquant portfolio-simple -n 50 # Quick selection from top 50 Expected Output: - Formatted table showing selected factors with their category, IC, and Sharpe @@ -954,9 +954,9 @@ def portfolio_simple( Only loads existing JSON results and performs keyword matching. See Also: - predix portfolio - Correlation-based diversification (more accurate but slower) - predix top - View top factors before portfolio selection - predix build-strategies - Build strategies from selected factors + nexquant portfolio - Correlation-based diversification (more accurate but slower) + nexquant top - View top factors before portfolio selection + nexquant build-strategies - Build strategies from selected factors """ import glob as glob_module import json @@ -1115,10 +1115,10 @@ def build_strategies( strategies. (default: False) Examples: - $ predix build-strategies # Build from top 50, pairs only - $ predix build-strategies -n 100 -c 3 # Top 100, up to triplets - $ predix build-strategies -d # Diversified (cross-category) only - $ predix build-strategies -n 30 -c 2 -d # Top 30, diversified pairs + $ nexquant build-strategies # Build from top 50, pairs only + $ nexquant build-strategies -n 100 -c 3 # Top 100, up to triplets + $ nexquant build-strategies -d # Diversified (cross-category) only + $ nexquant build-strategies -n 30 -c 2 -d # Top 30, diversified pairs Expected Output: - Formatted table of top strategies ranked by Sharpe ratio @@ -1130,9 +1130,9 @@ def build_strategies( Scales with O(n^k) where n=factors, k=max_combo_size. See Also: - predix build-strategies-ai - AI-powered strategy generation via LLM - predix portfolio - Select diversified factors before combining - predix top - View top factors before building strategies + nexquant build-strategies-ai - AI-powered strategy generation via LLM + nexquant portfolio - Select diversified factors before combining + nexquant top - View top factors before building strategies """ import numpy as np from rdagent.scenarios.qlib.developer.strategy_builder import StrategyBuilder @@ -1140,7 +1140,7 @@ def build_strategies( from rich.table import Table console.print(Panel( - "[bold cyan]🏗️ Predix Strategy Builder[/bold cyan]\n" + "[bold cyan]🏗️ NexQuant Strategy Builder[/bold cyan]\n" "Systematically combining factors into trading strategies", border_style="cyan", )) @@ -1271,12 +1271,12 @@ def build_strategies_ai( may require multiple improvement loops. (default: 1) Examples: - $ predix build-strategies-ai # Generate 1 strategy, 5 loops max - $ predix build-strategies-ai -t 100 # Use top 100 factors as pool - $ predix build-strategies-ai -l 10 # Allow 10 improvement loops - $ predix build-strategies-ai --min-sharpe 2.0 # Stricter Sharpe requirement - $ predix build-strategies-ai --max-dd -0.15 # Tighter drawdown limit - $ predix build-strategies-ai -c 5 # Generate 5 accepted strategies + $ nexquant build-strategies-ai # Generate 1 strategy, 5 loops max + $ nexquant build-strategies-ai -t 100 # Use top 100 factors as pool + $ nexquant build-strategies-ai -l 10 # Allow 10 improvement loops + $ nexquant build-strategies-ai --min-sharpe 2.0 # Stricter Sharpe requirement + $ nexquant build-strategies-ai --max-dd -0.15 # Tighter drawdown limit + $ nexquant build-strategies-ai -c 5 # Generate 5 accepted strategies Expected Output: - Formatted table of accepted strategies with Sharpe, return, drawdown, @@ -1289,9 +1289,9 @@ def build_strategies_ai( Each loop requires a full backtest execution plus LLM API calls. See Also: - predix build-strategies - Systematic (non-AI) strategy combination - predix quant - Generate new alpha factors via LLM trading loop - predix evaluate - Evaluate factors before strategy building + nexquant build-strategies - Systematic (non-AI) strategy combination + nexquant quant - Generate new alpha factors via LLM trading loop + nexquant evaluate - Evaluate factors before strategy building """ from pathlib import Path @@ -1345,7 +1345,7 @@ def build_strategies_ai( if not factors_dir.exists(): console.print("[bold red]❌ No factors directory found at results/factors/[/bold red]") - console.print("[yellow]Run 'predix quant' to generate factors first.[/yellow]") + console.print("[yellow]Run 'nexquant quant' to generate factors first.[/yellow]") return # Load evaluated factors @@ -1365,7 +1365,7 @@ def build_strategies_ai( if len(factors) < 10: console.print(f"[bold red]❌ Only {len(factors)} evaluated factors found. Need at least 10.[/bold red]") - console.print("[yellow]Run 'predix evaluate' or 'predix quant' to generate more factors.[/yellow]") + console.print("[yellow]Run 'nexquant evaluate' or 'nexquant quant' to generate more factors.[/yellow]") return # Sort by IC and take top factors @@ -1493,17 +1493,17 @@ def generate_strategies( MaxDD on equity curve, WinRate on trade P&L) with runtime verification. Examples: - $ predix generate-strategies # 10 strategies, Optuna, swing - $ predix generate-strategies -n 20 -w 4 # 20 strategies, 4 workers - $ predix generate-strategies --min-sharpe 3.0 # Stricter acceptance - $ predix generate-strategies -s daytrading # Day trading style - $ predix generate-strategies --no-optuna # Skip optimization + $ nexquant generate-strategies # 10 strategies, Optuna, swing + $ nexquant generate-strategies -n 20 -w 4 # 20 strategies, 4 workers + $ nexquant generate-strategies --min-sharpe 3.0 # Stricter acceptance + $ nexquant generate-strategies -s daytrading # Day trading style + $ nexquant generate-strategies --no-optuna # Skip optimization """ from rich.console import Console as RichConsole from rich.table import Table as RichTable console.print(f"\n[bold cyan]{'='*60}[/bold cyan]") - console.print("[bold cyan] Predix Strategy Generator[/bold cyan]") + console.print("[bold cyan] NexQuant Strategy Generator[/bold cyan]") console.print(f"[bold cyan]{'='*60}[/bold cyan]") console.print(f" Strategies: [cyan]{count}[/cyan] Workers: [cyan]{workers}[/cyan] Style: [cyan]{style}[/cyan]") console.print(f" Optuna: {'[green]Yes[/green]' if optuna else '[yellow]No[/yellow]'} (trials={optuna_trials}) Factors: [cyan]{top_factors}[/cyan]") @@ -1564,8 +1564,8 @@ def health(): helps identify setup issues before running computationally expensive operations. Examples: - $ predix health # Run full system health check - $ predix health --verbose # Detailed output (if supported) + $ nexquant health # Run full system health check + $ nexquant health --verbose # Detailed output (if supported) Expected Output: - Python version and dependency status @@ -1579,8 +1579,8 @@ def health(): ~5-15 seconds depending on network and database checks. See Also: - predix status - Show current trading loop status and statistics - predix quant - Main trading loop command + nexquant status - Show current trading loop status and statistics + nexquant quant - Main trading loop command """ from rdagent.app.utils.health_check import health_check health_check() @@ -1597,8 +1597,8 @@ def status(): and verifying data persistence. Examples: - $ predix status # Show current trading loop status - $ predix status --json # JSON output (if supported) + $ nexquant status # Show current trading loop status + $ nexquant status --json # JSON output (if supported) Expected Output: - Trading loop process status: RUNNING or STOPPED @@ -1610,9 +1610,9 @@ def status(): Nearly instantaneous (< 1 second). See Also: - predix health - Check system health and configuration - predix quant - Start the quantitative trading loop - predix top - View top evaluated factors + nexquant health - Check system health and configuration + nexquant quant - Start the quantitative trading loop + nexquant top - View top evaluated factors """ import sqlite3 @@ -1707,11 +1707,11 @@ def best( """Rank backtested strategies by performance — source code is never exposed. Examples: - $ predix best # Top 10 by composite score - $ predix best -n 20 -m sharpe # Top 20 by Sharpe - $ predix best --no-realistic # Include numerically suspicious runs - $ predix best --show TrendMomentumHybrid - $ predix best -n 50 --export /tmp/top.json + $ nexquant best # Top 10 by composite score + $ nexquant best -n 20 -m sharpe # Top 20 by Sharpe + $ nexquant best --no-realistic # Include numerically suspicious runs + $ nexquant best --show TrendMomentumHybrid + $ nexquant best -n 50 --export /tmp/top.json """ import json @@ -1779,7 +1779,7 @@ def best( ) console.print(table) console.print(f"\n[dim]{len(pool)} strategies matched filters (of {len(items)} total). " - f"Use [bold]predix best --show NAME[/bold] for details.[/dim]") + f"Use [bold]nexquant best --show NAME[/bold] for details.[/dim]") if export: payload = [{k: v for k, v in s.items() if k != "code"} for s in top] @@ -1800,7 +1800,7 @@ def kronos_factor( """Generate Kronos-mini predicted-return alpha factor (Option A). Runs Kronos-mini (4.1M params OHLCV foundation model, AAAI 2026) on rolling - windows of EUR/USD 1-min data and saves a predicted-return factor in Predix's + windows of EUR/USD 1-min data and saves a predicted-return factor in NexQuant's standard MultiIndex (datetime, instrument) format. Strategy: every STRIDE bars, use the previous CONTEXT bars as input and @@ -1813,13 +1813,13 @@ def kronos_factor( git_ignore_folder/factor_implementation_source_data/intraday_pv.h5 Examples: - $ predix kronos-factor # Default: daily stride, GPU - $ predix kronos-factor --pred 30 --device cpu # 30-bar horizon, CPU - $ predix kronos-factor --context 256 --pred 48 + $ nexquant kronos-factor # Default: daily stride, GPU + $ nexquant kronos-factor --pred 30 --device cpu # 30-bar horizon, CPU + $ nexquant kronos-factor --context 256 --pred 48 See Also: - predix kronos-eval - Evaluate Kronos as model and compute IC vs LightGBM - predix top - Show top factors by IC + nexquant kronos-eval - Evaluate Kronos as model and compute IC vs LightGBM + nexquant top - Show top factors by IC """ from rdagent.components.coder.kronos_adapter import _cuda_available _device = device or ("cuda" if _cuda_available() else "cpu") @@ -1871,7 +1871,7 @@ def kronos_factor( console.print(f"\n[green]Factor saved:[/green] {out_path}") console.print(f" Shape: {factor_df.shape} | Non-NaN: {meta['n_non_nan']}") console.print(f" Metadata: {meta_path}") - console.print("\n[dim]Use 'predix top' to compare with other factors.[/dim]") + console.print("\n[dim]Use 'nexquant top' to compare with other factors.[/dim]") @app.command("kronos-eval") @@ -1897,13 +1897,13 @@ def kronos_eval( git_ignore_folder/factor_implementation_source_data/intraday_pv.h5 Examples: - $ predix kronos-eval # Default: 30-bar horizon - $ predix kronos-eval --pred 96 --device cuda # Daily horizon, GPU - $ predix kronos-eval --context 256 --pred 15 # Shorter horizon + $ nexquant kronos-eval # Default: 30-bar horizon + $ nexquant kronos-eval --pred 96 --device cuda # Daily horizon, GPU + $ nexquant kronos-eval --context 256 --pred 15 # Shorter horizon See Also: - predix kronos-factor - Generate Kronos factor for the factor pipeline - predix best - Show top strategies + nexquant kronos-factor - Generate Kronos factor for the factor pipeline + nexquant best - Show top strategies """ from rdagent.components.coder.kronos_adapter import _cuda_available _device = device or ("cuda" if _cuda_available() else "cpu") diff --git a/prompts/INDEX.md b/prompts/INDEX.md index a7a2f797..557ff150 100644 --- a/prompts/INDEX.md +++ b/prompts/INDEX.md @@ -1,6 +1,6 @@ -# Predix Prompts Index +# NexQuant Prompts Index -Centralized location for all LLM prompts used in the Predix trading system. +Centralized location for all LLM prompts used in the NexQuant trading system. ## Structure diff --git a/prompts/README.md b/prompts/README.md index ce606ece..a82296be 100644 --- a/prompts/README.md +++ b/prompts/README.md @@ -1,6 +1,6 @@ -# Predix Prompts +# NexQuant Prompts -This directory contains all LLM prompts for the Predix trading agent. +This directory contains all LLM prompts for the NexQuant trading agent. --- @@ -174,13 +174,13 @@ prompt_v2 = load_yaml_file("prompts/local/factor_discovery_v2.yaml") ```bash # Backup to private repo -cd ~/Predix +cd ~/NexQuant git archive --format=tar prompts/local/ | gzip > ~/backups/prompts_local_$(date +%Y%m%d).tar.gz # Or sync to private GitHub repo -git clone git@github.com:TPTBusiness/predix-prompts-private.git -cp -r prompts/local/* predix-prompts-private/ -cd predix-prompts-private && git push +git clone git@github.com:TPTBusiness/nexquant-prompts-private.git +cp -r prompts/local/* nexquant-prompts-private/ +cd nexquant-prompts-private && git push ``` --- diff --git a/pyproject.toml b/pyproject.toml index 7cef578a..54c57235 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ requires = [ [project] authors = [ - {email = "nico@predix.io", name = "Predix Team"}, + {email = "nico@nexquant.io", name = "NexQuant Team"}, ] classifiers = [ "Development Status :: 3 - Alpha", @@ -16,7 +16,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", ] -description = "Predix - AI-gestützter Quantitative Trading Agent für EUR/USD" +description = "NexQuant - AI-gestützter Quantitative Trading Agent für EUR/USD" dynamic = [ "dependencies", "optional-dependencies", @@ -29,7 +29,7 @@ keywords = [ "EUR/USD", "Forex", ] -name = "predix" +name = "nexquant" readme = "README.md" requires-python = ">=3.10" @@ -37,8 +37,8 @@ requires-python = ">=3.10" rdagent = "rdagent.app.cli:app" [project.urls] -homepage = "https://github.com/PredixAI/predix/" -issue = "https://github.com/PredixAI/predix/issues" +homepage = "https://github.com/NexQuantAI/nexquant/" +issue = "https://github.com/NexQuantAI/nexquant/issues" [tool.coverage.report] fail_under = 80 diff --git a/rdagent/app/cli.py b/rdagent/app/cli.py index 6f32c028..528955ed 100644 --- a/rdagent/app/cli.py +++ b/rdagent/app/cli.py @@ -294,7 +294,7 @@ def fin_quant_cli( # Start CLI Dashboard wenn gewünscht if with_cli_dashboard: def start_cli_dash(): - from rdagent.log.ui.predix_dashboard import run_dashboard + from rdagent.log.ui.nexquant_dashboard import run_dashboard run_dashboard(log_path="fin_quant.log", refresh_interval=3) cli_thread = threading.Thread(target=start_cli_dash, daemon=True) @@ -1262,9 +1262,9 @@ def start_loop_cli( from datetime import datetime script_dir = str(Path(__file__).parent.parent.parent) - generator = [sys.executable, f"{script_dir}/scripts/predix_smart_strategy_gen.py"] + generator = [sys.executable, f"{script_dir}/scripts/nexquant_smart_strategy_gen.py"] logfile = f"{script_dir}/results/logs/generator_loop.log" - pidfile = "/tmp/predix_loop.pid" # nosec B108 — administrative PID file, single-process daemon + pidfile = "/tmp/nexquant_loop.pid" # nosec B108 — administrative PID file, single-process daemon os.makedirs(f"{script_dir}/results/logs", exist_ok=True) @@ -1418,7 +1418,7 @@ def parallel_cli( from rdagent.log import daily_log as _dlog project_root = Path(__file__).parent.parent.parent - script = project_root / "scripts" / "predix_parallel.py" + script = project_root / "scripts" / "nexquant_parallel.py" if not script.exists(): typer.echo(f"❌ Script not found: {script}") @@ -1469,7 +1469,7 @@ def eval_all_cli( from rdagent.log import daily_log as _dlog project_root = Path(__file__).parent.parent.parent - script = project_root / "scripts" / "predix_full_eval.py" + script = project_root / "scripts" / "nexquant_full_eval.py" if not script.exists(): typer.echo(f"❌ Script not found: {script}") @@ -1522,7 +1522,7 @@ def batch_backtest_cli( from pathlib import Path project_root = Path(__file__).parent.parent.parent - script = project_root / "scripts" / "predix_batch_backtest.py" + script = project_root / "scripts" / "nexquant_batch_backtest.py" if not script.exists(): typer.echo(f"❌ Script not found: {script}") @@ -1574,7 +1574,7 @@ def simple_eval_cli( from pathlib import Path project_root = Path(__file__).parent.parent.parent - script = project_root / "scripts" / "predix_simple_eval.py" + script = project_root / "scripts" / "nexquant_simple_eval.py" if not script.exists(): typer.echo(f"❌ Script not found: {script}") @@ -1620,7 +1620,7 @@ def rebacktest_cli( from pathlib import Path project_root = Path(__file__).parent.parent.parent - script = project_root / "scripts" / "predix_rebacktest_strategies.py" + script = project_root / "scripts" / "nexquant_rebacktest_strategies.py" if not script.exists(): typer.echo(f"❌ Script not found: {script}") @@ -1673,7 +1673,7 @@ def report_cli( from pathlib import Path project_root = Path(__file__).parent.parent.parent - script = project_root / "scripts" / "predix_strategy_report.py" + script = project_root / "scripts" / "nexquant_strategy_report.py" if not script.exists(): typer.echo(f"❌ Script not found: {script}") @@ -1697,10 +1697,10 @@ def report_cli( -@app.command(name="predix") -def predix_welcome(): +@app.command(name="nexquant") +def nexquant_welcome(): """ - Show Predix welcome screen with system overview. + Show NexQuant welcome screen with system overview. This command displays a beautiful dashboard showing: - System status (factors, strategies, security) @@ -1710,7 +1710,7 @@ def predix_welcome(): Perfect for GitHub README screenshots! Examples: - rdagent predix + rdagent nexquant """ from rdagent.app.cli_welcome import show_welcome show_welcome() diff --git a/rdagent/app/cli_welcome.py b/rdagent/app/cli_welcome.py index 93509108..13faaae2 100644 --- a/rdagent/app/cli_welcome.py +++ b/rdagent/app/cli_welcome.py @@ -1,5 +1,5 @@ """ -Predix CLI Welcome Screen - Beautiful dashboard for GitHub README screenshot. +NexQuant CLI Welcome Screen - Beautiful dashboard for GitHub README screenshot. """ import os @@ -16,7 +16,7 @@ from datetime import datetime console = Console() def show_welcome(): - """Show beautiful Predix welcome screen.""" + """Show beautiful NexQuant welcome screen.""" # Header console.print() @@ -89,7 +89,7 @@ def show_welcome(): console.print() # Footer - footer = Text("📄 github.com/TPTBusiness/Predix • 🔒 MIT License • 📖 docs/", style="dim white") + footer = Text("📄 github.com/TPTBusiness/NexQuant • 🔒 MIT License • 📖 docs/", style="dim white") console.print(Align.center(footer)) console.print() @@ -98,5 +98,5 @@ if __name__ == "__main__": def main(): - """Entry point for 'predix' CLI command.""" + """Entry point for 'nexquant' CLI command.""" show_welcome() diff --git a/rdagent/components/backtesting/__init__.py b/rdagent/components/backtesting/__init__.py index 940a9b52..a941fd31 100644 --- a/rdagent/components/backtesting/__init__.py +++ b/rdagent/components/backtesting/__init__.py @@ -1,4 +1,4 @@ -"""Predix Backtesting Package""" +"""NexQuant Backtesting Package""" from .backtest_engine import BacktestMetrics, FactorBacktester from .results_db import ResultsDatabase from .risk_management import CorrelationAnalyzer, PortfolioOptimizer, AdvancedRiskManager diff --git a/rdagent/components/backtesting/backtest_engine.py b/rdagent/components/backtesting/backtest_engine.py index 69c661f7..d82c0892 100644 --- a/rdagent/components/backtesting/backtest_engine.py +++ b/rdagent/components/backtesting/backtest_engine.py @@ -1,5 +1,5 @@ """ -Predix Backtesting Engine - IC, Sharpe, Drawdown +NexQuant Backtesting Engine - IC, Sharpe, Drawdown Thin wrapper around the unified ``vbt_backtest.backtest_signal`` engine. All metric formulas live in ``vbt_backtest``; this module exists for diff --git a/rdagent/components/backtesting/protections/__init__.py b/rdagent/components/backtesting/protections/__init__.py index 6e1bf179..bc741a53 100644 --- a/rdagent/components/backtesting/protections/__init__.py +++ b/rdagent/components/backtesting/protections/__init__.py @@ -1,5 +1,5 @@ """ -Trading Protection System for Predix. +Trading Protection System for NexQuant. Prevents excessive losses by automatically pausing trading when risk thresholds are exceeded. diff --git a/rdagent/components/backtesting/protections/base.py b/rdagent/components/backtesting/protections/base.py index dccb2c9c..96993b18 100644 --- a/rdagent/components/backtesting/protections/base.py +++ b/rdagent/components/backtesting/protections/base.py @@ -3,7 +3,7 @@ Trading Protection System Prevents excessive losses by automatically pausing trading when risk thresholds are exceeded. -Inspired by common trading protection patterns, implemented from scratch for Predix. +Inspired by common trading protection patterns, implemented from scratch for NexQuant. """ from abc import ABC, abstractmethod diff --git a/rdagent/components/backtesting/results_db.py b/rdagent/components/backtesting/results_db.py index e727c3b6..a6fc91dc 100644 --- a/rdagent/components/backtesting/results_db.py +++ b/rdagent/components/backtesting/results_db.py @@ -1,5 +1,5 @@ """ -Predix Results Database - SQLite für Backtest-Ergebnisse +NexQuant Results Database - SQLite für Backtest-Ergebnisse Stores backtest metrics from Qlib/MLflow runs for querying and dashboard display. """ @@ -409,7 +409,7 @@ class ResultsDatabase: worst_dd_str = self._fmt_float(best['worst_drawdown'], ".4f") md_lines = [ - "# Predix Results Summary", + "# NexQuant Results Summary", "", f"**Generated:** {summary['generated_at']}", f"**Database:** `{summary['database_path']}`", diff --git a/rdagent/components/backtesting/risk_management.py b/rdagent/components/backtesting/risk_management.py index cd8a5b87..37fc69bd 100644 --- a/rdagent/components/backtesting/risk_management.py +++ b/rdagent/components/backtesting/risk_management.py @@ -1,5 +1,5 @@ """ -Predix Risk Management - Korrelation, Portfolio-Optimierung +NexQuant Risk Management - Korrelation, Portfolio-Optimierung """ import numpy as np diff --git a/rdagent/components/backtesting/vbt_backtest.py b/rdagent/components/backtesting/vbt_backtest.py index d67a2e7e..85e077ba 100644 --- a/rdagent/components/backtesting/vbt_backtest.py +++ b/rdagent/components/backtesting/vbt_backtest.py @@ -2,7 +2,7 @@ Unified, verifiable backtesting engine. Single entry point (`backtest_signal`) used by: - - scripts/predix_gen_strategies_real_bt.py + - scripts/nexquant_gen_strategies_real_bt.py - rdagent/scenarios/qlib/local/strategy_orchestrator.py - rdagent/scenarios/qlib/local/optuna_optimizer.py - rdagent/components/backtesting/backtest_engine.py diff --git a/rdagent/components/coder/factor_coder/auto_fixer.py b/rdagent/components/coder/factor_coder/auto_fixer.py index 42e45996..a9ea6489 100644 --- a/rdagent/components/coder/factor_coder/auto_fixer.py +++ b/rdagent/components/coder/factor_coder/auto_fixer.py @@ -1,5 +1,5 @@ """ -Predix Factor Auto-Fixer - Automatically patches common factor code issues. +NexQuant Factor Auto-Fixer - Automatically patches common factor code issues. This module intercepts LLM-generated factor code and automatically fixes known problems: 1. min_periods mismatch in rolling window calculations diff --git a/rdagent/components/coder/kronos_adapter.py b/rdagent/components/coder/kronos_adapter.py index c3ff59ca..b13decdc 100644 --- a/rdagent/components/coder/kronos_adapter.py +++ b/rdagent/components/coder/kronos_adapter.py @@ -1,5 +1,5 @@ """ -Kronos Foundation Model Adapter for Predix. +Kronos Foundation Model Adapter for NexQuant. Wraps the Kronos-mini OHLCV foundation model (4.1M params, AAAI 2026, MIT) for use as: @@ -55,8 +55,8 @@ def _ensure_kronos() -> bool: return _KRONOS_AVAILABLE -def _ohlcv_from_predix(df: pd.DataFrame) -> pd.DataFrame: - """Convert Predix HDF5 format ($open/$close/...) to Kronos format (open/close/...).""" +def _ohlcv_from_nexquant(df: pd.DataFrame) -> pd.DataFrame: + """Convert NexQuant HDF5 format ($open/$close/...) to Kronos format (open/close/...).""" col_map = {"$open": "open", "$high": "high", "$low": "low", "$close": "close", "$volume": "volume"} renamed = df.rename(columns=col_map) cols = [c for c in ["open", "high", "low", "close", "volume"] if c in renamed.columns] @@ -253,7 +253,7 @@ def build_kronos_factor( instrument = raw.index.get_level_values("instrument").unique()[0] df = raw.xs(instrument, level="instrument") - ohlcv = _ohlcv_from_predix(df) + ohlcv = _ohlcv_from_nexquant(df) adapter = KronosAdapter(device=device, max_context=min(context_bars, 512), model_size=model_size) adapter.load() @@ -328,7 +328,7 @@ def evaluate_kronos_model( raw = pd.read_hdf(hdf5_path, key="data") instrument = raw.index.get_level_values("instrument").unique()[0] df = raw.xs(instrument, level="instrument") - ohlcv = _ohlcv_from_predix(df) + ohlcv = _ohlcv_from_nexquant(df) adapter = KronosAdapter(device=device, max_context=min(context_bars, 512), model_size=model_size) adapter.load() diff --git a/rdagent/components/coder/rl/__init__.py b/rdagent/components/coder/rl/__init__.py index c7c1aed5..218f604b 100644 --- a/rdagent/components/coder/rl/__init__.py +++ b/rdagent/components/coder/rl/__init__.py @@ -1,4 +1,4 @@ -"""RL Trading Agent components for Predix. +"""RL Trading Agent components for NexQuant. This package provides reinforcement learning trading capabilities. Works with or without stable-baselines3 (graceful fallback). diff --git a/rdagent/components/coder/rl/agent.py b/rdagent/components/coder/rl/agent.py index 6bfa1bb3..d80febcc 100644 --- a/rdagent/components/coder/rl/agent.py +++ b/rdagent/components/coder/rl/agent.py @@ -2,7 +2,7 @@ RL Trading Agent wrapper for Stable Baselines3. Provides an easy-to-use interface for training, evaluating, and deploying -RL trading agents within the Predix framework. +RL trading agents within the NexQuant framework. Supported algorithms: - PPO: Proximal Policy Optimization (most stable, recommended for production) diff --git a/rdagent/components/coder/rl/env.py b/rdagent/components/coder/rl/env.py index 3ad0ecbe..84041da3 100644 --- a/rdagent/components/coder/rl/env.py +++ b/rdagent/components/coder/rl/env.py @@ -5,7 +5,7 @@ Gym-compatible environment for training RL trading agents. Supports single-asset (EUR/USD) trading with technical indicators and portfolio state as observations. -Inspired by common RL trading environment patterns, implemented from scratch for Predix. +Inspired by common RL trading environment patterns, implemented from scratch for NexQuant. """ import gymnasium as gym diff --git a/rdagent/components/coder/rl/fallback.py b/rdagent/components/coder/rl/fallback.py index c9912672..df38c649 100644 --- a/rdagent/components/coder/rl/fallback.py +++ b/rdagent/components/coder/rl/fallback.py @@ -2,7 +2,7 @@ Fallback RL implementation for users without stable-baselines3. Provides simple rule-based trading when RL library is not available. -This ensures the Predix system works for all GitHub users, even +This ensures the NexQuant system works for all GitHub users, even without the optional stable-baselines3 dependency. The fallback implements a momentum-based strategy as a placeholder diff --git a/rdagent/components/model_loader.py b/rdagent/components/model_loader.py index ec58fb22..a0315461 100644 --- a/rdagent/components/model_loader.py +++ b/rdagent/components/model_loader.py @@ -1,5 +1,5 @@ """ -Predix Model Loader +NexQuant Model Loader Loads models from: 1. models/local/*.py (your improved models - not in Git) @@ -23,7 +23,7 @@ from typing import Optional, Any # Base paths -BASE_DIR = Path(__file__).parent.parent.parent # Predix/ +BASE_DIR = Path(__file__).parent.parent.parent # NexQuant/ MODELS_DIR = BASE_DIR / "models" LOCAL_MODELS_DIR = MODELS_DIR / "local" STANDARD_MODELS_DIR = MODELS_DIR / "standard" diff --git a/rdagent/components/prompt_loader.py b/rdagent/components/prompt_loader.py index e9d4e9f6..14c3a987 100644 --- a/rdagent/components/prompt_loader.py +++ b/rdagent/components/prompt_loader.py @@ -1,5 +1,5 @@ """ -Predix Prompt Loader +NexQuant Prompt Loader Loads prompts from: 1. prompts/local/*.yaml (your improved prompts - not in Git) @@ -22,7 +22,7 @@ from typing import Optional, Dict, Any # Base paths -BASE_DIR = Path(__file__).parent.parent.parent # Predix/ +BASE_DIR = Path(__file__).parent.parent.parent # NexQuant/ PROMPTS_DIR = BASE_DIR / "prompts" LOCAL_PROMPTS_DIR = PROMPTS_DIR / "local" STANDARD_PROMPTS_FILE = PROMPTS_DIR / "standard_prompts.yaml" diff --git a/rdagent/scenarios/qlib/developer/factor_runner.py b/rdagent/scenarios/qlib/developer/factor_runner.py index f3caf5f8..74ba25d4 100644 --- a/rdagent/scenarios/qlib/developer/factor_runner.py +++ b/rdagent/scenarios/qlib/developer/factor_runner.py @@ -969,7 +969,7 @@ class QlibFactorRunner(CachedRunner[QlibFactorExperiment]): # Run factor code on full data in a temp workspace import pandas as pd - with tempfile.TemporaryDirectory(prefix="predix_fullval_") as tmp_dir: + with tempfile.TemporaryDirectory(prefix="nexquant_fullval_") as tmp_dir: tmp = Path(tmp_dir) shutil.copy(str(factor_py), str(tmp / "factor.py")) shutil.copy(str(full_data), str(tmp / "intraday_pv.h5")) diff --git a/rdagent/scenarios/qlib/developer/strategy_builder.py b/rdagent/scenarios/qlib/developer/strategy_builder.py index 7d1a7eb5..33a2d710 100644 --- a/rdagent/scenarios/qlib/developer/strategy_builder.py +++ b/rdagent/scenarios/qlib/developer/strategy_builder.py @@ -1,5 +1,5 @@ """ -Predix Strategy Builder - Systematically combine factors into trading strategies. +NexQuant Strategy Builder - Systematically combine factors into trading strategies. This module: 1. Loads evaluated factors with time-series values @@ -8,9 +8,9 @@ This module: 4. Ranks and saves best strategies Usage: - predix build-strategies # Build strategies from top factors - predix build-strategies --top 50 # Use top 50 factors - predix build-strategies --max-combo 3 # Allow up to 3-factor combinations + nexquant build-strategies # Build strategies from top factors + nexquant build-strategies --top 50 # Use top 50 factors + nexquant build-strategies --max-combo 3 # Allow up to 3-factor combinations """ import json diff --git a/rdagent/scenarios/qlib/fx_validator/agents/analysts/macro_analyst.py b/rdagent/scenarios/qlib/fx_validator/agents/analysts/macro_analyst.py index 8eed8835..0dcf4452 100644 --- a/rdagent/scenarios/qlib/fx_validator/agents/analysts/macro_analyst.py +++ b/rdagent/scenarios/qlib/fx_validator/agents/analysts/macro_analyst.py @@ -56,7 +56,7 @@ Current Date: {current_date} Live Macro Data: {macro_data} -Factor Report from Predix RD-Agent: +Factor Report from NexQuant RD-Agent: {factor_report} Analyze the macro environment and its impact on the proposed factor: diff --git a/rdagent/scenarios/qlib/fx_validator/agents/analysts/session_analyst.py b/rdagent/scenarios/qlib/fx_validator/agents/analysts/session_analyst.py index 1fbc6a35..8bc17ad5 100644 --- a/rdagent/scenarios/qlib/fx_validator/agents/analysts/session_analyst.py +++ b/rdagent/scenarios/qlib/fx_validator/agents/analysts/session_analyst.py @@ -47,7 +47,7 @@ Active Session: {session} Expected Regime: {regime} Session Notes: {session_note} -Factor Report from Predix RD-Agent: +Factor Report from NexQuant RD-Agent: {factor_report} Analyze whether the proposed factor is suitable for the current session regime. diff --git a/rdagent/scenarios/qlib/fx_validator/agents/trader/fx_trader.py b/rdagent/scenarios/qlib/fx_validator/agents/trader/fx_trader.py index f90b6591..91896048 100644 --- a/rdagent/scenarios/qlib/fx_validator/agents/trader/fx_trader.py +++ b/rdagent/scenarios/qlib/fx_validator/agents/trader/fx_trader.py @@ -17,7 +17,7 @@ def create_fx_trader(llm): You have received reports from your team: -FACTOR ANALYSIS (Predix RD-Agent): +FACTOR ANALYSIS (NexQuant RD-Agent): {factor_report} SESSION ANALYSIS: diff --git a/rdagent/scenarios/qlib/fx_validator/fx_graph.py b/rdagent/scenarios/qlib/fx_validator/fx_graph.py index 7944103a..7e8d391a 100644 --- a/rdagent/scenarios/qlib/fx_validator/fx_graph.py +++ b/rdagent/scenarios/qlib/fx_validator/fx_graph.py @@ -1,5 +1,5 @@ """ -FX Validator Graph — Multi-Agent Validierung für Predix Faktoren +FX Validator Graph — Multi-Agent Validierung für NexQuant Faktoren Implementiert Multi-Agenten-System für Trading-Entscheidungen: - Session Analyst: Analysiert aktuelle FX-Session @@ -88,10 +88,10 @@ def create_fx_validator(config: dict = None): def validate_factor(factor_report: str, trade_date: str = None) -> dict: """ - Hauptfunktion — validiert einen Predix-Faktor durch Multi-Agent Debatte + Hauptfunktion — validiert einen NexQuant-Faktor durch Multi-Agent Debatte Args: - factor_report: Der Faktor-Report von Predix RD-Agent + factor_report: Der Faktor-Report von NexQuant RD-Agent trade_date: Datum/Zeit in ISO Format (default: jetzt) Returns: diff --git a/rdagent/scenarios/qlib/quant_loop_factory.py b/rdagent/scenarios/qlib/quant_loop_factory.py index 851fedde..504b5c2a 100644 --- a/rdagent/scenarios/qlib/quant_loop_factory.py +++ b/rdagent/scenarios/qlib/quant_loop_factory.py @@ -1,5 +1,5 @@ """ -Predix Quant Loop Factory - Selects appropriate workflow based on available components. +NexQuant Quant Loop Factory - Selects appropriate workflow based on available components. This module is the entry point for the quantitative trading loop. It automatically selects between: diff --git a/requirements/rl.txt b/requirements/rl.txt index 5a382118..193e5f29 100644 --- a/requirements/rl.txt +++ b/requirements/rl.txt @@ -3,7 +3,7 @@ # Install with: pip install -r requirements/rl.txt # # These dependencies are OPTIONAL. -# The Predix RL trading system works without them using a simple momentum fallback. +# The NexQuant RL trading system works without them using a simple momentum fallback. # # Only install if you want to use full PPO/A2C/SAC training. diff --git a/scripts/debug_backtest.py b/scripts/debug_backtest.py index 0b919e7e..cd5d1dc8 100644 --- a/scripts/debug_backtest.py +++ b/scripts/debug_backtest.py @@ -5,8 +5,8 @@ import numpy as np import pandas as pd from pathlib import Path -OHLCV_PATH = Path('/home/nico/Predix/git_ignore_folder/factor_implementation_source_data/intraday_pv.h5') -FACTORS_DIR = Path('/home/nico/Predix/results/factors') +OHLCV_PATH = Path('/home/nico/NexQuant/git_ignore_folder/factor_implementation_source_data/intraday_pv.h5') +FACTORS_DIR = Path('/home/nico/NexQuant/results/factors') VALUES_DIR = FACTORS_DIR / 'values' print("=" * 70) diff --git a/scripts/kronos_factor_gen.py b/scripts/kronos_factor_gen.py index c18cc68e..911eb5e0 100644 --- a/scripts/kronos_factor_gen.py +++ b/scripts/kronos_factor_gen.py @@ -3,10 +3,10 @@ Option A: Generate Kronos predicted-return factor from EUR/USD 1-min data. Runs Kronos-mini inference in daily strides (96 bars/day) over all available -OHLCV data and saves the resulting factor for use in Predix's factor pipeline. +OHLCV data and saves the resulting factor for use in NexQuant's factor pipeline. Usage: - conda activate predix + conda activate nexquant python scripts/kronos_factor_gen.py python scripts/kronos_factor_gen.py --context 512 --pred 96 --device cuda python scripts/kronos_factor_gen.py --device cpu # slower but no GPU needed @@ -71,7 +71,7 @@ def main(): print(f"\nSample (first 5):") print(factor_df.head()) - # Save metadata for predix.py top / best integration + # Save metadata for nexquant.py top / best integration meta = { "factor_name": f"KronosPredReturn_p{args.pred}", "description": f"Kronos-mini predicted return, {args.pred}-bar horizon", diff --git a/scripts/kronos_model_eval.py b/scripts/kronos_model_eval.py index aad65123..f613403f 100644 --- a/scripts/kronos_model_eval.py +++ b/scripts/kronos_model_eval.py @@ -6,7 +6,7 @@ Computes IC (Information Coefficient) and hit rate for Kronos predictions vs actual realized returns. Results are printed for comparison with LightGBM. Usage: - conda activate predix + conda activate nexquant python scripts/kronos_model_eval.py python scripts/kronos_model_eval.py --pred 30 --context 512 --device cuda """ diff --git a/scripts/predix_add_risk_management.py b/scripts/nexquant_add_risk_management.py similarity index 99% rename from scripts/predix_add_risk_management.py rename to scripts/nexquant_add_risk_management.py index f437ad38..921ad248 100644 --- a/scripts/predix_add_risk_management.py +++ b/scripts/nexquant_add_risk_management.py @@ -10,8 +10,8 @@ For each accepted strategy, add: - Generate Live Trading report Usage: - python predix_add_risk_management.py - python predix_add_risk_management.py --live # Mark as live-ready + python nexquant_add_risk_management.py + python nexquant_add_risk_management.py --live # Mark as live-ready """ import os, sys, json, time from pathlib import Path diff --git a/scripts/nexquant_autopilot.py b/scripts/nexquant_autopilot.py new file mode 100644 index 00000000..89c5bf31 --- /dev/null +++ b/scripts/nexquant_autopilot.py @@ -0,0 +1,132 @@ +#!/usr/bin/env python +""" +NexQuant Auto-Pilot — vollautomatischer Strategie-Generator. + +Läuft unbegrenzt, kein menschlicher Eingriff nötig. +Jede Runde: Factors laden → LLM Code → Pre-Flight → Backtest → Optuna → Ensemble +Bei Crash: auto-restart nach 30s. + +Usage: + python scripts/nexquant_autopilot.py +""" +from __future__ import annotations + +import json, logging, os, sys, time, traceback +from datetime import datetime +from pathlib import Path + +import numpy as np, pandas as pd + +sys.path.insert(0, str(Path(__file__).resolve().parent.parent)) + +# Load .env before any rdagent imports (required for pydantic-settings) +try: + from dotenv import load_dotenv + _env_path = Path(__file__).resolve().parent.parent / ".env" + load_dotenv(_env_path) +except ImportError: + pass + +logging.basicConfig(level=logging.INFO, format="%(asctime)s [%(levelname)s] %(message)s") +logger = logging.getLogger("autopilot") + +LOG_FILE = Path(__file__).resolve().parent.parent / "git_ignore_folder" / "logs" / f"autopilot_{datetime.now().strftime('%Y%m%d_%H%M%S')}.log" +LOG_FILE.parent.mkdir(parents=True, exist_ok=True) +fh = logging.FileHandler(str(LOG_FILE)) +fh.setFormatter(logging.Formatter("%(asctime)s [%(levelname)s] %(message)s")) +logger.addHandler(fh) + +BATCH_SIZE = 2 +OPTUNA_TRIALS = 10 +COOLDOWN = 30 +MAX_CONSECUTIVE_FAILS = 5 + +def main_round(style: str, round_num: int) -> int: + """Run one round. Returns number of accepted strategies.""" + from rdagent.scenarios.qlib.local.strategy_orchestrator import StrategyOrchestrator + + accepted_count = 0 + try: + orch = StrategyOrchestrator( + top_factors=20, trading_style=style, + min_sharpe=0.1, use_optuna=True, optuna_trials=OPTUNA_TRIALS, + ) + except Exception as e: + logger.error(f"Orchestrator init failed: {e}") + return 0 + + try: + results = orch.generate_strategies(count=BATCH_SIZE, workers=1) + except Exception as e: + logger.error(f"generate_strategies failed: {e}") + return 0 + + for r in results: + status = r.get("status", "?") + if status == "accepted": + accepted_count += 1 + logger.info(f" ✓ {r.get('strategy_name','?')[:40]:40s} S={r.get('sharpe_ratio',0):.1f} OOS={r.get('oos_sharpe',0):.1f}") + else: + reason = r.get("reason", "?")[:80] + logger.debug(f" ✗ {r.get('strategy_name','?')[:40]:40s} {reason}") + + if accepted_count >= 2: + try: + ensemble = orch.build_ensemble(results) + if ensemble and ensemble.get("status") == "success": + logger.info(f" Ensemble: S={ensemble['sharpe_ratio']:.1f} OOS={ensemble['oos_sharpe']:.1f} ({len(ensemble['members'])} members)") + except Exception: + pass + + return accepted_count + + +def main(): + print(f"\n{'='*50}") + print(f" NexQuant Auto-Pilot") + print(f" Log: {LOG_FILE}") + print(f" Batch: {BATCH_SIZE} | Optuna: {OPTUNA_TRIALS} trials") + print(f"{'='*50}\n") + + round_num = 0 + total_accepted = 0 + consecutive_fails = 0 + start_time = datetime.now() + styles = ["swing", "daytrading"] + + while True: + round_num += 1 + style = styles[round_num % 2] + print(f"\n[Round {round_num}] {style} | {datetime.now().strftime('%H:%M:%S')}", flush=True) + + try: + accepted = main_round(style, round_num) + total_accepted += accepted + + if accepted == 0: + consecutive_fails += 1 + else: + consecutive_fails = 0 + + elapsed = (datetime.now() - start_time).total_seconds() + rate = total_accepted / (elapsed / 3600) if elapsed > 0 else 0 + print(f" Accepted: {accepted} | Total: {total_accepted} | Rate: {rate:.1f}/h | Fails: {consecutive_fails}", flush=True) + + if consecutive_fails >= MAX_CONSECUTIVE_FAILS: + logger.warning(f"{consecutive_fails} consecutive failures — cooling down {COOLDOWN*2}s") + time.sleep(COOLDOWN * 2) + consecutive_fails = 0 + + except KeyboardInterrupt: + print(f"\n\nStopped after {round_num} rounds. Total accepted: {total_accepted}") + break + except Exception as e: + logger.error(f"Round {round_num} crashed: {e}\n{traceback.format_exc()[-500:]}") + consecutive_fails += 1 + time.sleep(COOLDOWN) + + time.sleep(COOLDOWN) + + +if __name__ == "__main__": + main() diff --git a/scripts/predix_batch_backtest.py b/scripts/nexquant_batch_backtest.py similarity index 98% rename from scripts/predix_batch_backtest.py rename to scripts/nexquant_batch_backtest.py index 70720fd9..53b1839b 100644 --- a/scripts/predix_batch_backtest.py +++ b/scripts/nexquant_batch_backtest.py @@ -1,14 +1,14 @@ """ -Predix Batch Backtest Script - Extract and backtest existing factors. +NexQuant Batch Backtest Script - Extract and backtest existing factors. Scans generated factor code from workspaces, runs Qlib backtests directly (bypassing CoSTEER), and saves results to JSON + SQLite. Usage: - python predix_batch_backtest.py --factors 100 # Backtest top 100 factors - python predix_batch_backtest.py --all # Backtest all discovered factors - python predix_batch_backtest.py --parallel 5 # 5 parallel backtests - python predix_batch_backtest.py --scan-only # Only scan, don't run backtests + python nexquant_batch_backtest.py --factors 100 # Backtest top 100 factors + python nexquant_batch_backtest.py --all # Backtest all discovered factors + python nexquant_batch_backtest.py --parallel 5 # 5 parallel backtests + python nexquant_batch_backtest.py --scan-only # Only scan, don't run backtests """ import json @@ -660,7 +660,7 @@ def _run_factor_directly(factor_info: FactorInfo) -> Optional[BacktestResult]: import tempfile import subprocess - with tempfile.TemporaryDirectory(prefix="predix_factor_") as tmp_dir: + with tempfile.TemporaryDirectory(prefix="nexquant_factor_") as tmp_dir: ws = Path(tmp_dir) # Write factor code @@ -742,7 +742,7 @@ def _run_qlib_single(factor_info: FactorInfo) -> BacktestResult: import tempfile # Create temp workspace - with tempfile.TemporaryDirectory(prefix="predix_bt_") as tmp_dir: + with tempfile.TemporaryDirectory(prefix="nexquant_bt_") as tmp_dir: ws = Path(tmp_dir) # Write factor code @@ -1182,7 +1182,7 @@ def main( Metric for ranking ('ic' or 'sharpe') """ console.print(Panel( - "[bold cyan]Predix Batch Backtest Runner[/bold cyan]\n" + "[bold cyan]NexQuant Batch Backtest Runner[/bold cyan]\n" f"Scanning workspaces for generated factors...", border_style="cyan", )) @@ -1196,7 +1196,7 @@ def main( if not all_factors_list: console.print("\n[red]No factors found in workspaces![/red]") console.print( - "[yellow]Ensure factors have been generated via `predix.py quant` first.[/yellow]" + "[yellow]Ensure factors have been generated via `nexquant.py quant` first.[/yellow]" ) return @@ -1407,7 +1407,7 @@ if __name__ == "__main__": import argparse parser = argparse.ArgumentParser( - description="Predix Batch Backtest - Extract and backtest existing factors" + description="NexQuant Batch Backtest - Extract and backtest existing factors" ) parser.add_argument( "--factors", "-n", diff --git a/scripts/predix_continuous_strategies.py b/scripts/nexquant_continuous_strategies.py similarity index 96% rename from scripts/predix_continuous_strategies.py rename to scripts/nexquant_continuous_strategies.py index 9205f6d1..f5f68652 100644 --- a/scripts/predix_continuous_strategies.py +++ b/scripts/nexquant_continuous_strategies.py @@ -12,9 +12,9 @@ Features: - Daytrading AND swing style alternating Usage: - python scripts/predix_continuous_strategies.py - python scripts/predix_continuous_strategies.py --style daytrading --rounds 100 - python scripts/predix_continuous_strategies.py --style both --workers 4 + python scripts/nexquant_continuous_strategies.py + python scripts/nexquant_continuous_strategies.py --style daytrading --rounds 100 + python scripts/nexquant_continuous_strategies.py --style both --workers 4 """ from __future__ import annotations @@ -105,7 +105,7 @@ def main(): args = parser.parse_args() print(f"\n{'='*60}") - print(f" Predix Continuous Strategy Generator") + print(f" NexQuant Continuous Strategy Generator") print(f" Style: {args.style} | Workers: {args.workers}") print(f" Min Sharpe: {args.min_sharpe} | Batch: {args.batch_size}") print(f" ML every {args.ml_rounds} rounds") diff --git a/scripts/nexquant_fast_rebacktest.py b/scripts/nexquant_fast_rebacktest.py new file mode 100644 index 00000000..0ab65bec --- /dev/null +++ b/scripts/nexquant_fast_rebacktest.py @@ -0,0 +1,156 @@ +#!/usr/bin/env python +"""Fast rebacktest: only strategies with factor parquets, skip already-done.""" +import json, sys, pandas as pd, subprocess, tempfile, numpy as np +from pathlib import Path +from datetime import datetime + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +from rdagent.components.backtesting.vbt_backtest import backtest_signal + +OHLCV = Path("git_ignore_folder/factor_implementation_source_data/intraday_pv.h5") +FACTORS_DIR = Path("results/factors/values") +STRAT_DIR = Path("results/strategies_new") + +# Pre-build factor name → path map +fmap = {p.stem: str(p) for p in FACTORS_DIR.glob("*.parquet")} + +# Load close once +print("Loading OHLCV...") +ohlcv = pd.read_hdf(str(OHLCV), key="data") +close = ohlcv["$close"].dropna() +if isinstance(close.index, pd.MultiIndex): + close = close.droplevel(-1) +close = close.astype(float).sort_index() +print(f"{len(close):,} bars") + +# Build work list +work = [] +for f in sorted(STRAT_DIR.glob("*.json")): + try: + d = json.loads(f.read_text()) + except Exception: + continue + if d.get("reevaluation_status") == "verified_v2": + continue + names = d.get("factor_names", []) + code = d.get("code", "") + if not names or not code: + continue + paths = [] + for n in names: + p = fmap.get(n) or fmap.get(n.replace("/", "_")[:150]) + if p: + paths.append((n, p)) + if len(paths) >= 2: + work.append((f, d, paths)) + +print(f"{len(work)} strategies to process") + +if not work: + print("All done!") + sys.exit(0) + +ok = skip = fail = 0 +start = datetime.now() + +for i, (f, data, factor_paths) in enumerate(work): + name = data.get("strategy_name", f.stem)[:45] + code = data.get("code", "") + + # Load factor series + series = {} + for fn, fp in factor_paths: + try: + s = pd.read_parquet(fp).iloc[:, 0] + series[fn] = s + except Exception: + pass + + if len(series) < 2: + skip += 1 + continue + + df = pd.DataFrame(series).sort_index() + if isinstance(df.index, pd.MultiIndex): + df = df.droplevel(-1) + + try: + df_1m = df.reindex(close.index).ffill() + except Exception: + skip += 1 + continue + + valid = df_1m.notna().any(axis=1) + if valid.sum() < 1000: + skip += 1 + continue + + ca = close.loc[valid] + fa = df_1m.loc[valid] + + # Execute strategy code + try: + with tempfile.TemporaryDirectory() as td: + tdp = Path(td) + fa.to_parquet(str(tdp / "factors.parquet")) + ca.to_pickle(str(tdp / "close.pkl")) + + exec_script = ( + "import pandas as pd, numpy as np\n" + "factors = pd.read_parquet('factors.parquet')\n" + "close = pd.read_pickle('close.pkl')\n" + "df = factors\n" + + code + + "\nif 'signal' not in dir():\n" + " raise SystemExit(1)\n" + "pd.Series(signal).fillna(0).to_pickle('signal.pkl')\n" + ) + (tdp / "run.py").write_text(exec_script) + r = subprocess.run( + ["python", "run.py"], + capture_output=True, text=True, timeout=60, cwd=str(tdp), + ) + if r.returncode != 0: + fail += 1 + continue + sig = pd.read_pickle(tdp / "signal.pkl") + except Exception: + fail += 1 + continue + + try: + sig = sig.reindex(ca.index).ffill().fillna(0) + result = backtest_signal(ca, sig, txn_cost_bps=2.14) + except Exception: + fail += 1 + continue + + # Write back + data["reevaluation_status"] = "verified_v2" + data["sharpe_ratio"] = result.get("sharpe") + data["max_drawdown"] = result.get("max_drawdown") + data["win_rate"] = result.get("win_rate") + data["total_return"] = result.get("total_return") + data["summary"] = { + **data.get("summary", {}), + "sharpe": result.get("sharpe"), + "max_drawdown": result.get("max_drawdown"), + "win_rate": result.get("win_rate"), + "monthly_return_pct": result.get("monthly_return_pct"), + "real_n_trades": result.get("n_trades"), + "total_return": result.get("total_return"), + "annualized_return": result.get("annualized_return"), + "engine": "verified_v2", + "txn_cost_bps": 2.14, + } + f.write_text(json.dumps(data, indent=2, ensure_ascii=False)) + ok += 1 + + elapsed = (datetime.now() - start).total_seconds() + rate = ok / elapsed * 60 if elapsed > 0 else 0 + print(f" [{ok:4d}/{len(work)}] {rate:5.0f}/min {name:45s} " + f"S={result['sharpe']:6.1f} DD={result['max_drawdown']:7.2%} " + f"WR={result['win_rate']:5.1%} T={result['n_trades']:4d}") + +elapsed = (datetime.now() - start).total_seconds() +print(f"\nDONE: ok={ok} skip={skip} fail={fail} in {elapsed:.0f}s") diff --git a/scripts/predix_full_eval.py b/scripts/nexquant_full_eval.py similarity index 98% rename from scripts/predix_full_eval.py rename to scripts/nexquant_full_eval.py index ae32fd21..2a8eb791 100644 --- a/scripts/predix_full_eval.py +++ b/scripts/nexquant_full_eval.py @@ -1,13 +1,13 @@ """ -Predix Full Data Factor Evaluator - Evaluate factors with FULL 1min data. +NexQuant Full Data Factor Evaluator - Evaluate factors with FULL 1min data. Evaluates factors using the complete intraday_pv.h5 dataset (2022-2026, ~2.26M rows) instead of the debug dataset (2024 only, ~371K rows). Usage: - python predix_full_eval.py --top 100 # Evaluate top 100 factors with full data - python predix_full_eval.py --all # Evaluate all factors - python predix_full_eval.py --parallel 4 # 4 parallel workers + python nexquant_full_eval.py --top 100 # Evaluate top 100 factors with full data + python nexquant_full_eval.py --all # Evaluate all factors + python nexquant_full_eval.py --parallel 4 # 4 parallel workers """ import json @@ -271,7 +271,7 @@ def evaluate_factor_full(factor: FactorInfo, full_data: pd.DataFrame, import tempfile import subprocess - with tempfile.TemporaryDirectory(prefix="predix_full_") as tmp_dir: + with tempfile.TemporaryDirectory(prefix="nexquant_full_") as tmp_dir: ws = Path(tmp_dir) try: @@ -628,7 +628,7 @@ def main( ) -> None: """Main entry point.""" console.print(Panel( - "[bold cyan]Predix Full Data Factor Evaluator[/bold cyan]\n" + "[bold cyan]NexQuant Full Data Factor Evaluator[/bold cyan]\n" f"Using FULL 1min data: {FULL_DATA_FILE}", border_style="cyan", )) @@ -679,7 +679,7 @@ if __name__ == "__main__": import argparse parser = argparse.ArgumentParser( - description="Predix Full Data Factor Evaluator" + description="NexQuant Full Data Factor Evaluator" ) parser.add_argument( "--top", "-n", diff --git a/scripts/predix_gen_strategies_real_bt.py b/scripts/nexquant_gen_strategies_real_bt.py similarity index 98% rename from scripts/predix_gen_strategies_real_bt.py rename to scripts/nexquant_gen_strategies_real_bt.py index 6c964d70..bc6e9d82 100644 --- a/scripts/predix_gen_strategies_real_bt.py +++ b/scripts/nexquant_gen_strategies_real_bt.py @@ -7,13 +7,13 @@ each with real backtesting on OHLCV data. Usage: # Swing trading (96-bar forward returns) - python predix_gen_strategies_real_bt.py 10 + python nexquant_gen_strategies_real_bt.py 10 # Daytrading with FTMO constraints (12-bar forward returns) - TRADING_STYLE=daytrading python predix_gen_strategies_real_bt.py 5 + TRADING_STYLE=daytrading python nexquant_gen_strategies_real_bt.py 5 # With parallel workers (default: CPU count) - TRADING_STYLE=daytrading WORKERS=4 python predix_gen_strategies_real_bt.py 20 + TRADING_STYLE=daytrading WORKERS=4 python nexquant_gen_strategies_real_bt.py 20 """ import os, sys, json, time, math, random, logging, warnings, subprocess from pathlib import Path @@ -42,9 +42,9 @@ except Exception: # ============================================================================ # Configuration # ============================================================================ -OHLCV_PATH = Path('/home/nico/Predix/git_ignore_folder/factor_implementation_source_data/intraday_pv.h5') -FACTORS_DIR = Path('/home/nico/Predix/results/factors') -STRATEGIES_DIR = Path('/home/nico/Predix/results/strategies_new') +OHLCV_PATH = Path('/home/nico/NexQuant/git_ignore_folder/factor_implementation_source_data/intraday_pv.h5') +FACTORS_DIR = Path('/home/nico/NexQuant/results/factors') +STRATEGIES_DIR = Path('/home/nico/NexQuant/results/strategies_new') STRATEGIES_DIR.mkdir(parents=True, exist_ok=True) # Trading style @@ -632,7 +632,7 @@ def main(target_count=10): # Generate PDF report try: - from predix_strategy_report import StrategyPerformanceReporter + from nexquant_strategy_report import StrategyPerformanceReporter reporter = StrategyPerformanceReporter(strategy) reporter.generate_report() except: diff --git a/scripts/predix_parallel.py b/scripts/nexquant_parallel.py similarity index 96% rename from scripts/predix_parallel.py rename to scripts/nexquant_parallel.py index 2147c944..a7d34400 100644 --- a/scripts/predix_parallel.py +++ b/scripts/nexquant_parallel.py @@ -1,16 +1,16 @@ """ -Predix Parallel Runner - Run multiple factor experiments concurrently. +NexQuant Parallel Runner - Run multiple factor experiments concurrently. -Spawns N subprocesses, each running `predix.py quant` with isolated config: +Spawns N subprocesses, each running `nexquant.py quant` with isolated config: - Separate log files (fin_quant_run1.log, fin_quant_run2.log, etc.) - Separate result directories (results/runs/run1/, results/runs/run2/, etc.) - Separate workspace directories - API key distribution across multiple keys (round-robin) Usage: - python predix_parallel.py --runs 5 --api-keys 2 - python predix_parallel.py --runs 3 --model openrouter - python predix_parallel.py --runs 5 --model local --api-keys 1 + python nexquant_parallel.py --runs 5 --api-keys 2 + python nexquant_parallel.py --runs 3 --model openrouter + python nexquant_parallel.py --runs 5 --model local --api-keys 1 """ import os import signal @@ -188,7 +188,7 @@ class ParallelRunner: def _build_command(self, run_state: RunState) -> list[str]: """ - Build the subprocess command to run predix quant. + Build the subprocess command to run nexquant quant. Parameters ---------- @@ -202,7 +202,7 @@ class ParallelRunner: """ cmd = [ sys.executable, # Use same Python interpreter - str(self.project_root / "predix.py"), + str(self.project_root / "nexquant.py"), "quant", "--model", run_state.model, "--run-id", str(run_state.run_id), @@ -327,7 +327,7 @@ class ParallelRunner: # Build summary table table = Table( - title="🔀 Predix Parallel Run Dashboard", + title="🔀 NexQuant Parallel Run Dashboard", show_header=True, header_style="bold cyan", expand=True, @@ -399,7 +399,7 @@ class ParallelRunner: signal.signal(signal.SIGTERM, self._signal_handler) console.print(f"\n[bold cyan]{'=' * 60}[/bold cyan]") - console.print("[bold cyan]🔀 Predix Parallel Runner[/bold cyan]") + console.print("[bold cyan]🔀 NexQuant Parallel Runner[/bold cyan]") console.print(f"[bold cyan]{'=' * 60}[/bold cyan]") console.print(f" Runs: {self.num_runs}") console.print(f" API Keys: {self.num_api_keys} ({len(self.api_keys)} available)") @@ -503,7 +503,7 @@ if __name__ == "__main__": import argparse parser = argparse.ArgumentParser( - description="Predix Parallel Runner - Run multiple factor experiments concurrently", + description="NexQuant Parallel Runner - Run multiple factor experiments concurrently", ) parser.add_argument( "--runs", "-n", diff --git a/scripts/nexquant_quick_daytrading.py b/scripts/nexquant_quick_daytrading.py new file mode 100644 index 00000000..ef1ba70e --- /dev/null +++ b/scripts/nexquant_quick_daytrading.py @@ -0,0 +1,467 @@ +#!/usr/bin/env python +""" +Quick Daytrading Strategy Generator with CORRECT factor alignment. + +Uses forward-fill to align daily factors to 1-min frequency, +then runs fast backtests without LLM calls. + +Usage: + python nexquant_quick_daytrading.py 5 + python nexquant_quick_daytrading.py 10 +""" +import json, time, subprocess, tempfile # nosec +from pathlib import Path +import numpy as np +import pandas as pd +from rich.console import Console + +console = Console() + +STRATEGIES_DIR = Path('results/strategies_new') +STRATEGIES_DIR.mkdir(parents=True, exist_ok=True) + +FACTOR_FILES = Path('results/factors') +VALUE_FILES = FACTOR_FILES / 'values' +OHLCV_PATH = Path('git_ignore_folder/factor_implementation_source_data/intraday_pv.h5') + +# Best daytrading strategies (12-min horizon, optimized for FTMO) +DAYTRADING_COMBOS = [ + { + 'name': 'MomentumDivergence12min', + 'factors': ['daily_close_return_96', 'daily_session_momentum_divergence_1d'], + 'code': '''mom = factors['daily_close_return_96'] +div = factors['daily_session_momentum_divergence_1d'] + +w = 20 +mom_z = (mom - mom.rolling(w).mean()) / (mom.rolling(w).std() + 1e-8) +div_z = (div - div.rolling(w).mean()) / (div.rolling(w).std() + 1e-8) + +composite = (mom_z - div_z).fillna(0) +signal = pd.Series(0, index=close.index, name='signal') +signal[composite > 0.3] = 1 +signal[composite < -0.3] = -1 +signal = signal.fillna(0).astype(int)''', + }, + { + 'name': 'LondonSessionScalp', + 'factors': ['london_mom', 'daily_session_momentum_divergence_1d'], + 'code': '''mom = factors['london_mom'] +div = factors['daily_session_momentum_divergence_1d'] + +w = 15 +mom_z = (mom - mom.rolling(w).mean()) / (mom.rolling(w).std() + 1e-8) +div_z = (div - div.rolling(w).mean()) / (div.rolling(w).std() + 1e-8) + +composite = (mom_z - div_z).fillna(0) +signal = pd.Series(0, index=close.index, name='signal') +signal[composite > 0.25] = 1 +signal[composite < -0.25] = -1 +signal = signal.fillna(0).astype(int)''', + }, + { + 'name': 'TrendReversionScalp', + 'factors': ['daily_ols_slope_96', 'daily_session_momentum_divergence_1d', 'DailyTrendStrength_Raw'], + 'code': '''slope = factors['daily_ols_slope_96'] +div = factors['daily_session_momentum_divergence_1d'] +trend = factors['DailyTrendStrength_Raw'] + +w = 20 +slope_z = (slope - slope.rolling(w).mean()) / (slope.rolling(w).std() + 1e-8) +div_z = (div - div.rolling(w).mean()) / (div.rolling(w).std() + 1e-8) +trend_z = (trend - trend.rolling(w).mean()) / (trend.rolling(w).std() + 1e-8) + +composite = (0.5 * slope_z - 0.3 * div_z + 0.2 * trend_z).fillna(0) +signal = pd.Series(0, index=close.index, name='signal') +signal[composite > 0.3] = 1 +signal[composite < -0.3] = -1 +signal = signal.fillna(0).astype(int)''', + }, + { + 'name': 'VolAdjMomentum12', + 'factors': ['daily_ret_vol_adj_1d', 'daily_session_momentum_divergence_1d', 'DCP'], + 'code': '''vol = factors['daily_ret_vol_adj_1d'] +div = factors['daily_session_momentum_divergence_1d'] +dcp = factors['DCP'] + +w = 20 +vol_z = (vol - vol.rolling(w).mean()) / (vol.rolling(w).std() + 1e-8) +div_z = (div - div.rolling(w).mean()) / (div.rolling(w).std() + 1e-8) +dcp_z = (dcp - dcp.rolling(w).mean()) / (dcp.rolling(w).std() + 1e-8) + +composite = (0.5 * vol_z - 0.3 * div_z + 0.2 * dcp_z).fillna(0) +signal = pd.Series(0, index=close.index, name='signal') +signal[composite > 0.35] = 1 +signal[composite < -0.35] = -1 +signal = signal.fillna(0).astype(int)''', + }, + { + 'name': 'SessionMeanReversion', + 'factors': ['session_momentum_diff', 'daily_norm_body', 'daily_c2c_return'], + 'code': '''session = factors['session_momentum_diff'] +body = factors['daily_norm_body'] +c2c = factors['daily_c2c_return'] + +w = 15 +sess_z = (session - session.rolling(w).mean()) / (session.rolling(w).std() + 1e-8) +body_z = (body - body.rolling(w).mean()) / (body.rolling(w).std() + 1e-8) +c2c_z = (c2c - c2c.rolling(w).mean()) / (c2c.rolling(w).std() + 1e-8) + +composite = (0.5 * sess_z + 0.3 * body_z + 0.2 * c2c_z).fillna(0) +signal = pd.Series(0, index=close.index, name='signal') +signal[composite > 0.4] = 1 +signal[composite < -0.4] = -1 +signal = signal.fillna(0).astype(int)''', + }, + { + 'name': 'MomentumContinuation', + 'factors': ['daily_mom', 'daily_ret_1d', 'momentum_1d'], + 'code': '''mom = factors['daily_mom'] +ret = factors['daily_ret_1d'] +mom2 = factors['momentum_1d'] + +w = 12 +mom_z = (mom - mom.rolling(w).mean()) / (mom.rolling(w).std() + 1e-8) +ret_z = (ret - ret.rolling(w).mean()) / (ret.rolling(w).std() + 1e-8) +mom2_z = (mom2 - mom2.rolling(w).mean()) / (mom2.rolling(w).std() + 1e-8) + +composite = (0.4 * mom_z + 0.3 * ret_z + 0.3 * mom2_z).fillna(0) +signal = pd.Series(0, index=close.index, name='signal') +signal[composite > 0.2] = 1 +signal[composite < -0.2] = -1 +signal = signal.fillna(0).astype(int)''', + }, + { + 'name': 'HighFreqScalper', + 'factors': ['daily_close_return_96', 'DCP', 'london_mom'], + 'code': '''close_ret = factors['daily_close_return_96'] +dcp = factors['DCP'] +london = factors['london_mom'] + +w = 10 +cr_z = (close_ret - close_ret.rolling(w).mean()) / (close_ret.rolling(w).std() + 1e-8) +dcp_z = (dcp - dcp.rolling(w).mean()) / (dcp.rolling(w).std() + 1e-8) +lon_z = (london - london.rolling(w).mean()) / (london.rolling(w).std() + 1e-8) + +composite = (0.4 * cr_z + 0.3 * dcp_z + 0.3 * lon_z).fillna(0) +signal = pd.Series(0, index=close.index, name='signal') +signal[composite > 0.25] = 1 +signal[composite < -0.25] = -1 +signal = signal.fillna(0).astype(int)''', + }, + { + 'name': 'AdaptiveMomentumMR', + 'factors': ['daily_close_return_96', 'daily_session_momentum_divergence_1d', 'daily_ols_slope_96'], + 'code': '''mom = factors['daily_close_return_96'] +div = factors['daily_session_momentum_divergence_1d'] +slope = factors['daily_ols_slope_96'] + +w = 20 +mom_z = (mom - mom.rolling(w).mean()) / (mom.rolling(w).std() + 1e-8) +div_z = (div - div.rolling(w).mean()) / (div.rolling(w).std() + 1e-8) +slope_z = (slope - slope.rolling(w).mean()) / (slope.rolling(w).std() + 1e-8) + +# Regime detection: high momentum = trend, low = mean reversion +regime = (mom_z.abs() > 1.0).astype(float) +composite = (regime * mom_z + (1 - regime) * (-div_z) + 0.3 * slope_z).fillna(0) +signal = pd.Series(0, index=close.index, name='signal') +signal[composite > 0.4] = 1 +signal[composite < -0.4] = -1 +signal = signal.fillna(0).astype(int)''', + }, + { + 'name': 'TrendPullbackScalp', + 'factors': ['daily_close_return_96', 'daily_session_momentum_divergence_1d', 'daily_norm_body'], + 'code': '''mom = factors['daily_close_return_96'] +div = factors['daily_session_momentum_divergence_1d'] +body = factors['daily_norm_body'] + +w = 15 +mom_z = (mom - mom.rolling(w).mean()) / (mom.rolling(w).std() + 1e-8) +div_z = (div - div.rolling(w).mean()) / (div.rolling(w).std() + 1e-8) +body_z = (body - body.rolling(w).mean()) / (body.rolling(w).std() + 1e-8) + +# Enter on pullbacks (divergence against trend) +composite = (mom_z - 0.5 * div_z * mom_z.sign() + 0.2 * body_z).fillna(0) +signal = pd.Series(0, index=close.index, name='signal') +signal[composite > 0.35] = 1 +signal[composite < -0.35] = -1 +signal = signal.fillna(0).astype(int)''', + }, + { + 'name': 'IntradayMomentumBlend', + 'factors': ['daily_close_return_96', 'london_mom', 'daily_session_momentum_divergence_1d', 'DCP'], + 'code': '''mom = factors['daily_close_return_96'] +lon = factors['london_mom'] +div = factors['daily_session_momentum_divergence_1d'] +dcp = factors['DCP'] + +w = 20 +mom_z = (mom - mom.rolling(w).mean()) / (mom.rolling(w).std() + 1e-8) +lon_z = (lon - lon.rolling(w).mean()) / (lon.rolling(w).std() + 1e-8) +div_z = (div - div.rolling(w).mean()) / (div.rolling(w).std() + 1e-8) +dcp_z = (dcp - dcp.rolling(w).mean()) / (dcp.rolling(w).std() + 1e-8) + +composite = (0.3 * mom_z + 0.3 * lon_z - 0.2 * div_z + 0.2 * dcp_z).fillna(0) +signal = pd.Series(0, index=close.index, name='signal') +signal[composite > 0.3] = 1 +signal[composite < -0.3] = -1 +signal = signal.fillna(0).astype(int)''', + }, +] + +def load_factor_series(name): + """Load factor parquet and return as Series with correct index.""" + safe = name.replace('/','_').replace('\\','_')[:150] + pf = VALUE_FILES / f"{safe}.parquet" + if not pf.exists(): + return None + + df = pd.read_parquet(str(pf)) + + # Extract EURUSD + if df.index.names == ['datetime', 'instrument']: + df_reset = df.reset_index() + if 'instrument' in df_reset.columns: + df_eur = df_reset[df_reset['instrument'] == 'EURUSD'].copy() + df_eur = df_eur.set_index('datetime') + series = df_eur.iloc[:, -1] # Last column is the factor value + series.name = name + return series + + # If single index, just return first column + series = df.iloc[:, 0] + series.name = name + return series + +def main(n_strategies=5): + console.print("[bold cyan]🎯 Daytrading Strategy Generator (Quick Mode)[/bold cyan]\n") + console.print(" Style: 12-minute forward returns") + console.print(" Target: FTMO compliant (IC>0.02, Sharpe>0.5, Trades>20, DD>-10%)\n") + + # Load OHLCV data + if not OHLCV_PATH.exists(): + console.print(f"[red]✗ OHLCV data not found: {OHLCV_PATH}[/red]") + return + + ohlcv = pd.read_hdf(str(OHLCV_PATH), key='data') + + # Extract close prices with datetime-only index (not MultiIndex) + if '$close' in ohlcv.columns: + close = ohlcv['$close'].dropna() + elif 'close' in ohlcv.columns: + close = ohlcv['close'].dropna() + else: + close = ohlcv.select_dtypes(include=[np.number]).iloc[:, 0].dropna() + + # Extract datetime from MultiIndex if present + if isinstance(close.index, pd.MultiIndex): + close_dt_idx = close.index.get_level_values('datetime') + close_series = pd.Series(close.values, index=close_dt_idx, name='close') + else: + close_series = close + + close_series = close_series.dropna() + console.print(f"[green]✓[/green] Loaded {len(close_series):,} OHLCV bars") + + # Load all factor series and align to close index + all_factor_series = {} + for combo in DAYTRADING_COMBOS: + for factor_name in combo['factors']: + if factor_name in all_factor_series: + continue + + series = load_factor_series(factor_name) + if series is not None: + # Forward fill to match close frequency + series_ff = series.reindex(close_series.index).ffill() + all_factor_series[factor_name] = series_ff + + # Create factors DataFrame + df_factors = pd.DataFrame(all_factor_series) + df_factors = df_factors.dropna(how='all') + + console.print(f"[green]✓[/green] Loaded {len(df_factors.columns)} factor series") + console.print(f"[green]✓[/green] Aligned to {len(df_factors):,} bars\n") + + accepted = [] + + for i, combo in enumerate(DAYTRADING_COMBOS[:n_strategies]): + console.print(f"[{i+1}/{n_strategies}] Testing {combo['name']}...") + + # Build factor dataframe + valid_factors = [f for f in combo['factors'] if f in df_factors.columns] + if len(valid_factors) < 2: + console.print(f" ✗ Not enough valid factors") + continue + + strat_factors = df_factors[valid_factors].dropna() + + if len(strat_factors) < 1000: + console.print(f" ✗ Not enough data: {len(strat_factors)} bars") + continue + + # Build backtest script + forward_bars = 12 + strategy_code = combo['code'] + + script = f""" +import pandas as pd +import numpy as np +import json + +close = pd.read_pickle('close.pkl') # nosec +factors = pd.read_pickle('factors.pkl') # nosec + +# Execute strategy +try: +{chr(10).join(' ' + l for l in strategy_code.split(chr(10)))} +except Exception as e: + print(f"ERROR: {{e}}") + exit(1) + +if 'signal' not in dir(): + print("ERROR: No signal generated") + exit(1) + +signal = signal.fillna(0) + +# Align +common_idx = close.index.intersection(signal.index) +close = close.loc[common_idx] +signal = signal.loc[common_idx] + +# Forward returns (12-min horizon for daytrading) +FORWARD_BARS = {forward_bars} +returns_fwd = close.pct_change(FORWARD_BARS).shift(-FORWARD_BARS) +signal_aligned = signal.loc[returns_fwd.dropna().index] +fwd_returns = returns_fwd.loc[signal_aligned.index] + +if len(signal_aligned) < 100 or len(fwd_returns) < 100: + print("ERROR: Not enough data") + exit(1) + +# Metrics +ic = signal_aligned.corr(fwd_returns) +strategy_returns = signal_aligned * fwd_returns +sharpe = strategy_returns.mean() / strategy_returns.std() * np.sqrt(252 * 1440 / {forward_bars}) if strategy_returns.std() > 0 else 0 + +cum = (1 + strategy_returns).cumprod() +running_max = cum.expanding().max() +drawdown = (cum - running_max) / running_max.replace(0, np.nan) +max_dd = drawdown.min() if len(drawdown) > 0 else 0 + +win_rate = (strategy_returns > 0).sum() / len(strategy_returns) if len(strategy_returns) > 0 else 0 +n_trades = int((signal_aligned != signal_aligned.shift(1)).sum()) +total_return = cum.iloc[-1] - 1 +n_bars = len(strategy_returns) +n_months = n_bars / (252 * 1440 / {forward_bars} / 12) if n_bars > 0 else 1 +monthly_return = (1 + total_return) ** (1 / n_months) - 1 if n_months > 0 and (1 + total_return) > 0 else total_return + +result = {{ + "status": "success", + "sharpe": float(sharpe), + "max_drawdown": float(max_dd) if not np.isnan(max_dd) else -0.20, + "win_rate": float(win_rate), + "ic": float(ic) if not np.isnan(ic) else 0, + "n_trades": n_trades, + "total_return": float(total_return), + "monthly_return_pct": float(monthly_return * 100), + "n_bars": int(n_bars), + "n_months": float(n_months), + "signal_long": int((signal_aligned == 1).sum()), + "signal_short": int((signal_aligned == -1).sum()), + "signal_neutral": int((signal_aligned == 0).sum()), +}} + +print(json.dumps(result)) +""" + + # Run backtest + import tempfile + with tempfile.TemporaryDirectory() as td: + tdp = Path(td) + strat_close = close_series.loc[strat_factors.index] + strat_close.to_pickle(str(tdp / 'close.pkl')) # nosec + strat_factors.to_pickle(str(tdp / 'factors.pkl')) # nosec + + script_path = tdp / 'run.py' + script_path.write_text(script) + + try: + result_proc = subprocess.run( # nosec B603 + [sys.executable, str(script_path)], + capture_output=True, text=True, timeout=60, + cwd=str(tdp) + ) + + if result_proc.returncode != 0: + console.print(f" ✗ Failed: {result_proc.stderr[:200]}") + continue + + result = None + for line in result_proc.stdout.strip().split('\n'): + try: + result = json.loads(line) + break + except: + continue + + if not result or result.get('status') != 'success': + console.print(f" ✗ Invalid result") + continue + + except subprocess.TimeoutExpired: # nosec + console.print(f" ✗ Timeout") + continue + except Exception as e: + console.print(f" ✗ Error: {e}") + continue + + ic = result.get('ic', 0) + sharpe = result.get('sharpe', 0) + trades = result.get('n_trades', 0) + dd = result.get('max_drawdown', 0) + + # FTMO criteria + if abs(ic) > 0.02 and sharpe > 0.5 and trades > 20 and dd > -0.10: + strategy = { + 'strategy_name': combo['name'], + 'factor_names': combo['factors'], + 'description': f"Daytrading strategy combining {', '.join(combo['factors'])}", + 'code': combo['code'], + 'real_backtest': result, + 'metrics': result, + 'summary': { + 'sharpe': sharpe, + 'max_drawdown': dd, + 'win_rate': result.get('win_rate', 0), + 'monthly_return_pct': result.get('monthly_return_pct', 0), + 'real_ic': ic, + 'real_n_trades': trades, + 'forward_bars': 12, + 'trading_style': 'daytrading', + } + } + + fname = f"{int(time.time())}_{combo['name']}.json" + with open(STRATEGIES_DIR / fname, 'w') as f: + json.dump(strategy, f, indent=2, ensure_ascii=False) + + accepted.append(strategy) + console.print(f" ✓ [green]ACCEPT[/green]: IC={ic:.4f}, Sharpe={sharpe:.2f}, Trades={trades}, DD={dd:.1%}") + else: + console.print(f" ✗ [red]REJECT[/red]: IC={ic:.4f}, Sharpe={sharpe:.2f}, Trades={trades}, DD={dd:.1%}") + + console.print(f"\n[bold green]✓ {len(accepted)}/{n_strategies} strategies accepted[/bold green]\n") + + if accepted: + console.print("[bold]Results:[/bold]") + for s in accepted: + bt = s['real_backtest'] + console.print(f" • {s['strategy_name']:30s} IC={bt['ic']:.4f} Sharpe={bt['sharpe']:.2f} " + f"Monthly={bt['monthly_return_pct']:.2f}% Trades={bt['n_trades']}") + +if __name__ == '__main__': + import sys + n = int(sys.argv[1]) if len(sys.argv) > 1 else 5 + main(n) diff --git a/scripts/nexquant_rebacktest_one.py b/scripts/nexquant_rebacktest_one.py new file mode 100644 index 00000000..4f25c198 --- /dev/null +++ b/scripts/nexquant_rebacktest_one.py @@ -0,0 +1,111 @@ +#!/usr/bin/env python +"""One strategy runner — standalone, called from parent script.""" +import json, sys, pandas as pd, subprocess, tempfile, numpy as np +from pathlib import Path + +sys.path.insert(0, str(Path(__file__).resolve().parent.parent)) +from rdagent.components.backtesting.vbt_backtest import backtest_signal + +if len(sys.argv) < 2: + print("Usage: python nexquant_rebacktest_one.py ") + sys.exit(1) + +strat_path = Path(sys.argv[1]) +data = json.loads(strat_path.read_text()) + +OHLCV = Path("git_ignore_folder/factor_implementation_source_data/intraday_pv.h5") +FACTORS_DIR = Path("results/factors/values") + +fmap = {p.stem: str(p) for p in FACTORS_DIR.glob("*.parquet")} + +names = data.get("factor_names", []) +code = data.get("code", "") +name = data.get("strategy_name", strat_path.stem) + +if not names or not code: + print(json.dumps({"status": "skipped", "reason": "no factors/code"})) + sys.exit(0) + +# Load close +ohlcv = pd.read_hdf(str(OHLCV), key="data") +close = ohlcv["$close"].dropna() +if isinstance(close.index, pd.MultiIndex): + close = close.droplevel(-1) +close = close.astype(float).sort_index() + +# Load factors +series = {} +for fn in names: + fp = fmap.get(fn) or fmap.get(fn.replace("/", "_")[:150]) + if fp: + try: + s = pd.read_parquet(fp).iloc[:, 0] + series[fn] = s + except Exception: + pass + +if len(series) < 2: + print(json.dumps({"status": "skipped", "reason": f"only {len(series)} factors loaded"})) + sys.exit(0) + +df = pd.DataFrame(series).sort_index() +if isinstance(df.index, pd.MultiIndex): + df = df.droplevel(-1) + +df_1m = df.reindex(close.index).ffill() +valid = df_1m.notna().any(axis=1) +if valid.sum() < 1000: + print(json.dumps({"status": "skipped", "reason": f"only {valid.sum()} valid bars"})) + sys.exit(0) + +ca = close.loc[valid] +fa = df_1m.loc[valid] + +# Execute +try: + with tempfile.TemporaryDirectory() as td: + tdp = Path(td) + fa.to_parquet(str(tdp / "factors.parquet")) + ca.to_pickle(str(tdp / "close.pkl")) + exec_script = ( + "import sys, os\n" + "sys.stdout = open(os.devnull, 'w')\n" + "sys.stderr = open(os.devnull, 'w')\n" + "import pandas as pd, numpy as np\n" + "factors = pd.read_parquet('factors.parquet')\n" + "close = pd.read_pickle('close.pkl')\n" + "df = factors\n" + + code + + "\nif 'signal' not in dir():\n" + " raise SystemExit(1)\n" + "pd.Series(signal).fillna(0).to_pickle('signal.pkl')\n" + ) + (tdp / "run.py").write_text(exec_script) + r = subprocess.run( + ["python", "run.py"], + capture_output=True, text=True, timeout=60, cwd=str(tdp), + stdin=subprocess.DEVNULL, + ) + if r.returncode != 0: + print(json.dumps({"status": "code_failed", "stderr": r.stderr[:500]})) + sys.exit(1) + sig = pd.read_pickle(tdp / "signal.pkl") +except Exception as e: + print(json.dumps({"status": "code_failed", "error": str(e)[:500]})) + sys.exit(1) + +sig = sig.reindex(ca.index).ffill().fillna(0) +result = backtest_signal(ca, sig, txn_cost_bps=2.14) + +# Return result as JSON +output = { + "status": "ok", + "sharpe": result.get("sharpe"), + "max_drawdown": result.get("max_drawdown"), + "win_rate": result.get("win_rate"), + "n_trades": result.get("n_trades"), + "total_return": result.get("total_return"), + "monthly_return_pct": result.get("monthly_return_pct"), + "annualized_return": result.get("annualized_return"), +} +print(json.dumps(output)) diff --git a/scripts/nexquant_rebacktest_parent.py b/scripts/nexquant_rebacktest_parent.py new file mode 100644 index 00000000..79fe4e31 --- /dev/null +++ b/scripts/nexquant_rebacktest_parent.py @@ -0,0 +1,75 @@ +#!/usr/bin/env python +"""Parent orchestrator: calls nexquant_rebacktest_one.py for each strategy.""" +import json, subprocess, sys +from pathlib import Path +from datetime import datetime + +STRAT_DIR = Path("results/strategies_new") + +# Build work list +work = [] +for f in sorted(STRAT_DIR.glob("*.json")): + if "verified_v2" in f.read_text(): + continue + try: + d = json.loads(f.read_text()) + except Exception: + continue + if d.get("factor_names") and d.get("code"): + work.append(f) + +print(f"{len(work)} strategies to re-backtest", flush=True) + +ok = skip = fail = 0 +start = datetime.now() + +for i, f in enumerate(work): + name = f.stem[:45] + print(f"[{i+1}/{len(work)}] {name} ...", end=" ", flush=True) + try: + r = subprocess.run( + ["timeout", "-s", "KILL", "90", "python", "scripts/nexquant_rebacktest_one.py", str(f)], + capture_output=True, text=True, timeout=120, + stdin=subprocess.DEVNULL, + ) + result = json.loads(r.stdout.strip() or "{}") + except subprocess.TimeoutExpired: + print("TIMEOUT", flush=True) + fail += 1 + continue + except Exception as e: + print(f"ERROR: {e}", flush=True) + fail += 1 + continue + + if result.get("status") == "ok": + data = json.loads(f.read_text()) + data["reevaluation_status"] = "verified_v2" + data["sharpe_ratio"] = result.get("sharpe") + data["max_drawdown"] = result.get("max_drawdown") + data["win_rate"] = result.get("win_rate") + data["total_return"] = result.get("total_return") + data["summary"] = { + **data.get("summary", {}), + "sharpe": result.get("sharpe"), + "max_drawdown": result.get("max_drawdown"), + "win_rate": result.get("win_rate"), + "monthly_return_pct": result.get("monthly_return_pct"), + "real_n_trades": result.get("n_trades"), + "total_return": result.get("total_return"), + "annualized_return": result.get("annualized_return"), + "engine": "verified_v2", + "txn_cost_bps": 2.14, + } + f.write_text(json.dumps(data, indent=2, ensure_ascii=False)) + ok += 1 + print(f"S={result['sharpe']:.1f} DD={result['max_drawdown']:.2%} WR={result['win_rate']:.1%} T={result['n_trades']}", flush=True) + elif result.get("status") == "skipped": + skip += 1 + print(f"SKIP: {result.get('reason', '?')}", flush=True) + else: + fail += 1 + print(f"FAIL: {result.get('stderr', result.get('error', '?'))[:100]}", flush=True) + +elapsed = (datetime.now() - start).total_seconds() +print(f"\nDONE: ok={ok} skip={skip} fail={fail} in {elapsed:.0f}s", flush=True) diff --git a/scripts/predix_rebacktest_strategies.py b/scripts/nexquant_rebacktest_strategies.py similarity index 98% rename from scripts/predix_rebacktest_strategies.py rename to scripts/nexquant_rebacktest_strategies.py index ac9e91e3..9c75cf2f 100644 --- a/scripts/predix_rebacktest_strategies.py +++ b/scripts/nexquant_rebacktest_strategies.py @@ -116,8 +116,8 @@ except Exception as e: "n_short":int((sig==-1).sum()), "n_neutral":int((sig==0).sum())} def main(count=None): - sdir = Path('/home/nico/Predix/results/strategies') - vdir = Path('/home/nico/Predix/results/factors/values') + sdir = Path('/home/nico/NexQuant/results/strategies') + vdir = Path('/home/nico/NexQuant/results/factors/values') files = [] for f in sorted(sdir.glob('*.json'), reverse=True): diff --git a/scripts/predix_rebacktest_unified.py b/scripts/nexquant_rebacktest_unified.py similarity index 97% rename from scripts/predix_rebacktest_unified.py rename to scripts/nexquant_rebacktest_unified.py index 7a7f62b4..13af6060 100644 --- a/scripts/predix_rebacktest_unified.py +++ b/scripts/nexquant_rebacktest_unified.py @@ -13,9 +13,9 @@ For every strategy JSON in results/strategies_new (or a user-supplied dir): Does NOT mutate the strategy JSON files — read-only comparison. Usage: - python scripts/predix_rebacktest_unified.py # all strategies - python scripts/predix_rebacktest_unified.py 50 # first 50 - python scripts/predix_rebacktest_unified.py 50 --csv report.csv + python scripts/nexquant_rebacktest_unified.py # all strategies + python scripts/nexquant_rebacktest_unified.py 50 # first 50 + python scripts/nexquant_rebacktest_unified.py 50 --csv report.csv """ from __future__ import annotations @@ -38,9 +38,9 @@ from rich.progress import BarColumn, Progress, SpinnerColumn, TextColumn, TimeEl sys.path.insert(0, str(Path(__file__).resolve().parent.parent)) from rdagent.components.backtesting.vbt_backtest import backtest_signal_ftmo # noqa: E402 -OHLCV_PATH = Path("/home/nico/Predix/git_ignore_folder/factor_implementation_source_data/intraday_pv.h5") -FACTORS_VALUES_DIR = Path("/home/nico/Predix/results/factors/values") -STRATEGIES_DIR = Path("/home/nico/Predix/results/strategies_new") +OHLCV_PATH = Path("/home/nico/NexQuant/git_ignore_folder/factor_implementation_source_data/intraday_pv.h5") +FACTORS_VALUES_DIR = Path("/home/nico/NexQuant/results/factors/values") +STRATEGIES_DIR = Path("/home/nico/NexQuant/results/strategies_new") # ── Logging setup: everything printed goes to log file + stdout ─────────────── _LOG_DIR = Path(__file__).resolve().parent.parent / "git_ignore_folder" / "logs" diff --git a/scripts/predix_simple_eval.py b/scripts/nexquant_simple_eval.py similarity index 97% rename from scripts/predix_simple_eval.py rename to scripts/nexquant_simple_eval.py index 0437abd1..aff1f8e4 100644 --- a/scripts/predix_simple_eval.py +++ b/scripts/nexquant_simple_eval.py @@ -1,13 +1,13 @@ """ -Predix Simple Factor Evaluator - Direct IC/Sharpe computation. +NexQuant Simple Factor Evaluator - Direct IC/Sharpe computation. Evaluates existing factor results by computing IC and Sharpe directly from factor values and forward returns, without Qlib infrastructure. Usage: - python predix_simple_eval.py --top 100 # Evaluate top 100 factors - python predix_simple_eval.py --all # Evaluate all - python predix_simple_eval.py --parallel 4 # 4 parallel workers + python nexquant_simple_eval.py --top 100 # Evaluate top 100 factors + python nexquant_simple_eval.py --all # Evaluate all + python nexquant_simple_eval.py --parallel 4 # 4 parallel workers """ import json @@ -421,7 +421,7 @@ def main( ) -> None: """Main entry point.""" console.print(Panel( - "[bold cyan]Predix Simple Factor Evaluator[/bold cyan]\n" + "[bold cyan]NexQuant Simple Factor Evaluator[/bold cyan]\n" f"Scanning workspaces for generated factors...", border_style="cyan", )) @@ -467,7 +467,7 @@ if __name__ == "__main__": import argparse parser = argparse.ArgumentParser( - description="Predix Simple Factor Evaluator - Direct IC/Sharpe computation" + description="NexQuant Simple Factor Evaluator - Direct IC/Sharpe computation" ) parser.add_argument( "--top", "-n", diff --git a/scripts/nexquant_smart_strategy_gen.py b/scripts/nexquant_smart_strategy_gen.py new file mode 100644 index 00000000..e6f534f7 --- /dev/null +++ b/scripts/nexquant_smart_strategy_gen.py @@ -0,0 +1,1734 @@ +#!/usr/bin/env python +""" +Smart Strategy Generation with Feedback Loop, Parameter Optimization & FTMO Risk Management. + +Generates EUR/USD daytrading strategies using LLM with: +- Adaptive feedback loop (IC, trades, drawdown-based suggestions) +- Grid search for optimal parameters (thresholds, SL/TP, trailing stops) +- Mandatory FTMO-compliant risk management layer +- Comprehensive evaluation metrics # nosec + +Usage: + python nexquant_smart_strategy_gen.py 10 + python nexquant_smart_strategy_gen.py 5 --style daytrading + python nexquant_smart_strategy_gen.py 20 --style swing --max-attempts 200 +""" +import os, sys, json, time, math, random, logging, warnings, subprocess # nosec +from pathlib import Path +from datetime import datetime +from itertools import product +from typing import Dict, List, Optional, Tuple, Any + +import numpy as np +import pandas as pd +from rich.console import Console +from rich.progress import Progress, SpinnerColumn, TextColumn, BarColumn, TimeElapsedColumn +from rich.table import Table +from rich.logging import RichHandler +from dotenv import load_dotenv + +warnings.filterwarnings('ignore') + +# ============================================================================ +# Configuration & Constants +# ============================================================================ +OHLCV_PATH = Path('/home/nico/NexQuant/git_ignore_folder/factor_implementation_source_data/intraday_pv.h5') +FACTORS_DIR = Path('/home/nico/NexQuant/results/factors') +STRATEGIES_DIR = Path('/home/nico/NexQuant/results/strategies_new') +STRATEGIES_DIR.mkdir(parents=True, exist_ok=True) + +# Logging setup +LOG_DIR = Path('/home/nico/NexQuant/results/logs') +LOG_DIR.mkdir(parents=True, exist_ok=True) +log_file = LOG_DIR / f"smart_strategy_gen_{datetime.now().strftime('%Y%m%d_%H%M%S')}.log" + +logging.basicConfig( + level=logging.INFO, + format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', + handlers=[ + logging.FileHandler(log_file), + RichHandler(rich_tracebacks=True, show_time=False, show_path=False) + ] +) +logger = logging.getLogger('SmartStrategyGen') + +console = Console() + +# ============================================================================ +# FTMO Risk Management Constants +# ============================================================================ +class FTMORiskLimits: + """FTMO-compliant risk management constants.""" + MAX_DAILY_LOSS_PCT = 0.05 # 5% max daily loss (FTMO rule) + MAX_PER_TRADE_LOSS_PCT = 0.02 # 2% max per trade + MAX_TOTAL_DRAWDOWN = 0.10 # 10% max overall drawdown + MAX_POSITIONS = 1 # Only 1 position at a time + MIN_RISK_REWARD_RATIO = 2.0 # TP must be at least 2x SL + POSITION_RISK_PCT = 0.01 # 1% risk per trade + +# ============================================================================ +# Acceptance Criteria +# ============================================================================ +ACCEPTANCE_CRITERIA = { + 'daytrading': { + 'min_abs_ic': 0.02, + 'min_sharpe': 1.0, + 'min_trades': 50, + 'max_drawdown': -0.15, + 'min_win_rate': 0.45, + 'min_monthly_return': 0.01, + 'max_daily_loss': 0.05, + }, + 'daytrading': { + 'min_abs_ic': 0.02, + 'min_sharpe': 0.5, + 'min_trades': 10, + 'max_drawdown': -0.15, + 'min_win_rate': 0.40, + 'min_monthly_return': 0.01, + 'max_daily_loss': 0.05, + } +} + +# ============================================================================ +# Parameter Grid for Optimization +# ============================================================================ +PARAMETER_GRID = { + 'threshold_entry': [0.2, 0.3, 0.4, 0.5], + 'rolling_window': [10, 20, 30, 60], + 'stop_loss': [0.01, 0.015, 0.02], # 1%, 1.5%, 2% (HARD MAX: 2% for FTMO) + 'take_profit': [0.02, 0.03, 0.04, 0.06], # 2x-3x SL + 'trailing_stop': [0.01, 0.015], # 1%, 1.5% after profit threshold + 'trailing_activation': [0.015, 0.02], # Activate trail after 1.5%, 2% profit +} + +# ============================================================================ +# Data Loading (Cached) +# ============================================================================ +class DataCache: + """Thread-safe data cache for OHLCV and factors.""" + + def __init__(self): + self._ohlcv_cache: Optional[pd.Series] = None + self._factors_cache: Optional[List[Dict]] = None + self._factor_data_cache: Dict[str, pd.Series] = {} + + def load_ohlcv(self) -> pd.Series: + """Load OHLCV close prices from HDF5.""" + if self._ohlcv_cache is not None: + return self._ohlcv_cache + + if not OHLCV_PATH.exists(): + raise FileNotFoundError(f"OHLCV data not found: {OHLCV_PATH}") + + ohlcv = pd.read_hdf(str(OHLCV_PATH), key='data') + close_col = '$close' if '$close' in ohlcv.columns else 'close' if 'close' in ohlcv.columns else ohlcv.select_dtypes(include=[np.number]).columns[0] + close = ohlcv[close_col].dropna() + + # Limit to last 200k bars to avoid OOM during optimization + # (372k bars × 15 combinations = too much memory) + MAX_BARS = 200000 + if len(close) > MAX_BARS: + close = close.iloc[-MAX_BARS:] + logger.info(f"Trimmed OHLCV data to last {MAX_BARS:,} bars (from {len(ohlcv[close_col]):,})") + + self._ohlcv_cache = close + logger.info(f"Loaded {len(close):,} OHLCV bars") + return close + + def load_top_factors(self, top_n: int = 20) -> List[Dict]: + """Load top factors by IC that have parquet files.""" + if self._factors_cache is not None: + return self._factors_cache[:top_n] + + factors = [] + for f in FACTORS_DIR.glob('*.json'): + try: + data = json.load(open(f)) + fname = data.get('factor_name', '') + ic = data.get('ic') or 0 + safe = fname.replace('/', '_').replace('\\', '_')[:150] + if (FACTORS_DIR / 'values' / f"{safe}.parquet").exists(): + factors.append({'name': fname, 'ic': ic}) + except Exception as e: + logger.debug(f"Failed to load factor metadata: {f.name} - {e}") + + factors.sort(key=lambda x: abs(x['ic']), reverse=True) + self._factors_cache = factors + return factors[:top_n] + + def load_factor_timeseries(self, factor_name: str) -> Optional[pd.Series]: + """Load factor time-series from parquet.""" + if factor_name in self._factor_data_cache: + return self._factor_data_cache[factor_name] + + safe = factor_name.replace('/', '_').replace('\\', '_')[:150] + pf = FACTORS_DIR / 'values' / f"{safe}.parquet" + + if not pf.exists(): + return None + + try: + series = pd.read_parquet(str(pf)).iloc[:, 0] + self._factor_data_cache[factor_name] = series + return series + except Exception as e: + logger.debug(f"Failed to load factor data: {factor_name} - {e}") + return None + +data_cache = DataCache() + +# ============================================================================ +# LLM Setup +# ============================================================================ +def setup_llm_env(): + """Setup LLM environment variables with fallback chain.""" + load_dotenv(Path(__file__).parent / '.env', override=True) + + # Priority 1: OpenRouter (free models with fallback) + router_key = os.getenv('OPENROUTER_API_KEY', '') + if router_key and router_key != 'local': + # Build model fallback chain + models = [ + os.getenv('OPENROUTER_MODEL', ''), + os.getenv('OPENROUTER_MODEL_2', ''), + os.getenv('OPENROUTER_MODEL_3', ''), + ] + models = [m for m in models if m] # Remove empty + + if models: + os.environ['OPENAI_API_KEY'] = router_key + os.environ['OPENAI_API_BASE'] = 'https://openrouter.ai/api/v1' + os.environ['OPENROUTER_MODELS'] = json.dumps(models) # Store for fallback + os.environ['CHAT_MODEL'] = models[0] + logger.info(f"LLM environment configured for OpenRouter: {', '.join(models)}") + return + + # Priority 2: Local LLM (llama.cpp) + api_key = os.getenv('OPENAI_API_KEY', '') + api_base = os.getenv('OPENAI_API_BASE', '') + chat_model = os.getenv('CHAT_MODEL', '') + + if api_key == 'local' and api_base: + os.environ['OPENAI_API_KEY'] = 'local' + os.environ['OPENAI_API_BASE'] = api_base + os.environ['CHAT_MODEL'] = chat_model or 'openai/qwen3.5-35b' + logger.info(f"LLM environment configured for LOCAL LLM: {api_base}") + else: + logger.warning("No API key found - LLM generation will fail") + +# ============================================================================ +# Risk Management Engine +# ============================================================================ +class RiskManagementEngine: + """ + FTMO-compliant risk management layer. + + Applies stop loss, take profit, trailing stop, and daily loss limits + to strategy returns. + """ + + def __init__( + self, + stop_loss: float = 0.02, + take_profit: float = 0.04, + trailing_stop: float = 0.015, + trailing_activation: float = 0.02, + max_daily_loss: float = 0.05, + max_positions: int = 1, + ): + """ + Initialize risk management parameters. + + Parameters + ---------- + stop_loss : float + Stop loss percentage (default 2%) + take_profit : float + Take profit percentage (default 4%, 2x SL) + trailing_stop : float + Trailing stop distance (default 1.5%) + trailing_activation : float + Profit level to activate trailing stop (default 2%) + max_daily_loss : float + Maximum daily loss percentage (default 5%) + max_positions : int + Maximum concurrent positions (default 1) + """ + # Validate FTMO compliance + if stop_loss > 0.02: + raise ValueError(f"Stop loss {stop_loss:.2%} exceeds FTMO max of 2%") + if take_profit < stop_loss * 2: + raise ValueError(f"Take profit {take_profit:.2%} must be at least 2x SL ({stop_loss*2:.2%})") + if max_daily_loss > 0.05: + raise ValueError(f"Daily loss {max_daily_loss:.2%} exceeds FTMO max of 5%") + + self.stop_loss = stop_loss + self.take_profit = take_profit + self.trailing_stop = trailing_stop + self.trailing_activation = trailing_activation + self.max_daily_loss = max_daily_loss + self.max_positions = max_positions + + @property + def risk_reward_ratio(self) -> float: + """Calculate risk/reward ratio (TP/SL).""" + return self.take_profit / self.stop_loss if self.stop_loss > 0 else 0.0 + + def apply_risk_management( + self, + signal: pd.Series, + close: pd.Series, + ) -> pd.Series: + """ + Apply SL/TP/Trailing stop to signal-based strategy. + + Parameters + ---------- + signal : pd.Series + Trading signals (1=LONG, -1=SHORT, 0=NEUTRAL) + close : pd.Series + Close prices + + Returns + ------- + pd.Series + Strategy returns after risk management + """ + if len(signal) == 0 or len(close) == 0: + return pd.Series(dtype=float) + + # Align indices + common_idx = signal.index.intersection(close.index) + signal = signal.loc[common_idx].fillna(0) + close = close.loc[common_idx] + + # Calculate returns + returns = close.pct_change().fillna(0) + strategy_returns = pd.Series(0.0, index=common_idx) + + position = 0 # 0=neutral, 1=long, -1=short + entry_price = 0.0 + highest_profit = 0.0 + daily_pnl = 0.0 + current_date = None + + for i, idx in enumerate(common_idx): + if i == 0: + continue + + # Track daily PnL for max daily loss + bar_date = idx.date() if hasattr(idx, 'date') else idx + if current_date is None: + current_date = bar_date + elif bar_date != current_date: + daily_pnl = 0.0 # Reset daily PnL + current_date = bar_date + + current_price = close.iloc[i] + prev_price = close.iloc[i - 1] + current_signal = signal.iloc[i] + + # Check if we should exit position due to SL/TP/Trailing + if position != 0: + pnl_pct = 0.0 + if position == 1: # Long + pnl_pct = (current_price - entry_price) / entry_price + elif position == -1: # Short + pnl_pct = (entry_price - current_price) / entry_price + + # Stop Loss hit + if pnl_pct <= -self.stop_loss: + strategy_returns.iloc[i] = -self.stop_loss * position + daily_pnl += -self.stop_loss + position = 0 + highest_profit = 0.0 + continue + + # Take Profit hit + if pnl_pct >= self.take_profit: + strategy_returns.iloc[i] = self.take_profit * position + daily_pnl += self.take_profit + position = 0 + highest_profit = 0.0 + continue + + # Trailing Stop (activate after profit threshold) + if pnl_pct >= self.trailing_activation: + highest_profit = max(highest_profit, pnl_pct) + if (highest_profit - pnl_pct) >= self.trailing_stop: + strategy_returns.iloc[i] = pnl_pct * position + daily_pnl += pnl_pct + position = 0 + highest_profit = 0.0 + continue + + # Normal position PnL + if position == 1: + strategy_returns.iloc[i] = (current_price - prev_price) / prev_price + elif position == -1: + strategy_returns.iloc[i] = -(current_price - prev_price) / prev_price + + # Update daily PnL + daily_pnl += strategy_returns.iloc[i] + + # Check max daily loss + if daily_pnl <= -self.max_daily_loss: + strategy_returns.iloc[i] = strategy_returns.iloc[i] # Keep the loss + position = 0 # Stop trading for the day + highest_profit = 0.0 + continue + + # Enter new position (only if neutral and max positions not exceeded) + if position == 0 and current_signal != 0: + position = int(np.sign(current_signal)) + entry_price = current_price + highest_profit = 0.0 + + return strategy_returns + + def get_config(self) -> Dict[str, float]: + """Return risk management configuration.""" + return { + 'stop_loss': self.stop_loss, + 'take_profit': self.take_profit, + 'trailing_stop': self.trailing_stop, + 'trailing_activation': self.trailing_activation, + 'max_daily_loss': self.max_daily_loss, + 'max_positions': self.max_positions, + 'risk_reward_ratio': self.take_profit / self.stop_loss, + } + +# ============================================================================ +# Strategy Evaluator +# ============================================================================ +class StrategyEvaluator: + """ + Comprehensive strategy evaluation with FTMO metrics. # nosec + """ + + def __init__(self, trading_style: str = 'daytrading', forward_bars: int = 96): + self.trading_style = trading_style + self.forward_bars = forward_bars + self.criteria = ACCEPTANCE_CRITERIA.get(trading_style, ACCEPTANCE_CRITERIA['daytrading']) + + def evaluate( # nosec + self, + signal: pd.Series, + close: pd.Series, + strategy_returns: pd.Series, + ) -> Dict[str, Any]: + """ + Evaluate strategy with comprehensive metrics. + + Parameters + ---------- + signal : pd.Series + Trading signals + close : pd.Series + Close prices + strategy_returns : pd.Series + Strategy returns after risk management + + Returns + ------- + dict + Evaluation metrics dict + """ + if len(strategy_returns) < 10: + return {'status': 'failed', 'reason': 'Insufficient data'} + + # Forward returns for IC calculation + fwd_returns = close.pct_change(self.forward_bars).shift(-self.forward_bars) + common_idx = signal.index.intersection(fwd_returns.dropna().index) + + if len(common_idx) < 10: + return {'status': 'failed', 'reason': 'Insufficient overlapping data'} + + signal_aligned = signal.loc[common_idx] + fwd_aligned = fwd_returns.loc[common_idx] + + # IC (Information Coefficient) + ic = signal_aligned.corr(fwd_aligned) if signal_aligned.std() > 0 else 0.0 + + # Basic metrics + total_bars = len(strategy_returns) + n_signals = int((signal != signal.shift(1)).sum()) + n_long = int((signal == 1).sum()) + n_short = int((signal == -1).sum()) + n_neutral = int((signal == 0).sum()) + + # Returns metrics + cum_returns = (1 + strategy_returns).cumprod() + total_return = cum_returns.iloc[-1] - 1 if len(cum_returns) > 0 else 0.0 + + # Annualization factor (assuming 252 trading days, 1440 minutes per day) + bars_per_year = 252 * 1440 / self.forward_bars + n_months = total_bars / (bars_per_year / 12) if total_bars > 0 else 1 + + if n_months > 0 and (1 + total_return) > 0: + monthly_return = (1 + total_return) ** (1 / n_months) - 1 + annual_return = (1 + total_return) ** (12 / n_months) - 1 + else: + monthly_return = total_return + annual_return = total_return * 12 + + # Sharpe Ratio + if strategy_returns.std() > 0: + sharpe = strategy_returns.mean() / strategy_returns.std() * np.sqrt(bars_per_year) + else: + sharpe = 0.0 + + # Max Drawdown + running_max = cum_returns.expanding().max() + drawdown = (cum_returns - running_max) / running_max.replace(0, np.nan) + max_drawdown = drawdown.min() if len(drawdown) > 0 else 0.0 + + # Win Rate + active_returns = strategy_returns[strategy_returns != 0] + win_rate = (active_returns > 0).sum() / len(active_returns) if len(active_returns) > 0 else 0.0 + + # Daily loss analysis (for FTMO compliance) + daily_returns = strategy_returns.groupby( + strategy_returns.index.date if hasattr(strategy_returns.index[0], 'date') else strategy_returns.index + ).sum() + max_daily_loss = abs(daily_returns.min()) if len(daily_returns) > 0 else 0.0 + + # Acceptance check + passed, failed_criteria = self._check_acceptance( + ic=ic if not np.isnan(ic) else 0, + sharpe=sharpe, + n_trades=n_signals, + max_drawdown=max_drawdown, + win_rate=win_rate, + monthly_return=monthly_return, + max_daily_loss=max_daily_loss, + ) + + result = { + 'status': 'accepted' if passed else 'rejected', + 'failed_criteria': failed_criteria, + + # Core metrics + 'ic': float(ic) if not np.isnan(ic) else 0.0, + 'sharpe': float(sharpe), + 'max_drawdown': float(max_drawdown), + 'win_rate': float(win_rate), + 'total_return': float(total_return), + 'monthly_return_pct': float(monthly_return * 100), + 'annual_return_pct': float(annual_return * 100), + + # Trade statistics + 'n_trades': n_signals, + 'n_long': n_long, + 'n_short': n_short, + 'n_neutral': n_neutral, + 'n_bars': total_bars, + 'n_months': float(n_months), + + # FTMO compliance + 'max_daily_loss': float(max_daily_loss), + 'ftmo_compliant': max_daily_loss <= 0.05, + + # Signal distribution + 'signal_long_pct': n_long / total_bars if total_bars > 0 else 0, + 'signal_short_pct': n_short / total_bars if total_bars > 0 else 0, + 'signal_neutral_pct': n_neutral / total_bars if total_bars > 0 else 0, + } + + return result + + def _check_acceptance( + self, + ic: float, + sharpe: float, + n_trades: int, + max_drawdown: float, + win_rate: float, + monthly_return: float, + max_daily_loss: float, + ) -> Tuple[bool, List[str]]: + """Check if strategy meets acceptance criteria.""" + failed = [] + + if abs(ic) < self.criteria['min_abs_ic']: + failed.append(f"IC too low: {ic:.4f} < {self.criteria['min_abs_ic']}") + + if sharpe < self.criteria['min_sharpe']: + failed.append(f"Sharpe too low: {sharpe:.3f} < {self.criteria['min_sharpe']}") + + if n_trades < self.criteria['min_trades']: + failed.append(f"Too few trades: {n_trades} < {self.criteria['min_trades']}") + + if max_drawdown < self.criteria['max_drawdown']: + failed.append(f"Max drawdown exceeded: {max_drawdown:.1%} < {self.criteria['max_drawdown']}") + + if win_rate < self.criteria['min_win_rate']: + failed.append(f"Win rate too low: {win_rate:.1%} < {self.criteria['min_win_rate']}") + + if monthly_return < self.criteria['min_monthly_return']: + failed.append(f"Monthly return too low: {monthly_return:.2%} < {self.criteria['min_monthly_return']}") + + if max_daily_loss > self.criteria['max_daily_loss']: + failed.append(f"Daily loss exceeded: {max_daily_loss:.2%} > {self.criteria['max_daily_loss']}") + + return len(failed) == 0, failed + +# ============================================================================ +# Feedback Generator +# ============================================================================ +class FeedbackGenerator: + """ + Generate intelligent feedback for LLM strategy improvement. + """ + + @staticmethod + def generate_feedback( + evaluation: Dict[str, Any], # nosec + factor_list: List[Dict], + attempt: int, + param_config: Optional[Dict] = None, + ) -> str: + """ + Generate actionable feedback based on strategy performance. + + Parameters + ---------- + evaluation : dict # nosec + Strategy evaluation metrics # nosec + factor_list : list + Available factors with IC values + attempt : int + Current attempt number + param_config : dict, optional + Current parameter configuration + + Returns + ------- + str + Feedback string for LLM + """ + ic = evaluation.get('ic', 0) # nosec + sharpe = evaluation.get('sharpe', 0) # nosec + trades = evaluation.get('n_trades', 0) # nosec + dd = evaluation.get('max_drawdown', 0) # nosec + win_rate = evaluation.get('win_rate', 0) # nosec + monthly_ret = evaluation.get('monthly_return_pct', 0) # nosec + failed = evaluation.get('failed_criteria', []) # nosec + + feedback_parts = [f"Attempt {attempt} results:"] + + # Performance summary + feedback_parts.append(f"IC={ic:.4f}, Sharpe={sharpe:.2f}, Trades={trades}, DD={dd:.1%}, WinRate={win_rate:.1%}, Monthly={monthly_ret:.2f}%") + + # Specific suggestions based on failures + if failed: + feedback_parts.append("\nIssues found:") + + if any('IC' in f for f in failed): + # Suggest top factors + top_factors = sorted(factor_list, key=lambda x: abs(x['ic']), reverse=True)[:5] + top_factor_names = [f['name'] for f in top_factors] + feedback_parts.append( + f"\n- IC too low ({ic:.4f}). Try different factors. Top factors by IC: {', '.join(top_factor_names)}" + ) + + if any('trades' in f.lower() for f in failed): + feedback_parts.append( + f"\n- Too few trades ({trades}). Lower thresholds (try 0.2-0.3), use more sensitive factors, or reduce rolling window (10-20 bars)" + ) + + if any('drawdown' in f.lower() for f in failed): + feedback_parts.append( + f"\n- High drawdown ({dd:.1%}). Add filters (volatility, trend), reduce position size, or tighten stop loss" + ) + + if any('sharpe' in f.lower() for f in failed): + feedback_parts.append( + f"\n- Low Sharpe ({sharpe:.2f}). Improve signal quality: combine momentum + mean reversion, add regime filters" + ) + + if any('win rate' in f.lower() for f in failed): + feedback_parts.append( + f"\n- Low win rate ({win_rate:.1%}). Try higher take profit (4-6%), or add confirmation filters" + ) + + if any('monthly return' in f.lower() for f in failed): + feedback_parts.append( + f"\n- Low monthly return ({monthly_ret:.2%}). Increase signal frequency or use higher-IC factors" + ) + + else: + # Strategy passed - suggest optimization + feedback_parts.append("\n✓ Strategy meets all criteria!") + + if sharpe < 1.5: + feedback_parts.append( + f"\nTry optimizing: 1) Test SL=1.5% vs 2% 2) Test TP=3% vs 4% 3) Add trailing stop at 1.5%" + ) + + if abs(ic) < 0.05: + top_factors = sorted(factor_list, key=lambda x: abs(x['ic']), reverse=True)[:3] + feedback_parts.append( + f"\nIC could be higher. Consider adding: {', '.join(f['name'] for f in top_factors)}" + ) + + if param_config: + feedback_parts.append( + f"\nCurrent params: threshold={param_config.get('threshold_entry', 'N/A')}, " + f"window={param_config.get('rolling_window', 'N/A')}, " + f"SL={param_config.get('stop_loss', 'N/A'):.1%}, " + f"TP={param_config.get('take_profit', 'N/A'):.1%}" + ) + + return " ".join(feedback_parts) + +# ============================================================================ +# LLM Strategy Generator +# ============================================================================ +class LLMStrategyGenerator: + """ + Generate trading strategies using LLM with feedback loop. + """ + + def __init__(self): + setup_llm_env() + + def generate( + self, + factor_subset: List[Dict], + feedback: Optional[str] = None, + trading_style: str = 'daytrading', + forward_bars: int = 96, + ) -> Dict[str, Any]: + """ + Generate a single strategy via qwen CLI. + + Parameters + ---------- + factor_subset : list + List of factor dicts with 'name' and 'ic' + feedback : str, optional + Previous feedback for improvement + trading_style : str + 'daytrading' or 'swing' + forward_bars : int + Forward return horizon + + Returns + ------- + dict + Strategy dict with 'status', 'strategy', 'error' + """ + try: + import subprocess # nosec B404 + import re + + factor_list = ", ".join([f"{f['name']} (IC={f['ic']:.4f})" for f in factor_subset]) + factor_names = ", ".join([f['name'] for f in factor_subset]) + + feedback_text = f" Vorheriges Feedback: {feedback}" if feedback else " Erster Versuch - sei kreativ!" + + prompt = f"""Du bist ein quantitativer Trading-Experte. Erzeuge eine EUR/USD Daytrading-Strategie als JSON. + +Faktoren: {factor_list} + +⚠️ WICHTIG - DU MUSST VIELE SIGNALE GENERIEREN! ⚠️ +Die Strategie MUSS mindestens 50+ Trades über den Datensatz erzeugen. +Verwende DESHALB diese Regeln: +1. Schwellenwerte MÜSSEN niedrig sein: 0.1 bis 0.25 (NICHT höher!) +2. Verwende Z-Score Normalisierung mit FENSTERN VON 10-20 Bars (kurz!) +3. Erstelle Signale für JEDE Bar wo der Z-Score den Schwellenwert überschreitet +4. Vermeide zu strenge Filter - die Strategie soll AKTIV traden! +5. Kombiniere 2-4 Faktoren mit GEWICHTEN für diversifizierte Signale + +BEISPIEL für gute Signal-Logik: +```python +z = (factor - factor.rolling(15).mean()) / factor.rolling(15).std() +signal = pd.Series(0, index=close.index) +signal[z > 0.15] = 1 # NIEDRIGER Schwellenwert = VIELE Signale! +signal[z < -0.15] = -1 # Auch negative Signale für Shorts +``` + +❌ SCHLECHT: signal[composite > 0.5] = 1 (zu streng, nur 1 Trade!) +✅ GUT: signal[composite > 0.15] = 1 (niedrig, viele Trades!) + +Anforderungen: +- Trading-Stil: Daytrading mit {forward_bars}-Bar Forward Returns +- ZIEL: 50-200+ Trades gesamt (sehr aktiv!) +- Schwellenwerte: 0.1-0.25 (sehr niedrig!) +- Rolling Windows: 10-20 Bars (kurz!) +- Erstelle signal Series mit Werten 1, -1, 0 + +{feedback_text} + +WICHTIG: Das JSON MUSS diese Felder haben: +{{ + "strategy_name": "kurzer_Name", + "factor_names": ["faktor1", "faktor2"], + "description": "Ein Satz Beschreibung", + "code": "Python Code der signal Series erzeugt" +}} + +Der Python Code MUSS mit DataFrame 'factors' und Series 'close' arbeiten und eine Series 'signal' erzeugen. + +Antworte NUR mit dem JSON Objekt!""" + + # Call qwen CLI + logger.info(f"Calling qwen CLI with prompt ({len(prompt)} chars)...") + result = subprocess.run( # nosec B603 + ['qwen', '-p', prompt], + capture_output=True, + text=True, + timeout=120, + cwd=str(Path(__file__).parent) + ) + + if result.returncode != 0: + logger.error(f"qwen CLI failed: {result.stderr[:300]}") + return {'status': 'error', 'error': f'qwen CLI failed: {result.stderr[:200]}'} + + response = result.stdout.strip() + logger.info(f"qwen CLI response ({len(response)} chars)") + + # Extract JSON from response + # qwen CLI might output to file OR stdout + # Check if a file was created in results/strategies_new/ + import glob + new_files = glob.glob(str(STRATEGIES_DIR / '*.json')) + if new_files: + latest = max(new_files, key=os.path.getmtime) + if os.path.getmtime(latest) > time.time() - 120: # Created in last 120s + logger.info(f"Strategy file found: {latest}") + with open(latest) as f: + raw_data = json.load(f) + # Convert qwen CLI format to our format + strategy_data = self._convert_qwen_output(raw_data, factor_subset) + if strategy_data: + return {'status': 'generated', 'strategy': strategy_data} + + # Otherwise parse JSON from stdout + # Try to find JSON object in response + json_match = re.search(r'\{[^{}]*"strategy_name"[^{}]*\}', response, re.DOTALL) + if json_match: + strategy_str = json_match.group() + raw_data = json.loads(strategy_str) + else: + # Try to parse entire response as JSON + raw_data = json.loads(response) + + # Convert to our format + strategy_data = self._convert_qwen_output(raw_data, factor_subset) + if not strategy_data: + return {'status': 'invalid', 'error': 'Could not convert qwen output'} + + return { + 'status': 'generated', + 'strategy': strategy_data, + } + + except subprocess.TimeoutExpired: # nosec + return {'status': 'error', 'error': 'qwen CLI timeout (120s)'} + except Exception as e: + logger.error(f"qwen CLI generation failed: {e}") + return {'status': 'error', 'error': str(e)[:300]} + + def _convert_qwen_output(self, raw_data: Dict, factors: List[Dict]) -> Optional[Dict]: + """ + Convert qwen CLI output format to our standard format. + + qwen CLI may output: + - code as string with literal \n + - Different field names (name vs strategy_name) + - Nested structures + + We need: + - strategy_name: str + - factor_names: List[str] + - description: str + - code: str (executable Python with real newlines) # nosec + """ + try: + # Extract strategy name + strategy_name = raw_data.get('strategy_name') or raw_data.get('name', 'UnknownStrategy') + + # Extract factor names + factor_names = raw_data.get('factor_names', []) + if not factor_names: + # Use factors from the generation request + factor_names = [f['name'] for f in factors[:3]] + + # Extract description + description = raw_data.get('description', raw_data.get('desc', 'Generated strategy')) + + # Extract and clean code + code = raw_data.get('code', '') + if not code: + # Try to find code in nested structures + if 'strategy' in raw_data: + code = raw_data['strategy'].get('code', '') + elif 'logic' in raw_data: + code = raw_data['logic'].get('code', '') + + # Unescape code (convert literal \n to real newlines) + if code: + code = code.replace('\\n', '\n').replace('\\"', '"').replace('\\\\', '\\') + # Remove leading/trailing quotes if present + if code.startswith('"') and code.endswith('"'): + code = code[1:-1] + if code.startswith("'") and code.endswith("'"): + code = code[1:-1] + # Ensure variable name consistency: factors_df → factors + code = code.replace('factors_df', 'factors') + + # Validate we have what we need + if not code or not strategy_name: + logger.warning(f"Missing required fields: name={strategy_name}, code={'yes' if code else 'no'}") + return None + + return { + 'strategy_name': strategy_name, + 'factor_names': factor_names, + 'description': description, + 'code': code, + } + except Exception as e: + logger.error(f"Failed to convert qwen output: {e}") + return None + +# ============================================================================ +# Backtest Runner +# ============================================================================ +class BacktestRunner: + """ + Run backtests in isolated subprocess with risk management. # nosec + """ + + @staticmethod + def run( + close: pd.Series, + factors_df: pd.DataFrame, + strategy_code: str, + risk_config: Dict[str, float], + forward_bars: int = 96, + ) -> Optional[Dict[str, Any]]: + """ + Run strategy backtest with risk management. + + Parameters + ---------- + close : pd.Series + Close prices + factors_df : pd.DataFrame + Factor values DataFrame + strategy_code : str + Python code string for signal generation + risk_config : dict + Risk management configuration (SL, TP, trailing, etc.) + forward_bars : int + Forward return horizon + + Returns + ------- + dict or None + Backtest results dict or None on failure + """ + # Build backtest script with risk management + risk_code = f""" +# Risk Management Configuration +STOP_LOSS = {risk_config['stop_loss']} +TAKE_PROFIT = {risk_config['take_profit']} +TRAILING_STOP = {risk_config['trailing_stop']} +TRAILING_ACTIVATION = {risk_config['trailing_activation']} +MAX_DAILY_LOSS = {risk_config['max_daily_loss']} +MAX_POSITIONS = {risk_config['max_positions']} + +def apply_risk_management_with_params(signal, close_prices, sl, tp, trailing, trail_activation): + \"\"\"Apply SL/TP/Trailing stop to signals.\"\"\" + if len(signal) == 0 or len(close_prices) == 0: + return pd.Series(0.0, index=signal.index) + + common_idx = signal.index.intersection(close_prices.index) + sig = signal.loc[common_idx].fillna(0) + prices = close_prices.loc[common_idx] + + strategy_returns = pd.Series(0.0, index=common_idx) + position = 0 + entry_price = 0.0 + highest_profit = 0.0 + daily_pnl = 0.0 + current_date = None + + for i, idx in enumerate(common_idx): + if i == 0: + continue + + bar_date = idx.date() if hasattr(idx, 'date') else idx + if current_date is None: + current_date = bar_date + elif bar_date != current_date: + daily_pnl = 0.0 + current_date = bar_date + + current_price = prices.iloc[i] + prev_price = prices.iloc[i - 1] + current_signal = sig.iloc[i] + + if position != 0: + pnl_pct = 0.0 + if position == 1: + pnl_pct = (current_price - entry_price) / entry_price + elif position == -1: + pnl_pct = (entry_price - current_price) / entry_price + + # Stop Loss + if pnl_pct <= -sl: + strategy_returns.iloc[i] = -sl * position + daily_pnl += -sl + position = 0 + highest_profit = 0.0 + continue + + # Take Profit + if pnl_pct >= tp: + strategy_returns.iloc[i] = tp * position + daily_pnl += tp + position = 0 + highest_profit = 0.0 + continue + + # Trailing Stop + if pnl_pct >= trail_activation: + highest_profit = max(highest_profit, pnl_pct) + if (highest_profit - pnl_pct) >= trailing: + strategy_returns.iloc[i] = pnl_pct * position + daily_pnl += pnl_pct + position = 0 + highest_profit = 0.0 + continue + + # Normal PnL + if position == 1: + strategy_returns.iloc[i] = (current_price - prev_price) / prev_price + elif position == -1: + strategy_returns.iloc[i] = -(current_price - prev_price) / prev_price + + daily_pnl += strategy_returns.iloc[i] + + # Max daily loss + if daily_pnl <= -{risk_config['max_daily_loss']}: + position = 0 + highest_profit = 0.0 + continue + + # Enter position + if position == 0 and current_signal != 0: + position = int(np.sign(current_signal)) + entry_price = current_price + highest_profit = 0.0 + + return strategy_returns +""" + + script = f""" +import pandas as pd +import numpy as np +import json +import sys + +close = pd.read_pickle('close.pkl') # nosec +factors = pd.read_pickle('factors.pkl') # nosec + +try: +{chr(10).join(' ' + line for line in strategy_code.split(chr(10)))} +except Exception as e: + print(f"ERROR: Strategy execution failed: {{e}}", file=sys.stderr) # nosec + sys.exit(1) + +if 'signal' not in dir(): + print("ERROR: No signal variable created", file=sys.stderr) + sys.exit(1) + +# Apply risk management +{risk_code} + +signal = signal.fillna(0) +strategy_returns = apply_risk_management_with_params(signal, close, STOP_LOSS, TAKE_PROFIT, TRAILING_STOP, TRAILING_ACTIVATION) + +# Calculate metrics +common_idx = close.index.intersection(signal.index) +close_aligned = close.loc[common_idx] +signal_aligned = signal.loc[common_idx] +fwd_returns = close_aligned.pct_change({forward_bars}).shift(-{forward_bars}) + +ic = signal_aligned.corr(fwd_returns.dropna()) if signal_aligned.std() > 0 else 0 +total_return = (1 + strategy_returns).prod() - 1 +cum_returns = (1 + strategy_returns).cumprod() +running_max = cum_returns.expanding().max() +drawdown = (cum_returns - running_max) / running_max.replace(0, np.nan) +max_dd = drawdown.min() if len(drawdown) > 0 else 0 + +active_returns = strategy_returns[strategy_returns != 0] +win_rate = (active_returns > 0).sum() / len(active_returns) if len(active_returns) > 0 else 0 +n_trades = int((signal_aligned != signal_aligned.shift(1)).sum()) + +bars_per_year = 252 * 1440 / {forward_bars} +if strategy_returns.std() > 0: + sharpe = strategy_returns.mean() / strategy_returns.std() * np.sqrt(bars_per_year) +else: + sharpe = 0 + +n_bars = len(strategy_returns) +n_months = n_bars / (bars_per_year / 12) if n_bars > 0 else 1 + +if n_months > 0 and (1 + total_return) > 0: + monthly_return = (1 + total_return) ** (1 / n_months) - 1 + annual_return = (1 + total_return) ** (12 / n_months) - 1 +else: + monthly_return = total_return + annual_return = total_return * 12 + +# Daily loss check +daily_returns = strategy_returns.groupby( + strategy_returns.index.date if hasattr(strategy_returns.index[0], 'date') else strategy_returns.index +).sum() +max_daily_loss = abs(daily_returns.min()) if len(daily_returns) > 0 else 0 + +result = {{ + "status": "success", + "ic": float(ic) if not np.isnan(ic) else 0, + "sharpe": float(sharpe), + "max_drawdown": float(max_dd) if not np.isnan(max_dd) else 0, + "win_rate": float(win_rate), + "n_trades": n_trades, + "total_return": float(total_return), + "monthly_return_pct": float(monthly_return * 100), + "annual_return_pct": float(annual_return * 100), + "n_bars": int(n_bars), + "n_months": float(n_months), + "n_long": int((signal_aligned == 1).sum()), + "n_short": int((signal_aligned == -1).sum()), + "n_neutral": int((signal_aligned == 0).sum()), + "max_daily_loss": float(max_daily_loss), + "ftmo_compliant": max_daily_loss <= 0.05, +}} + +def sanitize_val(v): + if isinstance(v, (np.integer,)): return int(v) + if isinstance(v, (np.floating,)): return float(v) + if isinstance(v, np.bool_): return bool(v) + if isinstance(v, float): + import math + if math.isnan(v): return 0.0 + if math.isinf(v): return -999.0 if v < 0 else 999.0 + return v + +result = {{k: sanitize_val(v) for k, v in result.items()}} +print(json.dumps(result)) +""" + + import tempfile + with tempfile.TemporaryDirectory() as td: + td_path = Path(td) + close.to_pickle(str(td_path / 'close.pkl')) # nosec + factors_df.to_pickle(str(td_path / 'factors.pkl')) # nosec + (td_path / 'run.py').write_text(script) + + try: + result = subprocess.run( # nosec B603 + [sys.executable, str(td_path / 'run.py')], + capture_output=True, text=True, timeout=300, + cwd=str(td_path) + ) + + if result.returncode != 0: + logger.warning(f"Backtest failed: {result.stderr[:200] or result.stdout[:200]}") + return {'status': 'failed', 'reason': result.stderr[:200] or result.stdout[:200]} + + for line in result.stdout.strip().split('\n'): + try: + return json.loads(line) + except json.JSONDecodeError: + continue + + return {'status': 'failed', 'reason': 'No valid JSON output'} + + except subprocess.TimeoutExpired: # nosec + return {'status': 'failed', 'reason': 'Timeout (90s)'} + except Exception as e: + return {'status': 'failed', 'reason': str(e)[:200]} + +# ============================================================================ +# Parameter Optimizer +# ============================================================================ +class ParameterOptimizer: + """ + Grid search for optimal strategy parameters. + """ + + def __init__(self, max_combinations: int = 50): + """ + Initialize optimizer. + + Parameters + ---------- + max_combinations : int + Maximum parameter combinations to test + """ + self.max_combinations = max_combinations + + def optimize( + self, + close: pd.Series, + factors_df: pd.DataFrame, + strategy_code: str, + forward_bars: int = 96, + ) -> Tuple[Dict[str, float], Dict[str, Any]]: + """ + Optimize strategy parameters via grid search. + + Parameters + ---------- + close : pd.Series + Close prices + factors_df : pd.DataFrame + Factor values + strategy_code : str + Strategy Python code + forward_bars : int + Forward return horizon + + Returns + ------- + tuple + (best_params, best_result) + """ + # Generate parameter combinations (sample if too many) + all_combinations = list(product( + PARAMETER_GRID['threshold_entry'], + PARAMETER_GRID['rolling_window'], + PARAMETER_GRID['stop_loss'], + PARAMETER_GRID['take_profit'], + PARAMETER_GRID['trailing_stop'], + PARAMETER_GRID['trailing_activation'], + )) + + # Filter invalid combinations (TP must be >= 2x SL) + valid_combinations = [ + c for c in all_combinations + if c[3] >= c[2] * 2 # take_profit >= 2 * stop_loss + ] + + # Sample if too many + if len(valid_combinations) > self.max_combinations: + valid_combinations = random.sample(valid_combinations, self.max_combinations) + + logger.info(f"Testing {len(valid_combinations)} parameter combinations...") + + best_result = None + best_params = None + best_score = -np.inf + + runner = BacktestRunner() + + for idx, (threshold, window, sl, tp, trail, trail_act) in enumerate(valid_combinations): + # Modify strategy code with current parameters + param_code = self._inject_parameters(strategy_code, threshold, window) + + # Risk config for this combination + risk_config = { + 'stop_loss': sl, + 'take_profit': tp, + 'trailing_stop': trail, + 'trailing_activation': trail_act, + 'max_daily_loss': 0.05, + 'max_positions': 1, + } + + # Run backtest + result = runner.run(close, factors_df, param_code, risk_config, forward_bars) + + if result and result.get('status') == 'success': + # Score: prioritize IC and Sharpe, penalize drawdown and low trades + score = ( + abs(result.get('ic', 0)) * 10 + + result.get('sharpe', 0) * 2 - + abs(result.get('max_drawdown', 0)) * 5 + + min(result.get('n_trades', 0) / 100, 2) + ) + + if score > best_score: + best_score = score + best_params = { + 'threshold_entry': threshold, + 'rolling_window': window, + 'stop_loss': sl, + 'take_profit': tp, + 'trailing_stop': trail, + 'trailing_activation': trail_act, + } + best_result = result + + if (idx + 1) % 10 == 0: + logger.info(f" Tested {idx + 1}/{len(valid_combinations)} combinations, best score={best_score:.3f}") + + if best_result is None: + logger.warning("No successful backtests found, using default parameters") + best_params = { + 'threshold_entry': 0.3, + 'rolling_window': 20, + 'stop_loss': 0.02, + 'take_profit': 0.04, + 'trailing_stop': 0.015, + 'trailing_activation': 0.02, + } + best_result = {'status': 'failed', 'reason': 'No valid parameters found'} + + return best_params, best_result + + def _inject_parameters( + self, + strategy_code: str, + threshold: float, + window: int, + ) -> str: + """ + Inject parameters into strategy code - DISABLED for stability. + qwen CLI generates code with its own thresholds which work better. + """ + # Don't modify qwen CLI generated code - it already has good parameters + return strategy_code + +# ============================================================================ +# Smart Strategy Generator (Main Class) +# ============================================================================ +class SmartStrategyGenerator: + """ + Main strategy generator with feedback loop, optimization, and risk management. + + Usage: + generator = SmartStrategyGenerator(trading_style='daytrading') + strategies = generator.generate_strategies(target_count=10) + """ + + def __init__( + self, + trading_style: str = 'daytrading', + forward_bars: Optional[int] = None, + max_attempts: int = 100, + enable_optimization: bool = True, + ): + """ + Initialize strategy generator. + + Parameters + ---------- + trading_style : str + 'daytrading' or 'swing' + forward_bars : int, optional + Forward return horizon (auto-detected from style) + max_attempts : int + Maximum generation attempts + enable_optimization : bool + Enable parameter grid search + """ + self.trading_style = trading_style + self.forward_bars = forward_bars or (12 if trading_style == 'daytrading' else 96) + self.max_attempts = max_attempts + self.enable_optimization = enable_optimization + + self.llm_generator = LLMStrategyGenerator() + self.evaluator = StrategyEvaluator(trading_style, self.forward_bars) # nosec + self.feedback_gen = FeedbackGenerator() + self.optimizer = ParameterOptimizer(max_combinations=15) + self.backtest_runner = BacktestRunner() + + self.factors = data_cache.load_top_factors(20) + self.close = data_cache.load_ohlcv() + + # Load factor time-series + self.factor_data = {} + for f_info in self.factors: + series = data_cache.load_factor_timeseries(f_info['name']) + if series is not None: + self.factor_data[f_info['name']] = series + + # Align data + all_series = [self.factor_data[n] for n in self.factor_data] + if not all_series: + raise ValueError("No factor data loaded!") + + self.df_factors = pd.DataFrame({n: self.factor_data[n] for n in self.factor_data}) + self.common_idx = self.close.index.intersection(self.df_factors.dropna(how='all').index) + self.close_aligned = self.close.loc[self.common_idx] + self.df_aligned = self.df_factors.loc[self.common_idx] + + self.accepted_strategies: List[Dict] = [] + self.feedback_history: List[str] = [] + + logger.info( + f"SmartStrategyGenerator initialized: style={trading_style}, " + f"forward_bars={self.forward_bars}, factors={len(self.factor_data)}, " + f"bars={len(self.close_aligned):,}" + ) + + def generate_strategy( + self, + attempt_idx: int, + factor_subset: Optional[List[Dict]] = None, + feedback: Optional[str] = None, + ) -> Optional[Dict]: + """ + Generate a single strategy with feedback loop. + + Parameters + ---------- + attempt_idx : int + Attempt number (for logging) + factor_subset : list, optional + Subset of factors to use (random if None) + feedback : str, optional + Previous feedback + + Returns + ------- + dict or None + Strategy dict or None if failed + """ + # Select factor subset + if factor_subset is None: + n_factors = random.randint(2, min(5, len(self.factors))) + factor_subset = random.sample(self.factors, n_factors) + + # Generate strategy via LLM + gen_result = self.llm_generator.generate( + factor_subset=factor_subset, + feedback=feedback, + trading_style=self.trading_style, + forward_bars=self.forward_bars, + ) + + if gen_result['status'] != 'generated': + logger.warning(f"Attempt {attempt_idx}: LLM generation failed - {gen_result.get('error', 'Unknown')}") + return None + + strategy = gen_result['strategy'] + factor_names = strategy.get('factor_names', []) + + # Build factors DataFrame + valid_factors = [f for f in factor_names if f in self.df_aligned.columns] + if len(valid_factors) < 2: + logger.warning(f"Attempt {attempt_idx}: Insufficient valid factors ({len(valid_factors)})") + return None + + factors_df = self.df_aligned[valid_factors] + + # Default risk config + risk_config = { + 'stop_loss': 0.02, + 'take_profit': 0.04, + 'trailing_stop': 0.015, + 'trailing_activation': 0.02, + 'max_daily_loss': 0.05, + 'max_positions': 1, + } + + # Parameter optimization (if enabled) + if self.enable_optimization: + logger.info(f"Attempt {attempt_idx}: Running parameter optimization...") + best_params, opt_result = self.optimizer.optimize( + self.close_aligned, factors_df, strategy['code'], self.forward_bars + ) + + if opt_result.get('status') == 'success': + risk_config.update(best_params) + logger.info( + f" Best params: threshold={best_params['threshold_entry']}, " + f"window={best_params['rolling_window']}, " + f"SL={best_params['stop_loss']:.1%}, TP={best_params['take_profit']:.1%}" + ) + else: + logger.warning(f" Optimization failed, using default parameters") + + # Run final backtest with optimized/default risk config + bt_result = self.backtest_runner.run( + self.close_aligned, factors_df, strategy['code'], risk_config, self.forward_bars + ) + + if bt_result is None or bt_result.get('status') != 'success': + logger.warning(f"Attempt {attempt_idx}: Backtest failed - {bt_result.get('reason', 'Unknown') if bt_result else 'No result'}") + return None + + # Evaluate strategy + # Reconstruct signal from backtest (approximate) + signal_approx = pd.Series(0, index=self.close_aligned.index[:bt_result.get('n_bars', len(self.close_aligned))]) + evaluation = self.evaluator.evaluate( # nosec + signal=signal_approx, + close=self.close_aligned.iloc[:len(signal_approx)], + strategy_returns=pd.Series(dtype=float), # Already computed in backtest + ) + + # Use backtest metrics directly for evaluation # nosec + evaluation = { # nosec + 'ic': bt_result.get('ic', 0), + 'sharpe': bt_result.get('sharpe', 0), + 'max_drawdown': bt_result.get('max_drawdown', 0), + 'win_rate': bt_result.get('win_rate', 0), + 'n_trades': bt_result.get('n_trades', 0), + 'monthly_return': bt_result.get('monthly_return_pct', 0) / 100.0, + 'max_daily_loss': bt_result.get('max_daily_loss', 0), + } + + # Check acceptance + passed, failed_criteria = self.evaluator._check_acceptance(**evaluation) # nosec + evaluation['status'] = 'accepted' if passed else 'rejected' # nosec + evaluation['failed_criteria'] = failed_criteria # nosec + + # Generate feedback + feedback = self.feedback_gen.generate_feedback( + evaluation=evaluation, # nosec + factor_list=self.factors, + attempt=attempt_idx, + param_config=risk_config, + ) + self.feedback_history.append(feedback) + + # Store strategy + strategy['metrics'] = bt_result + strategy['risk_config'] = risk_config + strategy['evaluation'] = evaluation # nosec + strategy['feedback'] = feedback + + if passed: + logger.info( + f"✓ Strategy #{len(self.accepted_strategies)+1} ACCEPTED: " + f"IC={evaluation['ic']:.4f}, Sharpe={evaluation['sharpe']:.2f}, " # nosec + f"Trades={evaluation['n_trades']}, DD={evaluation['max_drawdown']:.1%}" # nosec + ) + self.accepted_strategies.append(strategy) + else: + logger.info( + f"✗ Strategy REJECTED: {', '.join(failed_criteria[:3])}" + ) + + return strategy + + def generate_strategies(self, target_count: int = 10) -> List[Dict]: + """ + Generate multiple strategies with feedback loop. + + Parameters + ---------- + target_count : int + Number of accepted strategies to generate + + Returns + ------- + list + List of accepted strategy dicts + """ + console.print(f"\n[bold cyan]🧠 Smart Strategy Generation[/bold cyan]") + console.print(f" Style: {self.trading_style}") + console.print(f" Forward bars: {self.forward_bars}") + console.print(f" Target: {target_count} accepted strategies") + console.print(f" Factors: {len(self.factor_data)}") + console.print(f" Data points: {len(self.close_aligned):,}\n") + + max_attempts = min(self.max_attempts, target_count * 15) + accepted = [] + + with Progress( + SpinnerColumn(), + TextColumn("[bold blue]{task.description}"), + BarColumn(), + TextColumn("[bold green]{task.completed}/{task.total}"), + TimeElapsedColumn(), + ) as progress: + task = progress.add_task(f"Generating {self.trading_style} strategies...", total=max_attempts) + + for attempt in range(max_attempts): + if len(accepted) >= target_count: + break + + progress.update(task, description=f"Attempt {attempt+1}...") + + # Get feedback from last attempt + feedback = self.feedback_history[-1] if self.feedback_history and random.random() < 0.7 else None + + strategy = self.generate_strategy(attempt, feedback=feedback) + + if strategy and strategy['evaluation']['status'] == 'accepted': # nosec + accepted.append(strategy) + + # Save strategy + self._save_strategy(strategy) + + console.print( + f"[green]✓ Strategy #{len(accepted)}:[/green] {strategy['strategy_name']} " + f"IC={strategy['metrics'].get('ic', 0):.4f}, " + f"Sharpe={strategy['metrics'].get('sharpe', 0):.3f}, " + f"Trades={strategy['metrics'].get('n_trades', 0)}, " + f"DD={strategy['metrics'].get('max_drawdown', 0):.1%}, " + f"Monthly={strategy['metrics'].get('monthly_return_pct', 0):.2f}%" + ) + + progress.update(task, advance=1) + + # Summary + console.print(f"\n[bold green]✓ Generated {len(accepted)}/{target_count} accepted strategies[/bold green]\n") + + if accepted: + accepted.sort(key=lambda x: x['metrics'].get('ic', 0), reverse=True) + + table = Table(title=f"Top {len(accepted)} Accepted Strategies") + table.add_column("#", justify="right") + table.add_column("Name") + table.add_column("IC", justify="right") + table.add_column("Sharpe", justify="right") + table.add_column("Trades", justify="right") + table.add_column("Max DD", justify="right") + table.add_column("Monthly %", justify="right") + table.add_column("FTMO", justify="center") + + for i, s in enumerate(accepted, 1): + m = s['metrics'] + table.add_row( + str(i), + s['strategy_name'], + f"{m.get('ic', 0):.4f}", + f"{m.get('sharpe', 0):.3f}", + str(m.get('n_trades', 0)), + f"{m.get('max_drawdown', 0):.1%}", + f"{m.get('monthly_return_pct', 0):.2f}%", + "✅" if m.get('ftmo_compliant', False) else "❌", + ) + + console.print(table) + + return accepted + + def _save_strategy(self, strategy: Dict) -> None: + """Save strategy to JSON file.""" + fname = f"{int(time.time())}_{strategy['strategy_name'].replace(' ', '_')[:50]}.json" + fpath = STRATEGIES_DIR / fname + + # Convert numpy types for JSON serialization + def convert_numpy(obj): + if isinstance(obj, (np.integer,)): + return int(obj) + elif isinstance(obj, (np.floating,)): + return float(obj) + elif isinstance(obj, np.ndarray): + return obj.tolist() + return obj + + strategy_serializable = {k: convert_numpy(v) for k, v in strategy.items()} + + with open(fpath, 'w') as f: + json.dump(strategy_serializable, f, indent=2, ensure_ascii=False) + + # Generate PDF report if available + try: + from nexquant_strategy_report import StrategyPerformanceReporter + reporter = StrategyPerformanceReporter(strategy) + reporter.generate_report() + except Exception as e: + logger.debug(f"Failed to generate report: {e}") + + logger.info(f"Saved strategy: {fpath}") + +# ============================================================================ +# CLI Interface +# ============================================================================ +def parse_args(): + """Parse command line arguments.""" + import argparse + + parser = argparse.ArgumentParser( + description='Smart Strategy Generation with Feedback & Optimization', + formatter_class=argparse.RawDescriptionHelpFormatter, + epilog=""" +Examples: + python nexquant_smart_strategy_gen.py 10 + python nexquant_smart_strategy_gen.py 5 --style daytrading + python nexquant_smart_strategy_gen.py 20 --style swing --max-attempts 200 + python nexquant_smart_strategy_gen.py 10 --no-optimization + """, + ) + + parser.add_argument( + 'count', + type=int, + nargs='?', + default=10, + help='Number of strategies to generate (default: 10)', + ) + parser.add_argument( + '--style', + choices=['daytrading', 'swing'], + default='daytrading', + help='Trading style (default: daytrading)', + ) + parser.add_argument( + '--forward-bars', + type=int, + default=None, + help='Forward return bars (auto: 12 for daytrading, 96 for swing)', + ) + parser.add_argument( + '--max-attempts', + type=int, + default=150, + help='Maximum generation attempts (default: 150)', + ) + parser.add_argument( + '--no-optimization', + action='store_true', + help='Disable parameter grid search', + ) + parser.add_argument( + '--factors', + type=int, + default=20, + help='Number of top factors to consider (default: 20)', + ) + + return parser.parse_args() + +def main(): + """Main entry point.""" + args = parse_args() + + console.print(f"\n[bold magenta]{'='*70}[/bold magenta]") + console.print(f"[bold]🤖 PREDIX Smart Strategy Generator[/bold]") + console.print(f"[bold magenta]{'='*70}[/bold magenta]\n") + + try: + # Initialize generator + generator = SmartStrategyGenerator( + trading_style=args.style, + forward_bars=args.forward_bars, + max_attempts=args.max_attempts, + enable_optimization=not args.no_optimization, + ) + + # Generate strategies + strategies = generator.generate_strategies(target_count=args.count) + + if strategies: + console.print(f"\n[bold green]✓ Success! {len(strategies)} strategies saved to:[/bold green]") + console.print(f" {STRATEGIES_DIR}\n") + else: + console.print(f"\n[bold yellow]⚠ No strategies met acceptance criteria[/bold yellow]") + console.print(f" Try: --max-attempts 200 or --style swing\n") + + except KeyboardInterrupt: + console.print("\n[yellow]Interrupted by user[/yellow]") + sys.exit(0) + except Exception as e: + logger.exception(f"Fatal error: {e}") + console.print(f"\n[red]✗ Fatal error: {e}[/red]") + sys.exit(1) + +if __name__ == '__main__': + main() diff --git a/scripts/predix_strategy_report.py b/scripts/nexquant_strategy_report.py similarity index 97% rename from scripts/predix_strategy_report.py rename to scripts/nexquant_strategy_report.py index 7ec395f8..8e9e79a5 100644 --- a/scripts/predix_strategy_report.py +++ b/scripts/nexquant_strategy_report.py @@ -1,6 +1,6 @@ #!/usr/bin/env python """ -Strategy Performance Report Generator for Predix. +Strategy Performance Report Generator for NexQuant. Generates detailed PDF reports with charts for each accepted strategy. @@ -11,8 +11,8 @@ Features: - Full metrics table and strategy code Usage: - python predix_strategy_report.py # All strategies - python predix_strategy_report.py results/strategies_new/123.json # Single strategy + python nexquant_strategy_report.py # All strategies + python nexquant_strategy_report.py results/strategies_new/123.json # Single strategy """ import os, sys, json, warnings from pathlib import Path @@ -39,8 +39,8 @@ from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_RIGHT warnings.filterwarnings('ignore') # Config -OHLCV_PATH = Path('/home/nico/Predix/git_ignore_folder/factor_implementation_source_data/intraday_pv.h5') -REPORTS_DIR = Path('/home/nico/Predix/results/strategy_reports') +OHLCV_PATH = Path('/home/nico/NexQuant/git_ignore_folder/factor_implementation_source_data/intraday_pv.h5') +REPORTS_DIR = Path('/home/nico/NexQuant/results/strategy_reports') REPORTS_DIR.mkdir(parents=True, exist_ok=True) # Colors @@ -226,7 +226,7 @@ class StrategyPerformanceReporter: def _gen_pdf_report(self, pdf_path): doc = SimpleDocTemplate(str(pdf_path), pagesize=A4, - title=f"Predix: {self.name}", author="Predix AI", + title=f"NexQuant: {self.name}", author="NexQuant AI", leftMargin=2*cm, rightMargin=2*cm, topMargin=2*cm, bottomMargin=2*cm) styles = getSampleStyleSheet() styles.add(ParagraphStyle(name='PTitle', fontName='Helvetica-Bold', fontSize=22, leading=26, alignment=TA_CENTER, textColor=colors.HexColor('#1A237E'))) @@ -324,7 +324,7 @@ def generate_report_for_strategy(path: str) -> dict: def generate_all_reports(): - d = Path('/home/nico/Predix/results/strategies_new') + d = Path('/home/nico/NexQuant/results/strategies_new') if not d.exists(): print("No strategies."); return for jf in sorted(d.glob('*.json')): try: diff --git a/scripts/realistic_backtest_all.py b/scripts/realistic_backtest_all.py index a2f57445..725efba5 100644 --- a/scripts/realistic_backtest_all.py +++ b/scripts/realistic_backtest_all.py @@ -14,7 +14,7 @@ FTMO 100k rules enforced: Out-of-sample window: 2024-01-01 onwards (never seen during factor research). Usage: - conda activate predix + conda activate nexquant python scripts/realistic_backtest_all.py python scripts/realistic_backtest_all.py --target-monthly 4.0 --min-trades 50 python scripts/realistic_backtest_all.py --workers 8 diff --git a/scripts/run_all_tests.sh b/scripts/run_all_tests.sh index da2024c5..7e2737b4 100755 --- a/scripts/run_all_tests.sh +++ b/scripts/run_all_tests.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Run all Predix integration tests +# Run all NexQuant integration tests # Usage: # ./scripts/run_all_tests.sh # Full test suite # ./scripts/run_all_tests.sh --quick # Skip slow tests @@ -12,7 +12,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" PROJECT_ROOT="$(dirname "$SCRIPT_DIR")" echo "=========================================" -echo "Predix Integration Test Suite" +echo "NexQuant Integration Test Suite" echo "=========================================" echo "Project: $PROJECT_ROOT" echo "Date: $(date '+%Y-%m-%d %H:%M:%S')" diff --git a/scripts/start_strategy_loop.sh b/scripts/start_strategy_loop.sh index 6e419cea..bb393c9c 100755 --- a/scripts/start_strategy_loop.sh +++ b/scripts/start_strategy_loop.sh @@ -4,11 +4,11 @@ # Restarts automatically on crash, generates strategies continuously. # ============================================================================ -SCRIPT_DIR="/home/nico/Predix" -GENERATOR="python ${SCRIPT_DIR}/predix_smart_strategy_gen.py" +SCRIPT_DIR="/home/nico/NexQuant" +GENERATOR="python ${SCRIPT_DIR}/nexquant_smart_strategy_gen.py" TARGET_COUNT=3 LOGFILE="${SCRIPT_DIR}/results/logs/generator_loop.log" -PIDFILE="/tmp/predix_loop.pid" +PIDFILE="/tmp/nexquant_loop.pid" echo $$ > "$PIDFILE" mkdir -p "${SCRIPT_DIR}/results/logs" @@ -19,7 +19,7 @@ log() { cleanup() { log "Received termination signal. Cleaning up..." - pkill -f "predix_smart_strategy_gen.py" 2>/dev/null + pkill -f "nexquant_smart_strategy_gen.py" 2>/dev/null rm -f "$PIDFILE" log "Cleanup complete. Exiting." exit 0 @@ -53,7 +53,7 @@ while true; do log "📁 Existing strategies: ${STRAT_COUNT}" # Kill any stale processes - pkill -9 -f "predix_smart_strategy_gen.py" 2>/dev/null + pkill -9 -f "nexquant_smart_strategy_gen.py" 2>/dev/null sleep 2 # Start generator diff --git a/scripts/watchdog_generator.sh b/scripts/watchdog_generator.sh index 5876ebfd..26368268 100755 --- a/scripts/watchdog_generator.sh +++ b/scripts/watchdog_generator.sh @@ -4,13 +4,13 @@ # Checks every 20min: is the generator running? If not, (re)start it. # ============================================================================ -SCRIPT_DIR="/home/nico/Predix" -GENERATOR="python ${SCRIPT_DIR}/predix_smart_strategy_gen.py" +SCRIPT_DIR="/home/nico/NexQuant" +GENERATOR="python ${SCRIPT_DIR}/nexquant_smart_strategy_gen.py" TARGET_COUNT=3 LOGFILE="${SCRIPT_DIR}/results/logs/watchdog.log" -LOCKFILE="/tmp/predix_generator.lock" +LOCKFILE="/tmp/nexquant_generator.lock" MAX_ATTEMPTS=50 # Stop after this many attempts -PIDFILE="/tmp/predix_generator_attempt.pid" +PIDFILE="/tmp/nexquant_generator_attempt.pid" mkdir -p "${SCRIPT_DIR}/results/logs" @@ -51,7 +51,7 @@ check_progress() { # Kill any existing generator processes cleanup() { - pkill -9 -f "predix_smart_strategy_gen.py" 2>/dev/null + pkill -9 -f "nexquant_smart_strategy_gen.py" 2>/dev/null rm -f "$LOCKFILE" log "Cleaned up old processes" } @@ -63,7 +63,7 @@ if [ "$(get_attempt_count)" -ge "$MAX_ATTEMPTS" ]; then fi # Check if generator is running -if pgrep -f "predix_smart_strategy_gen.py" > /dev/null 2>&1; then +if pgrep -f "nexquant_smart_strategy_gen.py" > /dev/null 2>&1; then # Check if it's making progress if check_progress; then log "Generator is running and making progress. Exiting." diff --git a/selector.log.gz b/selector.log.gz new file mode 100644 index 00000000..c1e451cf Binary files /dev/null and b/selector.log.gz differ diff --git a/test/backtesting/README.md b/test/backtesting/README.md index 5698b659..9249e085 100644 --- a/test/backtesting/README.md +++ b/test/backtesting/README.md @@ -26,7 +26,7 @@ Die Pakete sind in `requirements.txt` enthalten. ### Alle Tests ausführen ```bash -cd /home/nico/Predix +cd /home/nico/NexQuant pytest test/backtesting/ ``` @@ -226,8 +226,8 @@ Für GitHub Actions oder andere CI/CD-Systeme: ```bash # Stelle sicher dass du im Projekt-Verzeichnis bist -cd /home/nico/Predix -export PYTHONPATH=/home/nico/Predix:$PYTHONPATH +cd /home/nico/NexQuant +export PYTHONPATH=/home/nico/NexQuant:$PYTHONPATH pytest test/backtesting/ ``` diff --git a/test/backtesting/__init__.py b/test/backtesting/__init__.py index 277c8003..960a57b6 100644 --- a/test/backtesting/__init__.py +++ b/test/backtesting/__init__.py @@ -1 +1 @@ -"""Predix Backtesting Test Package""" +"""NexQuant Backtesting Test Package""" diff --git a/test/backtesting/conftest.py b/test/backtesting/conftest.py index c74149b3..3e1f3c78 100644 --- a/test/backtesting/conftest.py +++ b/test/backtesting/conftest.py @@ -1,5 +1,5 @@ """ -Predix Backtesting Test Fixtures +NexQuant Backtesting Test Fixtures Wiederverwendbare Test-Daten und Fixtures für alle Backtesting-Tests """ import pytest diff --git a/test/backtesting/test_kronos_adapter.py b/test/backtesting/test_kronos_adapter.py index 92a42905..04b24840 100644 --- a/test/backtesting/test_kronos_adapter.py +++ b/test/backtesting/test_kronos_adapter.py @@ -25,8 +25,8 @@ def _make_ohlcv(n: int = 600, freq: str = "1min") -> pd.DataFrame: }, index=idx) -def _make_predix_hdf5(tmp_path: Path, n: int = 300) -> Path: - """Write a minimal Predix-format HDF5 file and return its path.""" +def _make_nexquant_hdf5(tmp_path: Path, n: int = 300) -> Path: + """Write a minimal NexQuant-format HDF5 file and return its path.""" idx = pd.MultiIndex.from_arrays( [pd.date_range("2024-01-01", periods=n, freq="1min"), ["EURUSD"] * n], names=["datetime", "instrument"], @@ -63,12 +63,12 @@ def _make_mock_adapter(): # --------------------------------------------------------------------------- -# Unit tests: _ohlcv_from_predix +# Unit tests: _ohlcv_from_nexquant # --------------------------------------------------------------------------- class TestOhlcvConversion: def test_renames_dollar_columns(self): - from rdagent.components.coder.kronos_adapter import _ohlcv_from_predix + from rdagent.components.coder.kronos_adapter import _ohlcv_from_nexquant idx = pd.MultiIndex.from_arrays( [pd.date_range("2024-01-01", periods=3, freq="1min"), ["EURUSD"] * 3], names=["datetime", "instrument"], @@ -78,17 +78,17 @@ class TestOhlcvConversion: "$low": [1.05, 1.15, 1.25], "$close": [1.12, 1.22, 1.32], "$volume": [100.0, 200.0, 300.0], }, index=idx) - result = _ohlcv_from_predix(df) + result = _ohlcv_from_nexquant(df) assert list(result.columns) == ["open", "high", "low", "close", "volume"] def test_no_dollar_columns_passthrough(self): - from rdagent.components.coder.kronos_adapter import _ohlcv_from_predix + from rdagent.components.coder.kronos_adapter import _ohlcv_from_nexquant df = pd.DataFrame({"open": [1.0], "close": [1.1], "high": [1.2], "low": [0.9], "volume": [100.0]}) - result = _ohlcv_from_predix(df) + result = _ohlcv_from_nexquant(df) assert "close" in result.columns def test_output_is_float64(self): - from rdagent.components.coder.kronos_adapter import _ohlcv_from_predix + from rdagent.components.coder.kronos_adapter import _ohlcv_from_nexquant df = pd.DataFrame({ "$open": np.array([1.1], dtype="float32"), "$close": np.array([1.1], dtype="float32"), @@ -96,7 +96,7 @@ class TestOhlcvConversion: "$low": np.array([1.1], dtype="float32"), "$volume": np.array([100.0], dtype="float32"), }) - result = _ohlcv_from_predix(df) + result = _ohlcv_from_nexquant(df) assert result["close"].dtype == np.float64 @@ -134,7 +134,7 @@ class TestBuildKronosFactor: def test_output_has_correct_multiindex(self, tmp_path, monkeypatch): import rdagent.components.coder.kronos_adapter as mod monkeypatch.setattr(mod, "KronosAdapter", lambda **kw: _make_mock_adapter()) - h5 = _make_predix_hdf5(tmp_path) + h5 = _make_nexquant_hdf5(tmp_path) result = mod.build_kronos_factor(h5, context_bars=100, pred_bars=20, stride_bars=20, device="cpu") assert result.index.names == ["datetime", "instrument"] assert result.index.nlevels == 2 @@ -142,14 +142,14 @@ class TestBuildKronosFactor: def test_output_column_name(self, tmp_path, monkeypatch): import rdagent.components.coder.kronos_adapter as mod monkeypatch.setattr(mod, "KronosAdapter", lambda **kw: _make_mock_adapter()) - h5 = _make_predix_hdf5(tmp_path) + h5 = _make_nexquant_hdf5(tmp_path) result = mod.build_kronos_factor(h5, context_bars=100, pred_bars=20, stride_bars=20, device="cpu") assert "KronosPredReturn" in result.columns def test_output_has_non_nan_values(self, tmp_path, monkeypatch): import rdagent.components.coder.kronos_adapter as mod monkeypatch.setattr(mod, "KronosAdapter", lambda **kw: _make_mock_adapter()) - h5 = _make_predix_hdf5(tmp_path) + h5 = _make_nexquant_hdf5(tmp_path) result = mod.build_kronos_factor(h5, context_bars=100, pred_bars=20, stride_bars=20, device="cpu") assert result["KronosPredReturn"].notna().sum() > 0 @@ -157,7 +157,7 @@ class TestBuildKronosFactor: import rdagent.components.coder.kronos_adapter as mod monkeypatch.setattr(mod, "KronosAdapter", lambda **kw: _make_mock_adapter()) n = 300 - h5 = _make_predix_hdf5(tmp_path, n=n) + h5 = _make_nexquant_hdf5(tmp_path, n=n) result = mod.build_kronos_factor(h5, context_bars=100, pred_bars=20, stride_bars=20, device="cpu") assert len(result) == n @@ -165,7 +165,7 @@ class TestBuildKronosFactor: """Values within a predicted window should be forward-filled, not NaN.""" import rdagent.components.coder.kronos_adapter as mod monkeypatch.setattr(mod, "KronosAdapter", lambda **kw: _make_mock_adapter()) - h5 = _make_predix_hdf5(tmp_path, n=300) + h5 = _make_nexquant_hdf5(tmp_path, n=300) result = mod.build_kronos_factor(h5, context_bars=100, pred_bars=20, stride_bars=20, device="cpu") non_nan_ratio = result["KronosPredReturn"].notna().mean() assert non_nan_ratio > 0.5, f"Expected >50% non-NaN, got {non_nan_ratio:.2%}" @@ -185,7 +185,7 @@ class TestEvaluateKronosModel: def test_returns_required_keys(self, tmp_path, monkeypatch): import rdagent.components.coder.kronos_adapter as mod monkeypatch.setattr(mod, "KronosAdapter", lambda **kw: _make_mock_adapter()) - h5 = _make_predix_hdf5(tmp_path, n=400) + h5 = _make_nexquant_hdf5(tmp_path, n=400) metrics = mod.evaluate_kronos_model(h5, context_bars=100, pred_bars=20, stride_bars=20, device="cpu") for key in ["IC_mean", "IC_std", "IC_IR", "hit_rate", "n_predictions"]: assert key in metrics, f"Missing key: {key}" @@ -193,14 +193,14 @@ class TestEvaluateKronosModel: def test_hit_rate_in_valid_range(self, tmp_path, monkeypatch): import rdagent.components.coder.kronos_adapter as mod monkeypatch.setattr(mod, "KronosAdapter", lambda **kw: _make_mock_adapter()) - h5 = _make_predix_hdf5(tmp_path, n=400) + h5 = _make_nexquant_hdf5(tmp_path, n=400) metrics = mod.evaluate_kronos_model(h5, context_bars=100, pred_bars=20, stride_bars=20, device="cpu") assert 0.0 <= metrics["hit_rate"] <= 1.0 def test_n_predictions_positive(self, tmp_path, monkeypatch): import rdagent.components.coder.kronos_adapter as mod monkeypatch.setattr(mod, "KronosAdapter", lambda **kw: _make_mock_adapter()) - h5 = _make_predix_hdf5(tmp_path, n=400) + h5 = _make_nexquant_hdf5(tmp_path, n=400) metrics = mod.evaluate_kronos_model(h5, context_bars=100, pred_bars=20, stride_bars=20, device="cpu") assert metrics["n_predictions"] > 0 @@ -213,41 +213,41 @@ class TestCLICommands: def test_kronos_factor_missing_data_exits(self, tmp_path, monkeypatch): """kronos-factor exits with code 1 when HDF5 data is missing.""" from typer.testing import CliRunner - import predix as predix_mod + import nexquant as nexquant_mod monkeypatch.chdir(tmp_path) runner = CliRunner() - result = runner.invoke(predix_mod.app, ["kronos-factor"]) + result = runner.invoke(nexquant_mod.app, ["kronos-factor"]) assert result.exit_code == 1 def test_kronos_eval_missing_data_exits(self, tmp_path, monkeypatch): """kronos-eval exits with code 1 when HDF5 data is missing.""" from typer.testing import CliRunner - import predix as predix_mod + import nexquant as nexquant_mod monkeypatch.chdir(tmp_path) runner = CliRunner() - result = runner.invoke(predix_mod.app, ["kronos-eval"]) + result = runner.invoke(nexquant_mod.app, ["kronos-eval"]) assert result.exit_code == 1 def test_kronos_factor_runs_with_mock(self, tmp_path, monkeypatch): """kronos-factor completes and saves parquet + json when adapter is mocked.""" from typer.testing import CliRunner import rdagent.components.coder.kronos_adapter as mod - import predix as predix_mod + import nexquant as nexquant_mod monkeypatch.setattr(mod, "KronosAdapter", lambda **kw: _make_mock_adapter()) data_dir = tmp_path / "git_ignore_folder" / "factor_implementation_source_data" data_dir.mkdir(parents=True) - _make_predix_hdf5(data_dir.parent.parent, n=300) + _make_nexquant_hdf5(data_dir.parent.parent, n=300) h5_src = tmp_path / "intraday_pv.h5" # Put HDF5 where the CLI expects it import shutil - src = _make_predix_hdf5(tmp_path, n=300) + src = _make_nexquant_hdf5(tmp_path, n=300) shutil.copy(src, data_dir / "intraday_pv.h5") monkeypatch.chdir(tmp_path) runner = CliRunner() - result = runner.invoke(predix_mod.app, [ + result = runner.invoke(nexquant_mod.app, [ "kronos-factor", "--context", "100", "--pred", "20", "--device", "cpu" ]) assert result.exit_code == 0, result.output @@ -257,20 +257,20 @@ class TestCLICommands: """kronos-eval completes and prints IC metrics when adapter is mocked.""" from typer.testing import CliRunner import rdagent.components.coder.kronos_adapter as mod - import predix as predix_mod + import nexquant as nexquant_mod monkeypatch.setattr(mod, "KronosAdapter", lambda **kw: _make_mock_adapter()) data_dir = tmp_path / "git_ignore_folder" / "factor_implementation_source_data" data_dir.mkdir(parents=True) - _make_predix_hdf5(data_dir.parent.parent, n=400) - src = _make_predix_hdf5(tmp_path, n=400) + _make_nexquant_hdf5(data_dir.parent.parent, n=400) + src = _make_nexquant_hdf5(tmp_path, n=400) import shutil shutil.copy(src, data_dir / "intraday_pv.h5") monkeypatch.chdir(tmp_path) runner = CliRunner() - result = runner.invoke(predix_mod.app, [ + result = runner.invoke(nexquant_mod.app, [ "kronos-eval", "--context", "100", "--pred", "20", "--device", "cpu" ]) assert result.exit_code == 0, result.output diff --git a/test/integration/conftest.py b/test/integration/conftest.py index 2141aebd..6c6a26f1 100644 --- a/test/integration/conftest.py +++ b/test/integration/conftest.py @@ -1,5 +1,5 @@ """ -Shared fixtures for Predix integration tests. +Shared fixtures for NexQuant integration tests. Provides common test data, mock objects, and utilities. """ import pytest diff --git a/test/integration/test_all_features.py b/test/integration/test_all_features.py index ac6f386f..e3e593d3 100644 --- a/test/integration/test_all_features.py +++ b/test/integration/test_all_features.py @@ -1,5 +1,5 @@ """ -Comprehensive Integration Test Suite for Predix +Comprehensive Integration Test Suite for NexQuant Tests all 13 implemented features to ensure they work correctly. Usage: @@ -1457,22 +1457,22 @@ class TestFinQuantCriticalIntegrations: # ============================================================================= -# CLI Model Selection Tests (predix.py, cli.py) +# CLI Model Selection Tests (nexquant.py, cli.py) # ============================================================================= class TestCLIModelSelection: """Test CLI model selection (--model/-m flag) for local vs OpenRouter.""" - def test_predix_cli_imports(self): - """Test that predix.py CLI module can be imported.""" + def test_nexquant_cli_imports(self): + """Test that nexquant.py CLI module can be imported.""" import importlib.util spec = importlib.util.spec_from_file_location( - "predix", Path(__file__).parent.parent.parent / "predix.py" + "nexquant", Path(__file__).parent.parent.parent / "nexquant.py" ) - predix = importlib.util.module_from_spec(spec) - spec.loader.exec_module(predix) - assert hasattr(predix, "app") - assert hasattr(predix, "quant") + nexquant = importlib.util.module_from_spec(spec) + spec.loader.exec_module(nexquant) + assert hasattr(nexquant, "app") + assert hasattr(nexquant, "quant") def test_fin_quant_cli_has_model_option(self): """Test that fin_quant CLI has --model option.""" @@ -1488,36 +1488,36 @@ class TestCLIModelSelection: # (Typer auto-generates help from function signatures) assert isinstance(result.output, str) - def test_predix_quant_has_model_option(self): - """Test that predix quant CLI has --model option.""" + def test_nexquant_quant_has_model_option(self): + """Test that nexquant quant CLI has --model option.""" from typer.testing import CliRunner import importlib.util spec = importlib.util.spec_from_file_location( - "predix", Path(__file__).parent.parent.parent / "predix.py" + "nexquant", Path(__file__).parent.parent.parent / "nexquant.py" ) - predix = importlib.util.module_from_spec(spec) - spec.loader.exec_module(predix) + nexquant = importlib.util.module_from_spec(spec) + spec.loader.exec_module(nexquant) runner = CliRunner() - result = runner.invoke(predix.app, ["quant", "--help"]) + result = runner.invoke(nexquant.app, ["quant", "--help"]) assert result.exit_code == 0 assert "--model" in result.output or "-m" in result.output - def test_predix_quant_has_log_file_option(self): - """Test that predix quant CLI has --log-file option.""" + def test_nexquant_quant_has_log_file_option(self): + """Test that nexquant quant CLI has --log-file option.""" from typer.testing import CliRunner import importlib.util spec = importlib.util.spec_from_file_location( - "predix", Path(__file__).parent.parent.parent / "predix.py" + "nexquant", Path(__file__).parent.parent.parent / "nexquant.py" ) - predix = importlib.util.module_from_spec(spec) - spec.loader.exec_module(predix) + nexquant = importlib.util.module_from_spec(spec) + spec.loader.exec_module(nexquant) runner = CliRunner() - result = runner.invoke(predix.app, ["quant", "--help"]) + result = runner.invoke(nexquant.app, ["quant", "--help"]) assert result.exit_code == 0 assert "--log-file" in result.output @@ -1541,12 +1541,12 @@ class TestCLIModelSelection: import inspect import importlib.util spec = importlib.util.spec_from_file_location( - "predix", Path(__file__).parent.parent.parent / "predix.py" + "nexquant", Path(__file__).parent.parent.parent / "nexquant.py" ) - predix = importlib.util.module_from_spec(spec) - spec.loader.exec_module(predix) + nexquant = importlib.util.module_from_spec(spec) + spec.loader.exec_module(nexquant) - source = inspect.getsource(predix.quant) + source = inspect.getsource(nexquant.quant) assert "OPENROUTER_API_KEY" in source assert "not set" in source or "not set in" in source finally: @@ -1554,50 +1554,50 @@ class TestCLIModelSelection: os.environ["OPENROUTER_API_KEY"] = original_key def test_tee_writer_class_exists(self): - """Test that TeeWriter class is defined in predix.py.""" + """Test that TeeWriter class is defined in nexquant.py.""" import importlib.util spec = importlib.util.spec_from_file_location( - "predix", Path(__file__).parent.parent.parent / "predix.py" + "nexquant", Path(__file__).parent.parent.parent / "nexquant.py" ) - predix = importlib.util.module_from_spec(spec) - spec.loader.exec_module(predix) + nexquant = importlib.util.module_from_spec(spec) + spec.loader.exec_module(nexquant) # TeeWriter is defined inside the quant function # Verify the function source contains TeeWriter import inspect - source = inspect.getsource(predix.quant) + source = inspect.getsource(nexquant.quant) assert "TeeWriter" in source - def test_predix_health_command(self): - """Test that predix health command exists.""" + def test_nexquant_health_command(self): + """Test that nexquant health command exists.""" from typer.testing import CliRunner import importlib.util spec = importlib.util.spec_from_file_location( - "predix", Path(__file__).parent.parent.parent / "predix.py" + "nexquant", Path(__file__).parent.parent.parent / "nexquant.py" ) - predix = importlib.util.module_from_spec(spec) - spec.loader.exec_module(predix) + nexquant = importlib.util.module_from_spec(spec) + spec.loader.exec_module(nexquant) runner = CliRunner() - result = runner.invoke(predix.app, ["health", "--help"]) + result = runner.invoke(nexquant.app, ["health", "--help"]) assert result.exit_code == 0 - def test_predix_status_command(self): - """Test that predix status command exists.""" + def test_nexquant_status_command(self): + """Test that nexquant status command exists.""" from typer.testing import CliRunner import importlib.util spec = importlib.util.spec_from_file_location( - "predix", Path(__file__).parent.parent.parent / "predix.py" + "nexquant", Path(__file__).parent.parent.parent / "nexquant.py" ) - predix = importlib.util.module_from_spec(spec) - spec.loader.exec_module(predix) + nexquant = importlib.util.module_from_spec(spec) + spec.loader.exec_module(nexquant) runner = CliRunner() - result = runner.invoke(predix.app, ["status", "--help"]) + result = runner.invoke(nexquant.app, ["status", "--help"]) assert result.exit_code == 0 diff --git a/test/integration/test_full_pipeline.py b/test/integration/test_full_pipeline.py index ed02392f..27dc9e99 100644 --- a/test/integration/test_full_pipeline.py +++ b/test/integration/test_full_pipeline.py @@ -1,5 +1,5 @@ """ -Integration Tests for Full Predix Pipeline (P6-P9) +Integration Tests for Full NexQuant Pipeline (P6-P9) Tests the complete end-to-end pipeline including: - Feedback Loop Integration (P6) diff --git a/test/local/test_autopilot.py b/test/local/test_autopilot.py index fc4d1ef9..338933b2 100644 --- a/test/local/test_autopilot.py +++ b/test/local/test_autopilot.py @@ -1,4 +1,4 @@ -"""Deep tests for predix_autopilot.py — property-based, mocks, edge cases. +"""Deep tests for nexquant_autopilot.py — property-based, mocks, edge cases. Tests the core logic of the 24/7 strategy generator by mocking the StrategyOrchestrator at the correct import path. @@ -39,14 +39,14 @@ class TestMainRound: "rdagent.scenarios.qlib.local.strategy_orchestrator.StrategyOrchestrator", side_effect=RuntimeError("no data"), ): - from scripts.predix_autopilot import main_round + from scripts.nexquant_autopilot import main_round result = main_round("daytrading", 1) assert result == 0 def test_returns_zero_on_generate_failure(self, mock_orch): mock_cls, instance = mock_orch instance.generate_strategies.side_effect = RuntimeError("crash") - from scripts.predix_autopilot import main_round + from scripts.nexquant_autopilot import main_round result = main_round("daytrading", 1) assert result == 0 @@ -56,7 +56,7 @@ class TestMainRound: {"status": "accepted", "strategy_name": "s1", "sharpe_ratio": 0.5, "oos_sharpe": 0.3}, {"status": "rejected", "strategy_name": "s2", "reason": "low"}, ] - from scripts.predix_autopilot import main_round + from scripts.nexquant_autopilot import main_round result = main_round("daytrading", 1) assert result == 1 @@ -70,7 +70,7 @@ class TestMainRound: "status": "success", "sharpe_ratio": 0.95, "oos_sharpe": 0.65, "members": ["a", "b"], } - from scripts.predix_autopilot import main_round + from scripts.nexquant_autopilot import main_round main_round("daytrading", 1) instance.build_ensemble.assert_called_once() @@ -80,7 +80,7 @@ class TestMainRound: {"status": "accepted", "strategy_name": "a", "sharpe_ratio": 0.5, "oos_sharpe": 0.3}, {"status": "rejected", "strategy_name": "b", "reason": "no"}, ] - from scripts.predix_autopilot import main_round + from scripts.nexquant_autopilot import main_round main_round("daytrading", 1) instance.build_ensemble.assert_not_called() @@ -91,14 +91,14 @@ class TestMainRound: {"status": "accepted", "strategy_name": "b", "sharpe_ratio": 0.6, "oos_sharpe": 0.4}, ] instance.build_ensemble.side_effect = RuntimeError("boom") - from scripts.predix_autopilot import main_round + from scripts.nexquant_autopilot import main_round result = main_round("daytrading", 1) assert result == 2 # Still counts accepted def test_empty_results_returns_zero(self, mock_orch): mock_cls, instance = mock_orch instance.generate_strategies.return_value = [] - from scripts.predix_autopilot import main_round + from scripts.nexquant_autopilot import main_round result = main_round("daytrading", 1) assert result == 0 @@ -109,7 +109,7 @@ class TestMainRound: {"status": "accepted", "strategy_name": "b", "sharpe_ratio": 0.6, "oos_sharpe": 0.4}, ] instance.build_ensemble.return_value = None - from scripts.predix_autopilot import main_round + from scripts.nexquant_autopilot import main_round result = main_round("daytrading", 1) assert result == 2 @@ -130,27 +130,27 @@ class TestMainRound: "reason": "test"}, ] mock_cls.return_value = instance - from scripts.predix_autopilot import main_round + from scripts.nexquant_autopilot import main_round result = main_round("daytrading", 1) assert isinstance(result, int) and result >= 0 class TestConfig: def test_batch_size_positive(self): - from scripts import predix_autopilot - assert predix_autopilot.BATCH_SIZE > 0 + from scripts import nexquant_autopilot + assert nexquant_autopilot.BATCH_SIZE > 0 def test_optuna_trials_positive(self): - from scripts import predix_autopilot - assert predix_autopilot.OPTUNA_TRIALS > 0 + from scripts import nexquant_autopilot + assert nexquant_autopilot.OPTUNA_TRIALS > 0 def test_cooldown_positive(self): - from scripts import predix_autopilot - assert predix_autopilot.COOLDOWN > 0 + from scripts import nexquant_autopilot + assert nexquant_autopilot.COOLDOWN > 0 def test_max_consecutive_fails_positive(self): - from scripts import predix_autopilot - assert predix_autopilot.MAX_CONSECUTIVE_FAILS > 0 + from scripts import nexquant_autopilot + assert nexquant_autopilot.MAX_CONSECUTIVE_FAILS > 0 class TestStyleCycling: diff --git a/test/local/test_background_tasks.py b/test/local/test_background_tasks.py index 4e37201e..fe91c65e 100644 --- a/test/local/test_background_tasks.py +++ b/test/local/test_background_tasks.py @@ -2,9 +2,9 @@ Tests for background task infrastructure (parallel runner, CLI paths, env loading). Verifies bugs that were previously present: -- predix_parallel.py: project_root pointing to scripts/ instead of repo root -- predix_parallel.py: .env loaded from scripts/ instead of repo root -- predix_parallel.py: API key round-robin overwritten by comma-separated list +- nexquant_parallel.py: project_root pointing to scripts/ instead of repo root +- nexquant_parallel.py: .env loaded from scripts/ instead of repo root +- nexquant_parallel.py: API key round-robin overwritten by comma-separated list - cli.py: project_root depth wrong (4 .parent hops instead of 3) - cli.py start_loop: hardcoded "python" instead of sys.executable - cli.py parallel: hardcoded model=local @@ -18,7 +18,7 @@ from unittest.mock import Mock, patch import pytest -# ── predix_parallel.py ────────────────────────────────────────────────── +# ── nexquant_parallel.py ────────────────────────────────────────────────── class TestParallelRunnerProjectRoot: @@ -26,36 +26,36 @@ class TestParallelRunnerProjectRoot: def test_project_root_is_repo_root(self): """Bug: project_root was Path(__file__).parent (= scripts/).""" - from scripts.predix_parallel import ParallelRunner + from scripts.nexquant_parallel import ParallelRunner runner = ParallelRunner(num_runs=1, num_api_keys=1, model="local") root = runner.project_root - # Must contain predix.py (repo root), NOT be the scripts/ dir - assert (root / "predix.py").exists(), ( - f"project_root={root} does not contain predix.py — " + # Must contain nexquant.py (repo root), NOT be the scripts/ dir + assert (root / "nexquant.py").exists(), ( + f"project_root={root} does not contain nexquant.py — " f"likely still pointing to scripts/ instead of repo root" ) assert root.name != "scripts", ( f"project_root={root} ends with 'scripts/' — should be repo root" ) - def test_build_command_points_to_predix_py(self): - """Bug: command pointed to scripts/predix.py which doesn't exist.""" - from scripts.predix_parallel import ParallelRunner, RunState + def test_build_command_points_to_nexquant_py(self): + """Bug: command pointed to scripts/nexquant.py which doesn't exist.""" + from scripts.nexquant_parallel import ParallelRunner, RunState runner = ParallelRunner(num_runs=1, num_api_keys=1, model="local") run = RunState(run_id=1, api_key_idx=0, model="local") cmd = runner._build_command(run) - predix_path = Path(cmd[1]) - assert predix_path.exists(), ( - f"Command references {predix_path} which does not exist — " + nexquant_path = Path(cmd[1]) + assert nexquant_path.exists(), ( + f"Command references {nexquant_path} which does not exist — " f"project_root likely still wrong" ) - assert predix_path.name == "predix.py" - assert predix_path.parent.name != "scripts", ( - "predix.py should be in repo root, not scripts/" + assert nexquant_path.name == "nexquant.py" + assert nexquant_path.parent.name != "scripts", ( + "nexquant.py should be in repo root, not scripts/" ) def test_env_loading_from_repo_root(self): @@ -75,7 +75,7 @@ class TestParallelRunnerAPIKeys: def test_single_api_key_no_overwrite(self): """Bug: with num_api_keys=1, individual key was set then overwritten.""" - from scripts.predix_parallel import ParallelRunner, RunState + from scripts.nexquant_parallel import ParallelRunner, RunState with patch.dict(os.environ, {}, clear=True): os.environ["OPENROUTER_API_KEY"] = "sk-test-key-1" @@ -95,7 +95,7 @@ class TestParallelRunnerAPIKeys: def test_multi_api_key_comma_separated(self): """With 2+ keys, all runs get comma-separated list for load balancing.""" - from scripts.predix_parallel import ParallelRunner, RunState + from scripts.nexquant_parallel import ParallelRunner, RunState with patch.dict(os.environ, {}, clear=True): os.environ["OPENROUTER_API_KEY"] = "sk-key-a" @@ -111,7 +111,7 @@ class TestParallelRunnerAPIKeys: def test_round_robin_api_key_index(self): """Verify round-robin API key index assignment is computed correctly.""" - from scripts.predix_parallel import ParallelRunner + from scripts.nexquant_parallel import ParallelRunner with patch.dict(os.environ, {}, clear=True): os.environ["OPENROUTER_API_KEY"] = "a" @@ -129,7 +129,7 @@ class TestParallelRunnerLogFileHandling: def test_log_file_paths_in_repo_root(self): """Bug: logs went to scripts/fin_quant_runN.log.""" - from scripts.predix_parallel import ParallelRunner + from scripts.nexquant_parallel import ParallelRunner runner = ParallelRunner(num_runs=2, num_api_keys=1, model="local") @@ -170,7 +170,7 @@ class TestCLIProjectRoot: "4 .parent hops should NOT yield repo root " f"(got {buggy}, expected {self.REPO_ROOT.parent})" ) - assert (buggy / "Predix").exists() or buggy == self.REPO_ROOT.parent, ( + assert (buggy / "NexQuant").exists() or buggy == self.REPO_ROOT.parent, ( f"4 .parent hops overshoots repo root: {buggy}" ) @@ -210,12 +210,12 @@ class TestCLIProjectRoot: # All these commands use Path(__file__).parent.parent.parent as project_root commands = { - "eval_all": "scripts/predix_full_eval.py", - "batch_backtest": "scripts/predix_batch_backtest.py", - "simple_eval": "scripts/predix_simple_eval.py", - "rebacktest": "scripts/predix_rebacktest_strategies.py", - "report": "scripts/predix_strategy_report.py", - "parallel": "scripts/predix_parallel.py", + "eval_all": "scripts/nexquant_full_eval.py", + "batch_backtest": "scripts/nexquant_batch_backtest.py", + "simple_eval": "scripts/nexquant_simple_eval.py", + "rebacktest": "scripts/nexquant_rebacktest_strategies.py", + "report": "scripts/nexquant_strategy_report.py", + "parallel": "scripts/nexquant_parallel.py", } for cmd_name, script_path in commands.items(): @@ -231,12 +231,12 @@ class TestCLIProjectRoot: import inspect source = inspect.getsource(start_loop_cli) - # The generator should reference scripts/predix_smart_strategy_gen.py - assert "predix_smart_strategy_gen.py" in source, ( - "start_loop_cli should reference predix_smart_strategy_gen.py" + # The generator should reference scripts/nexquant_smart_strategy_gen.py + assert "nexquant_smart_strategy_gen.py" in source, ( + "start_loop_cli should reference nexquant_smart_strategy_gen.py" ) - script = self.REPO_ROOT / "scripts" / "predix_smart_strategy_gen.py" + script = self.REPO_ROOT / "scripts" / "nexquant_smart_strategy_gen.py" assert script.exists(), ( f"Generator script not found at {script}" ) @@ -266,7 +266,7 @@ class TestImportsDontCrash: def test_import_parallel_runner(self): """ParallelRunner should import without errors.""" - from scripts.predix_parallel import ParallelRunner, RunState + from scripts.nexquant_parallel import ParallelRunner, RunState runner = ParallelRunner(num_runs=1, num_api_keys=1, model="local") assert runner.num_runs == 1 assert len(runner.runs) == 1 diff --git a/test/local/test_bug_fixes.py b/test/local/test_bug_fixes.py index c49dc037..52052161 100644 --- a/test/local/test_bug_fixes.py +++ b/test/local/test_bug_fixes.py @@ -15,8 +15,8 @@ Verifies: - strategy_orchestrator.py exec() exception logged at ERROR level - strategy_orchestrator.py template validation warns on unreplaced {{...}} - factor_runner.py IC_max guard against scalar (AttributeError) -- predix_parallel.py handle leak on Popen failure -- predix_rebacktest_strategies.py bare except replaced with except Exception +- nexquant_parallel.py handle leak on Popen failure +- nexquant_rebacktest_strategies.py bare except replaced with except Exception """ import ast @@ -228,32 +228,32 @@ class TestFactorRunnerICMaxGuard: ) -# ── Fix 13: predix_parallel.py handle leak ─────────────────────────────── +# ── Fix 13: nexquant_parallel.py handle leak ─────────────────────────────── class TestParallelRunnerHandleLeak: def test_log_f_close_on_popen_failure(self): """Bug: open() file handle leaked if Popen failed.""" - source = (REPO_ROOT / "scripts/predix_parallel.py").read_text() + source = (REPO_ROOT / "scripts/nexquant_parallel.py").read_text() # After fix, log_f.close() is called before re-raise assert "log_f.close()" in source, ( - "predix_parallel.py should close log file handle on Popen failure" + "nexquant_parallel.py should close log file handle on Popen failure" ) -# ── Fix 14: predix_rebacktest_strategies.py bare except ────────────────── +# ── Fix 14: nexquant_rebacktest_strategies.py bare except ────────────────── class TestRebacktestBareExcept: def test_not_bare_except(self): """Bug: bare except: pass swallowed all errors including SystemExit.""" - source = (REPO_ROOT / "scripts/predix_rebacktest_strategies.py").read_text() + source = (REPO_ROOT / "scripts/nexquant_rebacktest_strategies.py").read_text() # After fix, should use except Exception, not bare except assert "except Exception:" in source assert "except:" not in source, ( - "predix_rebacktest_strategies.py should not use bare except:" + "nexquant_rebacktest_strategies.py should not use bare except:" ) diff --git a/test/local/test_continuous_strategies.py b/test/local/test_continuous_strategies.py index 96ded8f5..4a912fa6 100644 --- a/test/local/test_continuous_strategies.py +++ b/test/local/test_continuous_strategies.py @@ -1,4 +1,4 @@ -"""Deep tests for predix_continuous_strategies.py — ML model building, style cycling. +"""Deep tests for nexquant_continuous_strategies.py — ML model building, style cycling. Tests the build_ml_model function and the round/style alternation logic without requiring real StrategyOrchestrator connections. @@ -45,7 +45,7 @@ def close_data(): class TestBuildMLModel: def test_insufficient_data_returns_none(self, factor_data, close_data): """<5000 rows should return None.""" - from scripts.predix_continuous_strategies import build_ml_model + from scripts.nexquant_continuous_strategies import build_ml_model result = build_ml_model(factor_data.iloc[:100], close_data.iloc[:100], "swing") assert result is None @@ -55,7 +55,7 @@ class TestBuildMLModel: "sharpe": 1.5, "max_drawdown": -0.1, "win_rate": 0.55, "n_trades": 200, "wf_oos_sharpe_mean": 0.8, } - from scripts.predix_continuous_strategies import build_ml_model + from scripts.nexquant_continuous_strategies import build_ml_model result = build_ml_model(factor_data, close_data, "daytrading") assert result is not None assert "strategy_name" in result @@ -69,7 +69,7 @@ class TestBuildMLModel: "sharpe": 1.5, "max_drawdown": -0.1, "win_rate": 0.55, "n_trades": 200, "wf_oos_sharpe_mean": -0.3, } - from scripts.predix_continuous_strategies import build_ml_model + from scripts.nexquant_continuous_strategies import build_ml_model result = build_ml_model(factor_data, close_data, "swing") assert result is None @@ -90,7 +90,7 @@ class TestBuildMLModel: }, index=factor_data.index[:n]) c = pd.Series(1.10 + rng.normal(0, 0.001, n).cumsum(), index=f.index) try: - from scripts.predix_continuous_strategies import build_ml_model + from scripts.nexquant_continuous_strategies import build_ml_model result = build_ml_model(f, c, "swing") assert result is None or isinstance(result, dict) except Exception as e: @@ -102,12 +102,12 @@ class TestBuildMLModel: class TestConfig: def test_batch_size_is_positive(self): - from scripts import predix_continuous_strategies - assert predix_continuous_strategies.BATCH_SIZE > 0 + from scripts import nexquant_continuous_strategies + assert nexquant_continuous_strategies.BATCH_SIZE > 0 def test_cooldown_is_positive(self): - from scripts import predix_continuous_strategies - assert predix_continuous_strategies.COOLDOWN_SECONDS > 0 + from scripts import nexquant_continuous_strategies + assert nexquant_continuous_strategies.COOLDOWN_SECONDS > 0 class TestStyleCycling: diff --git a/test/local/test_gen_strategies.py b/test/local/test_gen_strategies.py index f70ccfc6..cb530677 100644 --- a/test/local/test_gen_strategies.py +++ b/test/local/test_gen_strategies.py @@ -1,4 +1,4 @@ -"""Deep tests for predix_gen_strategies_real_bt.py — property-based, edge cases. +"""Deep tests for nexquant_gen_strategies_real_bt.py — property-based, edge cases. Tests factor loading, threshold rescaling, backtest runner, acceptance criteria, and the TeeFile logger — without requiring real OHLCV data or LLM. @@ -27,7 +27,7 @@ from hypothesis import strategies as st @pytest.fixture def gen_module(): import importlib - import scripts.predix_gen_strategies_real_bt as m + import scripts.nexquant_gen_strategies_real_bt as m return m @@ -280,7 +280,7 @@ class TestConfiguration: """Daytrading config uses tighter risk limits.""" os.environ["TRADING_STYLE"] = "daytrading" import importlib - import scripts.predix_gen_strategies_real_bt as m + import scripts.nexquant_gen_strategies_real_bt as m importlib.reload(m) assert m.MIN_IC == 0.02 assert m.MIN_SHARPE == 0.5 @@ -289,7 +289,7 @@ class TestConfiguration: def test_swing_defaults(self): os.environ["TRADING_STYLE"] = "swing" import importlib - import scripts.predix_gen_strategies_real_bt as m + import scripts.nexquant_gen_strategies_real_bt as m importlib.reload(m) assert m.MIN_TRADES == 10 assert m.MAX_DRAWDOWN == -0.30 diff --git a/test/local/test_ml_trainer.py b/test/local/test_ml_trainer.py index 8146734d..9918acc1 100644 --- a/test/local/test_ml_trainer.py +++ b/test/local/test_ml_trainer.py @@ -1,5 +1,5 @@ """ -Tests for MLTrainer - ML Training Pipeline for Predix quant trading system. +Tests for MLTrainer - ML Training Pipeline for NexQuant quant trading system. Tests cover: - Feature matrix building diff --git a/test/local/test_predix_parallel.py b/test/local/test_nexquant_parallel.py similarity index 87% rename from test/local/test_predix_parallel.py rename to test/local/test_nexquant_parallel.py index aa1fa40b..a7c8aee3 100644 --- a/test/local/test_predix_parallel.py +++ b/test/local/test_nexquant_parallel.py @@ -1,4 +1,4 @@ -"""Deep tests for predix_parallel.py — property-based, state transitions, edge cases. +"""Deep tests for nexquant_parallel.py — property-based, state transitions, edge cases. Tests RunState, ParallelRunner configuration, environment building, command building, and API key loading logic. @@ -25,7 +25,7 @@ from hypothesis import strategies as st @pytest.fixture def runstate(): - from scripts.predix_parallel import RunState + from scripts.nexquant_parallel import RunState return RunState(run_id=1, api_key_idx=0, model="local") @@ -43,7 +43,7 @@ class TestRunState: def test_elapsed_running(self, runstate): runstate.start_time = datetime(2024, 1, 1, 12, 0, 0) - with patch("scripts.predix_parallel.datetime") as mock_dt: + with patch("scripts.nexquant_parallel.datetime") as mock_dt: mock_dt.now.return_value = datetime(2024, 1, 1, 13, 30, 45) assert runstate.elapsed == "01:30:45" @@ -94,7 +94,7 @@ class TestRunState: class TestParallelRunnerConfig: @patch.dict(os.environ, {}, clear=True) def test_load_api_keys_openrouter(self): - from scripts.predix_parallel import ParallelRunner + from scripts.nexquant_parallel import ParallelRunner with patch.dict(os.environ, { "OPENROUTER_API_KEY": "sk-key1", "OPENROUTER_API_KEY_2": "sk-key2", @@ -106,13 +106,13 @@ class TestParallelRunnerConfig: @patch.dict(os.environ, {}, clear=True) def test_load_api_keys_local(self): - from scripts.predix_parallel import ParallelRunner + from scripts.nexquant_parallel import ParallelRunner runner = ParallelRunner(num_runs=1, num_api_keys=1, model="local") assert runner.api_keys == ["local"] @patch.dict(os.environ, {}, clear=True) def test_load_api_keys_round_robin(self): - from scripts.predix_parallel import ParallelRunner + from scripts.nexquant_parallel import ParallelRunner runner = ParallelRunner(num_runs=5, num_api_keys=2, model="local") assert len(runner.runs) == 5 idxs = [r.api_key_idx for r in runner.runs] @@ -120,7 +120,7 @@ class TestParallelRunnerConfig: @patch.dict(os.environ, {}, clear=True) def test_build_env_local_model(self): - from scripts.predix_parallel import ParallelRunner, RunState + from scripts.nexquant_parallel import ParallelRunner, RunState with patch.dict(os.environ, { "OPENAI_API_KEY": "local", "OPENAI_API_BASE": "http://localhost:8081/v1", @@ -135,7 +135,7 @@ class TestParallelRunnerConfig: @patch.dict(os.environ, {}, clear=True) def test_build_env_openrouter(self): - from scripts.predix_parallel import ParallelRunner, RunState + from scripts.nexquant_parallel import ParallelRunner, RunState with patch.dict(os.environ, { "OPENROUTER_API_KEY": "sk-test", "OPENROUTER_API_KEY_2": "sk-test2", @@ -147,7 +147,7 @@ class TestParallelRunnerConfig: @patch.dict(os.environ, {}, clear=True) def test_build_env_sets_workspace(self): - from scripts.predix_parallel import ParallelRunner, RunState + from scripts.nexquant_parallel import ParallelRunner, RunState runner = ParallelRunner(num_runs=1, num_api_keys=1, model="local") rs = RunState(run_id=42, api_key_idx=0, model="local") env = runner._build_env(rs) @@ -156,11 +156,11 @@ class TestParallelRunnerConfig: @patch.dict(os.environ, {}, clear=True) def test_build_command(self): - from scripts.predix_parallel import ParallelRunner, RunState + from scripts.nexquant_parallel import ParallelRunner, RunState runner = ParallelRunner(num_runs=1, num_api_keys=1, model="local") rs = RunState(run_id=7, api_key_idx=0, model="local") cmd = runner._build_command(rs) - assert "predix.py" in cmd[1] or "predix" in cmd[1] + assert "nexquant.py" in cmd[1] or "nexquant" in cmd[1] assert "quant" in cmd assert "--model" in cmd assert "local" in cmd @@ -168,7 +168,7 @@ class TestParallelRunnerConfig: @patch.dict(os.environ, {}, clear=True) def test_parallel_runner_init_counts(self): - from scripts.predix_parallel import ParallelRunner + from scripts.nexquant_parallel import ParallelRunner for n in [1, 3, 10]: runner = ParallelRunner(num_runs=n, num_api_keys=2, model="local") assert len(runner.runs) == n @@ -178,20 +178,20 @@ class TestParallelRunnerConfig: class TestParallelRunnerEdgeCases: @patch.dict(os.environ, {}, clear=True) def test_max_runs_limit(self): - from scripts.predix_parallel import ParallelRunner + from scripts.nexquant_parallel import ParallelRunner runner = ParallelRunner(num_runs=100, num_api_keys=1, model="local") assert len(runner.runs) == 100 @patch.dict(os.environ, {}, clear=True) def test_api_keys_empty_uses_local(self): - from scripts.predix_parallel import ParallelRunner + from scripts.nexquant_parallel import ParallelRunner runner = ParallelRunner(num_runs=1, num_api_keys=2, model="openrouter") assert len(runner.api_keys) >= 1 @patch.dict(os.environ, {}, clear=True) def test_build_env_preserves_existing_env(self, monkeypatch): monkeypatch.setenv("MY_CUSTOM_VAR", "custom_value") - from scripts.predix_parallel import ParallelRunner, RunState + from scripts.nexquant_parallel import ParallelRunner, RunState runner = ParallelRunner(num_runs=1, num_api_keys=1, model="local") rs = RunState(run_id=1, api_key_idx=0, model="local") env = runner._build_env(rs) diff --git a/test/local/test_strategy_worker.py b/test/local/test_strategy_worker.py index 3d467910..22601c04 100644 --- a/test/local/test_strategy_worker.py +++ b/test/local/test_strategy_worker.py @@ -643,14 +643,14 @@ class TestStrategySaver: 'passed': True, 'checks': {}, }, - metadata={'version': '1.0', 'author': 'Predix'}, + metadata={'version': '1.0', 'author': 'NexQuant'}, ) with open(filepath) as f: data = json.load(f) assert data['metadata']['version'] == '1.0' - assert data['metadata']['author'] == 'Predix' + assert data['metadata']['author'] == 'NexQuant' def test_save_strategy_with_llm_response(self, strategy_saver): """Test saving strategy with LLM response preview.""" diff --git a/test/qlib/test_everything_else.py b/test/qlib/test_everything_else.py index d25bb309..722e54ba 100644 --- a/test/qlib/test_everything_else.py +++ b/test/qlib/test_everything_else.py @@ -123,9 +123,9 @@ class TestWebDashboard: class TestScriptsImportable: - def test_predix_full_eval(self): + def test_nexquant_full_eval(self): import importlib - spec = importlib.util.spec_from_file_location("m", PROJECT_ROOT / "scripts/predix_full_eval.py") + spec = importlib.util.spec_from_file_location("m", PROJECT_ROOT / "scripts/nexquant_full_eval.py") assert spec is not None def test_extract_results(self): @@ -153,24 +153,24 @@ class TestScriptsImportable: spec = importlib.util.spec_from_file_location("m", PROJECT_ROOT / "scripts/kronos_model_eval.py") assert spec is not None - def test_predix_add_risk_management(self): + def test_nexquant_add_risk_management(self): import importlib - spec = importlib.util.spec_from_file_location("m", PROJECT_ROOT / "scripts/predix_add_risk_management.py") + spec = importlib.util.spec_from_file_location("m", PROJECT_ROOT / "scripts/nexquant_add_risk_management.py") assert spec is not None - def test_predix_gen_strategies(self): + def test_nexquant_gen_strategies(self): import importlib - spec = importlib.util.spec_from_file_location("m", PROJECT_ROOT / "scripts/predix_gen_strategies_real_bt.py") + spec = importlib.util.spec_from_file_location("m", PROJECT_ROOT / "scripts/nexquant_gen_strategies_real_bt.py") assert spec is not None - def test_predix_quick_daytrading(self): + def test_nexquant_quick_daytrading(self): import importlib - spec = importlib.util.spec_from_file_location("m", PROJECT_ROOT / "scripts/predix_quick_daytrading.py") + spec = importlib.util.spec_from_file_location("m", PROJECT_ROOT / "scripts/nexquant_quick_daytrading.py") assert spec is not None - def test_predix_rebacktest_unified(self): + def test_nexquant_rebacktest_unified(self): import importlib - spec = importlib.util.spec_from_file_location("m", PROJECT_ROOT / "scripts/predix_rebacktest_unified.py") + spec = importlib.util.spec_from_file_location("m", PROJECT_ROOT / "scripts/nexquant_rebacktest_unified.py") assert spec is not None def test_realistic_backtest_all(self): diff --git a/test/qlib/test_factor_eval_bugs.py b/test/qlib/test_factor_eval_bugs.py index a0a03838..46dbac19 100644 --- a/test/qlib/test_factor_eval_bugs.py +++ b/test/qlib/test_factor_eval_bugs.py @@ -196,7 +196,7 @@ class TestInfNanHandlingInsertion: # ============================================================================= -# Bug 5: scan_factors reads factor_code twice (predix_full_eval.py:174 + 195) +# Bug 5: scan_factors reads factor_code twice (nexquant_full_eval.py:174 + 195) # ============================================================================= class TestScanFactorsDoubleRead: @@ -205,9 +205,9 @@ class TestScanFactorsDoubleRead: def test_factor_code_read_only_when_needed(self): """Confirm the scan_factors double-read behavior (line 174+195).""" import inspect - from scripts import predix_full_eval + from scripts import nexquant_full_eval - source = inspect.getsource(predix_full_eval.scan_factors) + source = inspect.getsource(nexquant_full_eval.scan_factors) # Count occurrences of `.read_text()` count = source.count(".read_text()") diff --git a/test/qlib/test_headform4.py b/test/qlib/test_headform4.py index 29628408..4e64190c 100644 --- a/test/qlib/test_headform4.py +++ b/test/qlib/test_headform4.py @@ -18,8 +18,8 @@ class TestContinuousGenerator: def test_module_imports(self): import importlib.util spec = importlib.util.spec_from_file_location( - "predix_autopilot", - PROJECT_ROOT / "scripts/predix_autopilot.py", + "nexquant_autopilot", + PROJECT_ROOT / "scripts/nexquant_autopilot.py", ) assert spec is not None @@ -107,6 +107,6 @@ class TestAutopilotIntegration: def test_autopilot_pid_running(self): import os - result = os.system("pgrep -f predix_autopilot > /dev/null 2>&1") + result = os.system("pgrep -f nexquant_autopilot > /dev/null 2>&1") # 0 = running, 1 = not running — both are valid states assert result in (0, 1) diff --git a/test/qlib/test_predix_full_eval.py b/test/qlib/test_nexquant_full_eval.py similarity index 77% rename from test/qlib/test_predix_full_eval.py rename to test/qlib/test_nexquant_full_eval.py index b6dccaa2..2a006717 100644 --- a/test/qlib/test_predix_full_eval.py +++ b/test/qlib/test_nexquant_full_eval.py @@ -1,4 +1,4 @@ -"""Tests for scripts/predix_full_eval.py pure functions and dataclasses.""" +"""Tests for scripts/nexquant_full_eval.py pure functions and dataclasses.""" from __future__ import annotations @@ -13,7 +13,7 @@ sys.path.insert(0, str(PROJECT_ROOT)) class TestFactorInfo: def test_construction(self): - from scripts.predix_full_eval import FactorInfo + from scripts.nexquant_full_eval import FactorInfo fi = FactorInfo( workspace_hash="abc123", factor_name="test_factor", @@ -26,7 +26,7 @@ class TestFactorInfo: class TestEvalResult: def test_defaults(self): - from scripts.predix_full_eval import EvalResult + from scripts.nexquant_full_eval import EvalResult er = EvalResult(factor_name="f1", workspace_hash="h1") assert er.status == "" assert er.ic is None @@ -34,7 +34,7 @@ class TestEvalResult: assert er.non_null_count == 0 def test_failed_result(self): - from scripts.predix_full_eval import EvalResult + from scripts.nexquant_full_eval import EvalResult er = EvalResult( factor_name="f1", workspace_hash="h1", status="failed", error_message="timeout", @@ -43,7 +43,7 @@ class TestEvalResult: assert er.error_message == "timeout" def test_to_dict(self): - from scripts.predix_full_eval import EvalResult + from scripts.nexquant_full_eval import EvalResult er = EvalResult(factor_name="f1", workspace_hash="h1", status="success", ic=0.05) d = er.to_dict() assert d["factor_name"] == "f1" @@ -53,26 +53,26 @@ class TestEvalResult: class TestExtractFactorDescription: def test_docstring_extracted(self): - from scripts.predix_full_eval import _extract_factor_description + from scripts.nexquant_full_eval import _extract_factor_description code = '"""This is a test factor.\nComputes momentum."""\nx=1' desc = _extract_factor_description(code) assert "test factor" in desc def test_comment_extraction(self): - from scripts.predix_full_eval import _extract_factor_description + from scripts.nexquant_full_eval import _extract_factor_description code = "# Momentum factor\n# Uses 20-bar window\nx=1" desc = _extract_factor_description(code) assert "Momentum factor" in desc assert "20-bar window" in desc def test_no_docstring_or_comments(self): - from scripts.predix_full_eval import _extract_factor_description + from scripts.nexquant_full_eval import _extract_factor_description code = "x = 1\ny = 2\n" desc = _extract_factor_description(code) assert desc == "No description available" def test_shebang_skipped(self): - from scripts.predix_full_eval import _extract_factor_description + from scripts.nexquant_full_eval import _extract_factor_description code = "#!/usr/bin/env python\n# Real comment\nx=1" desc = _extract_factor_description(code) assert "Real comment" in desc diff --git a/test/qlib/test_open_source_suite.py b/test/qlib/test_open_source_suite.py index 628815b1..d7d6a48e 100644 --- a/test/qlib/test_open_source_suite.py +++ b/test/qlib/test_open_source_suite.py @@ -16,10 +16,10 @@ PROJECT_ROOT = Path(__file__).parent.parent.parent sys.path.insert(0, str(PROJECT_ROOT)) -class TestPredixCLI: +class TestNexQuantCLI: def test_cli_commands_available(self): import subprocess - r = subprocess.run([sys.executable, "predix.py", "--help"], capture_output=True, text=True, timeout=10) + r = subprocess.run([sys.executable, "nexquant.py", "--help"], capture_output=True, text=True, timeout=10) assert r.returncode == 0 for cmd in ["evaluate", "top", "best", "portfolio", "build-strategies", "generate-strategies", "health"]: assert cmd in r.stdout.lower(), f"Missing command: {cmd}" diff --git a/web/dashboard_api.py b/web/dashboard_api.py index 0f4616d3..f40b222c 100644 --- a/web/dashboard_api.py +++ b/web/dashboard_api.py @@ -1,5 +1,5 @@ """ -Predix Dashboard API +NexQuant Dashboard API Flask-Backend für das Web-Dashboard. Zeigt COMPLETE Progress von EURUSD Trading-Agent. @@ -290,7 +290,7 @@ def get_full_dashboard(): def index(): """Root Endpoint - zeigt API-Info.""" return jsonify({ - "name": "Predix Dashboard API", + "name": "NexQuant Dashboard API", "version": "1.0.0", "description": "COMPLETE Progress Visualisierung für EURUSD Trading-Agent", "endpoints": { @@ -307,7 +307,7 @@ def index(): if __name__ == '__main__': print("="*60) - print("Predix Dashboard API") + print("NexQuant Dashboard API") print("="*60) print(f"Modules available: {MODULES_AVAILABLE}") print(f"Starting server on http://localhost:5000")