{"id":50502796,"url":"https://github.com/tptbusiness/nexquant","last_synced_at":"2026-06-02T13:01:38.260Z","repository":{"id":348776681,"uuid":"1188936327","full_name":"TPTBusiness/NexQuant","owner":"TPTBusiness","description":"NexQuant is an autonomous AI agent for quantitative strategy research. Built on a multi-agent framework","archived":false,"fork":false,"pushed_at":"2026-06-01T12:48:18.000Z","size":153760,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-06-01T14:23:42.320Z","etag":null,"topics":["ai-agents","algorithmic-trading","autonomous-agents","backtesting","eurusd","forex","foundation-models","ftmo","kronos","llm","multi-agent","optuna","python","pytorch","quantitative-finance","streamlit","trading-bot"],"latest_commit_sha":null,"homepage":"https://github.com/TPTBusiness/NexQuant","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TPTBusiness.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":"SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-03-22T19:28:20.000Z","updated_at":"2026-06-01T12:45:01.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/TPTBusiness/NexQuant","commit_stats":null,"previous_names":["tptbusiness/predix","tptbusiness/nexquant"],"tags_count":36,"template":false,"template_full_name":null,"purl":"pkg:github/TPTBusiness/NexQuant","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TPTBusiness%2FNexQuant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TPTBusiness%2FNexQuant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TPTBusiness%2FNexQuant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TPTBusiness%2FNexQuant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TPTBusiness","download_url":"https://codeload.github.com/TPTBusiness/NexQuant/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TPTBusiness%2FNexQuant/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33822821,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-02T02:00:07.132Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agents","algorithmic-trading","autonomous-agents","backtesting","eurusd","forex","foundation-models","ftmo","kronos","llm","multi-agent","optuna","python","pytorch","quantitative-finance","streamlit","trading-bot"],"created_at":"2026-06-02T13:01:36.104Z","updated_at":"2026-06-02T13:01:38.252Z","avatar_url":"https://github.com/TPTBusiness.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NexQuant\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Python-3.10%20|%203.11-blue?style=for-the-badge\u0026logo=python\" alt=\"Python\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Platform-Linux-lightgrey?style=for-the-badge\u0026logo=linux\" alt=\"Platform\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Numba-0.59+-00A3E0?style=for-the-badge\u0026logo=numba\" alt=\"Numba\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Optuna-4.8+-009B77?style=for-the-badge\u0026logo=optuna\" alt=\"Optuna\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/TA--Lib-0.6+-green?style=for-the-badge\" alt=\"TA-Lib\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/LightGBM-4.6+-00A1E0?style=for-the-badge\" alt=\"LightGBM\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Pandas-2.0+-150458?style=for-the-badge\u0026logo=pandas\" alt=\"Pandas\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/cTrader-OpenAPI-FF6B6B?style=for-the-badge\" alt=\"cTrader\"\u003e\n\u003c/p\u003e\n\n\u003ch4 align=\"center\"\u003e\n  \u003cstrong\u003eHigh-Speed Strategy Discovery Framework\u003c/strong\u003e\n\u003c/h4\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#quick-start\"\u003eQuick Start\u003c/a\u003e •\n  \u003ca href=\"#strategy-discovery\"\u003eStrategy Discovery\u003c/a\u003e •\n  \u003ca href=\"#live-trading\"\u003eLive Trading\u003c/a\u003e •\n  \u003ca href=\"#features\"\u003eFeatures\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/TPTBusiness/NexQuant/actions/workflows/ci.yml\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/TPTBusiness/NexQuant/ci.yml?branch=master\u0026label=CI\u0026logo=github\u0026style=flat-square\" alt=\"CI Status\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/TPTBusiness/NexQuant/actions/workflows/codacy.yml\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/TPTBusiness/NexQuant/codacy.yml?branch=master\u0026label=Security\u0026logo=shield\u0026style=flat-square\" alt=\"Security Scan\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/TPTBusiness/NexQuant/blob/master/LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/TPTBusiness/NexQuant?style=flat-square\" alt=\"License\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/astral-sh/ruff\"\u003e\n    \u003cimg src=\"https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json\u0026style=flat-square\" alt=\"Ruff\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/TPTBusiness/NexQuant/commits/master\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/last-commit/TPTBusiness/NexQuant?style=flat-square\" alt=\"Last Commit\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n## Overview\n\n**NexQuant** discovers profitable trading strategies through high-speed search — no LLM required. Core engine: Numba JIT-compiled backtest at **735 million bars/second** (245× faster than pandas). Four discovery methods run in a continuous loop:\n\n| Method | Frequency | Description |\n|--------|-----------|-------------|\n| **Explore** | 30% of iterations | Random strategies from 17 TA-Lib indicators across timeframes |\n| **Exploit** | 70% of iterations | Mutate the best-known strategy (change params, indicator, or timeframe) |\n| **Optuna** | Every 500 iterations | 20-trial hyperparameter optimization on the current best |\n| **LightGBM** | Every 2000 iterations | ML classifier trained on SOTA indicator signals to predict direction |\n\n**Current best strategy**: MACD(3,10,3) 4-TF with 2/4 vote majority — **+32.0%/month** (Numba), **+24.3%/month** (verified independent backtest), 0/75 negative months.\n\n\u003e **This repository contains the research framework.** Trading strategies, broker integrations, and live trading infrastructure are available as separate closed-source modules (`git_ignore_folder/`).\n\n---\n\n## Quick Start\n\n```bash\n# Prerequisites\nconda create -n nexquant python=3.10 -y \u0026\u0026 conda activate nexquant\npip install -e .\n# Ensure OHLCV data exists: git_ignore_folder/intraday_pv_all.h5\n\n# Strategy Discovery Loop (10,000 iterations, ~1 hour)\npython scripts/nexquant_rd_loop.py --iterations 10000\n\n# Price-Action Indicator Loop (grid search all TA-Lib indicators)\npython scripts/nexquant_priceaction_loop.py\n\n# Top strategies report\npython nexquant.py best -n 20 -m monthly_return --min-trades 30\n```\n\n---\n\n## Strategy Discovery\n\n### R\u0026D Loop (`scripts/nexquant_rd_loop.py`)\n\n```\n ┌──────────┐     ┌──────────┐     ┌──────────┐     ┌──────────┐\n │ Explore  │ ──→ │ Exploit  │ ──→ │ Optuna   │ ──→ │ LightGBM │\n │ (Random) │     │ (Mutate) │     │ (Tuning) │     │   (ML)   │\n └──────────┘     └──────────┘     └──────────┘     └──────────┘\n       30%              70%           /500 iter        /2000 iter\n```\n\n**17 TA-Lib indicators**: MACD, RSI, Donchian, SAR, ADX, BBANDS, CCI, WCLPRICE, MFI, OBV, STOCH, ROC, AROON, AROONOSC, MOM, ULTOSC, WILLR\n\n**4 timeframes**: 15min, 30min, 1h, 4h\n\n**3 strategy types**: Single-TF, Multi-TF (vote majority), Portfolio (indicator ensemble)\n\n**Discovery example** (50,000 iterations):\n```\nrandom → SAR(+65) → MACD(+73) → MACD-mutated(+102.75, +32%/month)\n                                        ↓\n                                  Optuna tuned params\n                                        ↓\n                                  LightGBM ensemble\n```\n\n### Grid Search (`scripts/nexquant_priceaction_loop.py`)\n\nDeterministic parameter grid over all 17 indicators. Finds MACD(3,10,3) as optimal.\n\n### Portfolio Optimizer (`scripts/nexquant_portfolio_optimizer.py`)\n\nGreedy correlation-aware selection from discovered strategies.\n\n---\n\n## Live Trading\n\nClosed-source module at `git_ignore_folder/nexquant_live_trader.py`. Architecture:\n\n```\nMACD(3,10,3) Signal → cTrader OpenAPI → Live Account\n 4-TF 2/4 Votes      (WebSocket+Protobuf)        ↓\n                                             Paper Mode\n```\n\nIntegration: cTrader WebSocket `live.ctraderapi.com:5035`, OAuth2 authentication, Protobuf message encoding, FIX protocol.\n\n---\n\n## Features\n\n### ⚡ Numba Backtest\n- 735M bars/second (0.003s for 2.26M bars)\n- JIT-compiled profit/drawdown/sharpe computation\n- Signal construction via pandas resample + TA-Lib (~0.4s) is the bottleneck\n\n### 🔍 Four Discovery Methods\n- **Explore**: Random indicator + timeframe + parameters\n- **Exploit**: Mutation of top-5 SOTA strategies (parameter tweak, indicator swap, timeframe change)\n- **Optuna**: 20-trial TPE hyperparameter optimization on best strategy\n- **LightGBM**: ML classifier on SOTA indicator signals (80/20 train/test split)\n\n### 📊 TA-Lib Integration\n- 17 indicators with full parameter ranges\n- Auto-guard against bad parameters (negative/zero values that crash TA-Lib)\n- Multi-timeframe voting with configurable threshold\n\n### 🔒 Security \u0026 Quality\n- 0 Dependabot alerts, 0 CodeScan alerts\n- No proprietary terms in git history\n- Closed-source detection CI\n\n---\n\n## Project Structure\n\n```\nnexquant/\n├── scripts/                     # Strategy discovery \u0026 trading\n│   ├── nexquant_rd_loop.py              # High-speed R\u0026D loop (Numba + Optuna + ML)\n│   ├── nexquant_priceaction_loop.py     # TA-Lib grid search loop\n│   ├── nexquant_portfolio_optimizer.py  # Correlation-aware portfolio selection\n│   ├── nexquant_gridsearch.py           # Deterministic parameter grid search\n│   ├── nexquant_daily_strategies.py     # Daily Kronos + factor combinations\n│   ├── nexquant_gen_strategies_real_bt.py  # LLM-based strategy generation\n│   ├── nexquant_autopilot.py            # 24/7 continuous generator\n│   └── nexquant_parallel.py             # Multi-instance parallel runs\n├── rdagent/                     # Core framework (LLM-based, see note below)\n│   ├── app/                     # CLI and scenario apps\n│   ├── components/              # Backtest engine, protections, coders\n│   ├── core/                    # Core abstractions\n│   ├── scenarios/               # Domain-specific scenarios\n│   └── utils/                   # Utilities\n├── git_ignore_folder/           # Closed-source (never committed)\n│   ├── nexquant_live_trader.py          # cTrader live trading\n│   ├── nexquant_fix_trader.py           # FIX protocol trader\n│   ├── intraday_pv_all.h5               # OHLCV data\n│   ├── gbpusdt_1min.h5                  # GBP/USD data\n│   └── btc_1min.h5                      # BTC data\n├── test/                        # 1,125+ collected tests\n├── data_config.yaml             # Walk-forward split configuration\n├── requirements.txt             # Dependencies\n└── AGENTS.md                    # Agent configuration \u0026 workflow guide\n```\n\n\u003e **Note on `rdagent/`**: The LLM-based R\u0026D framework (`rdagent fin_quant`) is part of the codebase but the Qlib/CoSTEER pipeline currently produces zero factors. The primary strategy discovery path is the Numba-based loop in `scripts/`.\n\n---\n\n## Installation\n\n### Prerequisites\n- **Conda** (Miniconda or Anaconda)\n- **TA-Lib** system library (`apt install ta-lib` or `brew install ta-lib`)\n- **Linux** (Ubuntu 22.04+)\n\n### Install\n\n```bash\ngit clone https://github.com/TPTBusiness/NexQuant \u0026\u0026 cd NexQuant\nconda create -n nexquant python=3.10 -y \u0026\u0026 conda activate nexquant\npip install -e .\n```\n\n### Data\nPlace OHLCV HDF5 data at `git_ignore_folder/intraday_pv_all.h5`:\n```python\n# Format: MultiIndex (datetime, instrument), columns: $open $close $high $low $volume\ndf.to_hdf('git_ignore_folder/intraday_pv_all.h5', key='data')\n```\n\n---\n\n## License\n\n**GNU Affero General Public License v3.0 (AGPL-3.0)**. See [`LICENSE`](LICENSE).\n\n---\n\n## Disclaimer\n\nNexQuant is provided for **research and educational purposes only**. Past performance does not guarantee future results. Users assume all liability.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftptbusiness%2Fnexquant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftptbusiness%2Fnexquant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftptbusiness%2Fnexquant/lists"}