Skip to content

FinceptTerminal is a modern finance application offering advanced market analytics, investment research, and economic data tools, designed for interactive exploration and data-driven decision-making in a user-friendly environment.

voice mode update

tilakpatel2299ca913e09cf
diff --git a/fincept-qt/CMakeLists.txt b/fincept-qt/CMakeLists.txt
index e1c3a39e4..a33713b85 100644
--- a/fincept-qt/CMakeLists.txt
+++ b/fincept-qt/CMakeLists.txt
@@ -69,7 +69,7 @@ if(Qt6WebSockets_FOUND)
endif()
# Optional: MultimediaWidgets (for inline video/stream playback)
-# Qt6::Multimedia is already required above (needed for QAudioSource / WhisperService).
+# Qt6::Multimedia is already required above (needed for QMediaPlayer in AiChatBubble / VideoPlayerWidget).
find_package(Qt6 QUIET COMPONENTS MultimediaWidgets)
if(Qt6MultimediaWidgets_FOUND)
set(HAS_MULTIMEDIA TRUE)
@@ -113,51 +113,6 @@ else()
)
endif()
-# ── whisper.cpp (offline speech-to-text, cross-platform) ─────────────────────
-# Disable all whisper examples/tests — we only need the static library + header.
-set(WHISPER_BUILD_TESTS OFF CACHE BOOL "" FORCE)
-set(WHISPER_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
-set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
-# SDL2 is only needed by the stream example — not required when embedding.
-set(WHISPER_SDL2 OFF CACHE BOOL "" FORCE)
-
-# Whisper/GGML build guards — prevent CI failures across all platforms:
-#
-# GGML_NATIVE: detects host CPU features at configure time and enables
-# architecture-specific intrinsics. Breaks in three ways on CI:
-# - macOS ARM64 native: runner may lack i8mm support → vmmlaq_s32 build error
-# - macOS ARM64 → x86_64 cross: detects apple-m3 CPU, invalid for x86 target
-# - Windows ARM64 (clang-cl): emits 'native+nodotprod+noi8mm+nosve', unsupported
-# We embed whisper for STT only — native CPU tuning gives negligible benefit
-# vs the build fragility it introduces across CI runners.
-#
-# GGML_METAL: uses Objective-C (.m files). GGML's CMake unity build merges .m
-# into a .c translation unit, which breaks ObjC syntax (@class, @protocol etc.)
-# on all macOS jobs. We use CPU inference only (use_gpu=false in WhisperService),
-# so Metal provides no benefit.
-if(APPLE)
- set(GGML_NATIVE OFF CACHE BOOL "" FORCE)
- set(GGML_METAL OFF CACHE BOOL "" FORCE)
-elseif(MSVC AND CMAKE_GENERATOR_PLATFORM STREQUAL "ARM64")
- # Windows ARM64 cross-compile: clang-cl rejects GGML's native ARM feature string.
- set(GGML_NATIVE OFF CACHE BOOL "" FORCE)
-endif()
-FetchContent_Declare(
- whisper
- GIT_REPOSITORY https://github.com/ggml-org/whisper.cpp.git
- GIT_TAG v1.7.4
- GIT_SHALLOW TRUE
- # After first fetch, never touch the network again — saves 3-8s per configure
- UPDATE_DISCONNECTED TRUE
-)
-FetchContent_MakeAvailable(whisper)
-# whisper.cpp uses C-style casts internally — suppress warnings for third-party code
-if(MSVC)
- target_compile_options(whisper PRIVATE /W0)
-else()
- target_compile_options(whisper PRIVATE -w)
-endif()
-
# ── QSimpleUpdater (cross-platform auto-update) ──────────────────────────────
set(QSIMPLE_UPDATER_BUILD_TESTS OFF CACHE BOOL "" FORCE)
FetchContent_Declare(
@@ -502,8 +457,8 @@ set(SERVICE_SOURCES
src/services/polymarket/PolymarketService.cpp
src/services/polymarket/PolymarketWebSocket.cpp
- # Whisper STT service (cross-platform offline speech recognition)
- src/services/stt/WhisperService.cpp
+ # Speech-to-text service (Python speech_recognition + Google API)
+ src/services/stt/SpeechService.cpp
# Modular notification system — service + 15 providers
src/services/notifications/NotificationService.cpp
@@ -1159,8 +1114,6 @@ set_source_files_properties(
src/trading/brokers/ibkr/IBKRBroker.cpp
src/trading/brokers/tradier/TradierBroker.cpp
src/trading/brokers/saxo/SaxoBankBroker.cpp
- # WhisperService has a static local QStringList — exclude from unity to avoid ODR issues
- src/services/stt/WhisperService.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION TRUE
)
@@ -1283,8 +1236,6 @@ add_executable(FinceptTerminal ${_FINCEPT_EXE_FLAGS}
target_include_directories(FinceptTerminal PRIVATE
src
- ${whisper_SOURCE_DIR}/include
- ${whisper_SOURCE_DIR}
${SingleApplication_SOURCE_DIR}
)
@@ -1513,7 +1464,6 @@ target_link_libraries(FinceptTerminal PRIVATE
QXlsx::QXlsx
qgeoview
QSimpleUpdater
- whisper
md4c
md4c-html
SingleApplication::SingleApplication
diff --git "a/fincept-qt/C\357\200\272Tempfincept_out.txt" "b/fincept-qt/C\357\200\272Tempfincept_out.txt"
new file mode 100644
index 000000000..1f31ccc41
--- /dev/null
+++ "b/fincept-qt/C\357\200\272Tempfincept_out.txt"
@@ -0,0 +1,4 @@
+Microsoft Windows [Version 10.0.26200.8037]
+(c) Microsoft Corporation. All rights reserved.
+
+C:\windowsdisk\finceptTerminal\fincept-qt>
\ No newline at end of file
diff --git a/fincept-qt/resources/requirements-numpy2.txt b/fincept-qt/resources/requirements-numpy2.txt
index 7b53422e4..6b7ea41c1 100644
--- a/fincept-qt/resources/requirements-numpy2.txt
+++ b/fincept-qt/resources/requirements-numpy2.txt
@@ -152,3 +152,7 @@ mlflow>=2.0.0
# VisionQuant Pattern Intelligence
faiss-cpu>=1.7.0
mplfinance>=0.12.0
+
+# Voice recognition (speech-to-text via Google API)
+SpeechRecognition>=3.10.0
+PyAudio>=0.2.14
diff --git a/fincept-qt/scripts/ai_quant_lab/qlib_rolling_retraining.py b/fincept-qt/scripts/ai_quant_lab/qlib_rolling_retraining.py
index 8759c6f85..ba6da5c27 100644
--- a/fincept-qt/scripts/ai_quant_lab/qlib_rolling_retraining.py
+++ b/fincept-qt/scripts/ai_quant_lab/qlib_rolling_retraining.py
@@ -1,46 +1,422 @@
-"""AI Quant Lab - Rolling Retraining: Automated model retraining scheduler"""
-import json, sys, warnings
-from typing import Dict, Any
+"""AI Quant Lab - Rolling Retraining: Real Qlib-backed rolling model scheduler"""
+import json
+import os
+import sys
+import time
+import warnings
from datetime import datetime, timedelta
-warnings.filterwarnings('ignore')
+from pathlib import Path
+from typing import Any, Dict, Optional
+warnings.filterwarnings("ignore")
+
+# ── Persistence paths ─────────────────────────────────────────────────────────
+FINCEPT_DIR = Path.home() / ".fincept"
+SCHEDULES_FILE = FINCEPT_DIR / "rolling_schedules.json"
+CONFIGS_DIR = FINCEPT_DIR / "configs"
+
+# ── Qlib import ───────────────────────────────────────────────────────────────
try:
+ from qlib.contrib.rolling.base import Rolling
import qlib
- from qlib.contrib.rolling import Rolling
- ROLLING_AVAILABLE = True
-except: ROLLING_AVAILABLE = False
-
-class RollingRetrainer:
- def __init__(self): self.schedules, self.history = {}, []
- def create_schedule(self, model_id, freq='daily', window=252):
- next_run = (datetime.now() + timedelta(days=1)).isoformat()
- self.schedules[model_id] = {'freq': freq, 'window': window, 'next_run': next_run}
- return {'success': True, 'model_id': model_id, 'schedule': self.schedules[model_id]}
- def execute_retrain(self, model_id):
- self.history.append({'model_id': model_id, 'timestamp': datetime.now().isoformat(), 'status': 'completed'})
- return {'success': True, 'model_id': model_id, 'message': 'Retraining completed'}
- def get_schedules(self): return {'success': True, 'schedules': self.schedules, 'count': len(self.schedules)}
+ import logging
+ # Send qlib's verbose logs to stderr so only our JSON lines appear on stdout
+ logging.getLogger("qlib").setLevel(logging.WARNING)
+
+ QLIB_AVAILABLE = True
+except Exception as e:
+ QLIB_AVAILABLE = False
+ QLIB_ERROR = str(e)
+
+# ── Built-in LightGBM + Alpha158 template ─────────────────────────────────────
+BUILTIN_TEMPLATE = """\
+qlib_init:
+ provider_uri: "{provider_uri}"
+ region: {region}
+
+task:
+ model:
+ class: LGBModel
+ module_path: qlib.contrib.model.gbdt
+ kwargs:
+ loss: mse
+ colsample_bytree: 0.8879
+ learning_rate: 0.0421
+ subsample: 0.8789
+ lambda_l1: 205.6999
+ lambda_l2: 580.4723
+ max_depth: 8
+ num_leaves: 210
+ num_threads: 20
+ dataset:
+ class: DatasetH
+ module_path: qlib.data.dataset
+ kwargs:
+ handler:
+ class: Alpha158
+ module_path: qlib.contrib.data.handler
+ kwargs:
+ start_time: {train_start}
+ end_time: {test_end}
+ fit_start_time: {train_start}
+ fit_end_time: {train_end}
+ instruments: {market}
+ segments:
+ train: [{train_start}, {train_end}]
+ valid: [{valid_start}, {valid_end}]
+ test: [{test_start}, {test_end}]
+ record:
+ - class: SignalRecord
+ module_path: qlib.workflow.record_temp
+ kwargs:
+ model: <MODEL>
+ dataset: <DATASET>
+ - class: SigAnaRecord
+ module_path: qlib.workflow.record_temp
+ kwargs:
+ ana_long_short: False
+ ann_scaler: 252
+"""
+
+
+def emit(obj: dict):
+ """Print a single JSON line and flush immediately (streaming protocol)."""
+ print(json.dumps(obj), flush=True)
+
+
+# ── Schedule store ─────────────────────────────────────────────────────────────
+
+def load_schedules() -> Dict[str, Any]:
+ if SCHEDULES_FILE.exists():
+ try:
+ with open(SCHEDULES_FILE) as f:
+ return json.load(f)
+ except Exception:
+ pass
+ return {}
+
+
+def save_schedules(schedules: Dict[str, Any]):
+ FINCEPT_DIR.mkdir(parents=True, exist_ok=True)
+ with open(SCHEDULES_FILE, "w") as f:
+ json.dump(schedules, f, indent=2)
+
+
+def next_run_date(frequency: str) -> str:
+ now = datetime.now()
+ if frequency == "daily":
+ dt = now + timedelta(days=1)
+ elif frequency == "weekly":
+ dt = now + timedelta(weeks=1)
+ else: # monthly
+ month = now.month % 12 + 1
+ year = now.year + (1 if now.month == 12 else 0)
+ dt = now.replace(year=year, month=month, day=1)
+ return dt.strftime("%Y-%m-%dT%H:%M:%S")
+
+
+# ── Commands ──────────────────────────────────────────────────────────────────
+
+def cmd_list():
+ schedules = load_schedules()
+ emit({
+ "success": True,
+ "schedules": schedules,
+ "count": len(schedules),
+ "qlib_available": QLIB_AVAILABLE,
+ })
+
+
+def cmd_create(params: dict):
+ model_id = params.get("model_id", "").strip()
+ if not model_id:
+ emit({"success": False, "error": "model_id is required"})
+ return
+
+ frequency = params.get("frequency", "weekly")
+ window = int(params.get("window", 252))
+ step = int(params.get("step", 20))
+ horizon = int(params.get("horizon", 20))
+ conf_path = params.get("conf_path", "").strip()
+ region = params.get("region", "us")
+ market = params.get("market", "sp500")
+
+ # Generate built-in template if no conf_path provided
+ if not conf_path:
+ CONFIGS_DIR.mkdir(parents=True, exist_ok=True)
+ conf_path = str(CONFIGS_DIR / f"{model_id}.yaml")
+ provider_uri = (Path.home() / ".qlib" / "qlib_data" / f"{region}_data").as_posix()
+
+ # Detect the actual calendar end date for this region to avoid boundary errors
+ _end_date = _detect_calendar_end(provider_uri, region)
+ yaml_content = BUILTIN_TEMPLATE.format(
+ provider_uri=provider_uri,
+ region=region,
+ market=market,
+ train_start="2010-01-01",
+ train_end="2017-12-31",
+ valid_start="2018-01-01",
+ valid_end="2018-12-31",
+ test_start="2019-01-01",
+ test_end=_end_date,
+ )
+ with open(conf_path, "w") as f:
+ f.write(yaml_content)
+ template_generated = True
+ else:
+ if not Path(conf_path).exists():
+ emit({"success": False, "error": f"Config file not found: {conf_path}"})
+ return
+ template_generated = False
+
+ schedules = load_schedules()
+ schedules[model_id] = {
+ "conf_path": conf_path,
+ "frequency": frequency,
+ "window": window,
+ "step": step,
+ "horizon": horizon,
+ "next_run": next_run_date(frequency),
+ "last_run": None,
+ "last_status": "pending",
+ "template_generated": template_generated,
+ "created_at": datetime.now().isoformat(),
+ }
+ save_schedules(schedules)
+
+ emit({
+ "success": True,
+ "model_id": model_id,
+ "schedule": schedules[model_id],
+ "template_generated": template_generated,
+ "conf_path": conf_path,
+ })
+
+
+def _detect_calendar_end(provider_uri: str, region: str) -> str:
+ """Return the last available calendar date for the given data provider."""
+ try:
+ import qlib as _qlib
+ from qlib.data import D
+ _qlib.init(provider_uri=provider_uri, region=region)
+ cal = D.calendar(freq="day")
+ return str(cal[-1])[:10]
+ except Exception:
+ return "2020-11-01"
+
+
+def _qlib_init_from_conf(conf_path: str):
+ """Read qlib_init section from YAML and call qlib.init()."""
+ from ruamel.yaml import YAML as _YAML
+ yaml = _YAML(typ="safe", pure=True)
+ with open(conf_path) as f:
+ cfg = yaml.load(f)
+ init_cfg = cfg.get("qlib_init", {})
+ provider_uri = init_cfg.get("provider_uri", str(Path.home() / ".qlib" / "qlib_data" / "us_data"))
+ region = init_cfg.get("region", "us")
+ qlib.init(provider_uri=provider_uri, region=region)
+
+
+def cmd_preview(params: dict):
+ model_id = params.get("model_id", "").strip()
+ conf_path = params.get("conf_path", "").strip()
+ step = int(params.get("step", 20))
+ horizon = int(params.get("horizon", 20))
+
+ # Resolve conf_path from schedule store if model_id given
+ if model_id and not conf_path:
+ schedules = load_schedules()
+ if model_id not in schedules:
+ emit({"success": False, "error": f"No schedule found for model_id: {model_id}"})
+ return
+ sched = schedules[model_id]
+ conf_path = sched["conf_path"]
+ step = sched.get("step", step)
+ horizon = sched.get("horizon", horizon)
+
+ if not conf_path or not Path(conf_path).exists():
+ emit({"success": False, "error": f"Config file not found: {conf_path}"})
+ return
+
+ if not QLIB_AVAILABLE:
+ emit({"success": False, "error": f"Qlib not available: {QLIB_ERROR}"})
+ return
-def main():
- cmd = sys.argv[1] if len(sys.argv) > 1 else 'help'
- rr = RollingRetrainer()
try:
- if cmd == 'create':
- params = json.loads(sys.argv[2]) if len(sys.argv) > 2 else {}
- result = rr.create_schedule(
- model_id=params.get('model_id', 'model_1'),
- freq=params.get('frequency', params.get('freq', 'daily')),
- window=params.get('window', 252)
- )
- elif cmd == 'retrain':
- params = json.loads(sys.argv[2]) if len(sys.argv) > 2 else {}
- result = rr.execute_retrain(params.get('model_id', sys.argv[2] if len(sys.argv) > 2 else 'model_1'))
- elif cmd == 'list':
- result = rr.get_schedules()
- else:
- result = {'success': False, 'error': 'Unknown command'}
+ # Init qlib from the config's provider_uri
+ _qlib_init_from_conf(conf_path)
+ rolling = Rolling(conf_path=conf_path, step=step, horizon=horizon)
+ task_list = rolling.get_task_list()
+
+ windows = []
+ for t in task_list:
+ segs = t.get("dataset", {}).get("kwargs", {}).get("segments", {})
+ train_seg = segs.get("train", [None, None])
+ test_seg = segs.get("test", [None, None])
+ windows.append({
+ "train_start": str(train_seg[0]) if train_seg[0] else None,
+ "train_end": str(train_seg[1]) if train_seg[1] else None,
+ "test_start": str(test_seg[0]) if test_seg[0] else None,
+ "test_end": str(test_seg[1]) if test_seg[1] else None,
+ })
+
+ emit({
+ "success": True,
+ "conf_path": conf_path,
+ "total_windows": len(windows),
+ "step": step,
+ "horizon": horizon,
+ "windows": windows,
+ })
+ except Exception as e:
+ emit({"success": False, "error": str(e)})
+
+
+def cmd_retrain(params: dict):
+ model_id = params.get("model_id", "").strip()
+ if not model_id:
+ emit({"success": False, "error": "model_id is required"})
+ return
+
+ schedules = load_schedules()
+ if model_id not in schedules:
+ emit({"success": False, "error": f"No schedule found for model_id: {model_id}. Create it first."})
+ return
+
+ if not QLIB_AVAILABLE:
+ emit({"success": False, "error": f"Qlib not available: {QLIB_ERROR}"})
+ return
+
+ sched = schedules[model_id]
+ conf_path = sched["conf_path"]
+
+ if not Path(conf_path).exists():
+ emit({"success": False, "error": f"Config file not found: {conf_path}"})
+ return
+
+ step = sched.get("step", 20)
+ horizon = sched.get("horizon", 20)
+
+ try:
+ _qlib_init_from_conf(conf_path)
+ rolling = Rolling(
+ conf_path=conf_path,
+ exp_name=f"{model_id}_rolling",
+ step=step,
+ horizon=horizon,
+ rolling_exp=f"{model_id}_rolling_models",
+ )
+
+ # Get task list first to report total windows
+ task_list = rolling.get_task_list()
+ total = len(task_list)
+ emit({"event": "start", "model_id": model_id, "total_windows": total})
+
+ t_start = time.time()
+
+ # Patch trainer to emit per-window progress
+ # We intercept by running tasks one at a time
+ from qlib.model.trainer import TrainerR
+ from qlib.workflow import R
+
+ # Delete previous rolling experiment
+ try:
+ R.delete_exp(experiment_name=f"{model_id}_rolling_models")
+ except (ValueError, Exception):
+ pass
+
+ trainer = TrainerR(experiment_name=f"{model_id}_rolling_models")
+
+ for i, task in enumerate(task_list):
+ segs = task.get("dataset", {}).get("kwargs", {}).get("segments", {})
+ test_seg = segs.get("test", [None, None])
+ train_seg = segs.get("train", [None, None])
+ emit({
+ "event": "window",
+ "index": i + 1,
+ "total": total,
+ "train_end": str(train_seg[1]) if train_seg[1] else "",
+ "test_start": str(test_seg[0]) if test_seg[0] else "",
+ "test_end": str(test_seg[1]) if test_seg[1] else "",
+ })
+ trainer([task])
+
+ # Ensemble and evaluate
+ emit({"event": "ensemble", "model_id": model_id, "message": "Combining rolling results..."})
+ rolling._ens_rolling()
+ rolling._update_rolling_rec()
+
+ elapsed = round(time.time() - t_start, 1)
+
+ # Update schedule persistence
+ schedules[model_id]["last_run"] = datetime.now().isoformat()
+ schedules[model_id]["last_status"] = "completed"
+ schedules[model_id]["next_run"] = next_run_date(sched["frequency"])
+ save_schedules(schedules)
+
+ emit({
+ "event": "done",
+ "success": True,
+ "model_id": model_id,
+ "elapsed_sec": elapsed,
+ "windows_trained": total,
+ "exp_name": f"{model_id}_rolling",
+ })
+
except Exception as e:
- result = {'success': False, 'error': str(e)}
- print(json.dumps(result, indent=2))
+ # Update schedule with failure status
+ try:
+ schedules[model_id]["last_status"] = "failed"
+ schedules[model_id]["last_run"] = datetime.now().isoformat()
+ save_schedules(schedules)
+ except Exception:
+ pass
+ emit({"event": "error", "success": False, "error": str(e)})
+
+
+def cmd_delete(params: dict):
+ model_id = params.get("model_id", "").strip()
+ if not model_id:
+ emit({"success": False, "error": "model_id is required"})
+ return
+
+ schedules = load_schedules()
+ if model_id not in schedules:
+ emit({"success": False, "error": f"No schedule found for model_id: {model_id}"})
+ return
+
+ removed = schedules.pop(model_id)
+ save_schedules(schedules)
+ emit({"success": True, "model_id": model_id, "removed": removed})
+
+
+# ── Entry point ───────────────────────────────────────────────────────────────
+
+def main():
+ cmd = sys.argv[1] if len(sys.argv) > 1 else "help"
+ try:
+ params = json.loads(sys.argv[2]) if len(sys.argv) > 2 else {}
+ except (json.JSONDecodeError, IndexError):
+ params = {}
+
+ if cmd == "list":
+ cmd_list()
+ elif cmd == "create":
+ cmd_create(params)
+ elif cmd == "preview":
+ cmd_preview(params)
+ elif cmd == "retrain":
+ cmd_retrain(params)
+ elif cmd == "delete":
+ cmd_delete(params)
+ else:
+ emit({
+ "success": False,
+ "error": f"Unknown command: {cmd}",
+ "available": ["list", "create", "preview", "retrain", "delete"],
+ "qlib_available": QLIB_AVAILABLE,
+ })
+
-if __name__ == '__main__': main()
+if __name__ == "__main__":
+ main()
diff --git a/fincept-qt/scripts/algo_trading/backtest_engine.py b/fincept-qt/scripts/algo_trading/backtest_engine.py
index 99b8f2f7f..bf44c9ef3 100644
--- a/fincept-qt/scripts/algo_trading/backtest_engine.py
+++ b/fincept-qt/scripts/algo_trading/backtest_engine.py
@@ -534,6 +534,40 @@ def cmd_list_strategies(db_path: str):
print(json.dumps({'success': False, 'error': str(e), 'strategies': []}))
+def cmd_list_registry():
+ """Return all strategies from the strategies/_registry.py index."""
+ try:
+ import importlib.util
+ registry_path = os.path.join(os.path.dirname(__file__), '..', 'strategies', '_registry.py')
+ registry_path = os.path.normpath(registry_path)
+ spec = importlib.util.spec_from_file_location('_registry', registry_path)
+ mod = importlib.util.module_from_spec(spec)
+ spec.loader.exec_module(mod)
+ reg = mod.STRATEGY_REGISTRY # dict: id -> {name, category, path}
+ strategies = []
+ for fct_id, meta in reg.items():
+ strategies.append({
+ 'id': fct_id,
+ 'name': meta.get('name', fct_id),
+ 'description': meta.get('category', ''),
+ 'timeframe': '1d',
+ 'entry_conditions': [],
+ 'exit_conditions': [],
+ 'entry_logic': 'AND',
+ 'exit_logic': 'AND',
+ 'stop_loss': 0,
+ 'take_profit': 0,
+ 'trailing_stop': 0,
+ 'is_active': 1,
+ 'created_at': '',
+ 'updated_at': '',
+ 'script_path': meta.get('path', ''),
+ })
+ print(json.dumps({'success': True, 'strategies': strategies}))
+ except Exception as e:
+ print(json.dumps({'success': False, 'error': str(e), 'strategies': []}))
+
+
def cmd_delete_strategy(strategy_id: str, db_path: str):
"""Soft-delete a strategy (set is_active=0)."""
try:
@@ -668,7 +702,7 @@ def main():
debug(f"sys.argv: {sys.argv}")
parser = argparse.ArgumentParser(description='Backtest Engine')
- parser.add_argument('command', choices=['save_strategy', 'list_strategies', 'delete_strategy', 'run_backtest'],
+ parser.add_argument('command', choices=['save_strategy', 'list_strategies', 'list_registry', 'delete_strategy', 'run_backtest'],
help='Subcommand to execute')
parser.add_argument('payload', nargs='?', default=None,
help='JSON payload or ID depending on command')
@@ -696,6 +730,9 @@ def main():
elif args.command == 'list_strategies':
cmd_list_strategies(db_path)
+ elif args.command == 'list_registry':
+ cmd_list_registry()
+
elif args.command == 'delete_strategy':
if not args.payload:
print(json.dumps({'success': False, 'error': 'strategy_id required', 'debug': DEBUG_LOG}))
diff --git a/fincept-qt/scripts/strategies/registry_index.json b/fincept-qt/scripts/strategies/registry_index.json
new file mode 100644
index 000000000..6438f7951
--- /dev/null
+++ b/fincept-qt/scripts/strategies/registry_index.json
@@ -0,0 +1 @@
+{"strategies":[{"id":"FCT-19E8A564","name":"AccumulativeInsightPortfolioRegressionAlgorithm","description":"Portfolio Management","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"AccumulativeInsightPortfolioRegressionAlgorithm.py"},{"id":"FCT-761339E9","name":"AddAlphaModelAlgorithm","description":"Alpha Model","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"AddAlphaModelAlgorithm.py"},{"id":"FCT-3CCF5CE2","name":"AddFutureOptionContractDataStreamingRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"AddFutureOptionContractDataStreamingRegressionAlgorithm.py"},{"id":"FCT-2EF41B6D","name":"AddFutureOptionSingleOptionChainSelectedInUniverseFilterRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"AddFutureOptionSingleOptionChainSelectedInUniverseFilterRegressionAlgorithm.py"},{"id":"FCT-5CED3309","name":"AddOptionContractExpiresRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"AddOptionContractExpiresRegressionAlgorithm.py"},{"id":"FCT-202B8187","name":"AddOptionContractFromUniverseRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"AddOptionContractFromUniverseRegressionAlgorithm.py"},{"id":"FCT-DA228821","name":"AddRemoveSecurityRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"AddRemoveSecurityRegressionAlgorithm.py"},{"id":"FCT-9874FF18","name":"AddRiskManagementAlgorithm","description":"Risk Management","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"AddRiskManagementAlgorithm.py"},{"id":"FCT-8AB253F8","name":"AddUniverseSelectionModelAlgorithm","description":"Universe Selection","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"AddUniverseSelectionModelAlgorithm.py"},{"id":"FCT-D137348C","name":"AlgorithmModeAndDeploymentTargetAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"AlgorithmModeAndDeploymentTargetAlgorithm.py"},{"id":"FCT-6C937E43","name":"AllShortableSymbolsCoarseSelectionRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"AllShortableSymbolsCoarseSelectionRegressionAlgorithm.py"},{"id":"FCT-F9837218","name":"AsynchronousUniverseRegressionAlgorithm","description":"Universe Selection","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"AsynchronousUniverseRegressionAlgorithm.py"},{"id":"FCT-5FF79273","name":"AutoRegressiveIntegratedMovingAverageRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"AutoRegressiveIntegratedMovingAverageRegressionAlgorithm.py"},{"id":"FCT-C395D1D2","name":"AuxiliaryDataHandlersRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"AuxiliaryDataHandlersRegressionAlgorithm.py"},{"id":"FCT-0A7F740C","name":"BaseFrameworkRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BaseFrameworkRegressionAlgorithm.py"},{"id":"FCT-3B2A7C04","name":"BasicCSharpIntegrationTemplateAlgorithm","description":"Template","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicCSharpIntegrationTemplateAlgorithm.py"},{"id":"FCT-07DF2AB7","name":"BasicSetAccountCurrencyAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicSetAccountCurrencyAlgorithm.py"},{"id":"FCT-9A26B9BE","name":"BasicSetAccountCurrencyWithAmountAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicSetAccountCurrencyWithAmountAlgorithm.py"},{"id":"FCT-82A09B26","name":"BasicTemplateAlgorithm","description":"Template","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateAlgorithm.py"},{"id":"FCT-0FAA6BDF","name":"BasicTemplateAxosAlgorithm","description":"Template","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateAxosAlgorithm.py"},{"id":"FCT-07CF5BDC","name":"BasicTemplateCfdAlgorithm","description":"Template","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateCfdAlgorithm.py"},{"id":"FCT-CED11838","name":"BasicTemplateContinuousFutureAlgorithm","description":"Futures","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateContinuousFutureAlgorithm.py"},{"id":"FCT-34321EAB","name":"BasicTemplateContinuousFutureWithExtendedMarketAlgorithm","description":"Futures","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateContinuousFutureWithExtendedMarketAlgorithm.py"},{"id":"FCT-C45FB406","name":"BasicTemplateCryptoAlgorithm","description":"Crypto","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateCryptoAlgorithm.py"},{"id":"FCT-F09974A0","name":"BasicTemplateCryptoFutureAlgorithm","description":"Futures","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateCryptoFutureAlgorithm.py"},{"id":"FCT-E96624E8","name":"BasicTemplateCryptoFutureHourlyAlgorithm","description":"Futures","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateCryptoFutureHourlyAlgorithm.py"},{"id":"FCT-1ADBAC8E","name":"BasicTemplateDailyAlgorithm","description":"Template","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateDailyAlgorithm.py"},{"id":"FCT-59CC070D","name":"BasicTemplateEurexFuturesAlgorithm","description":"Futures","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateEurexFuturesAlgorithm.py"},{"id":"FCT-D7F55E8F","name":"BasicTemplateFillForwardAlgorithm","description":"Template","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateFillForwardAlgorithm.py"},{"id":"FCT-DBF9152F","name":"BasicTemplateForexAlgorithm","description":"Forex","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateForexAlgorithm.py"},{"id":"FCT-EE88AED1","name":"BasicTemplateFrameworkAlgorithm","description":"Template","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateFrameworkAlgorithm.py"},{"id":"FCT-2426C5B7","name":"BasicTemplateFutureOptionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateFutureOptionAlgorithm.py"},{"id":"FCT-1DD3D3FC","name":"BasicTemplateFutureRolloverAlgorithm","description":"Futures","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateFutureRolloverAlgorithm.py"},{"id":"FCT-D9822D5B","name":"BasicTemplateFuturesAlgorithm","description":"Futures","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateFuturesAlgorithm.py"},{"id":"FCT-C0AB4825","name":"BasicTemplateFuturesConsolidationAlgorithm","description":"Futures","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateFuturesConsolidationAlgorithm.py"},{"id":"FCT-B04B5965","name":"BasicTemplateFuturesDailyAlgorithm","description":"Futures","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateFuturesDailyAlgorithm.py"},{"id":"FCT-3F20A848","name":"BasicTemplateFuturesFrameworkAlgorithm","description":"Futures","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateFuturesFrameworkAlgorithm.py"},{"id":"FCT-456D112C","name":"BasicTemplateFuturesFrameworkWithExtendedMarketAlgorithm","description":"Futures","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateFuturesFrameworkWithExtendedMarketAlgorithm.py"},{"id":"FCT-265D788C","name":"BasicTemplateFuturesHistoryAlgorithm","description":"Futures","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateFuturesHistoryAlgorithm.py"},{"id":"FCT-9713D1F5","name":"BasicTemplateFuturesHistoryWithExtendedMarketHoursAlgorithm","description":"Futures","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateFuturesHistoryWithExtendedMarketHoursAlgorithm.py"},{"id":"FCT-D52E449D","name":"BasicTemplateFuturesHourlyAlgorithm","description":"Futures","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateFuturesHourlyAlgorithm.py"},{"id":"FCT-527E38F2","name":"BasicTemplateFuturesWithExtendedMarketAlgorithm","description":"Futures","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateFuturesWithExtendedMarketAlgorithm.py"},{"id":"FCT-074CBF2C","name":"BasicTemplateFuturesWithExtendedMarketDailyAlgorithm","description":"Futures","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateFuturesWithExtendedMarketDailyAlgorithm.py"},{"id":"FCT-006DF51F","name":"BasicTemplateFuturesWithExtendedMarketHourlyAlgorithm","description":"Futures","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateFuturesWithExtendedMarketHourlyAlgorithm.py"},{"id":"FCT-A17DA593","name":"BasicTemplateIndexAlgorithm","description":"Index","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateIndexAlgorithm.py"},{"id":"FCT-A8601615","name":"BasicTemplateIndexDailyAlgorithm","description":"Index","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateIndexDailyAlgorithm.py"},{"id":"FCT-210273A6","name":"BasicTemplateIndexOptionsAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateIndexOptionsAlgorithm.py"},{"id":"FCT-CB56992B","name":"BasicTemplateIndiaAlgorithm","description":"Template","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateIndiaAlgorithm.py"},{"id":"FCT-77306E7F","name":"BasicTemplateIndiaIndexAlgorithm","description":"Index","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateIndiaIndexAlgorithm.py"},{"id":"FCT-13F865B8","name":"BasicTemplateIntrinioEconomicData","description":"Template","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateIntrinioEconomicData.py"},{"id":"FCT-A18CA8E6","name":"BasicTemplateLibrary","description":"Template","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateLibrary.py"},{"id":"FCT-3EB6E68A","name":"BasicTemplateOptionEquityStrategyAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateOptionEquityStrategyAlgorithm.py"},{"id":"FCT-185C6BF9","name":"BasicTemplateOptionStrategyAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateOptionStrategyAlgorithm.py"},{"id":"FCT-29268ED2","name":"BasicTemplateOptionTradesAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateOptionTradesAlgorithm.py"},{"id":"FCT-9970673F","name":"BasicTemplateOptionsAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateOptionsAlgorithm.py"},{"id":"FCT-48AE2A59","name":"BasicTemplateOptionsConsolidationAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateOptionsConsolidationAlgorithm.py"},{"id":"FCT-216E29F5","name":"BasicTemplateOptionsDailyAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateOptionsDailyAlgorithm.py"},{"id":"FCT-702E8C68","name":"BasicTemplateOptionsFilterUniverseAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateOptionsFilterUniverseAlgorithm.py"},{"id":"FCT-778FF392","name":"BasicTemplateOptionsFrameworkAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateOptionsFrameworkAlgorithm.py"},{"id":"FCT-9F0275D6","name":"BasicTemplateOptionsHistoryAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateOptionsHistoryAlgorithm.py"},{"id":"FCT-77549805","name":"BasicTemplateOptionsHourlyAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateOptionsHourlyAlgorithm.py"},{"id":"FCT-79BA1C77","name":"BasicTemplateOptionsPriceModel","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateOptionsPriceModel.py"},{"id":"FCT-DB3B5321","name":"BasicTemplateSPXWeeklyIndexOptionsAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateSPXWeeklyIndexOptionsAlgorithm.py"},{"id":"FCT-88C8DA85","name":"BasicTemplateTradableIndexAlgorithm","description":"Index","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BasicTemplateTradableIndexAlgorithm.py"},{"id":"FCT-8B86F74C","name":"BlackLittermanPortfolioOptimizationFrameworkAlgorithm","description":"Portfolio Management","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BlackLittermanPortfolioOptimizationFrameworkAlgorithm.py"},{"id":"FCT-13992977","name":"BrokerageActivityEventHandlingAlgorithm","description":"Brokerage","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BrokerageActivityEventHandlingAlgorithm.py"},{"id":"FCT-21FCDA65","name":"BrokerageModelAlgorithm","description":"Brokerage","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BrokerageModelAlgorithm.py"},{"id":"FCT-181E0A50","name":"BubbleAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BubbleAlgorithm.py"},{"id":"FCT-C4535414","name":"BybitCryptoFuturesRegressionAlgorithm","description":"Futures","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BybitCryptoFuturesRegressionAlgorithm.py"},{"id":"FCT-8205EE4A","name":"BybitCryptoRegressionAlgorithm","description":"Crypto","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BybitCryptoRegressionAlgorithm.py"},{"id":"FCT-E8BBF79A","name":"BybitCustomDataCryptoRegressionAlgorithm","description":"Crypto","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"BybitCustomDataCryptoRegressionAlgorithm.py"},{"id":"FCT-E8875612","name":"CallbackCommandRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CallbackCommandRegressionAlgorithm.py"},{"id":"FCT-D8FB9470","name":"CanLiquidateWithOrderPropertiesRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CanLiquidateWithOrderPropertiesRegressionAlgorithm.py"},{"id":"FCT-65D25230","name":"CapmAlphaRankingFrameworkAlgorithm","description":"Alpha Model","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CapmAlphaRankingFrameworkAlgorithm.py"},{"id":"FCT-F172EB67","name":"ClassicRangeConsolidatorAlgorithm","description":"Data Consolidation","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"ClassicRangeConsolidatorAlgorithm.py"},{"id":"FCT-5407C44C","name":"ClassicRangeConsolidatorWithTickAlgorithm","description":"Data Consolidation","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"ClassicRangeConsolidatorWithTickAlgorithm.py"},{"id":"FCT-D909F7DF","name":"ClassicRenkoConsolidatorAlgorithm","description":"Data Consolidation","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"ClassicRenkoConsolidatorAlgorithm.py"},{"id":"FCT-A0A879A8","name":"CoarseFineAsyncUniverseRegressionAlgorithm","description":"Universe Selection","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CoarseFineAsyncUniverseRegressionAlgorithm.py"},{"id":"FCT-CE80899F","name":"CoarseFineFundamentalComboAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CoarseFineFundamentalComboAlgorithm.py"},{"id":"FCT-BF06E7EB","name":"CoarseFineFundamentalRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CoarseFineFundamentalRegressionAlgorithm.py"},{"id":"FCT-5542D978","name":"CoarseFineOptionUniverseChainRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CoarseFineOptionUniverseChainRegressionAlgorithm.py"},{"id":"FCT-F95F1806","name":"CoarseFundamentalTop3Algorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CoarseFundamentalTop3Algorithm.py"},{"id":"FCT-5600B07D","name":"Collective2PortfolioSignalExportDemonstrationAlgorithm","description":"Portfolio Management","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"Collective2PortfolioSignalExportDemonstrationAlgorithm.py"},{"id":"FCT-8AEECDC1","name":"Collective2SignalExportDemonstrationAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"Collective2SignalExportDemonstrationAlgorithm.py"},{"id":"FCT-EB692DBC","name":"ComboOrderTicketDemoAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"ComboOrderTicketDemoAlgorithm.py"},{"id":"FCT-203BF5C3","name":"ComboOrdersFillModelAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"ComboOrdersFillModelAlgorithm.py"},{"id":"FCT-5E302074","name":"CompleteOrderTagUpdateAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CompleteOrderTagUpdateAlgorithm.py"},{"id":"FCT-50C4F04D","name":"CompositeAlphaModelFrameworkAlgorithm","description":"Alpha Model","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CompositeAlphaModelFrameworkAlgorithm.py"},{"id":"FCT-5A1D14B7","name":"CompositeRiskManagementModelFrameworkAlgorithm","description":"Risk Management","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CompositeRiskManagementModelFrameworkAlgorithm.py"},{"id":"FCT-9EECE18B","name":"ConfidenceWeightedFrameworkAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"ConfidenceWeightedFrameworkAlgorithm.py"},{"id":"FCT-C054C3D1","name":"ConsolidateDifferentTickTypesRegressionAlgorithm","description":"Data Consolidation","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"ConsolidateDifferentTickTypesRegressionAlgorithm.py"},{"id":"FCT-D4F95392","name":"ConsolidateHourBarsIntoDailyBarsRegressionAlgorithm","description":"Data Consolidation","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"ConsolidateHourBarsIntoDailyBarsRegressionAlgorithm.py"},{"id":"FCT-16F5EE2E","name":"ConsolidateRegressionAlgorithm","description":"Data Consolidation","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"ConsolidateRegressionAlgorithm.py"},{"id":"FCT-EFBD246D","name":"ConstituentsQC500GeneratorAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"ConstituentsQC500GeneratorAlgorithm.py"},{"id":"FCT-DE244AD5","name":"ConstituentsUniverseRegressionAlgorithm","description":"Universe Selection","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"ConstituentsUniverseRegressionAlgorithm.py"},{"id":"FCT-E27B6A38","name":"ContinuousFutureModelsConsistencyRegressionAlgorithm","description":"Futures","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"ContinuousFutureModelsConsistencyRegressionAlgorithm.py"},{"id":"FCT-C573FB46","name":"ContinuousFutureRegressionAlgorithm","description":"Futures","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"ContinuousFutureRegressionAlgorithm.py"},{"id":"FCT-E9C47E95","name":"ConvertToFrameworkAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"ConvertToFrameworkAlgorithm.py"},{"id":"FCT-C0F56022","name":"CorrectConsolidatedBarTypeForTickTypesAlgorithm","description":"Data Consolidation","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CorrectConsolidatedBarTypeForTickTypesAlgorithm.py"},{"id":"FCT-0AD9A342","name":"CoveredAndProtectiveCallStrategiesAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CoveredAndProtectiveCallStrategiesAlgorithm.py"},{"id":"FCT-485EB46A","name":"CoveredAndProtectivePutStrategiesAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CoveredAndProtectivePutStrategiesAlgorithm.py"},{"id":"FCT-B5A1B412","name":"CrunchDAOSignalExportDemonstrationAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CrunchDAOSignalExportDemonstrationAlgorithm.py"},{"id":"FCT-390AE467","name":"CustomBenchmarkAlgorithm","description":"Benchmark","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CustomBenchmarkAlgorithm.py"},{"id":"FCT-F72D9CA4","name":"CustomBenchmarkRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CustomBenchmarkRegressionAlgorithm.py"},{"id":"FCT-BDF6639E","name":"CustomBrokerageModelRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CustomBrokerageModelRegressionAlgorithm.py"},{"id":"FCT-D2A1A24A","name":"CustomBrokerageSideOrderHandlingRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CustomBrokerageSideOrderHandlingRegressionAlgorithm.py"},{"id":"FCT-335819E6","name":"CustomBrokerageSideOrderHandlingRegressionPartialAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CustomBrokerageSideOrderHandlingRegressionPartialAlgorithm.py"},{"id":"FCT-DC4DC088","name":"CustomBuyingPowerModelAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CustomBuyingPowerModelAlgorithm.py"},{"id":"FCT-DAAB71C9","name":"CustomChartingAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CustomChartingAlgorithm.py"},{"id":"FCT-5FE7DA42","name":"CustomConsolidatorRegressionAlgorithm","description":"Data Consolidation","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CustomConsolidatorRegressionAlgorithm.py"},{"id":"FCT-23C6E607","name":"CustomDataBenchmarkRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CustomDataBenchmarkRegressionAlgorithm.py"},{"id":"FCT-0D7003A5","name":"CustomDataBitcoinAlgorithm","description":"Custom Data","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CustomDataBitcoinAlgorithm.py"},{"id":"FCT-52D9893F","name":"CustomDataIconicTypesAddDataRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CustomDataIconicTypesAddDataRegressionAlgorithm.py"},{"id":"FCT-0021591C","name":"CustomDataIndicatorExtensionsAlgorithm","description":"Indicators","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CustomDataIndicatorExtensionsAlgorithm.py"},{"id":"FCT-3EE829AC","name":"CustomDataLinkedIconicTypeAddDataCoarseSelectionRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CustomDataLinkedIconicTypeAddDataCoarseSelectionRegressionAlgorithm.py"},{"id":"FCT-BAD0C3B3","name":"CustomDataLinkedIconicTypeAddDataOnSecuritiesChangedRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CustomDataLinkedIconicTypeAddDataOnSecuritiesChangedRegressionAlgorithm.py"},{"id":"FCT-EA427FD2","name":"CustomDataMultiFileObjectStoreRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CustomDataMultiFileObjectStoreRegressionAlgorithm.py"},{"id":"FCT-8C140F85","name":"CustomDataNIFTYAlgorithm","description":"Custom Data","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CustomDataNIFTYAlgorithm.py"},{"id":"FCT-675A0EC6","name":"CustomDataObjectStoreRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CustomDataObjectStoreRegressionAlgorithm.py"},{"id":"FCT-9147ECE5","name":"CustomDataPropertiesRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CustomDataPropertiesRegressionAlgorithm.py"},{"id":"FCT-67CFD0CD","name":"CustomDataRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CustomDataRegressionAlgorithm.py"},{"id":"FCT-1A4DBA47","name":"CustomDataTypeHistoryAlgorithm","description":"Custom Data","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CustomDataTypeHistoryAlgorithm.py"},{"id":"FCT-A032E1EE","name":"CustomDataUniverseAlgorithm","description":"Universe Selection","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CustomDataUniverseAlgorithm.py"},{"id":"FCT-FC1DA597","name":"CustomDataUniverseRegressionAlgorithm","description":"Universe Selection","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CustomDataUniverseRegressionAlgorithm.py"},{"id":"FCT-72626C25","name":"CustomDataUniverseScheduledRegressionAlgorithm","description":"Universe Selection","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CustomDataUniverseScheduledRegressionAlgorithm.py"},{"id":"FCT-BEF6D76E","name":"CustomDataUsingMapFileRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CustomDataUsingMapFileRegressionAlgorithm.py"},{"id":"FCT-95644B6E","name":"CustomDataZippedObjectStoreRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CustomDataZippedObjectStoreRegressionAlgorithm.py"},{"id":"FCT-0B5CD58B","name":"CustomIndicatorAlgorithm","description":"Indicators","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CustomIndicatorAlgorithm.py"},{"id":"FCT-E42C0F2D","name":"CustomIndicatorWithExtensionAlgorithm","description":"Indicators","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CustomIndicatorWithExtensionAlgorithm.py"},{"id":"FCT-F06C15CD","name":"CustomMarginInterestRateModelAlgorithm","description":"Margin","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CustomMarginInterestRateModelAlgorithm.py"},{"id":"FCT-C77A7B18","name":"CustomModelsAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CustomModelsAlgorithm.py"},{"id":"FCT-3555D255","name":"CustomModelsPEP8Algorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CustomModelsPEP8Algorithm.py"},{"id":"FCT-8C620280","name":"CustomOptionAssignmentRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CustomOptionAssignmentRegressionAlgorithm.py"},{"id":"FCT-A7E25D46","name":"CustomOptionExerciseModelRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CustomOptionExerciseModelRegressionAlgorithm.py"},{"id":"FCT-3E3DC670","name":"CustomPartialFillModelAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CustomPartialFillModelAlgorithm.py"},{"id":"FCT-9C9C9891","name":"CustomPortfolioOptimizerRegressionAlgorithm","description":"Portfolio Management","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CustomPortfolioOptimizerRegressionAlgorithm.py"},{"id":"FCT-2F0E8AB5","name":"CustomSecurityDataFilterRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CustomSecurityDataFilterRegressionAlgorithm.py"},{"id":"FCT-C15813B3","name":"CustomSecurityInitializerAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CustomSecurityInitializerAlgorithm.py"},{"id":"FCT-3D3166AE","name":"CustomSettlementModelRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CustomSettlementModelRegressionAlgorithm.py"},{"id":"FCT-324DD834","name":"CustomShortableProviderRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CustomShortableProviderRegressionAlgorithm.py"},{"id":"FCT-CB434E24","name":"CustomUniverseSelectionModelRegressionAlgorithm","description":"Universe Selection","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CustomUniverseSelectionModelRegressionAlgorithm.py"},{"id":"FCT-57E3FCCE","name":"CustomVolatilityModelAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CustomVolatilityModelAlgorithm.py"},{"id":"FCT-223472B2","name":"CustomWarmUpPeriodIndicatorAlgorithm","description":"Indicators","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"CustomWarmUpPeriodIndicatorAlgorithm.py"},{"id":"FCT-DCA92403","name":"DailyAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"DailyAlgorithm.py"},{"id":"FCT-5DD0A982","name":"DataConsolidationAlgorithm","description":"Data Consolidation","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"DataConsolidationAlgorithm.py"},{"id":"FCT-2D323EF8","name":"DelistingEventsAlgorithm","description":"Corporate Actions","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"DelistingEventsAlgorithm.py"},{"id":"FCT-6513B96C","name":"DescendingCustomDataObjectStoreRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"DescendingCustomDataObjectStoreRegressionAlgorithm.py"},{"id":"FCT-E476428A","name":"DisplacedMovingAverageRibbon","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"DisplacedMovingAverageRibbon.py"},{"id":"FCT-3A64A758","name":"DividendAlgorithm","description":"Corporate Actions","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"DividendAlgorithm.py"},{"id":"FCT-FFA7AD77","name":"DropboxBaseDataUniverseSelectionAlgorithm","description":"Universe Selection","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"DropboxBaseDataUniverseSelectionAlgorithm.py"},{"id":"FCT-43A9D681","name":"DropboxCoarseFineAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"DropboxCoarseFineAlgorithm.py"},{"id":"FCT-C02B7DE9","name":"DropboxUniverseSelectionAlgorithm","description":"Universe Selection","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"DropboxUniverseSelectionAlgorithm.py"},{"id":"FCT-D86D36A8","name":"DynamicSecurityDataRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"DynamicSecurityDataRegressionAlgorithm.py"},{"id":"FCT-2A9A1A33","name":"ETFConstituentUniverseCompositeDelistingRegressionAlgorithm","description":"ETF","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"ETFConstituentUniverseCompositeDelistingRegressionAlgorithm.py"},{"id":"FCT-D7673A55","name":"ETFConstituentUniverseCompositeDelistingRegressionAlgorithmNoAddEquityETF","description":"ETF","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"ETFConstituentUniverseCompositeDelistingRegressionAlgorithmNoAddEquityETF.py"},{"id":"FCT-9E29F41C","name":"ETFConstituentUniverseFilterFunctionRegressionAlgorithm","description":"ETF","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"ETFConstituentUniverseFilterFunctionRegressionAlgorithm.py"},{"id":"FCT-D46C4922","name":"ETFConstituentUniverseFrameworkRegressionAlgorithm","description":"ETF","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"ETFConstituentUniverseFrameworkRegressionAlgorithm.py"},{"id":"FCT-B97EAA99","name":"ETFConstituentUniverseMappedCompositeRegressionAlgorithm","description":"ETF","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"ETFConstituentUniverseMappedCompositeRegressionAlgorithm.py"},{"id":"FCT-4249AE56","name":"ETFConstituentUniverseRSIAlphaModelAlgorithm","description":"ETF","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"ETFConstituentUniverseRSIAlphaModelAlgorithm.py"},{"id":"FCT-A8E104E5","name":"ETFConstituentsFrameworkAlgorithm","description":"ETF","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"ETFConstituentsFrameworkAlgorithm.py"},{"id":"FCT-A7B56E18","name":"ETFConstituentsFrameworkWithDifferentSelectionModelAlgorithm","description":"ETF","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"ETFConstituentsFrameworkWithDifferentSelectionModelAlgorithm.py"},{"id":"FCT-D3112758","name":"ETFGlobalRotationAlgorithm","description":"ETF","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"ETFGlobalRotationAlgorithm.py"},{"id":"FCT-A3A4BE5B","name":"EmaCrossAlphaModelFrameworkRegressionAlgorithm","description":"Alpha Model","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"EmaCrossAlphaModelFrameworkRegressionAlgorithm.py"},{"id":"FCT-EE365736","name":"EmaCrossFuturesFrontMonthAlgorithm","description":"Futures","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"EmaCrossFuturesFrontMonthAlgorithm.py"},{"id":"FCT-E66F50F9","name":"EmaCrossUniverseSelectionAlgorithm","description":"Universe Selection","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"EmaCrossUniverseSelectionAlgorithm.py"},{"id":"FCT-AE32C215","name":"EmaCrossUniverseSelectionFrameworkAlgorithm","description":"Universe Selection","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"EmaCrossUniverseSelectionFrameworkAlgorithm.py"},{"id":"FCT-62C5A2BF","name":"ExpiryHelperAlphaModelFrameworkAlgorithm","description":"Alpha Model","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"ExpiryHelperAlphaModelFrameworkAlgorithm.py"},{"id":"FCT-47C778A4","name":"ExtendedMarketTradingRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"ExtendedMarketTradingRegressionAlgorithm.py"},{"id":"FCT-E75184B8","name":"FilterUniverseRegressionAlgorithm","description":"Universe Selection","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"FilterUniverseRegressionAlgorithm.py"},{"id":"FCT-F0179E57","name":"FilteredIdentityAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"FilteredIdentityAlgorithm.py"},{"id":"FCT-29D656ED","name":"FinancialAdvisorDemoAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"FinancialAdvisorDemoAlgorithm.py"},{"id":"FCT-BB3C695A","name":"FineFundamentalFilteredUniverseRegressionAlgorithm","description":"Universe Selection","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"FineFundamentalFilteredUniverseRegressionAlgorithm.py"},{"id":"FCT-0212DBCD","name":"ForwardDataOnlyFillModelAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"ForwardDataOnlyFillModelAlgorithm.py"},{"id":"FCT-BA248F90","name":"FractionalQuantityRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"FractionalQuantityRegressionAlgorithm.py"},{"id":"FCT-1C8EF029","name":"FuncRiskFreeRateInterestRateModelWithPythonLambda","description":"Risk Management","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"FuncRiskFreeRateInterestRateModelWithPythonLambda.py"},{"id":"FCT-874367FD","name":"FundamentalCustomSelectionTimeRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"FundamentalCustomSelectionTimeRegressionAlgorithm.py"},{"id":"FCT-4A7607D6","name":"FundamentalRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"FundamentalRegressionAlgorithm.py"},{"id":"FCT-0A8C8781","name":"FundamentalUniverseSelectionAlgorithm","description":"Universe Selection","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"FundamentalUniverseSelectionAlgorithm.py"},{"id":"FCT-19976618","name":"FundamentalUniverseSelectionRegressionAlgorithm","description":"Universe Selection","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"FundamentalUniverseSelectionRegressionAlgorithm.py"},{"id":"FCT-E85797B9","name":"FutureContractsExtendedMarketHoursRegressionAlgorithm","description":"Futures","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"FutureContractsExtendedMarketHoursRegressionAlgorithm.py"},{"id":"FCT-1855F876","name":"FutureOptionBuySellCallIntradayRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"FutureOptionBuySellCallIntradayRegressionAlgorithm.py"},{"id":"FCT-DE2ACA2C","name":"FutureOptionCallITMExpiryRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"FutureOptionCallITMExpiryRegressionAlgorithm.py"},{"id":"FCT-B4342086","name":"FutureOptionCallOTMExpiryRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"FutureOptionCallOTMExpiryRegressionAlgorithm.py"},{"id":"FCT-16536530","name":"FutureOptionDailyRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"FutureOptionDailyRegressionAlgorithm.py"},{"id":"FCT-BC31D77F","name":"FutureOptionHourlyRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"FutureOptionHourlyRegressionAlgorithm.py"},{"id":"FCT-AA93FB6A","name":"FutureOptionMultipleContractsInDifferentContractMonthsWithSameUnderlyingFutureRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"FutureOptionMultipleContractsInDifferentContractMonthsWithSameUnderlyingFutureRegressionAlgorithm.py"},{"id":"FCT-88F9D2E8","name":"FutureOptionPutITMExpiryRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"FutureOptionPutITMExpiryRegressionAlgorithm.py"},{"id":"FCT-ADF65A2F","name":"FutureOptionPutOTMExpiryRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"FutureOptionPutOTMExpiryRegressionAlgorithm.py"},{"id":"FCT-129041A8","name":"FutureOptionShortCallITMExpiryRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"FutureOptionShortCallITMExpiryRegressionAlgorithm.py"},{"id":"FCT-68DA46AE","name":"FutureOptionShortCallOTMExpiryRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"FutureOptionShortCallOTMExpiryRegressionAlgorithm.py"},{"id":"FCT-97BFC0D6","name":"FutureOptionShortPutITMExpiryRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"FutureOptionShortPutITMExpiryRegressionAlgorithm.py"},{"id":"FCT-470C1BB3","name":"FutureOptionShortPutOTMExpiryRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"FutureOptionShortPutOTMExpiryRegressionAlgorithm.py"},{"id":"FCT-119E482D","name":"FutureStopMarketOrderOnExtendedHoursRegressionAlgorithm","description":"Futures","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"FutureStopMarketOrderOnExtendedHoursRegressionAlgorithm.py"},{"id":"FCT-2549D577","name":"FuturesAndFuturesOptionsExpiryTimeAndLiquidationRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"FuturesAndFuturesOptionsExpiryTimeAndLiquidationRegressionAlgorithm.py"},{"id":"FCT-4EE8D5FD","name":"FuturesExtendedMarketHoursRegressionAlgorithm","description":"Futures","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"FuturesExtendedMarketHoursRegressionAlgorithm.py"},{"id":"FCT-CA7ACD88","name":"FuturesMomentumAlgorithm","description":"Futures","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"FuturesMomentumAlgorithm.py"},{"id":"FCT-7CAB8ED5","name":"G10CurrencySelectionModelFrameworkAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"G10CurrencySelectionModelFrameworkAlgorithm.py"},{"id":"FCT-4F55CFD9","name":"GetParameterRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"GetParameterRegressionAlgorithm.py"},{"id":"FCT-649F439A","name":"HistoricalReturnsAlphaModelFrameworkRegressionAlgorithm","description":"Alpha Model","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"HistoricalReturnsAlphaModelFrameworkRegressionAlgorithm.py"},{"id":"FCT-4F051700","name":"HistoryAlgorithm","description":"Historical Data","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"HistoryAlgorithm.py"},{"id":"FCT-17047AD3","name":"HistoryAuxiliaryDataRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"HistoryAuxiliaryDataRegressionAlgorithm.py"},{"id":"FCT-5077EFC4","name":"HistoryTickRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"HistoryTickRegressionAlgorithm.py"},{"id":"FCT-D55B4B0F","name":"HistoryWithCustomDataSourceRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"HistoryWithCustomDataSourceRegressionAlgorithm.py"},{"id":"FCT-52E3A84A","name":"HistoryWithDifferentContinuousContractDepthOffsetsRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"HistoryWithDifferentContinuousContractDepthOffsetsRegressionAlgorithm.py"},{"id":"FCT-8CB7F1CC","name":"HistoryWithDifferentDataMappingModeRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"HistoryWithDifferentDataMappingModeRegressionAlgorithm.py"},{"id":"FCT-25201E5E","name":"HistoryWithDifferentDataNormalizationModeRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"HistoryWithDifferentDataNormalizationModeRegressionAlgorithm.py"},{"id":"FCT-690AD750","name":"HourReverseSplitRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"HourReverseSplitRegressionAlgorithm.py"},{"id":"FCT-ADDA18D4","name":"HourSplitRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"HourSplitRegressionAlgorithm.py"},{"id":"FCT-5C005A63","name":"ImmediateExecutionModelWorksWithBinanceFeeModel","description":"Execution Model","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"ImmediateExecutionModelWorksWithBinanceFeeModel.py"},{"id":"FCT-BDFB56F1","name":"InceptionDateSelectionRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"InceptionDateSelectionRegressionAlgorithm.py"},{"id":"FCT-5B348FD6","name":"IndexOptionBearCallSpreadAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"IndexOptionBearCallSpreadAlgorithm.py"},{"id":"FCT-F75EB8E2","name":"IndexOptionBearPutSpreadAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"IndexOptionBearPutSpreadAlgorithm.py"},{"id":"FCT-82E65BB4","name":"IndexOptionBullCallSpreadAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"IndexOptionBullCallSpreadAlgorithm.py"},{"id":"FCT-1D8349B6","name":"IndexOptionBullPutSpreadAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"IndexOptionBullPutSpreadAlgorithm.py"},{"id":"FCT-C204FEB8","name":"IndexOptionBuySellCallIntradayRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"IndexOptionBuySellCallIntradayRegressionAlgorithm.py"},{"id":"FCT-DC3B31DA","name":"IndexOptionCallButterflyAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"IndexOptionCallButterflyAlgorithm.py"},{"id":"FCT-C629FC42","name":"IndexOptionCallCalendarSpreadAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"IndexOptionCallCalendarSpreadAlgorithm.py"},{"id":"FCT-EA1D90BB","name":"IndexOptionCallITMExpiryRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"IndexOptionCallITMExpiryRegressionAlgorithm.py"},{"id":"FCT-32C0EE95","name":"IndexOptionCallITMGreeksExpiryRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"IndexOptionCallITMGreeksExpiryRegressionAlgorithm.py"},{"id":"FCT-6AE00A81","name":"IndexOptionCallOTMExpiryRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"IndexOptionCallOTMExpiryRegressionAlgorithm.py"},{"id":"FCT-F859111A","name":"IndexOptionChainApisConsistencyRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"IndexOptionChainApisConsistencyRegressionAlgorithm.py"},{"id":"FCT-F5FE9B32","name":"IndexOptionIronCondorAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"IndexOptionIronCondorAlgorithm.py"},{"id":"FCT-02F5AEAE","name":"IndexOptionModelsConsistencyRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"IndexOptionModelsConsistencyRegressionAlgorithm.py"},{"id":"FCT-BFEF2627","name":"IndexOptionPutButterflyAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"IndexOptionPutButterflyAlgorithm.py"},{"id":"FCT-E0220F96","name":"IndexOptionPutCalendarSpreadAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"IndexOptionPutCalendarSpreadAlgorithm.py"},{"id":"FCT-48BF5359","name":"IndexOptionPutITMExpiryRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"IndexOptionPutITMExpiryRegressionAlgorithm.py"},{"id":"FCT-4666C54E","name":"IndexOptionPutOTMExpiryRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"IndexOptionPutOTMExpiryRegressionAlgorithm.py"},{"id":"FCT-300B9FC2","name":"IndexOptionShortCallITMExpiryRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"IndexOptionShortCallITMExpiryRegressionAlgorithm.py"},{"id":"FCT-57548DAA","name":"IndexOptionShortCallOTMExpiryRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"IndexOptionShortCallOTMExpiryRegressionAlgorithm.py"},{"id":"FCT-D0643727","name":"IndexOptionShortPutITMExpiryRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"IndexOptionShortPutITMExpiryRegressionAlgorithm.py"},{"id":"FCT-905BC971","name":"IndexOptionShortPutOTMExpiryRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"IndexOptionShortPutOTMExpiryRegressionAlgorithm.py"},{"id":"FCT-EB8CE077","name":"IndiaDataRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"IndiaDataRegressionAlgorithm.py"},{"id":"FCT-31D18328","name":"IndicatorExtensionsSMAWithCustomIndicatorsRegressionAlgorithm","description":"Indicators","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"IndicatorExtensionsSMAWithCustomIndicatorsRegressionAlgorithm.py"},{"id":"FCT-2BC353A9","name":"IndicatorHistoryAlgorithm","description":"Indicators","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"IndicatorHistoryAlgorithm.py"},{"id":"FCT-B3C67AEA","name":"IndicatorHistoryRegressionAlgorithm","description":"Indicators","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"IndicatorHistoryRegressionAlgorithm.py"},{"id":"FCT-9EF0798B","name":"IndicatorSelectorsWorkWithDifferentOptions","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"IndicatorSelectorsWorkWithDifferentOptions.py"},{"id":"FCT-71C08CCA","name":"IndicatorSuiteAlgorithm","description":"Indicators","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"IndicatorSuiteAlgorithm.py"},{"id":"FCT-935D3B5D","name":"IndicatorWarmupAlgorithm","description":"Indicators","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"IndicatorWarmupAlgorithm.py"},{"id":"FCT-B8EB6886","name":"IndicatorWithRenkoBarsRegressionAlgorithm","description":"Indicators","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"IndicatorWithRenkoBarsRegressionAlgorithm.py"},{"id":"FCT-77C48AE3","name":"IndustryStandardSecurityIdentifiersRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"IndustryStandardSecurityIdentifiersRegressionAlgorithm.py"},{"id":"FCT-E8E10658","name":"InsightScoringRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"InsightScoringRegressionAlgorithm.py"},{"id":"FCT-15D6B08D","name":"InsightTagAlphaRegressionAlgorithm","description":"Alpha Model","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"InsightTagAlphaRegressionAlgorithm.py"},{"id":"FCT-955EB562","name":"InsightWeightingFrameworkAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"InsightWeightingFrameworkAlgorithm.py"},{"id":"FCT-FD19D095","name":"IronCondorStrategyAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"IronCondorStrategyAlgorithm.py"},{"id":"FCT-8863BE2D","name":"KerasNeuralNetworkAlgorithm","description":"Machine Learning","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"KerasNeuralNetworkAlgorithm.py"},{"id":"FCT-C37858CB","name":"LimitFillRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"LimitFillRegressionAlgorithm.py"},{"id":"FCT-78D0ECA0","name":"LimitIfTouchedRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"LimitIfTouchedRegressionAlgorithm.py"},{"id":"FCT-1E792B32","name":"LiquidETFUniverseFrameworkAlgorithm","description":"ETF","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"LiquidETFUniverseFrameworkAlgorithm.py"},{"id":"FCT-C5F5B3E0","name":"LiveFeaturesAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"LiveFeaturesAlgorithm.py"},{"id":"FCT-EC39F086","name":"LongAndShortButterflyCallStrategiesAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"LongAndShortButterflyCallStrategiesAlgorithm.py"},{"id":"FCT-812F2B68","name":"LongAndShortButterflyPutStrategiesAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"LongAndShortButterflyPutStrategiesAlgorithm.py"},{"id":"FCT-8F4CCF9F","name":"LongAndShortCallCalendarSpreadStrategiesAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"LongAndShortCallCalendarSpreadStrategiesAlgorithm.py"},{"id":"FCT-27A6F4AF","name":"LongAndShortPutCalendarSpreadStrategiesAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"LongAndShortPutCalendarSpreadStrategiesAlgorithm.py"},{"id":"FCT-9BF2DDCB","name":"LongAndShortStraddleStrategiesAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"LongAndShortStraddleStrategiesAlgorithm.py"},{"id":"FCT-73CA6D31","name":"LongAndShortStrangleStrategiesAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"LongAndShortStrangleStrategiesAlgorithm.py"},{"id":"FCT-BEFEB617","name":"LongOnlyAlphaStreamAlgorithm","description":"Alpha Model","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"LongOnlyAlphaStreamAlgorithm.py"},{"id":"FCT-F328066F","name":"MACDTrendAlgorithm","description":"Momentum","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"MACDTrendAlgorithm.py"},{"id":"FCT-EABA6096","name":"MacdAlphaModelFrameworkRegressionAlgorithm","description":"Alpha Model","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"MacdAlphaModelFrameworkRegressionAlgorithm.py"},{"id":"FCT-C0569D9C","name":"ManuallyRemovedConsolidatorsAlgorithm","description":"Data Consolidation","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"ManuallyRemovedConsolidatorsAlgorithm.py"},{"id":"FCT-A4B98519","name":"ManuallySetMarketHoursAndSymbolPropertiesDatabaseEntriesAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"ManuallySetMarketHoursAndSymbolPropertiesDatabaseEntriesAlgorithm.py"},{"id":"FCT-FB2B7755","name":"MarginCallEventsAlgorithm","description":"Margin","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"MarginCallEventsAlgorithm.py"},{"id":"FCT-26E2B07B","name":"MarketImpactSlippageModelRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"MarketImpactSlippageModelRegressionAlgorithm.py"},{"id":"FCT-F8893107","name":"MarketOnCloseOrderBufferExtendedMarketHoursRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"MarketOnCloseOrderBufferExtendedMarketHoursRegressionAlgorithm.py"},{"id":"FCT-74AD11AC","name":"MarketOnCloseOrderBufferRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"MarketOnCloseOrderBufferRegressionAlgorithm.py"},{"id":"FCT-A5E1134A","name":"MarketOnOpenOnCloseAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"MarketOnOpenOnCloseAlgorithm.py"},{"id":"FCT-791ECD54","name":"MaximumDrawdownPercentPerSecurityFrameworkRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"MaximumDrawdownPercentPerSecurityFrameworkRegressionAlgorithm.py"},{"id":"FCT-7A279BE5","name":"MaximumDrawdownPercentPortfolioFrameworkRegressionAlgorithm","description":"Portfolio Management","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"MaximumDrawdownPercentPortfolioFrameworkRegressionAlgorithm.py"},{"id":"FCT-C143732F","name":"MaximumSectorExposureRiskManagementModelFrameworkRegressionAlgorithm","description":"Risk Management","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"MaximumSectorExposureRiskManagementModelFrameworkRegressionAlgorithm.py"},{"id":"FCT-7E35ADAA","name":"MaximumUnrealizedProfitPercentPerSecurityFrameworkRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"MaximumUnrealizedProfitPercentPerSecurityFrameworkRegressionAlgorithm.py"},{"id":"FCT-98AE653C","name":"MeanReversionPortfolioAlgorithm","description":"Portfolio Management","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"MeanReversionPortfolioAlgorithm.py"},{"id":"FCT-C42B3790","name":"MeanVarianceOptimizationFrameworkAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"MeanVarianceOptimizationFrameworkAlgorithm.py"},{"id":"FCT-B8F7654B","name":"MovingAverageCrossAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"MovingAverageCrossAlgorithm.py"},{"id":"FCT-CFDE4C40","name":"MultipleSymbolConsolidationAlgorithm","description":"Data Consolidation","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"MultipleSymbolConsolidationAlgorithm.py"},{"id":"FCT-D2180B48","name":"NLTKSentimentTradingAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"NLTKSentimentTradingAlgorithm.py"},{"id":"FCT-AE6C825A","name":"NakedCallStrategyAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"NakedCallStrategyAlgorithm.py"},{"id":"FCT-82AD115E","name":"NakedPutStrategyAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"NakedPutStrategyAlgorithm.py"},{"id":"FCT-94DBB773","name":"NamedArgumentsRegression","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"NamedArgumentsRegression.py"},{"id":"FCT-994B4750","name":"NoUniverseSelectorRegressionAlgorithm","description":"Universe Selection","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"NoUniverseSelectorRegressionAlgorithm.py"},{"id":"FCT-7F8D7895","name":"NullBuyingPowerOptionBullCallSpreadAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"NullBuyingPowerOptionBullCallSpreadAlgorithm.py"},{"id":"FCT-B9E54A12","name":"NullMarginMultipleOrdersRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"NullMarginMultipleOrdersRegressionAlgorithm.py"},{"id":"FCT-16C48497","name":"NullOptionAssignmentRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"NullOptionAssignmentRegressionAlgorithm.py"},{"id":"FCT-F5080AAC","name":"NumeraiSignalExportDemonstrationAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"NumeraiSignalExportDemonstrationAlgorithm.py"},{"id":"FCT-6A2A6B6A","name":"ObjectStoreExampleAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"ObjectStoreExampleAlgorithm.py"},{"id":"FCT-5B1C96E9","name":"OnEndOfDayRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"OnEndOfDayRegressionAlgorithm.py"},{"id":"FCT-7E0FD2EB","name":"OnWarmupFinishedNoWarmup","description":"Warmup","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"OnWarmupFinishedNoWarmup.py"},{"id":"FCT-BA4498F3","name":"OnWarmupFinishedRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"OnWarmupFinishedRegressionAlgorithm.py"},{"id":"FCT-370B9F0E","name":"OpenInterestFuturesRegressionAlgorithm","description":"Futures","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"OpenInterestFuturesRegressionAlgorithm.py"},{"id":"FCT-A5BE1849","name":"OptionChainApisConsistencyRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"OptionChainApisConsistencyRegressionAlgorithm.py"},{"id":"FCT-98E14661","name":"OptionChainConsistencyRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"OptionChainConsistencyRegressionAlgorithm.py"},{"id":"FCT-A05E4856","name":"OptionChainFullDataRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"OptionChainFullDataRegressionAlgorithm.py"},{"id":"FCT-662DC1F1","name":"OptionChainProviderAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"OptionChainProviderAlgorithm.py"},{"id":"FCT-1D2112EA","name":"OptionChainedUniverseSelectionModelRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"OptionChainedUniverseSelectionModelRegressionAlgorithm.py"},{"id":"FCT-90DAF80B","name":"OptionChainsMultipleFullDataRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"OptionChainsMultipleFullDataRegressionAlgorithm.py"},{"id":"FCT-4E7CF48A","name":"OptionDataNullReferenceRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"OptionDataNullReferenceRegressionAlgorithm.py"},{"id":"FCT-A9A9EB72","name":"OptionExerciseAssignRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"OptionExerciseAssignRegressionAlgorithm.py"},{"id":"FCT-CFC8C48B","name":"OptionIndicatorsMirrorContractsRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"OptionIndicatorsMirrorContractsRegressionAlgorithm.py"},{"id":"FCT-707335FB","name":"OptionIndicatorsRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"OptionIndicatorsRegressionAlgorithm.py"},{"id":"FCT-62B73DDD","name":"OptionModelsConsistencyRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"OptionModelsConsistencyRegressionAlgorithm.py"},{"id":"FCT-0FFCB469","name":"OptionOpenInterestRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"OptionOpenInterestRegressionAlgorithm.py"},{"id":"FCT-9520559C","name":"OptionPriceModelForOptionStylesBaseRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"OptionPriceModelForOptionStylesBaseRegressionAlgorithm.py"},{"id":"FCT-9884C10F","name":"OptionPriceModelForSupportedAmericanOptionRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"OptionPriceModelForSupportedAmericanOptionRegressionAlgorithm.py"},{"id":"FCT-B34DCB29","name":"OptionPriceModelForSupportedAmericanOptionTimeSpanWarmupRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"OptionPriceModelForSupportedAmericanOptionTimeSpanWarmupRegressionAlgorithm.py"},{"id":"FCT-B6D1CB41","name":"OptionPriceModelForSupportedEuropeanOptionRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"OptionPriceModelForSupportedEuropeanOptionRegressionAlgorithm.py"},{"id":"FCT-6812E1E8","name":"OptionPriceModelForSupportedEuropeanOptionTimeSpanWarmupRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"OptionPriceModelForSupportedEuropeanOptionTimeSpanWarmupRegressionAlgorithm.py"},{"id":"FCT-03E734EA","name":"OptionPriceModelForUnsupportedAmericanOptionRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"OptionPriceModelForUnsupportedAmericanOptionRegressionAlgorithm.py"},{"id":"FCT-850F1B89","name":"OptionPriceModelForUnsupportedAmericanOptionTimeSpanWarmupRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"OptionPriceModelForUnsupportedAmericanOptionTimeSpanWarmupRegressionAlgorithm.py"},{"id":"FCT-C99DFC04","name":"OptionPriceModelForUnsupportedEuropeanOptionRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"OptionPriceModelForUnsupportedEuropeanOptionRegressionAlgorithm.py"},{"id":"FCT-6FBD513A","name":"OptionPriceModelForUnsupportedEuropeanOptionTimeSpanWarmupRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"OptionPriceModelForUnsupportedEuropeanOptionTimeSpanWarmupRegressionAlgorithm.py"},{"id":"FCT-8E5F0BE5","name":"OptionRenameRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"OptionRenameRegressionAlgorithm.py"},{"id":"FCT-D07A1F27","name":"OptionSplitRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"OptionSplitRegressionAlgorithm.py"},{"id":"FCT-CB64E8E9","name":"OptionStrategyFactoryMethodsBaseAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"OptionStrategyFactoryMethodsBaseAlgorithm.py"},{"id":"FCT-876722D3","name":"OptionUniverseFilterGreeksRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"OptionUniverseFilterGreeksRegressionAlgorithm.py"},{"id":"FCT-AED01B14","name":"OptionUniverseFilterGreeksShortcutsRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"OptionUniverseFilterGreeksShortcutsRegressionAlgorithm.py"},{"id":"FCT-62274EA6","name":"OptionUniverseFilterOptionsDataRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"OptionUniverseFilterOptionsDataRegressionAlgorithm.py"},{"id":"FCT-61D659F8","name":"OptionUniverseHistoryRegressionAlgorithm","description":"Options","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"OptionUniverseHistoryRegressionAlgorithm.py"},{"id":"FCT-D1943028","name":"OrderTicketAssignmentDemoAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"OrderTicketAssignmentDemoAlgorithm.py"},{"id":"FCT-4AD7FFC0","name":"OrderTicketDemoAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"OrderTicketDemoAlgorithm.py"},{"id":"FCT-73AEBCB1","name":"PEP8StyleBasicAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"PEP8StyleBasicAlgorithm.py"},{"id":"FCT-69B21AF4","name":"PandasDataFrameFromMultipleTickTypeTickHistoryRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"PandasDataFrameFromMultipleTickTypeTickHistoryRegressionAlgorithm.py"},{"id":"FCT-C16FBA05","name":"PandasDataFrameHistoryAlgorithm","description":"Historical Data","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"PandasDataFrameHistoryAlgorithm.py"},{"id":"FCT-3D4D4FC7","name":"ParameterizedAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"ParameterizedAlgorithm.py"},{"id":"FCT-6689DBF5","name":"PearsonCorrelationPairsTradingAlphaModelFrameworkAlgorithm","description":"Alpha Model","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"PearsonCorrelationPairsTradingAlphaModelFrameworkAlgorithm.py"},{"id":"FCT-B9E58D2A","name":"PeriodBasedHistoryRequestNotAllowedWithTickResolutionRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"PeriodBasedHistoryRequestNotAllowedWithTickResolutionRegressionAlgorithm.py"},{"id":"FCT-B4A28E80","name":"PortfolioRebalanceOnCustomFuncRegressionAlgorithm","description":"Portfolio Management","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"PortfolioRebalanceOnCustomFuncRegressionAlgorithm.py"},{"id":"FCT-53259B36","name":"PortfolioRebalanceOnDateRulesRegressionAlgorithm","description":"Portfolio Management","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"PortfolioRebalanceOnDateRulesRegressionAlgorithm.py"},{"id":"FCT-1D170EBB","name":"PortfolioTargetTagsRegressionAlgorithm","description":"Portfolio Management","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"PortfolioTargetTagsRegressionAlgorithm.py"},{"id":"FCT-3E91D425","name":"PythonDictionaryFeatureRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"PythonDictionaryFeatureRegressionAlgorithm.py"},{"id":"FCT-3BE1BA87","name":"PytorchNeuralNetworkAlgorithm","description":"Machine Learning","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"PytorchNeuralNetworkAlgorithm.py"},{"id":"FCT-0CB9D7FA","name":"QuitAfterInitializationRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"QuitAfterInitializationRegressionAlgorithm.py"},{"id":"FCT-87512128","name":"QuitInInitializationRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"QuitInInitializationRegressionAlgorithm.py"},{"id":"FCT-052CED9D","name":"RangeConsolidatorAlgorithm","description":"Data Consolidation","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"RangeConsolidatorAlgorithm.py"},{"id":"FCT-0761902F","name":"RangeConsolidatorWithTickAlgorithm","description":"Data Consolidation","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"RangeConsolidatorWithTickAlgorithm.py"},{"id":"FCT-4C4ACA6D","name":"RawDataRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"RawDataRegressionAlgorithm.py"},{"id":"FCT-8426823A","name":"RawPricesCoarseUniverseAlgorithm","description":"Universe Selection","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"RawPricesCoarseUniverseAlgorithm.py"},{"id":"FCT-EEE07C98","name":"RawPricesUniverseRegressionAlgorithm","description":"Universe Selection","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"RawPricesUniverseRegressionAlgorithm.py"},{"id":"FCT-0D15187F","name":"RegisterIndicatorRegressionAlgorithm","description":"Indicators","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"RegisterIndicatorRegressionAlgorithm.py"},{"id":"FCT-D350E387","name":"RegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"RegressionAlgorithm.py"},{"id":"FCT-CB76FD5F","name":"RegressionChannelAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"RegressionChannelAlgorithm.py"},{"id":"FCT-4F8A816B","name":"RiskParityPortfolioAlgorithm","description":"Risk Management","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"RiskParityPortfolioAlgorithm.py"},{"id":"FCT-5A71E57F","name":"RollingWindowAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"RollingWindowAlgorithm.py"},{"id":"FCT-2CBD0408","name":"RsiAlphaModelFrameworkRegressionAlgorithm","description":"Alpha Model","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"RsiAlphaModelFrameworkRegressionAlgorithm.py"},{"id":"FCT-9781F28A","name":"ScheduledEventsAlgorithm","description":"Scheduled Events","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"ScheduledEventsAlgorithm.py"},{"id":"FCT-BC10DFCE","name":"ScheduledQueuingAlgorithm","description":"Scheduled Events","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"ScheduledQueuingAlgorithm.py"},{"id":"FCT-AE6D38CF","name":"ScheduledUniverseRegressionAlgorithm","description":"Universe Selection","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"ScheduledUniverseRegressionAlgorithm.py"},{"id":"FCT-3F154B00","name":"ScheduledUniverseSelectionModelRegressionAlgorithm","description":"Universe Selection","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"ScheduledUniverseSelectionModelRegressionAlgorithm.py"},{"id":"FCT-1244BB8B","name":"ScikitLearnLinearRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"ScikitLearnLinearRegressionAlgorithm.py"},{"id":"FCT-9159A849","name":"SectorExposureRiskFrameworkAlgorithm","description":"Risk Management","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"SectorExposureRiskFrameworkAlgorithm.py"},{"id":"FCT-F578C144","name":"SectorWeightingFrameworkAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"SectorWeightingFrameworkAlgorithm.py"},{"id":"FCT-B0B2E65B","name":"SecurityCustomPropertiesAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"SecurityCustomPropertiesAlgorithm.py"},{"id":"FCT-B2BE2584","name":"SecurityDynamicPropertyPythonClassAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"SecurityDynamicPropertyPythonClassAlgorithm.py"},{"id":"FCT-79957FB5","name":"SecuritySeederRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"SecuritySeederRegressionAlgorithm.py"},{"id":"FCT-BCEB1931","name":"SelectUniverseSymbolsFromIDRegressionAlgorithm","description":"Universe Selection","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"SelectUniverseSymbolsFromIDRegressionAlgorithm.py"},{"id":"FCT-86D91C89","name":"SetCustomSettlementModelRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"SetCustomSettlementModelRegressionAlgorithm.py"},{"id":"FCT-D64ED04F","name":"SetEquityDataNormalizationModeOnAddEquity","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"SetEquityDataNormalizationModeOnAddEquity.py"},{"id":"FCT-36FF2819","name":"SetHoldingsLiquidateExistingHoldingsMultipleTargetsRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"SetHoldingsLiquidateExistingHoldingsMultipleTargetsRegressionAlgorithm.py"},{"id":"FCT-5A449593","name":"SetHoldingsMultipleTargetsRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"SetHoldingsMultipleTargetsRegressionAlgorithm.py"},{"id":"FCT-58C330FF","name":"SetHoldingsRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"SetHoldingsRegressionAlgorithm.py"},{"id":"FCT-EFDED6A6","name":"ShortableProviderOrdersRejectedRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"ShortableProviderOrdersRejectedRegressionAlgorithm.py"},{"id":"FCT-198E83AF","name":"SliceGetByTypeRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"SliceGetByTypeRegressionAlgorithm.py"},{"id":"FCT-9D3D6D8F","name":"SmaCrossUniverseSelectionAlgorithm","description":"Universe Selection","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"SmaCrossUniverseSelectionAlgorithm.py"},{"id":"FCT-E4FEA7D1","name":"SpreadExecutionModelRegressionAlgorithm","description":"Execution Model","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"SpreadExecutionModelRegressionAlgorithm.py"},{"id":"FCT-5C2FCFA1","name":"StableCoinsRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"StableCoinsRegressionAlgorithm.py"},{"id":"FCT-C7F868BA","name":"StandardDeviationExecutionModelRegressionAlgorithm","description":"Execution Model","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"StandardDeviationExecutionModelRegressionAlgorithm.py"},{"id":"FCT-99B5F510","name":"StatisticsResultsAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"StatisticsResultsAlgorithm.py"},{"id":"FCT-1A300907","name":"StochasticIndicatorWarmsUpProperlyRegressionAlgorithm","description":"Indicators","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"StochasticIndicatorWarmsUpProperlyRegressionAlgorithm.py"},{"id":"FCT-58C9B30E","name":"StopLimitOrderRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"StopLimitOrderRegressionAlgorithm.py"},{"id":"FCT-8FAFCC5D","name":"StringToSymbolImplicitConversionRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"StringToSymbolImplicitConversionRegressionAlgorithm.py"},{"id":"FCT-D0F1B141","name":"TalibIndicatorsAlgorithm","description":"Indicators","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"TalibIndicatorsAlgorithm.py"},{"id":"FCT-42FC8E69","name":"TensorFlowNeuralNetworkAlgorithm","description":"Machine Learning","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"TensorFlowNeuralNetworkAlgorithm.py"},{"id":"FCT-84B15249","name":"TickDataFilteringAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"TickDataFilteringAlgorithm.py"},{"id":"FCT-824A47D1","name":"TickHistoryRequestWithoutTickSubscriptionRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"TickHistoryRequestWithoutTickSubscriptionRegressionAlgorithm.py"},{"id":"FCT-B0BD73CA","name":"TiingoPriceAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"TiingoPriceAlgorithm.py"},{"id":"FCT-F8E8016B","name":"TimeInForceAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"TimeInForceAlgorithm.py"},{"id":"FCT-76B63DA7","name":"TrailingStopOrderRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"TrailingStopOrderRegressionAlgorithm.py"},{"id":"FCT-DD7ECCB4","name":"TrailingStopRiskFrameworkRegressionAlgorithm","description":"Risk Management","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"TrailingStopRiskFrameworkRegressionAlgorithm.py"},{"id":"FCT-4F56A3E5","name":"TrainingExampleAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"TrainingExampleAlgorithm.py"},{"id":"FCT-95DFEFEB","name":"TrainingInitializeRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"TrainingInitializeRegressionAlgorithm.py"},{"id":"FCT-FED4E182","name":"TwoLegCurrencyConversionRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"TwoLegCurrencyConversionRegressionAlgorithm.py"},{"id":"FCT-953A6967","name":"UniverseOnlyRegressionAlgorithm","description":"Universe Selection","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"UniverseOnlyRegressionAlgorithm.py"},{"id":"FCT-BAF35694","name":"UniverseSelectedRegressionAlgorithm","description":"Universe Selection","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"UniverseSelectedRegressionAlgorithm.py"},{"id":"FCT-DBD4926F","name":"UniverseSelectionDefinitionsAlgorithm","description":"Universe Selection","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"UniverseSelectionDefinitionsAlgorithm.py"},{"id":"FCT-E51F70E4","name":"UniverseSelectionRegressionAlgorithm","description":"Universe Selection","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"UniverseSelectionRegressionAlgorithm.py"},{"id":"FCT-91035E43","name":"UniverseUnchangedRegressionAlgorithm","description":"Universe Selection","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"UniverseUnchangedRegressionAlgorithm.py"},{"id":"FCT-D8849489","name":"UnregisterIndicatorRegressionAlgorithm","description":"Indicators","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"UnregisterIndicatorRegressionAlgorithm.py"},{"id":"FCT-BFC09E5D","name":"UpdateOrderRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"UpdateOrderRegressionAlgorithm.py"},{"id":"FCT-90E557F4","name":"UserDefinedUniverseAlgorithm","description":"Universe Selection","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"UserDefinedUniverseAlgorithm.py"},{"id":"FCT-253853F6","name":"VolumeRenkoConsolidatorAlgorithm","description":"Data Consolidation","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"VolumeRenkoConsolidatorAlgorithm.py"},{"id":"FCT-8D857005","name":"VolumeShareSlippageModelAlgorithm","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"VolumeShareSlippageModelAlgorithm.py"},{"id":"FCT-2D03F945","name":"VolumeWeightedAveragePriceExecutionModelRegressionAlgorithm","description":"Execution Model","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"VolumeWeightedAveragePriceExecutionModelRegressionAlgorithm.py"},{"id":"FCT-DB342081","name":"WarmupAlgorithm","description":"Warmup","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"WarmupAlgorithm.py"},{"id":"FCT-E048C42D","name":"WarmupHistoryAlgorithm","description":"Warmup","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"WarmupHistoryAlgorithm.py"},{"id":"FCT-161A4DE8","name":"WeeklyUniverseSelectionRegressionAlgorithm","description":"Universe Selection","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"WeeklyUniverseSelectionRegressionAlgorithm.py"},{"id":"FCT-F69688F5","name":"ZeroedBenchmarkRegressionAlgorithm","description":"Regression Test","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"ZeroedBenchmarkRegressionAlgorithm.py"},{"id":"FCT-FAD58DE7","name":"main","description":"General Strategy","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"main.py"},{"id":"FCT-70CBDC3D","name":"ContingentClaimsAnalysisDefaultPredictionAlpha","description":"Alpha Model","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"alphas/ContingentClaimsAnalysisDefaultPredictionAlpha.py"},{"id":"FCT-9D7FFCA4","name":"GasAndCrudeOilEnergyCorrelationAlpha","description":"Alpha Model","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"alphas/GasAndCrudeOilEnergyCorrelationAlpha.py"},{"id":"FCT-C3B2CF90","name":"GlobalEquityMeanReversionIBSAlpha","description":"Alpha Model","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"alphas/GlobalEquityMeanReversionIBSAlpha.py"},{"id":"FCT-46661FE6","name":"GreenblattMagicFormulaAlpha","description":"Alpha Model","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"alphas/GreenblattMagicFormulaAlpha.py"},{"id":"FCT-5596A325","name":"IntradayReversalCurrencyMarketsAlpha","description":"Alpha Model","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"alphas/IntradayReversalCurrencyMarketsAlpha.py"},{"id":"FCT-EAEEE69C","name":"MeanReversionLunchBreakAlpha","description":"Alpha Model","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"alphas/MeanReversionLunchBreakAlpha.py"},{"id":"FCT-B86663BE","name":"MortgageRateVolatilityAlpha","description":"Alpha Model","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"alphas/MortgageRateVolatilityAlpha.py"},{"id":"FCT-899805AE","name":"PriceGapMeanReversionAlpha","description":"Alpha Model","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"alphas/PriceGapMeanReversionAlpha.py"},{"id":"FCT-41404465","name":"RebalancingLeveragedETFAlpha","description":"Alpha Model","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"alphas/RebalancingLeveragedETFAlpha.py"},{"id":"FCT-B44500AA","name":"ShareClassMeanReversionAlpha","description":"Alpha Model","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"alphas/ShareClassMeanReversionAlpha.py"},{"id":"FCT-EEAA6B87","name":"SykesShortMicroCapAlpha","description":"Alpha Model","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"alphas/SykesShortMicroCapAlpha.py"},{"id":"FCT-217A291D","name":"TriangleExchangeRateArbitrageAlpha","description":"Alpha Model","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"alphas/TriangleExchangeRateArbitrageAlpha.py"},{"id":"FCT-A6C1E2B9","name":"TripleLeverageETFPairVolatilityDecayAlpha","description":"Alpha Model","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"alphas/TripleLeverageETFPairVolatilityDecayAlpha.py"},{"id":"FCT-7DFAE1BB","name":"VIXDualThrustAlpha","description":"Alpha Model","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"alphas/VIXDualThrustAlpha.py"},{"id":"FCT-B103DBA0","name":"BasicTemplateBenchmark","description":"Benchmark","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"benchmarks/BasicTemplateBenchmark.py"},{"id":"FCT-5B90E12B","name":"CoarseFineUniverseSelectionBenchmark","description":"Benchmark","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"benchmarks/CoarseFineUniverseSelectionBenchmark.py"},{"id":"FCT-9C878F2C","name":"EmptyEquityAndOptions400Benchmark","description":"Benchmark","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"benchmarks/EmptyEquityAndOptions400Benchmark.py"},{"id":"FCT-1E0D28D7","name":"EmptyMinute400EquityBenchmark","description":"Benchmark","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"benchmarks/EmptyMinute400EquityBenchmark.py"},{"id":"FCT-9BA28BE5","name":"EmptySingleSecuritySecondEquityBenchmark","description":"Benchmark","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"benchmarks/EmptySingleSecuritySecondEquityBenchmark.py"},{"id":"FCT-0C67D5F6","name":"HistoryRequestBenchmark","description":"Benchmark","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"benchmarks/HistoryRequestBenchmark.py"},{"id":"FCT-D5F0AB7B","name":"IndicatorRibbonBenchmark","description":"Benchmark","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"benchmarks/IndicatorRibbonBenchmark.py"},{"id":"FCT-5F7C7101","name":"ScheduledEventsBenchmark","description":"Benchmark","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"benchmarks/ScheduledEventsBenchmark.py"},{"id":"FCT-FA9F3E6A","name":"StatefulCoarseUniverseSelectionBenchmark","description":"Benchmark","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"benchmarks/StatefulCoarseUniverseSelectionBenchmark.py"},{"id":"FCT-D12D8ED1","name":"StatelessCoarseUniverseSelectionBenchmark","description":"Benchmark","timeframe":"1d","entry_conditions":[],"exit_conditions":[],"entry_logic":"AND","exit_logic":"AND","stop_loss":0,"take_profit":0,"trailing_stop":0,"script_path":"benchmarks/StatelessCoarseUniverseSelectionBenchmark.py"}]}
\ No newline at end of file
diff --git a/fincept-qt/scripts/voice/speech_to_text.py b/fincept-qt/scripts/voice/speech_to_text.py
new file mode 100644
index 000000000..43169eb14
--- /dev/null
+++ b/fincept-qt/scripts/voice/speech_to_text.py
@@ -0,0 +1,100 @@
+#!/usr/bin/env python3
+"""
+speech_to_text.py — Microphone → Google Speech Recognition → JSON stdout.
+
+Protocol (one JSON object per line on stdout):
+ {"status": "calibrating"} — adjusting for ambient noise
+ {"status": "listening"} — ready, waiting for speech
+ {"text": "hello world"} — transcription result
+ {"error": "..."} — recoverable error (keeps listening)
+ {"fatal": "..."} — unrecoverable error (process exits)
+
+The process runs until stdin is closed or it receives SIGTERM.
+"""
+
+import json
+import sys
+import signal
+
+
+def emit(obj: dict) -> None:
+ """Write a JSON line to stdout and flush immediately."""
+ sys.stdout.write(json.dumps(obj) + "\n")
+ sys.stdout.flush()
+
+
+def main() -> None:
+ # Fail fast if speech_recognition is not installed
+ try:
+ import speech_recognition as sr
+ except ImportError:
+ emit({"fatal": "speech_recognition not installed — run: pip install SpeechRecognition"})
+ sys.exit(1)
+
+ # Fail fast if PyAudio is not available (needed for microphone access)
+ try:
+ import pyaudio # noqa: F401
+ except ImportError:
+ emit({"fatal": "PyAudio not installed — run: pip install PyAudio"})
+ sys.exit(1)
+
+ # Graceful shutdown on SIGTERM (Windows doesn't have SIGTERM via signal,
+ # but QProcess::kill sends taskkill which terminates the process anyway).
+ running = True
+
+ def on_signal(signum, frame):
+ nonlocal running
+ running = False
+
+ if hasattr(signal, "SIGTERM"):
+ signal.signal(signal.SIGTERM, on_signal)
+
+ recognizer = sr.Recognizer()
+ recognizer.energy_threshold = 300
+ recognizer.dynamic_energy_threshold = True
+ recognizer.pause_threshold = 0.8
+
+ try:
+ mic = sr.Microphone()
+ except (OSError, AttributeError) as e:
+ emit({"fatal": f"No microphone available: {e}"})
+ sys.exit(1)
+
+ # Calibrate for ambient noise
+ emit({"status": "calibrating"})
+ try:
+ with mic as source:
+ recognizer.adjust_for_ambient_noise(source, duration=1)
+ except Exception as e:
+ emit({"fatal": f"Microphone calibration failed: {e}"})
+ sys.exit(1)
+
+ # Main listening loop
+ while running:
+ emit({"status": "listening"})
+ try:
+ with mic as source:
+ audio = recognizer.listen(source, timeout=10, phrase_time_limit=15)
+
+ text = recognizer.recognize_google(audio)
+ if text and text.strip():
+ emit({"text": text.strip()})
+
+ except sr.WaitTimeoutError:
+ # No speech detected within timeout — loop and try again
+ pass
+ except sr.UnknownValueError:
+ # Could not understand audio — not an error, just try again
+ pass
+ except sr.RequestError as e:
+ emit({"error": f"Google API request failed: {e}"})
+ except KeyboardInterrupt:
+ break
+ except Exception as e:
+ emit({"error": f"Unexpected error: {e}"})
+
+ emit({"status": "stopped"})
+
+
+if __name__ == "__main__":
+ main()
diff --git a/fincept-qt/src/ai_chat/AiChatBubble.cpp b/fincept-qt/src/ai_chat/AiChatBubble.cpp
index 11462d8f6..9309b3859 100644
--- a/fincept-qt/src/ai_chat/AiChatBubble.cpp
+++ b/fincept-qt/src/ai_chat/AiChatBubble.cpp
@@ -1,6 +1,6 @@
#include "ai_chat/AiChatBubble.h"
-#include "services/stt/WhisperService.h"
+#include "services/stt/SpeechService.h"
#include "storage/repositories/ChatRepository.h"
#include "ui/theme/Theme.h"
#include "ui/theme/ThemeManager.h"
@@ -65,17 +65,11 @@ AiChatBubble::AiChatBubble(QWidget* parent) : QWidget(parent) {
connect(&ai_chat::LlmService::instance(), &ai_chat::LlmService::finished_streaming, this,
&AiChatBubble::on_streaming_done, Qt::UniqueConnection);
- // ── WhisperService wiring ─────────────────────────────────────────────────
- auto& stt = services::WhisperService::instance();
- connect(&stt, &services::WhisperService::transcription_ready, this, &AiChatBubble::on_transcription);
- connect(&stt, &services::WhisperService::listening_changed, this, &AiChatBubble::on_stt_listening_changed);
- connect(&stt, &services::WhisperService::error_occurred, this, &AiChatBubble::on_stt_error);
- connect(&stt, &services::WhisperService::model_download_progress, this, &AiChatBubble::on_model_download_progress);
- connect(&stt, &services::WhisperService::model_ready, this, [this]() {
- update_voice_status();
- if (voice_mode_)
- start_listening();
- });
+ // ── SpeechService wiring ─────────────────────────────────────────────────
+ auto& stt = services::SpeechService::instance();
+ connect(&stt, &services::SpeechService::transcription_ready, this, &AiChatBubble::on_transcription);
+ connect(&stt, &services::SpeechService::listening_changed, this, &AiChatBubble::on_stt_listening_changed);
+ connect(&stt, &services::SpeechService::error_occurred, this, &AiChatBubble::on_stt_error);
if (parent)
parent->installEventFilter(this);
@@ -729,7 +723,7 @@ void AiChatBubble::update_unread(int delta) {
}
}
-// ── Voice input (STT — whisper.cpp offline, cross-platform) ──────────────────
+// ── Voice input (STT — Python speech_recognition + Google API) ───────────────
void AiChatBubble::on_toggle_mic() {
if (is_listening_)
@@ -741,13 +735,11 @@ void AiChatBubble::on_toggle_mic() {
void AiChatBubble::start_listening() {
if (is_listening_ || is_speaking_)
return;
- services::WhisperService::instance().start_listening();
- // is_listening_ state is updated via on_stt_listening_changed signal.
+ services::SpeechService::instance().start_listening();
}
void AiChatBubble::stop_listening() {
- services::WhisperService::instance().stop_listening();
- // is_listening_ state is updated via on_stt_listening_changed signal.
+ services::SpeechService::instance().stop_listening();
}
void AiChatBubble::on_stt_listening_changed(bool active) {
@@ -767,8 +759,15 @@ void AiChatBubble::on_transcription(const QString& text) {
return;
input_box_->setPlainText(text);
- if (voice_mode_)
+
+ // Stop mic after transcription in single-shot mic mode (not voice mode).
+ // In voice mode the mic restarts automatically after TTS completes.
+ if (!voice_mode_) {
+ stop_listening();
+ mic_btn_->setChecked(false);
+ } else {
on_send();
+ }
update_voice_status();
}
@@ -777,11 +776,6 @@ void AiChatBubble::on_stt_error(const QString& message) {
voice_status_lbl_->setText(QStringLiteral("⚠ ") + message);
}
-void AiChatBubble::on_model_download_progress(int percent) {
- if (voice_status_lbl_)
- voice_status_lbl_->setText(QStringLiteral("Downloading voice model… %1%").arg(percent));
-}
-
// ── Voice mode ────────────────────────────────────────────────────────────────
void AiChatBubble::on_toggle_voice_mode() {
voice_mode_ = voice_mode_btn_->isChecked();
@@ -894,23 +888,24 @@ void AiChatBubble::on_tts_media_status(QMediaPlayer::MediaStatus status) {
// ── Voice status ──────────────────────────────────────────────────────────────
void AiChatBubble::update_voice_status() {
- if (!voice_mode_)
- return;
if (!voice_status_lbl_)
return;
+ // Show status for both mic-only mode and full voice mode.
if (is_speaking_) {
voice_status_lbl_->setText("▶ AI speaking…");
voice_status_lbl_->setStyleSheet(
QString("color:%1;font-size:11px;font-style:italic;background:transparent;").arg(col::WARNING()));
} else if (is_listening_) {
- voice_status_lbl_->setText("● Listening…");
+ voice_status_lbl_->setText("● Listening — speak now…");
voice_status_lbl_->setStyleSheet(
QString("color:%1;font-size:11px;font-style:italic;background:transparent;").arg(col::POSITIVE()));
} else if (streaming_) {
voice_status_lbl_->setText("AI is thinking…");
voice_status_lbl_->setStyleSheet(
QString("color:%1;font-size:11px;font-style:italic;background:transparent;").arg(col::TEXT_DIM()));
+ } else {
+ voice_status_lbl_->clear();
}
}
diff --git a/fincept-qt/src/ai_chat/AiChatBubble.h b/fincept-qt/src/ai_chat/AiChatBubble.h
index 27aba42cd..021ef60e0 100644
--- a/fincept-qt/src/ai_chat/AiChatBubble.h
+++ b/fincept-qt/src/ai_chat/AiChatBubble.h
@@ -22,13 +22,13 @@ namespace fincept {
// ── AiChatBubble ─────────────────────────────────────────────────────────────
// Floating AI assistant bubble — fixed bottom-right corner of the main window.
-// Features: streaming chat, voice input (whisper.cpp offline STT — cross-platform),
+// Features: streaming chat, voice input (Python speech_recognition + Google STT),
// TTS output via QMediaPlayer, session persistence via ChatRepository.
//
// Voice flow:
// mic_btn / voice_mode_btn
-// → WhisperService::start_listening()
-// → WhisperService::transcription_ready(text) [signal on UI thread]
+// → SpeechService::start_listening()
+// → SpeechService::transcription_ready(text) [signal on UI thread]
// → on_transcription(text)
// → input_box_ populated → on_send()
@@ -55,7 +55,6 @@ class AiChatBubble : public QWidget {
void on_transcription(const QString& text);
void on_stt_listening_changed(bool active);
void on_stt_error(const QString& message);
- void on_model_download_progress(int percent);
void on_tts_media_status(QMediaPlayer::MediaStatus status);
private:
diff --git a/fincept-qt/src/app/DockScreenRouter.cpp b/fincept-qt/src/app/DockScreenRouter.cpp
index bac8976f2..5526caf47 100644
--- a/fincept-qt/src/app/DockScreenRouter.cpp
+++ b/fincept-qt/src/app/DockScreenRouter.cpp
@@ -5,15 +5,15 @@
#include "core/session/SessionManager.h"
#include "screens/IStatefulScreen.h"
-#include <QDebug>
#include <QEvent>
#include <QKeyEvent>
#include <QLabel>
#include <QLineEdit>
-#include <QPalette>
#include <QVBoxLayout>
#include <DockAreaWidget.h>
+#include <DockManager.h>
+#include <DockWidget.h>
#include <DockWidgetTab.h>
namespace fincept {
@@ -73,7 +73,8 @@ QString DockScreenRouter::title_for_id(const QString& id) {
return titles.value(id, id);
}
-DockScreenRouter::DockScreenRouter(ads::CDockManager* manager, QObject* parent) : QObject(parent), manager_(manager) {}
+DockScreenRouter::DockScreenRouter(ads::CDockManager* manager, QObject* parent) : QObject(parent), manager_(manager) {
+}
void DockScreenRouter::register_screen(const QString& id, QWidget* screen) {
// Store the screen widget — the CDockWidget is only created on first navigate().
@@ -251,9 +252,19 @@ void DockScreenRouter::navigate(const QString& id, bool exclusive) {
// call, the tab stays hidden because isClosed() returns false and the
// previous conditional `if (isClosed()) toggleView(true)` was skipped.
dw->toggleView(true);
+ // ADS does not restore CDockWidgetTab visibility when toggleView(true)
+ // re-opens a previously hidden widget — the tab stays hidden from the
+ // ensure_all_registered() phase where all widgets were toggleView(false)'d.
+ // Force the tab visible so the label text appears in the title bar.
+ if (auto* tab = dw->tabWidget()) {
+ if (tab->isHidden())
+ tab->setVisible(true);
+ }
dw->raise();
dw->setAsCurrentTab();
+ apply_ads_theme();
+
current_id_ = id;
SessionManager::instance().set_last_screen(id);
LOG_INFO("DockRouter", "Navigated to: " + id);
@@ -306,6 +317,10 @@ void DockScreenRouter::tab_into(const QString& id) {
}
dw->toggleView(true);
+ if (auto* tab = dw->tabWidget()) {
+ if (tab->isHidden())
+ tab->setVisible(true);
+ }
dw->raise();
dw->setAsCurrentTab();
@@ -400,6 +415,8 @@ void DockScreenRouter::ensure_all_registered() {
dw->toggleView(false); // start hidden
}
}
+ // Apply theme directly to all title bars and tabs created above.
+ apply_ads_theme();
}
ads::CDockWidget* DockScreenRouter::find_dock_widget(const QString& id) const {
@@ -625,4 +642,23 @@ void DockScreenRouter::restore_screen_state(const QString& id) {
ScreenStateManager::instance().restore(stateful);
}
+void DockScreenRouter::apply_ads_theme() {
+ // ADS's CSS (build_ads_qss on CDockManager) handles all ADS widget styling.
+ // This function ensures tab widgets and labels don't have stale widget-level
+ // QSS that could interfere with ADS's CSS cascade, and forces hidden tabs
+ // visible (they can get stuck hidden after ensure_all_registered()).
+ for (auto* dw : manager_->dockWidgetsMap()) {
+ if (auto* tab = dw->tabWidget()) {
+ if (!tab->styleSheet().isEmpty())
+ tab->setStyleSheet(QString());
+ if (tab->isHidden() && !dw->isClosed())
+ tab->setVisible(true);
+ for (auto* lbl : tab->findChildren<QLabel*>()) {
+ if (!lbl->styleSheet().isEmpty())
+ lbl->setStyleSheet(QString());
+ }
+ }
+ }
+}
+
} // namespace fincept
diff --git a/fincept-qt/src/app/DockScreenRouter.h b/fincept-qt/src/app/DockScreenRouter.h
index 70d39bab6..b5662fa64 100644
--- a/fincept-qt/src/app/DockScreenRouter.h
+++ b/fincept-qt/src/app/DockScreenRouter.h
@@ -85,6 +85,10 @@ class DockScreenRouter : public QObject {
ads::CDockWidget* create_dock_widget(const QString& id);
void materialize_screen(const QString& id);
+ /// Apply theme colors directly to all CDockAreaTitleBar and CDockWidgetTab
+ /// widgets. Called after any addDockWidget() call since those create new
+ /// QFrame-derived widgets that the app-level QFrame rule overrides.
+ void apply_ads_theme();
public:
/// Map a screen id to its human-readable title.
diff --git a/fincept-qt/src/app/MainWindow.cpp b/fincept-qt/src/app/MainWindow.cpp
index 5204c61e7..3d95a86de 100644
--- a/fincept-qt/src/app/MainWindow.cpp
+++ b/fincept-qt/src/app/MainWindow.cpp
@@ -260,11 +260,13 @@ MainWindow::MainWindow(int window_id, QWidget* parent) : QMainWindow(parent), wi
auto& km = KeyConfigManager::instance();
auto* act_chat = km.action(KeyAction::ToggleChat);
- act_chat->setParent(this);
+ act_chat->setShortcutContext(Qt::WindowShortcut);
+ addAction(act_chat);
connect(act_chat, &QAction::triggered, this, &MainWindow::toggle_chat_mode);
auto* act_fs = km.action(KeyAction::Fullscreen);
- act_fs->setParent(this);
+ act_fs->setShortcutContext(Qt::WindowShortcut);
+ addAction(act_fs);
connect(act_fs, &QAction::triggered, this, [this]() {
if (isFullScreen())
showNormal();
@@ -273,7 +275,8 @@ MainWindow::MainWindow(int window_id, QWidget* parent) : QMainWindow(parent), wi
});
auto* act_focus = km.action(KeyAction::FocusMode);
- act_focus->setParent(this);
+ act_focus->setShortcutContext(Qt::WindowShortcut);
+ addAction(act_focus);
connect(act_focus, &QAction::triggered, this, [this]() {
focus_mode_ = !focus_mode_;
if (dock_toolbar_)
@@ -283,7 +286,8 @@ MainWindow::MainWindow(int window_id, QWidget* parent) : QMainWindow(parent), wi
});
auto* act_refresh = km.action(KeyAction::Refresh);
- act_refresh->setParent(this);
+ act_refresh->setShortcutContext(Qt::WindowShortcut);
+ addAction(act_refresh);
connect(act_refresh, &QAction::triggered, this, [this]() {
if (dock_manager_) {
auto* focused = dock_manager_->focusedDockWidget();
@@ -293,7 +297,8 @@ MainWindow::MainWindow(int window_id, QWidget* parent) : QMainWindow(parent), wi
});
auto* act_screenshot = km.action(KeyAction::Screenshot);
- act_screenshot->setParent(this);
+ act_screenshot->setShortcutContext(Qt::WindowShortcut);
+ addAction(act_screenshot);
connect(act_screenshot, &QAction::triggered, this, [this]() {
QScreen* scr = this->screen();
if (!scr)
@@ -692,7 +697,7 @@ void MainWindow::setup_docking_mode() {
static bool s_ads_configured = false;
if (!s_ads_configured) {
ads::CDockManager::setConfigFlags(
- ads::CDockManager::DefaultOpaqueConfig | ads::CDockManager::FocusHighlighting |
+ ads::CDockManager::DefaultOpaqueConfig |
ads::CDockManager::AlwaysShowTabs | ads::CDockManager::DockAreaHasTabsMenuButton |
ads::CDockManager::DockAreaDynamicTabsMenuButtonVisibility |
ads::CDockManager::FloatingContainerHasWidgetTitle | ads::CDockManager::FloatingContainerHasWidgetIcon |
@@ -722,6 +727,11 @@ void MainWindow::setup_docking_mode() {
dock_layout->addWidget(tab_bar_);
dock_manager_ = new ads::CDockManager(dock_wrapper);
+ // ADS loads its own default.css via setStyleSheet() in its constructor.
+ // That CSS uses palette(window)/palette(highlight) — the Windows system
+ // gray/blue — which overrides our global QSS. Replace it with our own
+ // theme-matched ADS stylesheet so our colors apply consistently.
+ dock_manager_->setStyleSheet(ui::ThemeManager::instance().build_ads_qss());
dock_layout->addWidget(dock_manager_);
}
diff --git a/fincept-qt/src/core/config/AppPaths.h b/fincept-qt/src/core/config/AppPaths.h
index 582012f26..ce0badb04 100644
--- a/fincept-qt/src/core/config/AppPaths.h
+++ b/fincept-qt/src/core/config/AppPaths.h
@@ -15,7 +15,7 @@ namespace fincept {
/// logs/ — Application log files
/// files/ — User-managed file attachments
/// cache/ — Tile caches and other transient network data
-/// models/ — ML model files (Whisper, etc.)
+/// models/ — ML model files
/// runtime/ — Python interpreter, UV, virtual environments
///
/// Call AppPaths::ensure_all() once at startup to create every sub-directory.
diff --git a/fincept-qt/src/core/keys/KeyConfigManager.cpp b/fincept-qt/src/core/keys/KeyConfigManager.cpp
index cfa16c7d3..b4de7745a 100644
--- a/fincept-qt/src/core/keys/KeyConfigManager.cpp
+++ b/fincept-qt/src/core/keys/KeyConfigManager.cpp
@@ -54,7 +54,7 @@ KeyConfigManager::KeyConfigManager() {
for (auto it = defaults_.begin(); it != defaults_.end(); ++it) {
auto* act = new QAction(this);
act->setShortcut(it.value());
- act->setShortcutContext(Qt::WindowShortcut);
+ act->setShortcutContext(Qt::ApplicationShortcut);
actions_[it.key()] = act;
}
diff --git a/fincept-qt/src/screens/ai_quant_lab/QuantModulePanel.cpp b/fincept-qt/src/screens/ai_quant_lab/QuantModulePanel.cpp
index d46be2ed8..fafc0024f 100644
--- a/fincept-qt/src/screens/ai_quant_lab/QuantModulePanel.cpp
+++ b/fincept-qt/src/screens/ai_quant_lab/QuantModulePanel.cpp
@@ -24,6 +24,8 @@
#include <QJsonArray>
#include <QJsonDocument>
#include <QRegularExpression>
+#include <QFrame>
+#include <QProgressBar>
#include <QScrollArea>
#include <QTabWidget>
#include <QTableWidget>
@@ -2732,49 +2734,249 @@ void QuantModulePanel::on_result(const QString& module_id, const QString& comman
// ── Rolling Retraining ───────────────────────────────────────────────────
if (module_id == "rolling_retraining") {
+ // ── Streaming events from retrain command ────────────────────────────
+ const QString event = data["event"].toString();
+ if (!event.isEmpty()) {
+ auto* pb = this->findChild<QProgressBar*>("rr_progress");
+ auto* log = this->findChild<QTextEdit*>("rr_log");
+
+ if (event == "start") {
+ const int total = data["total_windows"].toInt();
+ if (pb) { pb->setRange(0, total); pb->setValue(0); pb->setFormat("0 / %v windows"); }
+ if (log) log->append(QString("Starting retrain: %1 | %2 windows")
+ .arg(data["model_id"].toString()).arg(total));
+ status_label_->setText(QString("Retraining %1 — 0/%2 windows")
+ .arg(data["model_id"].toString()).arg(total));
+ } else if (event == "window") {
+ const int idx = data["index"].toInt();
+ const int total = data["total"].toInt();
+ if (pb) { pb->setValue(idx); pb->setFormat(QString("%1 / %2 windows").arg(idx).arg(total)); }
+ if (log) log->append(QString(" Window %1/%2 train→%3 test %4→%5")
+ .arg(idx).arg(total)
+ .arg(data["train_end"].toString().left(10))
+ .arg(data["test_start"].toString().left(10))
+ .arg(data["test_end"].toString().left(10)));
+ status_label_->setText(QString("Window %1/%2").arg(idx).arg(total));
+ } else if (event == "ensemble") {
+ if (log) log->append(QString(" %1").arg(data["message"].toString()));
+ status_label_->setText("Combining rolling results...");
+ } else if (event == "done") {
+ const int total = data["windows_trained"].toInt();
+ if (pb) { pb->setValue(total); pb->setFormat("Complete"); }
+ if (log) log->append(QString("\nDone — %1 windows in %2s | Experiment: %3")
+ .arg(total)
+ .arg(data["elapsed_sec"].toDouble(), 0, 'f', 1)
+ .arg(data["exp_name"].toString()));
+ status_label_->setText(QString("Retrain complete — %1 windows in %2s")
+ .arg(total)
+ .arg(data["elapsed_sec"].toDouble(), 0, 'f', 1));
+ } else if (event == "error") {
+ if (pb) { pb->setFormat("Failed"); }
+ if (log) log->append(QString("\nError: %1").arg(data["error"].toString()));
+ display_error(data["error"].toString());
+ }
+ return;
+ }
+
+ // ── Non-streaming responses ──────────────────────────────────────────
if (!data["success"].toBool()) {
display_error(data["error"].toString());
return;
}
clear_results();
+
if (command == "list") {
auto schedules = data["schedules"].toObject();
- QString out =
- schedules.isEmpty() ? "No schedules configured." : QString("Schedules (%1)\n\n").arg(schedules.size());
- for (auto it = schedules.begin(); it != schedules.end(); ++it) {
- auto obj = it.value().toObject();
- out += QString("• %1\n Freq: %2 | Window: %3 days | Next: %4\n")
- .arg(it.key(), obj["freq"].toString(), QString::number(obj["window"].toInt()))
- .arg(obj["next_run"].toString("-"));
+ // Find the cards container and repopulate it
+ auto* cards_w = this->findChild<QWidget*>("rr_cards_container");
+ if (cards_w) {
+ auto* cards_vl = qobject_cast<QVBoxLayout*>(cards_w->layout());
+ // Remove old cards (keep the trailing stretch)
+ while (cards_vl->count() > 1)
+ delete cards_vl->takeAt(0)->widget();
+
+ if (schedules.isEmpty()) {
+ auto* empty = new QLabel("No schedules configured yet.\nUse the Create Schedule tab to add one.",
+ cards_w);
+ empty->setAlignment(Qt::AlignCenter);
+ empty->setStyleSheet(QString("color:%1; font-size:12px; padding:24px;")
+ .arg(ui::colors::TEXT_SECONDARY()));
+ cards_vl->insertWidget(0, empty);
+ } else {
+ int i = 0;
+ for (auto it = schedules.begin(); it != schedules.end(); ++it, ++i) {
+ const QString mid = it.key();
+ auto obj = it.value().toObject();
+
+ // Card frame
+ auto* card = new QWidget(cards_w);
+ card->setStyleSheet(QString(
+ "QWidget{background:%1;border:1px solid %2;border-radius:6px;}"
+ "QWidget:hover{border-color:%3;}")
+ .arg(ui::colors::BG_RAISED(), ui::colors::BORDER_MED(),
+ module_.color.name()));
+
+ auto* cvl = new QVBoxLayout(card);
+ cvl->setContentsMargins(12, 10, 12, 10);
+ cvl->setSpacing(4);
+
+ // Top row: model ID + status badge
+ auto* top = new QWidget(card);
+ top->setStyleSheet("QWidget{background:transparent;border:none;}");
+ auto* thl = new QHBoxLayout(top);
+ thl->setContentsMargins(0, 0, 0, 0);
+
+ auto* id_lbl = new QLabel(mid, top);
+ id_lbl->setStyleSheet(QString("color:%1;font-weight:700;font-size:13px;"
+ "background:transparent;border:none;")
+ .arg(ui::colors::TEXT_PRIMARY()));
+ thl->addWidget(id_lbl);
+ thl->addStretch();
+
+ const QString status = obj["last_status"].toString("pending");
+ const QString badge_color = (status == "completed") ? "#22c55e"
+ : (status == "failed") ? "#ef4444"
+ : "#f59e0b";
+ auto* badge = new QLabel(status.toUpper(), top);
+ badge->setStyleSheet(QString("color:%1;background:transparent;border:none;"
+ "font-size:10px;font-weight:700;")
+ .arg(badge_color));
+ thl->addWidget(badge);
+ cvl->addWidget(top);
+
+ // Details row
+ const QString freq = obj["frequency"].toString(obj["freq"].toString());
+ const QString window = QString::number(obj["window"].toInt());
+ const QString next = obj["next_run"].toString("-").left(16).replace("T", " ");
+ const QString last = obj["last_run"].isNull()
+ ? "Never"
+ : obj["last_run"].toString().left(16).replace("T", " ");
+ auto* detail = new QLabel(
+ QString("Freq: %1 | Window: %2 days | Next: %3 | Last: %4")
+ .arg(freq, window, next, last), card);
+ detail->setStyleSheet(QString("color:%1;font-size:11px;"
+ "background:transparent;border:none;")
+ .arg(ui::colors::TEXT_SECONDARY()));
+ cvl->addWidget(detail);
+
+ // Action buttons row
+ auto* acts = new QWidget(card);
+ acts->setStyleSheet("QWidget{background:transparent;border:none;}");
+ auto* ahl = new QHBoxLayout(acts);
+ ahl->setContentsMargins(0, 4, 0, 0);
+ ahl->setSpacing(6);
+
+ auto* run_btn = new QPushButton("Run Now", acts);
+ run_btn->setStyleSheet(QString(
+ "QPushButton{background:%1;color:%2;border:1px solid %1;"
+ "border-radius:3px;font-size:10px;font-weight:700;padding:3px 10px;}"
+ "QPushButton:hover{background:%3;}")
+ .arg(module_.color.name(), "#000000", module_.color.lighter(115).name()));
+ connect(run_btn, &QPushButton::clicked, this, [this, mid]() {
+ if (auto* pb = this->findChild<QProgressBar*>("rr_progress"))
+ { pb->setValue(0); pb->setFormat("Starting..."); }
+ if (auto* log = this->findChild<QTextEdit*>("rr_log")) log->clear();
+ status_label_->setText(QString("Retraining %1...").arg(mid));
+ QJsonObject p; p["model_id"] = mid;
+ AIQuantLabService::instance().rolling_execute_retrain(p);
+ });
+ ahl->addWidget(run_btn);
+
+ auto* del_btn = new QPushButton("Delete", acts);
+ del_btn->setStyleSheet(QString(
+ "QPushButton{background:transparent;color:#ef4444;border:1px solid #ef4444;"
+ "border-radius:3px;font-size:10px;font-weight:700;padding:3px 10px;}"
+ "QPushButton:hover{background:#7f1d1d;}"));
+ connect(del_btn, &QPushButton::clicked, this, [this, mid]() {
+ status_label_->setText(QString("Deleting %1...").arg(mid));
+ QJsonObject p; p["model_id"] = mid;
+ AIQuantLabService::instance().rolling_delete_schedule(p);
+ });
+ ahl->addWidget(del_btn);
+ ahl->addStretch();
+ cvl->addWidget(acts);
+
+ cards_vl->insertWidget(i, card);
+ }
+ }
}
- auto* lbl = new QLabel(out, this);
- lbl->setWordWrap(true);
- lbl->setStyleSheet(QString("color:%1;").arg(ui::colors::TEXT_PRIMARY()));
- results_layout_->addWidget(lbl);
status_label_->setText(QString("%1 schedule(s)").arg(schedules.size()));
return;
}
+
if (command == "create") {
auto sched = data["schedule"].toObject();
- auto* lbl = new QLabel(QString("Schedule created for %1\nFreq: %2 | Window: %3 days\nNext run: %4")
- .arg(data["model_id"].toString(), sched["freq"].toString())
- .arg(sched["window"].toInt())
- .arg(sched["next_run"].toString()),
- this);
+ const QString tmpl = data["template_generated"].toBool()
+ ? QString("\nBuilt-in LightGBM+Alpha158 template generated at:\n%1")
+ .arg(data["conf_path"].toString())
+ : "";
+ clear_results();
+ auto* lbl = new QLabel(
+ QString("Schedule created: %1\nFreq: %2 | Window: %3 days | Next: %4%5")
+ .arg(data["model_id"].toString(),
+ sched["frequency"].toString(),
+ QString::number(sched["window"].toInt()),
+ sched["next_run"].toString().left(16).replace("T", " "),
+ tmpl),
+ this);
lbl->setWordWrap(true);
lbl->setStyleSheet(QString("color:%1;").arg(ui::colors::TEXT_PRIMARY()));
results_layout_->addWidget(lbl);
- status_label_->setText("Schedule created");
+ status_label_->setText("Schedule created — switch to Schedules tab to view");
return;
}
- if (command == "retrain") {
- auto* lbl = new QLabel(
- QString("Retrain complete: %1\n%2").arg(data["model_id"].toString(), data["message"].toString()), this);
- lbl->setStyleSheet(QString("color:%1;").arg(ui::colors::TEXT_PRIMARY()));
- results_layout_->addWidget(lbl);
- status_label_->setText("Retrain complete");
+
+ if (command == "preview") {
+ clear_results();
+ const int total = data["total_windows"].toInt();
+ auto windows = data["windows"].toArray();
+
+ auto* hdr = new QLabel(
+ QString("Preview: %1 rolling windows (step=%2, horizon=%3)")
+ .arg(total).arg(data["step"].toInt()).arg(data["horizon"].toInt()),
+ this);
+ hdr->setStyleSheet(QString("color:%1;font-weight:700;font-size:13px;")
+ .arg(ui::colors::TEXT_PRIMARY()));
+ results_layout_->addWidget(hdr);
+
+ // Table of windows
+ auto* tbl = new QTableWidget(total, 4, this);
+ tbl->setStyleSheet(table_ss());
+ tbl->setHorizontalHeaderLabels({"#", "Train Start", "Train End", "Test Period"});
+ tbl->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
+ tbl->verticalHeader()->setVisible(false);
+ tbl->setEditTriggers(QAbstractItemView::NoEditTriggers);
+ tbl->setSelectionBehavior(QAbstractItemView::SelectRows);
+ tbl->setAlternatingRowColors(true);
+ int row = 0;
+ for (const auto& v : windows) {
+ auto obj = v.toObject();
+ auto item = [&](const QString& s) {
+ auto* it = new QTableWidgetItem(s.left(10));
+ it->setTextAlignment(Qt::AlignCenter);
+ return it;
+ };
+ tbl->setItem(row, 0, item(QString::number(row + 1)));
+ tbl->setItem(row, 1, item(obj["train_start"].toString()));
+ tbl->setItem(row, 2, item(obj["train_end"].toString()));
+ tbl->setItem(row, 3, item(QString("%1 → %2")
+ .arg(obj["test_start"].toString().left(10),
+ obj["test_end"].toString().left(10))));
+ ++row;
+ }
+ tbl->setMaximumHeight(220);
+ results_layout_->addWidget(tbl);
+ status_label_->setText(QString("Preview: %1 windows").arg(total));
+ return;
+ }
+
+ if (command == "delete") {
+ status_label_->setText(QString("Deleted: %1").arg(data["model_id"].toString()));
+ // Auto-refresh the schedule list
+ AIQuantLabService::instance().rolling_list_schedules();
return;
}
+
display_result(data);
return;
}
@@ -4664,84 +4866,212 @@ QWidget* QuantModulePanel::build_rolling_retraining_panel() {
vl->setContentsMargins(16, 16, 16, 16);
vl->setSpacing(12);
+ const QString accent = module_.color.name();
auto* tabs = new QTabWidget(w);
- tabs->setStyleSheet(tab_ss(module_.color.name()));
+ tabs->setStyleSheet(tab_ss(accent));
- // ── Schedules ──
- auto* list_tab = new QWidget(this);
+ // ── Tab 1: Schedules ─────────────────────────────────────────────────────
+ auto* list_tab = new QWidget;
auto* ltvl = new QVBoxLayout(list_tab);
ltvl->setContentsMargins(12, 12, 12, 12);
- ltvl->setSpacing(8);
- auto* lt_info = new QLabel("View all configured rolling retraining schedules.", list_tab);
+ ltvl->setSpacing(10);
+
+ auto* lt_info = new QLabel(
+ "Schedules are persisted in ~/.fincept/rolling_schedules.json. "
+ "Click Refresh to load the latest state.", list_tab);
lt_info->setWordWrap(true);
- lt_info->setStyleSheet(QString("color:%1; font-size:%2px; font-family:%3;")
- .arg(ui::colors::TEXT_SECONDARY)
- .arg(ui::fonts::SMALL)
- .arg(ui::fonts::DATA_FAMILY));
+ lt_info->setStyleSheet(QString("color:%1; font-size:11px;").arg(ui::colors::TEXT_SECONDARY()));
ltvl->addWidget(lt_info);
- auto* lt_run = make_run_button("LIST SCHEDULES", list_tab);
+
+ // Schedule cards container (scrollable)
+ auto* scroll = new QScrollArea(list_tab);
+ scroll->setWidgetResizable(true);
+ scroll->setFrameShape(QFrame::NoFrame);
+ scroll->setStyleSheet(QString("QScrollArea{background:transparent;border:none;}"
+ "QScrollBar:vertical{background:%1;width:6px;border-radius:3px;}"
+ "QScrollBar::handle:vertical{background:%2;border-radius:3px;}")
+ .arg(ui::colors::BG_BASE(), ui::colors::BORDER_MED()));
+ auto* cards_w = new QWidget;
+ cards_w->setStyleSheet("background:transparent;");
+ auto* cards_vl = new QVBoxLayout(cards_w);
+ cards_vl->setContentsMargins(0, 0, 0, 0);
+ cards_vl->setSpacing(8);
+ cards_vl->addStretch();
+ scroll->setWidget(cards_w);
+ ltvl->addWidget(scroll, 1);
+
+ // Store pointer so result handler can repopulate cards
+ // We tag the cards container via objectName
+ cards_w->setObjectName("rr_cards_container");
+
+ auto* lt_run = make_run_button("REFRESH SCHEDULES", list_tab);
connect(lt_run, &QPushButton::clicked, this, [this]() {
- status_label_->setText("Loading...");
+ status_label_->setText("Loading schedules...");
AIQuantLabService::instance().rolling_list_schedules();
});
ltvl->addWidget(lt_run);
- ltvl->addStretch();
tabs->addTab(list_tab, "Schedules");
- // ── Create Schedule ──
- auto* create_tab = new QWidget(this);
+ // ── Tab 2: Create Schedule ───────────────────────────────────────────────
+ auto* create_tab = new QWidget;
auto* ctvl = new QVBoxLayout(create_tab);
ctvl->setContentsMargins(12, 12, 12, 12);
ctvl->setSpacing(8);
+
auto* rr_model_id = new QLineEdit(create_tab);
- rr_model_id->setPlaceholderText("Model ID (e.g. model_aapl)");
+ rr_model_id->setPlaceholderText("Unique model ID (e.g. lgbm_sp500)");
rr_model_id->setStyleSheet(input_ss());
text_inputs_["rr_model_id"] = rr_model_id;
- ctvl->addWidget(build_input_row("Model ID", rr_model_id, create_tab));
+ ctvl->addWidget(build_input_row("Model ID *", rr_model_id, create_tab));
+
+ auto* rr_conf = new QLineEdit(create_tab);
+ rr_conf->setPlaceholderText("Optional: path to Qlib YAML config (leave blank for built-in LightGBM+Alpha158)");
+ rr_conf->setStyleSheet(input_ss());
+ text_inputs_["rr_conf_path"] = rr_conf;
+ ctvl->addWidget(build_input_row("Config Path", rr_conf, create_tab));
+
auto* rr_freq = new QComboBox(create_tab);
rr_freq->setStyleSheet(combo_ss());
rr_freq->addItems({"daily", "weekly", "monthly"});
combo_inputs_["rr_frequency"] = rr_freq;
ctvl->addWidget(build_input_row("Frequency", rr_freq, create_tab));
+
auto* rr_window = new QLineEdit(create_tab);
- rr_window->setPlaceholderText("Retrain window (trading days, e.g. 252)");
+ rr_window->setPlaceholderText("Rolling window in trading days (default: 252)");
rr_window->setStyleSheet(input_ss());
text_inputs_["rr_window"] = rr_window;
ctvl->addWidget(build_input_row("Window (days)", rr_window, create_tab));
- auto* rr_create = make_run_button("CREATE SCHEDULE", create_tab);
+
+ auto* rr_step = new QLineEdit(create_tab);
+ rr_step->setPlaceholderText("Step size between windows (default: 20)");
+ rr_step->setStyleSheet(input_ss());
+ text_inputs_["rr_step"] = rr_step;
+ ctvl->addWidget(build_input_row("Step (days)", rr_step, create_tab));
+
+ // Region selector
+ auto* rr_region = new QComboBox(create_tab);
+ rr_region->setStyleSheet(combo_ss());
+ rr_region->addItems({"us", "cn"});
+ combo_inputs_["rr_region"] = rr_region;
+ ctvl->addWidget(build_input_row("Data Region", rr_region, create_tab));
+
+ // Preview + Create buttons side by side
+ auto* btn_row = new QWidget(create_tab);
+ auto* btn_hl = new QHBoxLayout(btn_row);
+ btn_hl->setContentsMargins(0, 4, 0, 0);
+ btn_hl->setSpacing(8);
+
+ auto* rr_preview = make_run_button("PREVIEW WINDOWS", btn_row);
+ rr_preview->setStyleSheet(QString(
+ "QPushButton{background:%1;color:%2;border:1px solid %1;border-radius:4px;"
+ "font-size:11px;font-weight:700;padding:6px 14px;}"
+ "QPushButton:hover{background:%3;}")
+ .arg(ui::colors::BG_RAISED(), accent, ui::colors::BG_HOVER()));
+ connect(rr_preview, &QPushButton::clicked, this, [this]() {
+ const QString mid = text_inputs_["rr_model_id"]->text().trimmed();
+ const QString cp = text_inputs_["rr_conf_path"]->text().trimmed();
+ if (mid.isEmpty() && cp.isEmpty()) {
+ status_label_->setText("Enter a Model ID or Config Path to preview.");
+ return;
+ }
+ status_label_->setText("Generating preview...");
+ QJsonObject params;
+ if (!mid.isEmpty()) params["model_id"] = mid;
+ if (!cp.isEmpty()) params["conf_path"] = cp;
+ const QString step = text_inputs_["rr_step"]->text().trimmed();
+ if (!step.isEmpty()) params["step"] = step.toInt();
+ AIQuantLabService::instance().rolling_preview_tasks(params);
+ });
+ btn_hl->addWidget(rr_preview, 1);
+
+ auto* rr_create = make_run_button("CREATE SCHEDULE", btn_row);
connect(rr_create, &QPushButton::clicked, this, [this]() {
- status_label_->setText("Creating...");
+ const QString mid = text_inputs_["rr_model_id"]->text().trimmed();
+ if (mid.isEmpty()) {
+ status_label_->setText("Model ID is required.");
+ return;
+ }
+ status_label_->setText("Creating schedule...");
QJsonObject params;
- params["model_id"] = text_inputs_["rr_model_id"]->text().trimmed();
+ params["model_id"] = mid;
params["frequency"] = combo_inputs_["rr_frequency"]->currentText();
- auto w_text = text_inputs_["rr_window"]->text().trimmed();
- if (!w_text.isEmpty())
- params["window"] = w_text.toInt();
+ params["region"] = combo_inputs_["rr_region"]->currentText();
+ const QString cp = text_inputs_["rr_conf_path"]->text().trimmed();
+ if (!cp.isEmpty()) params["conf_path"] = cp;
+ const QString win = text_inputs_["rr_window"]->text().trimmed();
+ if (!win.isEmpty()) params["window"] = win.toInt();
+ const QString step = text_inputs_["rr_step"]->text().trimmed();
+ if (!step.isEmpty()) params["step"] = step.toInt();
AIQuantLabService::instance().rolling_create_schedule(params);
});
- ctvl->addWidget(rr_create);
+ btn_hl->addWidget(rr_create, 1);
+ ctvl->addWidget(btn_row);
ctvl->addStretch();
tabs->addTab(create_tab, "Create Schedule");
- // ── Execute Retrain ──
- auto* retrain_tab = new QWidget(this);
+ // ── Tab 3: Execute Retrain ───────────────────────────────────────────────
+ auto* retrain_tab = new QWidget;
auto* retrainvl = new QVBoxLayout(retrain_tab);
retrainvl->setContentsMargins(12, 12, 12, 12);
- retrainvl->setSpacing(8);
+ retrainvl->setSpacing(10);
+
+ auto* rt_info = new QLabel(
+ "Executes a full rolling retrain for a scheduled model. Each window trains "
+ "independently and progress is streamed live below.", retrain_tab);
+ rt_info->setWordWrap(true);
+ rt_info->setStyleSheet(QString("color:%1; font-size:11px;").arg(ui::colors::TEXT_SECONDARY()));
+ retrainvl->addWidget(rt_info);
+
auto* rr_exec_id = new QLineEdit(retrain_tab);
- rr_exec_id->setPlaceholderText("Model ID to retrain");
+ rr_exec_id->setPlaceholderText("Model ID (must be in Schedules)");
rr_exec_id->setStyleSheet(input_ss());
text_inputs_["rr_exec_id"] = rr_exec_id;
- retrainvl->addWidget(build_input_row("Model ID", rr_exec_id, retrain_tab));
+ retrainvl->addWidget(build_input_row("Model ID *", rr_exec_id, retrain_tab));
+
+ // Progress bar
+ auto* rr_progress = new QProgressBar(retrain_tab);
+ rr_progress->setObjectName("rr_progress");
+ rr_progress->setRange(0, 100);
+ rr_progress->setValue(0);
+ rr_progress->setTextVisible(true);
+ rr_progress->setFormat("Idle");
+ rr_progress->setStyleSheet(QString(
+ "QProgressBar{background:%1;border:1px solid %2;border-radius:4px;"
+ "color:%3;font-size:11px;font-weight:600;text-align:center;height:20px;}"
+ "QProgressBar::chunk{background:%4;border-radius:3px;}")
+ .arg(ui::colors::BG_RAISED(), ui::colors::BORDER_MED(),
+ ui::colors::TEXT_PRIMARY(), accent));
+ retrainvl->addWidget(rr_progress);
+
+ // Streaming log output
+ auto* rr_log = new QTextEdit(retrain_tab);
+ rr_log->setObjectName("rr_log");
+ rr_log->setReadOnly(true);
+ rr_log->setPlaceholderText("Training progress will stream here...");
+ rr_log->setStyleSheet(output_ss());
+ rr_log->setMinimumHeight(140);
+ retrainvl->addWidget(rr_log, 1);
+
auto* rr_exec = make_run_button("EXECUTE RETRAIN NOW", retrain_tab);
connect(rr_exec, &QPushButton::clicked, this, [this]() {
+ const QString mid = text_inputs_["rr_exec_id"]->text().trimmed();
+ if (mid.isEmpty()) {
+ status_label_->setText("Model ID is required.");
+ return;
+ }
+ // Reset progress UI
+ if (auto* pb = this->findChild<QProgressBar*>("rr_progress")) {
+ pb->setValue(0);
+ pb->setFormat("Starting...");
+ }
+ if (auto* log = this->findChild<QTextEdit*>("rr_log"))
+ log->clear();
status_label_->setText("Retraining...");
QJsonObject params;
- params["model_id"] = text_inputs_["rr_exec_id"]->text().trimmed();
+ params["model_id"] = mid;
AIQuantLabService::instance().rolling_execute_retrain(params);
});
retrainvl->addWidget(rr_exec);
- retrainvl->addStretch();
tabs->addTab(retrain_tab, "Execute Retrain");
vl->addWidget(tabs, 1);
diff --git a/fincept-qt/src/screens/algo_trading/AlgoTradingScreen.cpp b/fincept-qt/src/screens/algo_trading/AlgoTradingScreen.cpp
index 26c8bad3c..fe42c99bf 100644
--- a/fincept-qt/src/screens/algo_trading/AlgoTradingScreen.cpp
+++ b/fincept-qt/src/screens/algo_trading/AlgoTradingScreen.cpp
@@ -80,41 +80,44 @@ void AlgoTradingScreen::build_ui() {
QWidget* AlgoTradingScreen::build_top_bar() {
auto* bar = new QWidget(this);
- bar->setFixedHeight(44);
+ bar->setFixedHeight(40);
bar->setStyleSheet(
- QString("background:%1; border-bottom:1px solid %2;").arg(ui::colors::BG_RAISED, ui::colors::BORDER_DIM));
+ QString("background:%1; border-bottom:1px solid %2;").arg(ui::colors::BG_BASE(), ui::colors::BORDER_DIM()));
auto* hl = new QHBoxLayout(bar);
hl->setContentsMargins(12, 0, 12, 0);
- hl->setSpacing(12);
+ hl->setSpacing(8);
- auto* brand = new QLabel("ALGO TRADING", bar);
- brand->setStyleSheet(QString("color:#FF6B35; font-size:%1px; font-weight:700; font-family:%2;"
- "padding:4px 12px; background:rgba(255,107,53,0.08);"
- "border:1px solid rgba(255,107,53,0.25); border-radius:2px;")
- .arg(ui::fonts::TINY)
- .arg(ui::fonts::DATA_FAMILY));
- hl->addWidget(brand);
+ // Title + subtitle matching Economics header style
+ auto* title = new QLabel("ALGO TRADING", bar);
+ title->setStyleSheet(QString("color:%1; font-size:12px; font-weight:700;"
+ "letter-spacing:1.5px; background:transparent;")
+ .arg(ui::colors::TEXT_PRIMARY()));
+ hl->addWidget(title);
+
+ auto* subtitle = new QLabel("strategy builder · backtesting · live deployment", bar);
+ subtitle->setStyleSheet(
+ QString("color:%1; font-size:10px; background:transparent;").arg(ui::colors::TEXT_TERTIARY()));
+ hl->addWidget(subtitle);
auto* div = new QWidget(bar);
div->setFixedSize(1, 20);
- div->setStyleSheet(QString("background:%1;").arg(ui::colors::BORDER_DIM));
+ div->setStyleSheet(QString("background:%1;").arg(ui::colors::BORDER_DIM()));
hl->addWidget(div);
// Tab buttons
- QStringList tabs = {"BUILDER", "MY STRATEGIES", "SCANNER", "DASHBOARD"};
+ QStringList tabs = {"BUILDER", "MY STRATEGIES", "SCANNER", "DASHBOARD"};
QStringList colors = {"#FF6B35", "#00E5FF", "#FFC400", "#00D66F"};
for (int i = 0; i < tabs.size(); ++i) {
auto* btn = new QPushButton(tabs[i], bar);
btn->setCursor(Qt::PointingHandCursor);
- btn->setStyleSheet(QString("QPushButton { color:%1; font-size:9px; font-family:%2;"
- "padding:4px 12px; border:1px solid transparent; border-radius:2px;"
+ btn->setStyleSheet(QString("QPushButton { color:%1; font-size:10px; font-family:%2;"
+ "padding:4px 12px; border:none;"
"background:transparent; font-weight:400; }"
- "QPushButton:hover { background:rgba(%3,0.1); color:%4; }")
- .arg(ui::colors::TEXT_TERTIARY)
- .arg(ui::fonts::DATA_FAMILY)
- .arg(colors[i].mid(1))
+ "QPushButton:hover { color:%3; }")
+ .arg(ui::colors::TEXT_TERTIARY())
+ .arg(ui::fonts::DATA_FAMILY())
.arg(colors[i]));
connect(btn, &QPushButton::clicked, this, [this, i]() { on_tab_changed(i); });
hl->addWidget(btn);
@@ -128,8 +131,8 @@ QWidget* AlgoTradingScreen::build_top_bar() {
deploy_count_label_->setStyleSheet(QString("color:%1; font-size:9px; font-weight:700; font-family:%2;"
"padding:3px 8px; background:rgba(22,163,74,0.08);"
"border:1px solid rgba(22,163,74,0.25); border-radius:2px;")
- .arg(ui::colors::POSITIVE)
- .arg(ui::fonts::DATA_FAMILY));
+ .arg(ui::colors::POSITIVE())
+ .arg(ui::fonts::DATA_FAMILY()));
hl->addWidget(deploy_count_label_);
return bar;
@@ -181,14 +184,20 @@ void AlgoTradingScreen::update_tab_buttons() {
QStringList colors = {"#FF6B35", "#00E5FF", "#FFC400", "#00D66F"};
for (int i = 0; i < tab_buttons_.size(); ++i) {
bool active = (i == active_tab_);
- tab_buttons_[i]->setStyleSheet(QString("QPushButton { color:%1; font-size:9px; font-family:%2;"
- "padding:4px 12px; border:1px solid %3; border-radius:2px;"
- "background:%4; font-weight:%5; }")
- .arg(active ? colors[i] : ui::colors::TEXT_TERTIARY)
- .arg(ui::fonts::DATA_FAMILY)
- .arg(active ? QString("rgba(%1,0.3)").arg(colors[i].mid(1)) : "transparent")
- .arg(active ? QString("rgba(%1,0.12)").arg(colors[i].mid(1)) : "transparent")
- .arg(active ? "700" : "400"));
+ tab_buttons_[i]->setStyleSheet(
+ active
+ ? QString("QPushButton { color:%1; font-size:10px; font-family:%2;"
+ " padding:4px 12px; border:none; border-bottom:2px solid %1;"
+ " background:transparent; font-weight:700; }")
+ .arg(colors[i])
+ .arg(ui::fonts::DATA_FAMILY())
+ : QString("QPushButton { color:%1; font-size:10px; font-family:%2;"
+ " padding:4px 12px; border:none;"
+ " background:transparent; font-weight:400; }"
+ "QPushButton:hover { color:%3; }")
+ .arg(ui::colors::TEXT_TERTIARY())
+ .arg(ui::fonts::DATA_FAMILY())
+ .arg(colors[i]));
}
}
diff --git a/fincept-qt/src/screens/algo_trading/DeploymentDashboard.cpp b/fincept-qt/src/screens/algo_trading/DeploymentDashboard.cpp
index e9c70ac88..25be0cba2 100644
--- a/fincept-qt/src/screens/algo_trading/DeploymentDashboard.cpp
+++ b/fincept-qt/src/screens/algo_trading/DeploymentDashboard.cpp
@@ -5,7 +5,9 @@
#include "services/algo_trading/AlgoTradingService.h"
#include "ui/theme/Theme.h"
+#include <QFrame>
#include <QHBoxLayout>
+#include <QProgressBar>
#include <QPushButton>
#include <QScrollArea>
@@ -140,9 +142,12 @@ QWidget* DeploymentDashboard::build_deployment_card(const AlgoDeployment& d, QWi
top->addStretch();
- // Status badge
+ // Status badge with dot prefix
QColor status_clr = deployment_status_color(d.status);
- auto* status_badge = new QLabel(d.status.toUpper(), card);
+ QString status_dot;
+ if (d.status == "running" || d.status == "starting")
+ status_dot = "● ";
+ auto* status_badge = new QLabel(status_dot + d.status.toUpper(), card);
status_badge->setStyleSheet(QString("color: %1; font-size: %2px; font-weight: 700; %3"
" padding: 2px 8px; background: rgba(%4,%5,%6,0.08);"
" border: 1px solid rgba(%4,%5,%6,0.25);")
@@ -160,7 +165,8 @@ QWidget* DeploymentDashboard::build_deployment_card(const AlgoDeployment& d, QWi
auto* metrics = new QHBoxLayout;
metrics->setSpacing(16);
- auto add_metric = [&](const QString& label, const QString& value, const QString& color) {
+ auto add_metric = [&](const QString& label, const QString& value, const QString& color,
+ int font_size = fincept::ui::fonts::SMALL) {
auto* w = new QWidget(card);
auto* ml = new QVBoxLayout(w);
ml->setContentsMargins(0, 0, 0, 0);
@@ -174,17 +180,18 @@ QWidget* DeploymentDashboard::build_deployment_card(const AlgoDeployment& d, QWi
val->setStyleSheet(QString("color: %1; font-size: %2px; font-weight: 700; %3"
" background: transparent; border: none;")
.arg(color)
- .arg(fincept::ui::fonts::SMALL)
+ .arg(font_size)
.arg(kMonoFont()));
ml->addWidget(lbl);
ml->addWidget(val);
metrics->addWidget(w);
};
- // P&L
+ // P&L — larger font to match Quant Lab KPI style
double total_pnl = d.total_pnl + d.unrealized_pnl;
add_metric("P&L", QString("%1$%2").arg(total_pnl >= 0 ? "+" : "-").arg(std::abs(total_pnl), 0, 'f', 2),
- total_pnl >= 0 ? fincept::ui::colors::POSITIVE : fincept::ui::colors::NEGATIVE);
+ total_pnl >= 0 ? fincept::ui::colors::POSITIVE : fincept::ui::colors::NEGATIVE,
+ fincept::ui::fonts::TITLE);
// Win Rate
add_metric("WIN RATE", QString("%1%").arg(d.win_rate, 0, 'f', 1), fincept::ui::colors::TEXT_PRIMARY);
@@ -211,6 +218,18 @@ QWidget* DeploymentDashboard::build_deployment_card(const AlgoDeployment& d, QWi
vl->addLayout(metrics);
+ // ── Win rate progress bar ────────────────────────────────────────────────
+ auto* win_bar = new QProgressBar(card);
+ win_bar->setFixedHeight(4);
+ win_bar->setRange(0, 100);
+ win_bar->setValue(static_cast<int>(d.win_rate));
+ win_bar->setTextVisible(false);
+ win_bar->setStyleSheet(
+ QString("QProgressBar { background: %1; border: none; border-radius: 2px; }"
+ "QProgressBar::chunk { background: %2; border-radius: 2px; }")
+ .arg(fincept::ui::colors::BG_RAISED, fincept::ui::colors::POSITIVE));
+ vl->addWidget(win_bar);
+
// ── Error message if any ────────────────────────────────────────────────
if (!d.error_message.isEmpty()) {
auto* err = new QLabel(d.error_message, card);
@@ -328,6 +347,39 @@ void DeploymentDashboard::build_ui() {
vl->addLayout(summary_row);
+ // ── Equity curve placeholder ─────────────────────────────────────────────
+ equity_placeholder_ = new QFrame(content);
+ equity_placeholder_->setFixedHeight(140);
+ equity_placeholder_->setFrameShape(QFrame::NoFrame);
+ equity_placeholder_->setStyleSheet(
+ QString("QFrame { background: %1; border: 1px solid %2; }")
+ .arg(fincept::ui::colors::BG_SURFACE, fincept::ui::colors::BORDER_DIM));
+ {
+ auto* eq_vl = new QVBoxLayout(equity_placeholder_);
+ eq_vl->setContentsMargins(12, 8, 12, 8);
+ eq_vl->setSpacing(4);
+
+ auto* eq_header_row = new QHBoxLayout;
+ auto* eq_title = new QLabel("EQUITY CURVE", equity_placeholder_);
+ eq_title->setStyleSheet(kSectionLabel());
+ eq_header_row->addWidget(eq_title);
+ eq_header_row->addStretch();
+ eq_vl->addLayout(eq_header_row);
+
+ eq_vl->addStretch();
+
+ auto* eq_hint = new QLabel("Select a deployment to view curve", equity_placeholder_);
+ eq_hint->setAlignment(Qt::AlignCenter);
+ eq_hint->setStyleSheet(
+ QString("color: %1; font-size: %2px; %3 background: transparent; border: none;")
+ .arg(fincept::ui::colors::TEXT_TERTIARY)
+ .arg(fincept::ui::fonts::SMALL)
+ .arg(kMonoFont()));
+ eq_vl->addWidget(eq_hint);
+ eq_vl->addStretch();
+ }
+ vl->addWidget(equity_placeholder_);
+
// ── Control bar ─────────────────────────────────────────────────────────
auto* control_bar = new QHBoxLayout;
control_bar->setSpacing(8);
diff --git a/fincept-qt/src/screens/algo_trading/DeploymentDashboard.h b/fincept-qt/src/screens/algo_trading/DeploymentDashboard.h
index 713686c2f..0e3a64758 100644
--- a/fincept-qt/src/screens/algo_trading/DeploymentDashboard.h
+++ b/fincept-qt/src/screens/algo_trading/DeploymentDashboard.h
@@ -2,7 +2,9 @@
#pragma once
#include "services/algo_trading/AlgoTradingTypes.h"
+#include <QFrame>
#include <QLabel>
+#include <QProgressBar>
#include <QVBoxLayout>
#include <QWidget>
@@ -26,12 +28,15 @@ class DeploymentDashboard : public QWidget {
// Summary stats
QLabel* active_count_ = nullptr;
- QLabel* total_pnl_ = nullptr;
+ QLabel* total_pnl_ = nullptr;
QLabel* total_trades_ = nullptr;
QLabel* avg_win_rate_ = nullptr;
+ // Equity curve placeholder
+ QFrame* equity_placeholder_ = nullptr;
+
QVBoxLayout* deployments_layout_ = nullptr;
- QLabel* status_label_ = nullptr;
+ QLabel* status_label_ = nullptr;
};
} // namespace fincept::screens
diff --git a/fincept-qt/src/screens/algo_trading/ScannerPanel.cpp b/fincept-qt/src/screens/algo_trading/ScannerPanel.cpp
index 6dbe697d6..d2739d109 100644
--- a/fincept-qt/src/screens/algo_trading/ScannerPanel.cpp
+++ b/fincept-qt/src/screens/algo_trading/ScannerPanel.cpp
@@ -8,8 +8,10 @@
#include <QComboBox>
#include <QDoubleSpinBox>
#include <QHBoxLayout>
+#include <QHeaderView>
#include <QPushButton>
#include <QScrollArea>
+#include <QTableWidget>
// ── Shared style constants ──────────────────────────────────────────────────
@@ -456,12 +458,41 @@ void ScannerPanel::build_ui() {
results_title->setStyleSheet(kSectionLabel());
main_vl->addWidget(results_title);
- auto* results_container = new QWidget(content);
- results_layout_ = new QVBoxLayout(results_container);
- results_layout_->setContentsMargins(0, 0, 0, 0);
- results_layout_->setSpacing(4);
- main_vl->addWidget(results_container);
-
+ results_table_ = new QTableWidget(0, 5, content);
+ results_table_->setHorizontalHeaderLabels({"SYMBOL", "SIGNAL", "MATCH", "TIMEFRAME", "DETAILS"});
+ results_table_->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Fixed);
+ results_table_->horizontalHeader()->setSectionResizeMode(1, QHeaderView::Fixed);
+ results_table_->horizontalHeader()->setSectionResizeMode(2, QHeaderView::Fixed);
+ results_table_->horizontalHeader()->setSectionResizeMode(3, QHeaderView::Fixed);
+ results_table_->horizontalHeader()->setSectionResizeMode(4, QHeaderView::Stretch);
+ results_table_->setColumnWidth(0, 100);
+ results_table_->setColumnWidth(1, 90);
+ results_table_->setColumnWidth(2, 80);
+ results_table_->setColumnWidth(3, 90);
+ results_table_->setSortingEnabled(true);
+ results_table_->setEditTriggers(QAbstractItemView::NoEditTriggers);
+ results_table_->setSelectionBehavior(QAbstractItemView::SelectRows);
+ results_table_->setAlternatingRowColors(true);
+ results_table_->verticalHeader()->setVisible(false);
+ results_table_->setMinimumHeight(160);
+ results_table_->setStyleSheet(
+ QString("QTableWidget { background: %1; border: 1px solid %2; gridline-color: %2;"
+ " font-size: %3px; font-family: %4; color: %5;"
+ " alternate-background-color: %6; }"
+ "QTableWidget::item { padding: 4px 8px; border: none; }"
+ "QHeaderView::section { background: %7; color: %8; font-size: %3px;"
+ " font-weight: 700; font-family: %4; padding: 4px 8px;"
+ " border: none; border-bottom: 1px solid %2; }"
+ "QTableWidget::item:selected { background: %9; color: %5; }")
+ .arg(fincept::ui::colors::BG_BASE, fincept::ui::colors::BORDER_DIM)
+ .arg(fincept::ui::fonts::SMALL)
+ .arg(fincept::ui::fonts::DATA_FAMILY)
+ .arg(fincept::ui::colors::TEXT_PRIMARY)
+ .arg(fincept::ui::colors::BG_SURFACE)
+ .arg(fincept::ui::colors::BG_RAISED)
+ .arg(fincept::ui::colors::TEXT_TERTIARY)
+ .arg(fincept::ui::colors::BG_HOVER));
+ main_vl->addWidget(results_table_);
main_vl->addStretch();
scroll->setWidget(content);
@@ -512,87 +543,94 @@ void ScannerPanel::on_scan() {
}
void ScannerPanel::on_scan_result(const QJsonObject& data) {
- // Clear previous results
- while (results_layout_->count() > 0) {
- auto* item = results_layout_->takeAt(0);
- if (item->widget())
- item->widget()->deleteLater();
- delete item;
- }
+ results_table_->setSortingEnabled(false);
+ results_table_->setRowCount(0);
- QJsonArray matches = data.value("matches").toArray();
- int total_scanned = data.value("total_scanned").toInt();
+ QJsonArray matches = data.value("matches").toArray();
+ int total_scanned = data.value("total_scanned").toInt();
+ int condition_count = data.value("condition_count").toInt();
status_label_->setText(
QString("Scan complete: %1 matches out of %2 symbols").arg(matches.size()).arg(total_scanned));
- status_label_->setStyleSheet(QString("color: %1; font-size: %2px; %3 background: transparent; border: none;")
- .arg(fincept::ui::colors::POSITIVE)
- .arg(fincept::ui::fonts::SMALL)
- .arg(kMonoFont()));
-
- if (matches.isEmpty()) {
- auto* empty_lbl = new QLabel("No symbols matched the scan conditions.");
- empty_lbl->setStyleSheet(QString("color: %1; font-size: %2px; %3 background: transparent; border: none;"
- " padding: 12px;")
- .arg(fincept::ui::colors::TEXT_TERTIARY)
- .arg(fincept::ui::fonts::SMALL)
- .arg(kMonoFont()));
- results_layout_->addWidget(empty_lbl);
- return;
- }
+ status_label_->setStyleSheet(
+ QString("color: %1; font-size: %2px; %3 background: transparent; border: none;")
+ .arg(fincept::ui::colors::POSITIVE)
+ .arg(fincept::ui::fonts::SMALL)
+ .arg(kMonoFont()));
for (const auto& mval : matches) {
- QJsonObject match = mval.toObject();
- QString symbol = match.value("symbol").toString();
- QJsonArray matched_conds = match.value("conditions").toArray();
-
- auto* card = new QWidget(this);
- card->setStyleSheet(QString("background: %1; border: 1px solid %2;")
- .arg(fincept::ui::colors::BG_SURFACE, fincept::ui::colors::BORDER_DIM));
- auto* card_hl = new QHBoxLayout(card);
- card_hl->setContentsMargins(10, 8, 10, 8);
- card_hl->setSpacing(12);
-
- // Symbol
- auto* sym_lbl = new QLabel(symbol, card);
- sym_lbl->setStyleSheet(QString("color: %1; font-size: %2px; font-weight: 700; %3"
- " background: transparent; border: none;")
- .arg(fincept::ui::colors::AMBER)
- .arg(fincept::ui::fonts::DATA)
- .arg(kMonoFont()));
- sym_lbl->setFixedWidth(100);
- card_hl->addWidget(sym_lbl);
-
- // Condition details
+ QJsonObject match = mval.toObject();
+ QString symbol = match.value("symbol").toString();
+ QJsonArray matched_conds = match.value("conditions").toArray();
+
+ // Infer signal direction from operator types
+ int bullish_count = 0, bearish_count = 0;
+ for (const auto& cv : matched_conds) {
+ QString op = cv.toObject()["operator"].toString();
+ if (op == ">" || op == ">=" || op == "crosses above")
+ ++bullish_count;
+ else if (op == "<" || op == "<=" || op == "crosses below")
+ ++bearish_count;
+ }
+ QString signal_text, signal_color;
+ if (bullish_count > 0 && bearish_count == 0) {
+ signal_text = "BULLISH";
+ signal_color = fincept::ui::colors::POSITIVE();
+ } else if (bearish_count > 0 && bullish_count == 0) {
+ signal_text = "BEARISH";
+ signal_color = fincept::ui::colors::NEGATIVE();
+ } else {
+ signal_text = "NEUTRAL";
+ signal_color = fincept::ui::colors::TEXT_SECONDARY();
+ }
+
+ // Build condition detail string
QStringList cond_strs;
for (const auto& cv : matched_conds) {
QJsonObject c = cv.toObject();
cond_strs.append(QString("%1 %2 %3 %4")
- .arg(c["indicator"].toString(), c["field"].toString(), c["operator"].toString(),
- QString::number(c["value"].toDouble(), 'f', 2)));
+ .arg(c["indicator"].toString(), c["field"].toString(),
+ c["operator"].toString(),
+ QString::number(c["value"].toDouble(), 'f', 2)));
}
- auto* detail_lbl = new QLabel(cond_strs.join(" | "), card);
- detail_lbl->setWordWrap(true);
- detail_lbl->setStyleSheet(QString("color: %1; font-size: %2px; %3 background: transparent; border: none;")
- .arg(fincept::ui::colors::TEXT_SECONDARY)
- .arg(fincept::ui::fonts::SMALL)
- .arg(kMonoFont()));
- card_hl->addWidget(detail_lbl, 1);
-
- // Match count badge
- auto* cnt_badge =
- new QLabel(QString("%1/%2").arg(matched_conds.size()).arg(data.value("condition_count").toInt()), card);
- cnt_badge->setStyleSheet(QString("color: %1; font-size: %2px; font-weight: 700; %3"
- " padding: 2px 6px; background: rgba(22,163,74,0.08);"
- " border: 1px solid rgba(22,163,74,0.25);")
- .arg(fincept::ui::colors::POSITIVE)
- .arg(fincept::ui::fonts::TINY)
- .arg(kMonoFont()));
- card_hl->addWidget(cnt_badge);
- results_layout_->addWidget(card);
+ int row = results_table_->rowCount();
+ results_table_->insertRow(row);
+
+ // Col 0: Symbol
+ auto* sym_item = new QTableWidgetItem(symbol);
+ sym_item->setForeground(QColor(fincept::ui::colors::AMBER()));
+ sym_item->setFont(QFont(fincept::ui::fonts::DATA_FAMILY(),
+ fincept::ui::fonts::SMALL, QFont::Bold));
+ results_table_->setItem(row, 0, sym_item);
+
+ // Col 1: Signal
+ auto* sig_item = new QTableWidgetItem(signal_text);
+ sig_item->setForeground(QColor(signal_color));
+ sig_item->setFont(QFont(fincept::ui::fonts::DATA_FAMILY(),
+ fincept::ui::fonts::TINY, QFont::Bold));
+ results_table_->setItem(row, 1, sig_item);
+
+ // Col 2: Match count
+ auto* match_item = new QTableWidgetItem(
+ QString("%1/%2").arg(matched_conds.size()).arg(condition_count));
+ match_item->setForeground(QColor(fincept::ui::colors::POSITIVE()));
+ match_item->setTextAlignment(Qt::AlignCenter);
+ results_table_->setItem(row, 2, match_item);
+
+ // Col 3: Timeframe
+ auto* tf_item = new QTableWidgetItem(timeframe_combo_->currentText().toUpper());
+ tf_item->setForeground(QColor(fincept::ui::colors::CYAN()));
+ tf_item->setTextAlignment(Qt::AlignCenter);
+ results_table_->setItem(row, 3, tf_item);
+
+ // Col 4: Details
+ auto* detail_item = new QTableWidgetItem(cond_strs.join(" | "));
+ detail_item->setForeground(QColor(fincept::ui::colors::TEXT_SECONDARY()));
+ results_table_->setItem(row, 4, detail_item);
}
+ results_table_->setSortingEnabled(true);
LOG_INFO("AlgoTrading", QString("Scan results: %1 matches").arg(matches.size()));
}
diff --git a/fincept-qt/src/screens/algo_trading/ScannerPanel.h b/fincept-qt/src/screens/algo_trading/ScannerPanel.h
index a0355053e..f5ee263ba 100644
--- a/fincept-qt/src/screens/algo_trading/ScannerPanel.h
+++ b/fincept-qt/src/screens/algo_trading/ScannerPanel.h
@@ -7,6 +7,7 @@
#include <QLabel>
#include <QLineEdit>
#include <QSpinBox>
+#include <QTableWidget>
#include <QTextEdit>
#include <QVBoxLayout>
#include <QWidget>
@@ -29,14 +30,14 @@ class ScannerPanel : public QWidget {
void connect_service();
void apply_preset(int index);
- QVBoxLayout* conditions_layout_ = nullptr;
- QTextEdit* symbols_edit_ = nullptr;
- QComboBox* timeframe_combo_ = nullptr;
- QSpinBox* lookback_spin_ = nullptr;
- QComboBox* preset_combo_ = nullptr;
- QComboBox* logic_combo_ = nullptr;
- QVBoxLayout* results_layout_ = nullptr;
- QLabel* status_label_ = nullptr;
+ QVBoxLayout* conditions_layout_ = nullptr;
+ QTextEdit* symbols_edit_ = nullptr;
+ QComboBox* timeframe_combo_ = nullptr;
+ QSpinBox* lookback_spin_ = nullptr;
+ QComboBox* preset_combo_ = nullptr;
+ QComboBox* logic_combo_ = nullptr;
+ QTableWidget* results_table_ = nullptr; // replaced QVBoxLayout
+ QLabel* status_label_ = nullptr;
};
} // namespace fincept::screens
diff --git a/fincept-qt/src/screens/algo_trading/StrategyBuilderPanel.cpp b/fincept-qt/src/screens/algo_trading/StrategyBuilderPanel.cpp
index a383be214..9845df33b 100644
--- a/fincept-qt/src/screens/algo_trading/StrategyBuilderPanel.cpp
+++ b/fincept-qt/src/screens/algo_trading/StrategyBuilderPanel.cpp
@@ -8,22 +8,23 @@
#include <QFile>
#include <QFileInfo>
+#include <QGridLayout>
#include <QHBoxLayout>
#include <QJsonArray>
#include <QJsonDocument>
#include <QJsonObject>
#include <QRegularExpression>
#include <QScrollArea>
+#include <QSplitter>
#include <QUuid>
-// ── Shared style constants ──────────────────────────────────────────────────
+// ── Shared style helpers ────────────────────────────────────────────────────
namespace {
inline QString kMonoFont() {
return QString("font-family: %1;").arg(fincept::ui::fonts::DATA_FAMILY);
}
-
inline QString kLabelStyle() {
return QString("color: %1; font-size: %2px; font-weight: 700; letter-spacing: 0.5px; %3"
"background: transparent; border: none;")
@@ -31,7 +32,6 @@ inline QString kLabelStyle() {
.arg(fincept::ui::fonts::TINY)
.arg(kMonoFont());
}
-
inline QString kSectionLabel() {
return QString("color: %1; font-size: %2px; font-weight: 700; letter-spacing: 0.5px; %3"
"background: transparent; border: none;")
@@ -39,54 +39,68 @@ inline QString kSectionLabel() {
.arg(fincept::ui::fonts::TINY)
.arg(kMonoFont());
}
-
inline QString kInputStyle() {
return QString("QLineEdit { background: %1; border: 1px solid %2; color: %3; padding: 4px 8px;"
" font-size: %4px; %5 }"
"QLineEdit:focus { border-color: %6; }")
- .arg(fincept::ui::colors::BG_SURFACE, fincept::ui::colors::BORDER_DIM, fincept::ui::colors::TEXT_PRIMARY)
+ .arg(fincept::ui::colors::BG_SURFACE, fincept::ui::colors::BORDER_DIM,
+ fincept::ui::colors::TEXT_PRIMARY)
.arg(fincept::ui::fonts::SMALL)
.arg(kMonoFont())
.arg(fincept::ui::colors::BORDER_BRIGHT);
}
-
inline QString kComboStyle() {
return QString("QComboBox { background: %1; color: %2; border: 1px solid %3; padding: 4px 8px;"
" font-size: %4px; %5 }"
"QComboBox::drop-down { border: none; }"
"QComboBox QAbstractItemView { background: %1; color: %2; border: 1px solid %3;"
" selection-background-color: %6; %5 }")
- .arg(fincept::ui::colors::BG_SURFACE, fincept::ui::colors::TEXT_PRIMARY, fincept::ui::colors::BORDER_DIM)
+ .arg(fincept::ui::colors::BG_SURFACE, fincept::ui::colors::TEXT_PRIMARY,
+ fincept::ui::colors::BORDER_DIM)
.arg(fincept::ui::fonts::SMALL)
.arg(kMonoFont())
.arg(fincept::ui::colors::BG_HOVER);
}
-
inline QString kSpinStyle() {
return QString("QDoubleSpinBox { background: %1; color: %2; border: 1px solid %3; padding: 4px 8px;"
" font-size: %4px; %5 }"
"QDoubleSpinBox::up-button, QDoubleSpinBox::down-button { width: 14px; }")
- .arg(fincept::ui::colors::BG_SURFACE, fincept::ui::colors::TEXT_PRIMARY, fincept::ui::colors::BORDER_DIM)
+ .arg(fincept::ui::colors::BG_SURFACE, fincept::ui::colors::TEXT_PRIMARY,
+ fincept::ui::colors::BORDER_DIM)
.arg(fincept::ui::fonts::SMALL)
.arg(kMonoFont());
}
-inline QString kBtnStyle() {
- return QString("QPushButton { background: %1; color: %2; border: 1px solid %3; padding: 4px 12px;"
- " font-size: %4px; font-weight: 700; %5 }"
- "QPushButton:hover { background: %6; color: %7; }")
- .arg(fincept::ui::colors::BG_RAISED, fincept::ui::colors::TEXT_SECONDARY, fincept::ui::colors::BORDER_DIM)
- .arg(fincept::ui::fonts::TINY)
- .arg(kMonoFont())
- .arg(fincept::ui::colors::BG_HOVER, fincept::ui::colors::TEXT_PRIMARY);
-}
-
} // namespace
namespace fincept::screens {
using namespace fincept::services::algo;
+// ── gather_from_layout ──────────────────────────────────────────────────────
+
+static QJsonArray gather_from_layout(QVBoxLayout* layout) {
+ QJsonArray arr;
+ for (int i = 0; i < layout->count(); ++i) {
+ auto* item = layout->itemAt(i);
+ auto* row = item ? item->widget() : nullptr;
+ if (!row) continue;
+ auto* ind_combo = qobject_cast<QComboBox*>(row->property("ind_combo").value<QObject*>());
+ auto* field_combo = qobject_cast<QComboBox*>(row->property("field_combo").value<QObject*>());
+ auto* op_combo = qobject_cast<QComboBox*>(row->property("op_combo").value<QObject*>());
+ auto* val_spin = qobject_cast<QDoubleSpinBox*>(row->property("val_spin").value<QObject*>());
+ if (!ind_combo || !field_combo || !op_combo || !val_spin) continue;
+ QJsonObject cond;
+ cond["indicator"] = ind_combo->currentData().toString();
+ cond["field"] = field_combo->currentText();
+ cond["operator"] = op_combo->currentText();
+ cond["value"] = val_spin->value();
+ cond["params"] = QJsonObject{};
+ arr.append(cond);
+ }
+ return arr;
+}
+
// ── Constructor ─────────────────────────────────────────────────────────────
StrategyBuilderPanel::StrategyBuilderPanel(QWidget* parent) : QWidget(parent) {
@@ -102,16 +116,19 @@ void StrategyBuilderPanel::connect_service() {
connect(&svc, &AlgoTradingService::strategy_saved, this, [this](const QString& id) {
if (status_label_)
status_label_->setText(QString("Strategy saved: %1").arg(id));
- status_label_->setStyleSheet(QString("color: %1; font-size: %2px; %3 background: transparent; border: none;")
- .arg(fincept::ui::colors::POSITIVE)
- .arg(fincept::ui::fonts::SMALL)
- .arg(kMonoFont()));
+ status_label_->setStyleSheet(
+ QString("color: %1; font-size: %2px; %3 background: transparent; border: none;")
+ .arg(fincept::ui::colors::POSITIVE)
+ .arg(fincept::ui::fonts::SMALL)
+ .arg(kMonoFont()));
});
- connect(&svc, &AlgoTradingService::backtest_result, this, &StrategyBuilderPanel::on_backtest_result);
- connect(&svc, &AlgoTradingService::error_occurred, this, &StrategyBuilderPanel::on_error);
+ connect(&svc, &AlgoTradingService::backtest_result, this,
+ &StrategyBuilderPanel::on_backtest_result);
+ connect(&svc, &AlgoTradingService::error_occurred, this,
+ &StrategyBuilderPanel::on_error);
}
-// ── Build condition row ─────────────────────────────────────────────────────
+// ── Condition row ───────────────────────────────────────────────────────────
QWidget* StrategyBuilderPanel::build_condition_row(QWidget* parent) {
auto* row = new QWidget(parent);
@@ -121,7 +138,6 @@ QWidget* StrategyBuilderPanel::build_condition_row(QWidget* parent) {
hl->setContentsMargins(6, 4, 6, 4);
hl->setSpacing(4);
- // Indicator combo
auto* ind_combo = new QComboBox(row);
ind_combo->setStyleSheet(kComboStyle());
ind_combo->setFixedHeight(28);
@@ -130,27 +146,24 @@ QWidget* StrategyBuilderPanel::build_condition_row(QWidget* parent) {
for (const auto& ind : indicators)
ind_combo->addItem(ind.label, ind.id);
- // Field combo
auto* field_combo = new QComboBox(row);
field_combo->setStyleSheet(kComboStyle());
field_combo->setFixedHeight(28);
field_combo->setMinimumWidth(90);
- // Populate fields when indicator changes
- connect(ind_combo, QOverload<int>::of(&QComboBox::currentIndexChanged), row, [field_combo, indicators](int idx) {
- field_combo->clear();
- if (idx >= 0 && idx < indicators.size())
- field_combo->addItems(indicators[idx].fields);
- });
+ connect(ind_combo, QOverload<int>::of(&QComboBox::currentIndexChanged), row,
+ [field_combo, indicators](int idx) {
+ field_combo->clear();
+ if (idx >= 0 && idx < indicators.size())
+ field_combo->addItems(indicators[idx].fields);
+ });
- // Operator combo
auto* op_combo = new QComboBox(row);
op_combo->setStyleSheet(kComboStyle());
op_combo->setFixedHeight(28);
op_combo->setMinimumWidth(100);
op_combo->addItems(algo_operators());
- // Value spin
auto* val_spin = new QDoubleSpinBox(row);
val_spin->setStyleSheet(kSpinStyle());
val_spin->setFixedHeight(28);
@@ -159,17 +172,17 @@ QWidget* StrategyBuilderPanel::build_condition_row(QWidget* parent) {
val_spin->setDecimals(4);
val_spin->setValue(0);
- // Remove button
auto* rm_btn = new QPushButton("X", row);
rm_btn->setFixedSize(28, 28);
rm_btn->setCursor(Qt::PointingHandCursor);
- rm_btn->setStyleSheet(QString("QPushButton { background: transparent; color: %1; border: 1px solid %2;"
- " font-size: %3px; font-weight: 700; %4 }"
- "QPushButton:hover { color: %5; border-color: %5; }")
- .arg(fincept::ui::colors::TEXT_TERTIARY, fincept::ui::colors::BORDER_DIM)
- .arg(fincept::ui::fonts::TINY)
- .arg(kMonoFont())
- .arg(fincept::ui::colors::NEGATIVE));
+ rm_btn->setStyleSheet(
+ QString("QPushButton { background: transparent; color: %1; border: 1px solid %2;"
+ " font-size: %3px; font-weight: 700; %4 }"
+ "QPushButton:hover { color: %5; border-color: %5; }")
+ .arg(fincept::ui::colors::TEXT_TERTIARY, fincept::ui::colors::BORDER_DIM)
+ .arg(fincept::ui::fonts::TINY)
+ .arg(kMonoFont())
+ .arg(fincept::ui::colors::NEGATIVE));
connect(rm_btn, &QPushButton::clicked, row, [row]() { row->deleteLater(); });
hl->addWidget(ind_combo);
@@ -178,74 +191,49 @@ QWidget* StrategyBuilderPanel::build_condition_row(QWidget* parent) {
hl->addWidget(val_spin);
hl->addWidget(rm_btn);
- // Initialize fields for first indicator
if (ind_combo->count() > 0)
emit ind_combo->currentIndexChanged(0);
- // Store combos/spin as properties for later retrieval
- row->setProperty("ind_combo", QVariant::fromValue(static_cast<QObject*>(ind_combo)));
+ row->setProperty("ind_combo", QVariant::fromValue(static_cast<QObject*>(ind_combo)));
row->setProperty("field_combo", QVariant::fromValue(static_cast<QObject*>(field_combo)));
- row->setProperty("op_combo", QVariant::fromValue(static_cast<QObject*>(op_combo)));
- row->setProperty("val_spin", QVariant::fromValue(static_cast<QObject*>(val_spin)));
+ row->setProperty("op_combo", QVariant::fromValue(static_cast<QObject*>(op_combo)));
+ row->setProperty("val_spin", QVariant::fromValue(static_cast<QObject*>(val_spin)));
return row;
}
-// ── Gather conditions from a layout ─────────────────────────────────────────
-
-static QJsonArray gather_from_layout(QVBoxLayout* layout) {
- QJsonArray arr;
- for (int i = 0; i < layout->count(); ++i) {
- auto* item = layout->itemAt(i);
- auto* row = item ? item->widget() : nullptr;
- if (!row)
- continue;
-
- auto* ind_combo = qobject_cast<QComboBox*>(row->property("ind_combo").value<QObject*>());
- auto* field_combo = qobject_cast<QComboBox*>(row->property("field_combo").value<QObject*>());
- auto* op_combo = qobject_cast<QComboBox*>(row->property("op_combo").value<QObject*>());
- auto* val_spin = qobject_cast<QDoubleSpinBox*>(row->property("val_spin").value<QObject*>());
- if (!ind_combo || !field_combo || !op_combo || !val_spin)
- continue;
+// ── Left pane: strategy editor ──────────────────────────────────────────────
- QJsonObject cond;
- cond["indicator"] = ind_combo->currentData().toString();
- cond["field"] = field_combo->currentText();
- cond["operator"] = op_combo->currentText();
- cond["value"] = val_spin->value();
- cond["params"] = QJsonObject{}; // default params
- arr.append(cond);
- }
- return arr;
-}
+QWidget* StrategyBuilderPanel::build_left_pane() {
+ auto* pane = new QWidget(this);
+ pane->setStyleSheet(
+ QString("background: %1; border-right: 1px solid %2;")
+ .arg(fincept::ui::colors::BG_BASE, fincept::ui::colors::BORDER_DIM));
-// ── Build UI ────────────────────────────────────────────────────────────────
+ auto* root_layout = new QVBoxLayout(pane);
+ root_layout->setContentsMargins(0, 0, 0, 0);
+ root_layout->setSpacing(0);
-void StrategyBuilderPanel::build_ui() {
- auto* root = new QVBoxLayout(this);
- root->setContentsMargins(0, 0, 0, 0);
- root->setSpacing(0);
-
- // Scroll area
- auto* scroll = new QScrollArea(this);
+ auto* scroll = new QScrollArea(pane);
scroll->setWidgetResizable(true);
scroll->setFrameShape(QFrame::NoFrame);
- scroll->setStyleSheet(QString("QScrollArea { background: %1; border: none; }"
- "QScrollBar:vertical { background: %1; width: 6px; }"
- "QScrollBar::handle:vertical { background: %2; }"
- "QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical { height: 0; }")
- .arg(fincept::ui::colors::BG_BASE, fincept::ui::colors::BORDER_MED));
-
- auto* content = new QWidget(this);
+ scroll->setStyleSheet(
+ QString("QScrollArea { background: %1; border: none; }"
+ "QScrollBar:vertical { background: %1; width: 6px; }"
+ "QScrollBar::handle:vertical { background: %2; }"
+ "QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical { height: 0; }")
+ .arg(fincept::ui::colors::BG_BASE, fincept::ui::colors::BORDER_MED));
+
+ auto* content = new QWidget;
content->setStyleSheet(QString("background: %1;").arg(fincept::ui::colors::BG_BASE));
auto* vl = new QVBoxLayout(content);
vl->setContentsMargins(16, 12, 16, 12);
- vl->setSpacing(12);
+ vl->setSpacing(8);
- // ── Strategy Identity ───────────────────────────────────────────────────
- auto* id_section = new QLabel("STRATEGY DEFINITION", content);
- id_section->setStyleSheet(kSectionLabel());
- vl->addWidget(id_section);
+ // ── Strategy Definition ─────────────────────────────────────────────────
+ auto* id_sec = new QLabel("STRATEGY DEFINITION", content);
+ id_sec->setStyleSheet(kSectionLabel());
+ vl->addWidget(id_sec);
auto* name_lbl = new QLabel("NAME", content);
name_lbl->setStyleSheet(kLabelStyle());
@@ -279,26 +267,21 @@ void StrategyBuilderPanel::build_ui() {
auto* entry_hdr_hl = new QHBoxLayout(entry_hdr);
entry_hdr_hl->setContentsMargins(0, 8, 0, 0);
entry_hdr_hl->setSpacing(8);
-
auto* entry_lbl = new QLabel("ENTRY CONDITIONS", entry_hdr);
entry_lbl->setStyleSheet(kSectionLabel());
entry_hdr_hl->addWidget(entry_lbl);
-
auto* entry_logic_lbl = new QLabel("Logic:", entry_hdr);
entry_logic_lbl->setStyleSheet(kLabelStyle());
entry_hdr_hl->addWidget(entry_logic_lbl);
-
entry_logic_combo_ = new QComboBox(entry_hdr);
entry_logic_combo_->addItems({"AND", "OR"});
entry_logic_combo_->setStyleSheet(kComboStyle());
entry_logic_combo_->setFixedHeight(26);
entry_logic_combo_->setFixedWidth(80);
entry_hdr_hl->addWidget(entry_logic_combo_);
-
entry_hdr_hl->addStretch();
vl->addWidget(entry_hdr);
- // Entry conditions container
auto* entry_container = new QWidget(content);
entry_conditions_layout_ = new QVBoxLayout(entry_container);
entry_conditions_layout_->setContentsMargins(0, 0, 0, 0);
@@ -308,15 +291,17 @@ void StrategyBuilderPanel::build_ui() {
auto* add_entry_btn = new QPushButton("+ ADD ENTRY CONDITION", content);
add_entry_btn->setCursor(Qt::PointingHandCursor);
add_entry_btn->setFixedHeight(28);
- add_entry_btn->setStyleSheet(QString("QPushButton { background: transparent; color: %1; border: 1px dashed %2;"
- " font-size: %3px; font-weight: 700; %4 }"
- "QPushButton:hover { color: %5; border-color: %5; }")
- .arg(fincept::ui::colors::TEXT_TERTIARY, fincept::ui::colors::BORDER_DIM)
- .arg(fincept::ui::fonts::TINY)
- .arg(kMonoFont())
- .arg(fincept::ui::colors::AMBER));
- connect(add_entry_btn, &QPushButton::clicked, this,
- [this, entry_container]() { entry_conditions_layout_->addWidget(build_condition_row(entry_container)); });
+ add_entry_btn->setStyleSheet(
+ QString("QPushButton { background: transparent; color: %1; border: 1px dashed %2;"
+ " font-size: %3px; font-weight: 700; %4 }"
+ "QPushButton:hover { color: %5; border-color: %5; }")
+ .arg(fincept::ui::colors::TEXT_TERTIARY, fincept::ui::colors::BORDER_DIM)
+ .arg(fincept::ui::fonts::TINY)
+ .arg(kMonoFont())
+ .arg(fincept::ui::colors::AMBER));
+ connect(add_entry_btn, &QPushButton::clicked, this, [this, entry_container]() {
+ entry_conditions_layout_->addWidget(build_condition_row(entry_container));
+ });
vl->addWidget(add_entry_btn);
// ── Exit Conditions ─────────────────────────────────────────────────────
@@ -324,26 +309,21 @@ void StrategyBuilderPanel::build_ui() {
auto* exit_hdr_hl = new QHBoxLayout(exit_hdr);
exit_hdr_hl->setContentsMargins(0, 8, 0, 0);
exit_hdr_hl->setSpacing(8);
-
auto* exit_lbl = new QLabel("EXIT CONDITIONS", exit_hdr);
exit_lbl->setStyleSheet(kSectionLabel());
exit_hdr_hl->addWidget(exit_lbl);
-
auto* exit_logic_lbl = new QLabel("Logic:", exit_hdr);
exit_logic_lbl->setStyleSheet(kLabelStyle());
exit_hdr_hl->addWidget(exit_logic_lbl);
-
exit_logic_combo_ = new QComboBox(exit_hdr);
exit_logic_combo_->addItems({"AND", "OR"});
exit_logic_combo_->setStyleSheet(kComboStyle());
exit_logic_combo_->setFixedHeight(26);
exit_logic_combo_->setFixedWidth(80);
exit_hdr_hl->addWidget(exit_logic_combo_);
-
exit_hdr_hl->addStretch();
vl->addWidget(exit_hdr);
- // Exit conditions container
auto* exit_container = new QWidget(content);
exit_conditions_layout_ = new QVBoxLayout(exit_container);
exit_conditions_layout_->setContentsMargins(0, 0, 0, 0);
@@ -353,18 +333,13 @@ void StrategyBuilderPanel::build_ui() {
auto* add_exit_btn = new QPushButton("+ ADD EXIT CONDITION", content);
add_exit_btn->setCursor(Qt::PointingHandCursor);
add_exit_btn->setFixedHeight(28);
- add_exit_btn->setStyleSheet(QString("QPushButton { background: transparent; color: %1; border: 1px dashed %2;"
- " font-size: %3px; font-weight: 700; %4 }"
- "QPushButton:hover { color: %5; border-color: %5; }")
- .arg(fincept::ui::colors::TEXT_TERTIARY, fincept::ui::colors::BORDER_DIM)
- .arg(fincept::ui::fonts::TINY)
- .arg(kMonoFont())
- .arg(fincept::ui::colors::AMBER));
- connect(add_exit_btn, &QPushButton::clicked, this,
- [this, exit_container]() { exit_conditions_layout_->addWidget(build_condition_row(exit_container)); });
+ add_exit_btn->setStyleSheet(add_entry_btn->styleSheet());
+ connect(add_exit_btn, &QPushButton::clicked, this, [this, exit_container]() {
+ exit_conditions_layout_->addWidget(build_condition_row(exit_container));
+ });
vl->addWidget(add_exit_btn);
- // ── Risk Parameters ─────────────────────────────────────────────────────
+ // ── Risk Management ─────────────────────────────────────────────────────
auto* risk_lbl = new QLabel("RISK MANAGEMENT", content);
risk_lbl->setStyleSheet(kSectionLabel());
vl->addWidget(risk_lbl);
@@ -395,316 +370,447 @@ void StrategyBuilderPanel::build_ui() {
return spin;
};
- stop_loss_spin_ = make_risk_field("STOP LOSS %", 0.0);
- take_profit_spin_ = make_risk_field("TAKE PROFIT %", 0.0);
+ stop_loss_spin_ = make_risk_field("STOP LOSS %", 0.0);
+ take_profit_spin_ = make_risk_field("TAKE PROFIT %", 0.0);
trailing_stop_spin_ = make_risk_field("TRAILING STOP %", 0.0);
-
vl->addWidget(risk_grid);
- // ── Backtest Section ────────────────────────────────────────────────────
- auto* bt_lbl = new QLabel("BACKTEST", content);
- bt_lbl->setStyleSheet(kSectionLabel());
- vl->addWidget(bt_lbl);
-
- auto* bt_row = new QWidget(content);
- auto* bt_hl = new QHBoxLayout(bt_row);
- bt_hl->setContentsMargins(0, 0, 0, 0);
- bt_hl->setSpacing(8);
-
- // Symbol
- auto* bt_sym_col = new QWidget(bt_row);
- auto* bt_sym_vl = new QVBoxLayout(bt_sym_col);
- bt_sym_vl->setContentsMargins(0, 0, 0, 0);
- bt_sym_vl->setSpacing(2);
- auto* bt_sym_lbl = new QLabel("SYMBOL", bt_sym_col);
- bt_sym_lbl->setStyleSheet(kLabelStyle());
- bt_sym_vl->addWidget(bt_sym_lbl);
- bt_symbol_ = new QLineEdit(bt_sym_col);
+ vl->addStretch();
+
+ // ── Save button ─────────────────────────────────────────────────────────
+ auto* save_btn = new QPushButton("SAVE STRATEGY", content);
+ save_btn->setCursor(Qt::PointingHandCursor);
+ save_btn->setFixedHeight(36);
+ save_btn->setStyleSheet(
+ QString("QPushButton { background: rgba(217,119,6,0.1); color: %1; border: 1px solid %1;"
+ " font-size: %2px; font-weight: 700; %3 padding: 6px 24px; }"
+ "QPushButton:hover { background: %1; color: %4; }")
+ .arg(fincept::ui::colors::AMBER)
+ .arg(fincept::ui::fonts::DATA)
+ .arg(kMonoFont())
+ .arg(fincept::ui::colors::BG_BASE));
+ connect(save_btn, &QPushButton::clicked, this, &StrategyBuilderPanel::on_save);
+ vl->addWidget(save_btn);
+
+ scroll->setWidget(content);
+ root_layout->addWidget(scroll);
+ return pane;
+}
+
+// ── Right pane: backtest workbench ──────────────────────────────────────────
+
+QWidget* StrategyBuilderPanel::build_right_pane() {
+ auto* pane = new QWidget(this);
+ pane->setStyleSheet(QString("background: %1;").arg(fincept::ui::colors::BG_BASE));
+
+ auto* root_layout = new QVBoxLayout(pane);
+ root_layout->setContentsMargins(0, 0, 0, 0);
+ root_layout->setSpacing(0);
+
+ auto* scroll = new QScrollArea(pane);
+ scroll->setWidgetResizable(true);
+ scroll->setFrameShape(QFrame::NoFrame);
+ scroll->setStyleSheet(
+ QString("QScrollArea { background: %1; border: none; }"
+ "QScrollBar:vertical { background: %1; width: 6px; }"
+ "QScrollBar::handle:vertical { background: %2; }"
+ "QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical { height: 0; }")
+ .arg(fincept::ui::colors::BG_BASE, fincept::ui::colors::BORDER_MED));
+
+ auto* content = new QWidget;
+ content->setStyleSheet(QString("background: %1;").arg(fincept::ui::colors::BG_BASE));
+ auto* vl = new QVBoxLayout(content);
+ vl->setContentsMargins(16, 12, 16, 12);
+ vl->setSpacing(8);
+
+ // ── Backtest Parameters ─────────────────────────────────────────────────
+ auto* bt_sec = new QLabel("BACKTEST PARAMETERS", content);
+ bt_sec->setStyleSheet(kSectionLabel());
+ vl->addWidget(bt_sec);
+
+ // 2×2 grid of params
+ auto* params_grid = new QWidget(content);
+ auto* params_gl = new QGridLayout(params_grid);
+ params_gl->setContentsMargins(0, 0, 0, 0);
+ params_gl->setSpacing(8);
+
+ auto make_param_col = [&](const QString& label_text, QWidget* input) -> QWidget* {
+ auto* col = new QWidget(params_grid);
+ auto* cvl = new QVBoxLayout(col);
+ cvl->setContentsMargins(0, 0, 0, 0);
+ cvl->setSpacing(2);
+ auto* lbl = new QLabel(label_text, col);
+ lbl->setStyleSheet(kLabelStyle());
+ cvl->addWidget(lbl);
+ input->setParent(col);
+ cvl->addWidget(input);
+ return col;
+ };
+
+ bt_symbol_ = new QLineEdit;
bt_symbol_->setPlaceholderText("RELIANCE");
bt_symbol_->setStyleSheet(kInputStyle());
bt_symbol_->setFixedHeight(30);
- bt_sym_vl->addWidget(bt_symbol_);
- bt_hl->addWidget(bt_sym_col);
-
- // Capital
- auto* bt_cap_col = new QWidget(bt_row);
- auto* bt_cap_vl = new QVBoxLayout(bt_cap_col);
- bt_cap_vl->setContentsMargins(0, 0, 0, 0);
- bt_cap_vl->setSpacing(2);
- auto* bt_cap_lbl = new QLabel("CAPITAL ($)", bt_cap_col);
- bt_cap_lbl->setStyleSheet(kLabelStyle());
- bt_cap_vl->addWidget(bt_cap_lbl);
- bt_capital_ = new QDoubleSpinBox(bt_cap_col);
+ params_gl->addWidget(make_param_col("SYMBOL", bt_symbol_), 0, 0);
+
+ bt_capital_ = new QDoubleSpinBox;
bt_capital_->setStyleSheet(kSpinStyle());
bt_capital_->setFixedHeight(30);
bt_capital_->setRange(100, 1e9);
bt_capital_->setDecimals(0);
bt_capital_->setPrefix("$ ");
bt_capital_->setValue(100000);
- bt_cap_vl->addWidget(bt_capital_);
- bt_hl->addWidget(bt_cap_col);
-
- // Start date
- auto* bt_start_col = new QWidget(bt_row);
- auto* bt_start_vl = new QVBoxLayout(bt_start_col);
- bt_start_vl->setContentsMargins(0, 0, 0, 0);
- bt_start_vl->setSpacing(2);
- auto* bt_start_lbl = new QLabel("START DATE", bt_start_col);
- bt_start_lbl->setStyleSheet(kLabelStyle());
- bt_start_vl->addWidget(bt_start_lbl);
- bt_start_date_ = new QLineEdit(bt_start_col);
+ params_gl->addWidget(make_param_col("CAPITAL ($)", bt_capital_), 0, 1);
+
+ bt_start_date_ = new QLineEdit;
bt_start_date_->setPlaceholderText("YYYY-MM-DD");
bt_start_date_->setText("2024-01-01");
bt_start_date_->setStyleSheet(kInputStyle());
bt_start_date_->setFixedHeight(30);
- bt_start_vl->addWidget(bt_start_date_);
- bt_hl->addWidget(bt_start_col);
-
- // End date
- auto* bt_end_col = new QWidget(bt_row);
- auto* bt_end_vl = new QVBoxLayout(bt_end_col);
- bt_end_vl->setContentsMargins(0, 0, 0, 0);
- bt_end_vl->setSpacing(2);
- auto* bt_end_lbl = new QLabel("END DATE", bt_end_col);
- bt_end_lbl->setStyleSheet(kLabelStyle());
- bt_end_vl->addWidget(bt_end_lbl);
- bt_end_date_ = new QLineEdit(bt_end_col);
+ params_gl->addWidget(make_param_col("START DATE", bt_start_date_), 1, 0);
+
+ bt_end_date_ = new QLineEdit;
bt_end_date_->setPlaceholderText("YYYY-MM-DD");
bt_end_date_->setText("2025-01-01");
bt_end_date_->setStyleSheet(kInputStyle());
bt_end_date_->setFixedHeight(30);
- bt_end_vl->addWidget(bt_end_date_);
- bt_hl->addWidget(bt_end_col);
+ params_gl->addWidget(make_param_col("END DATE", bt_end_date_), 1, 1);
+
+ vl->addWidget(params_grid);
- // Backtest button
- auto* bt_btn = new QPushButton("BACKTEST", bt_row);
+ // RUN BACKTEST button
+ auto* bt_btn = new QPushButton("RUN BACKTEST", content);
bt_btn->setCursor(Qt::PointingHandCursor);
- bt_btn->setFixedHeight(30);
- bt_btn->setMinimumWidth(100);
- bt_btn->setStyleSheet(QString("QPushButton { background: rgba(8,145,178,0.1); color: %1; border: 1px solid %1;"
- " font-size: %2px; font-weight: 700; %3 padding: 4px 16px; }"
- "QPushButton:hover { background: %1; color: %4; }")
- .arg(fincept::ui::colors::CYAN)
- .arg(fincept::ui::fonts::TINY)
- .arg(kMonoFont())
- .arg(fincept::ui::colors::BG_BASE));
+ bt_btn->setFixedHeight(36);
+ bt_btn->setStyleSheet(
+ QString("QPushButton { background: rgba(8,145,178,0.1); color: %1; border: 1px solid %1;"
+ " font-size: %2px; font-weight: 700; %3 padding: 6px 24px; }"
+ "QPushButton:hover { background: %1; color: %4; }")
+ .arg(fincept::ui::colors::CYAN)
+ .arg(fincept::ui::fonts::DATA)
+ .arg(kMonoFont())
+ .arg(fincept::ui::colors::BG_BASE));
connect(bt_btn, &QPushButton::clicked, this, &StrategyBuilderPanel::on_backtest);
- bt_hl->addWidget(bt_btn, 0, Qt::AlignBottom);
-
- vl->addWidget(bt_row);
-
- // ── Save Button ─────────────────────────────────────────────────────────
- auto* save_btn = new QPushButton("SAVE STRATEGY", content);
- save_btn->setCursor(Qt::PointingHandCursor);
- save_btn->setFixedHeight(36);
- save_btn->setStyleSheet(QString("QPushButton { background: rgba(217,119,6,0.1); color: %1; border: 1px solid %1;"
- " font-size: %2px; font-weight: 700; %3 padding: 6px 24px; }"
- "QPushButton:hover { background: %1; color: %4; }")
- .arg(fincept::ui::colors::AMBER)
- .arg(fincept::ui::fonts::DATA)
- .arg(kMonoFont())
- .arg(fincept::ui::colors::BG_BASE));
- connect(save_btn, &QPushButton::clicked, this, &StrategyBuilderPanel::on_save);
- vl->addWidget(save_btn);
+ vl->addWidget(bt_btn);
- // ── Status label ────────────────────────────────────────────────────────
+ // Status label
status_label_ = new QLabel("", content);
status_label_->setWordWrap(true);
- status_label_->setStyleSheet(QString("color: %1; font-size: %2px; %3 background: transparent; border: none;")
- .arg(fincept::ui::colors::TEXT_TERTIARY)
- .arg(fincept::ui::fonts::SMALL)
- .arg(kMonoFont()));
+ status_label_->setStyleSheet(
+ QString("color: %1; font-size: %2px; %3 background: transparent; border: none;")
+ .arg(fincept::ui::colors::TEXT_TERTIARY)
+ .arg(fincept::ui::fonts::SMALL)
+ .arg(kMonoFont()));
vl->addWidget(status_label_);
// ── Results area ────────────────────────────────────────────────────────
- auto* results_section = new QLabel("BACKTEST RESULTS", content);
- results_section->setStyleSheet(kSectionLabel());
- vl->addWidget(results_section);
-
auto* results_container = new QWidget(content);
results_layout_ = new QVBoxLayout(results_container);
- results_layout_->setContentsMargins(0, 0, 0, 0);
- results_layout_->setSpacing(4);
- vl->addWidget(results_container);
+ results_layout_->setContentsMargins(0, 4, 0, 0);
+ results_layout_->setSpacing(8);
+
+ // Empty state
+ bt_empty_label_ = new QLabel("Run a backtest to see results", results_container);
+ bt_empty_label_->setAlignment(Qt::AlignCenter);
+ bt_empty_label_->setStyleSheet(
+ QString("color: %1; font-size: %2px; %3 background: transparent; border: none; padding: 24px;")
+ .arg(fincept::ui::colors::TEXT_TERTIARY)
+ .arg(fincept::ui::fonts::SMALL)
+ .arg(kMonoFont()));
+ results_layout_->addWidget(bt_empty_label_);
+
+ // KPI grid — hidden until first result
+ kpi_grid_widget_ = new QWidget(results_container);
+ kpi_grid_widget_->setVisible(false);
+
+ auto* kpi_gl = new QGridLayout(kpi_grid_widget_);
+ kpi_gl->setContentsMargins(0, 0, 0, 0);
+ kpi_gl->setSpacing(8);
+
+ // Helper to build one KPI card and wire up its labels
+ struct KpiDef {
+ QString label;
+ QLabel** val_out;
+ QLabel** sub_out;
+ };
+
+ QList<KpiDef> kpi_defs = {
+ {"TOTAL RETURN", &kpi_total_return_val_, &kpi_total_return_sub_},
+ {"SHARPE RATIO", &kpi_sharpe_val_, &kpi_sharpe_sub_},
+ {"MAX DRAWDOWN", &kpi_max_dd_val_, &kpi_max_dd_sub_},
+ {"WIN RATE", &kpi_win_rate_val_, &kpi_win_rate_sub_},
+ {"TOTAL TRADES", &kpi_trades_val_, &kpi_trades_sub_},
+ {"PROFIT FACTOR", &kpi_profit_factor_val_, &kpi_profit_factor_sub_},
+ };
+
+ for (int i = 0; i < kpi_defs.size(); ++i) {
+ const auto& def = kpi_defs[i];
+
+ auto* card = new QWidget(kpi_grid_widget_);
+ card->setObjectName("btKpiCard");
+ card->setStyleSheet(
+ QString("#btKpiCard { background:%1; border:1px solid %2; border-radius:4px; }")
+ .arg(fincept::ui::colors::BG_SURFACE, fincept::ui::colors::BORDER_DIM));
+
+ auto* cl = new QVBoxLayout(card);
+ cl->setContentsMargins(12, 10, 12, 10);
+ cl->setSpacing(2);
+
+ auto* lbl = new QLabel(def.label, card);
+ lbl->setStyleSheet(
+ QString("color:%1; font-size:%2px; font-family:%3; font-weight:600; letter-spacing:1px;"
+ " background:transparent; border:none;")
+ .arg(fincept::ui::colors::TEXT_TERTIARY)
+ .arg(fincept::ui::fonts::TINY)
+ .arg(fincept::ui::fonts::DATA_FAMILY));
+ cl->addWidget(lbl);
+
+ auto* val = new QLabel("—", card);
+ val->setStyleSheet(
+ QString("color:%1; font-size:%2px; font-family:%3; font-weight:800;"
+ " background:transparent; border:none;")
+ .arg(fincept::ui::colors::TEXT_PRIMARY)
+ .arg(fincept::ui::fonts::HEADER + 2)
+ .arg(fincept::ui::fonts::DATA_FAMILY));
+ cl->addWidget(val);
+ *def.val_out = val;
+
+ auto* sub = new QLabel("", card);
+ sub->setStyleSheet(
+ QString("color:%1; font-size:%2px; font-family:%3;"
+ " background:transparent; border:none;")
+ .arg(fincept::ui::colors::TEXT_TERTIARY)
+ .arg(fincept::ui::fonts::TINY)
+ .arg(fincept::ui::fonts::DATA_FAMILY));
+ cl->addWidget(sub);
+ *def.sub_out = sub;
+
+ kpi_gl->addWidget(card, i / 3, i % 3);
+ }
+ results_layout_->addWidget(kpi_grid_widget_);
+ vl->addWidget(results_container);
vl->addStretch();
scroll->setWidget(content);
- root->addWidget(scroll);
+ root_layout->addWidget(scroll);
+ return pane;
+}
+
+// ── build_ui: QSplitter shell ────────────────────────────────────────────────
+
+void StrategyBuilderPanel::build_ui() {
+ auto* root = new QVBoxLayout(this);
+ root->setContentsMargins(0, 0, 0, 0);
+ root->setSpacing(0);
+
+ auto* splitter = new QSplitter(Qt::Horizontal, this);
+ splitter->setHandleWidth(4);
+ splitter->setStyleSheet(
+ QString("QSplitter::handle { background: %1; }")
+ .arg(fincept::ui::colors::BORDER_DIM));
+ splitter->addWidget(build_left_pane());
+ splitter->addWidget(build_right_pane());
+ splitter->setStretchFactor(0, 2); // left ~40%
+ splitter->setStretchFactor(1, 3); // right ~60%
+
+ root->addWidget(splitter, 1);
+}
+
+// ── clear_results ────────────────────────────────────────────────────────────
+
+void StrategyBuilderPanel::clear_results() {
+ bt_empty_label_->setVisible(true);
+ kpi_grid_widget_->setVisible(false);
+}
+
+// ── display_backtest_result — Quant Lab KPI card style ───────────────────────
+
+void StrategyBuilderPanel::display_backtest_result(const QJsonObject& data) {
+ bt_empty_label_->setVisible(false);
+ kpi_grid_widget_->setVisible(true);
+
+ double total_return = data.value("total_return").toDouble();
+ double sharpe = data.value("sharpe_ratio").toDouble();
+ double max_dd = data.value("max_drawdown").toDouble();
+ int total_trades = data.value("total_trades").toInt();
+ double win_rate = data.value("win_rate").toDouble();
+ double profit_factor = data.value("profit_factor").toDouble();
+ double final_val = data.value("final_value").toDouble();
+
+ auto set_kpi = [](QLabel* lbl, const QString& text, const QString& color) {
+ lbl->setText(text);
+ lbl->setStyleSheet(
+ QString("color:%1; font-size:%2px; font-family:%3; font-weight:800;"
+ " background:transparent; border:none;")
+ .arg(color)
+ .arg(fincept::ui::fonts::HEADER + 2)
+ .arg(fincept::ui::fonts::DATA_FAMILY));
+ };
+
+ // TOTAL RETURN
+ set_kpi(kpi_total_return_val_,
+ QString("%1%2%").arg(total_return >= 0 ? "+" : "").arg(total_return, 0, 'f', 2),
+ total_return >= 0 ? fincept::ui::colors::POSITIVE : fincept::ui::colors::NEGATIVE);
+ kpi_total_return_sub_->setText(
+ QString("Final: $%1").arg(final_val, 0, 'f', 0));
+
+ // SHARPE
+ set_kpi(kpi_sharpe_val_, QString::number(sharpe, 'f', 3),
+ sharpe >= 0.5 ? fincept::ui::colors::POSITIVE : fincept::ui::colors::NEGATIVE);
+ kpi_sharpe_sub_->setText(sharpe >= 1.0 ? "Excellent" : sharpe >= 0.5 ? "Good" : "Weak");
+
+ // MAX DRAWDOWN (always red)
+ set_kpi(kpi_max_dd_val_,
+ QString("-%1%").arg(qAbs(max_dd), 0, 'f', 2),
+ fincept::ui::colors::NEGATIVE);
+ kpi_max_dd_sub_->setText("Max Drawdown");
+
+ // WIN RATE
+ set_kpi(kpi_win_rate_val_,
+ QString("%1%").arg(win_rate, 0, 'f', 1),
+ win_rate >= 50.0 ? fincept::ui::colors::POSITIVE : fincept::ui::colors::NEGATIVE);
+ kpi_win_rate_sub_->setText(win_rate >= 50.0 ? "Above average" : "Below average");
+
+ // TOTAL TRADES
+ set_kpi(kpi_trades_val_, QString::number(total_trades), fincept::ui::colors::TEXT_PRIMARY);
+ kpi_trades_sub_->setText("Total trades");
+
+ // PROFIT FACTOR
+ set_kpi(kpi_profit_factor_val_, QString::number(profit_factor, 'f', 2),
+ profit_factor >= 1.0 ? fincept::ui::colors::POSITIVE : fincept::ui::colors::NEGATIVE);
+ kpi_profit_factor_sub_->setText(profit_factor >= 1.5 ? "Strong" : profit_factor >= 1.0 ? "Profitable" : "Losing");
+}
+
+// ── on_backtest_result ───────────────────────────────────────────────────────
+
+void StrategyBuilderPanel::on_backtest_result(const QJsonObject& data) {
+ status_label_->setText("Backtest complete.");
+ status_label_->setStyleSheet(
+ QString("color: %1; font-size: %2px; %3 background: transparent; border: none;")
+ .arg(fincept::ui::colors::POSITIVE)
+ .arg(fincept::ui::fonts::SMALL)
+ .arg(kMonoFont()));
+ display_backtest_result(data);
+ LOG_INFO("AlgoTrading", "Backtest result displayed");
}
-// ── Slots ───────────────────────────────────────────────────────────────────
+// ── on_save ──────────────────────────────────────────────────────────────────
void StrategyBuilderPanel::on_save() {
if (name_edit_->text().trimmed().isEmpty()) {
status_label_->setText("Strategy name is required.");
- status_label_->setStyleSheet(QString("color: %1; font-size: %2px; %3 background: transparent; border: none;")
- .arg(fincept::ui::colors::NEGATIVE)
- .arg(fincept::ui::fonts::SMALL)
- .arg(kMonoFont()));
+ status_label_->setStyleSheet(
+ QString("color: %1; font-size: %2px; %3 background: transparent; border: none;")
+ .arg(fincept::ui::colors::NEGATIVE)
+ .arg(fincept::ui::fonts::SMALL)
+ .arg(kMonoFont()));
return;
}
AlgoStrategy strategy;
- strategy.id = QUuid::createUuid().toString(QUuid::WithoutBraces);
- strategy.name = name_edit_->text().trimmed();
- strategy.description = desc_edit_->text().trimmed();
- strategy.timeframe = timeframe_combo_->currentText();
+ strategy.id = QUuid::createUuid().toString(QUuid::WithoutBraces);
+ strategy.name = name_edit_->text().trimmed();
+ strategy.description = desc_edit_->text().trimmed();
+ strategy.timeframe = timeframe_combo_->currentText();
strategy.entry_conditions = gather_from_layout(entry_conditions_layout_);
- strategy.exit_conditions = gather_from_layout(exit_conditions_layout_);
- strategy.entry_logic = entry_logic_combo_->currentText();
- strategy.exit_logic = exit_logic_combo_->currentText();
- strategy.stop_loss = stop_loss_spin_->value();
- strategy.take_profit = take_profit_spin_->value();
- strategy.trailing_stop = trailing_stop_spin_->value();
+ strategy.exit_conditions = gather_from_layout(exit_conditions_layout_);
+ strategy.entry_logic = entry_logic_combo_->currentText();
+ strategy.exit_logic = exit_logic_combo_->currentText();
+ strategy.stop_loss = stop_loss_spin_->value();
+ strategy.take_profit = take_profit_spin_->value();
+ strategy.trailing_stop = trailing_stop_spin_->value();
status_label_->setText("Saving...");
- status_label_->setStyleSheet(QString("color: %1; font-size: %2px; %3 background: transparent; border: none;")
- .arg(fincept::ui::colors::TEXT_SECONDARY)
- .arg(fincept::ui::fonts::SMALL)
- .arg(kMonoFont()));
+ status_label_->setStyleSheet(
+ QString("color: %1; font-size: %2px; %3 background: transparent; border: none;")
+ .arg(fincept::ui::colors::TEXT_SECONDARY)
+ .arg(fincept::ui::fonts::SMALL)
+ .arg(kMonoFont()));
AlgoTradingService::instance().save_strategy(strategy);
LOG_INFO("AlgoTrading", QString("Saving strategy: %1").arg(strategy.name));
- // Serialize strategy to JSON and register with File Manager
{
QJsonObject json;
- json["id"] = strategy.id;
- json["name"] = strategy.name;
- json["description"] = strategy.description;
- json["timeframe"] = strategy.timeframe;
- json["entry_logic"] = strategy.entry_logic;
- json["exit_logic"] = strategy.exit_logic;
- json["stop_loss"] = strategy.stop_loss;
- json["take_profit"] = strategy.take_profit;
+ json["id"] = strategy.id;
+ json["name"] = strategy.name;
+ json["description"] = strategy.description;
+ json["timeframe"] = strategy.timeframe;
+ json["entry_logic"] = strategy.entry_logic;
+ json["exit_logic"] = strategy.exit_logic;
+ json["stop_loss"] = strategy.stop_loss;
+ json["take_profit"] = strategy.take_profit;
json["trailing_stop"] = strategy.trailing_stop;
QJsonArray entry_arr;
- for (const auto& c : strategy.entry_conditions)
- entry_arr.append(c);
+ for (const auto& c : strategy.entry_conditions) entry_arr.append(c);
json["entry_conditions"] = entry_arr;
QJsonArray exit_arr;
- for (const auto& c : strategy.exit_conditions)
- exit_arr.append(c);
+ for (const auto& c : strategy.exit_conditions) exit_arr.append(c);
json["exit_conditions"] = exit_arr;
QString safe_name = strategy.name;
safe_name.replace(QRegularExpression("[^a-zA-Z0-9_\\-]"), "_");
- QString dest = services::FileManagerService::instance().storage_dir() + "/" + safe_name + "_" +
- strategy.id.left(8) + ".json";
+ QString dest = services::FileManagerService::instance().storage_dir() + "/" +
+ safe_name + "_" + strategy.id.left(8) + ".json";
QFile f(dest);
if (f.open(QIODevice::WriteOnly | QIODevice::Text)) {
f.write(QJsonDocument(json).toJson(QJsonDocument::Indented));
f.close();
- services::FileManagerService::instance().register_file(safe_name + "_" + strategy.id.left(8) + ".json",
- strategy.name + ".json", QFileInfo(dest).size(),
- "application/json", "algo_trading");
+ services::FileManagerService::instance().register_file(
+ safe_name + "_" + strategy.id.left(8) + ".json",
+ strategy.name + ".json", QFileInfo(dest).size(),
+ "application/json", "algo_trading");
}
}
}
+// ── on_backtest ──────────────────────────────────────────────────────────────
+
void StrategyBuilderPanel::on_backtest() {
QString symbol = bt_symbol_->text().trimmed();
if (symbol.isEmpty()) {
status_label_->setText("Enter a symbol for backtesting.");
- status_label_->setStyleSheet(QString("color: %1; font-size: %2px; %3 background: transparent; border: none;")
- .arg(fincept::ui::colors::NEGATIVE)
- .arg(fincept::ui::fonts::SMALL)
- .arg(kMonoFont()));
+ status_label_->setStyleSheet(
+ QString("color: %1; font-size: %2px; %3 background: transparent; border: none;")
+ .arg(fincept::ui::colors::NEGATIVE)
+ .arg(fincept::ui::fonts::SMALL)
+ .arg(kMonoFont()));
return;
}
status_label_->setText("Running backtest...");
- status_label_->setStyleSheet(QString("color: %1; font-size: %2px; %3 background: transparent; border: none;")
- .arg(fincept::ui::colors::CYAN)
- .arg(fincept::ui::fonts::SMALL)
- .arg(kMonoFont()));
+ status_label_->setStyleSheet(
+ QString("color: %1; font-size: %2px; %3 background: transparent; border: none;")
+ .arg(fincept::ui::colors::CYAN)
+ .arg(fincept::ui::fonts::SMALL)
+ .arg(kMonoFont()));
QString start_date = bt_start_date_->text().trimmed();
- QString end_date = bt_end_date_->text().trimmed();
- if (start_date.isEmpty())
- start_date = "2024-01-01";
- if (end_date.isEmpty())
- end_date = "2025-01-01";
+ QString end_date = bt_end_date_->text().trimmed();
+ if (start_date.isEmpty()) start_date = "2024-01-01";
+ if (end_date.isEmpty()) end_date = "2025-01-01";
- // Use strategy name as identifier (strategy must be saved first for full backtest)
QString strat_id = name_edit_->text().trimmed();
- double capital = bt_capital_->value();
+ double capital = bt_capital_->value();
AlgoTradingService::instance().run_backtest(strat_id, symbol, start_date, end_date, capital);
LOG_INFO("AlgoTrading", QString("Backtest requested: %1 on %2").arg(strat_id, symbol));
}
-void StrategyBuilderPanel::on_backtest_result(const QJsonObject& data) {
- // Clear previous results
- while (results_layout_->count() > 0) {
- auto* item = results_layout_->takeAt(0);
- if (item->widget())
- item->widget()->deleteLater();
- delete item;
- }
-
- status_label_->setText("Backtest complete.");
- status_label_->setStyleSheet(QString("color: %1; font-size: %2px; %3 background: transparent; border: none;")
- .arg(fincept::ui::colors::POSITIVE)
- .arg(fincept::ui::fonts::SMALL)
- .arg(kMonoFont()));
-
- // Build result cards
- auto add_metric = [this](const QString& label, const QString& value, const QString& color) {
- auto* row = new QWidget(this);
- row->setStyleSheet(QString("background: %1; border: 1px solid %2;")
- .arg(fincept::ui::colors::BG_SURFACE, fincept::ui::colors::BORDER_DIM));
- auto* hl = new QHBoxLayout(row);
- hl->setContentsMargins(8, 4, 8, 4);
- hl->setSpacing(0);
- auto* lbl = new QLabel(label, row);
- lbl->setStyleSheet(QString("color: %1; font-size: %2px; %3 background: transparent; border: none;")
- .arg(fincept::ui::colors::TEXT_SECONDARY)
- .arg(fincept::ui::fonts::SMALL)
- .arg(kMonoFont()));
- auto* val = new QLabel(value, row);
- val->setStyleSheet(
- QString("color: %1; font-size: %2px; font-weight: 700; %3 background: transparent; border: none;")
- .arg(color)
- .arg(fincept::ui::fonts::DATA)
- .arg(kMonoFont()));
- val->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
- hl->addWidget(lbl);
- hl->addStretch();
- hl->addWidget(val);
- results_layout_->addWidget(row);
- };
-
- double total_return = data.value("total_return").toDouble();
- double sharpe = data.value("sharpe_ratio").toDouble();
- double max_dd = data.value("max_drawdown").toDouble();
- int total_trades = data.value("total_trades").toInt();
- double win_rate = data.value("win_rate").toDouble();
- double profit_factor = data.value("profit_factor").toDouble();
-
- add_metric("TOTAL RETURN", QString("%1%2%").arg(total_return >= 0 ? "+" : "").arg(total_return, 0, 'f', 2),
- total_return >= 0 ? fincept::ui::colors::POSITIVE : fincept::ui::colors::NEGATIVE);
- add_metric("SHARPE RATIO", QString::number(sharpe, 'f', 2), fincept::ui::colors::TEXT_PRIMARY);
- add_metric("MAX DRAWDOWN", QString("-%1%").arg(qAbs(max_dd), 0, 'f', 2), fincept::ui::colors::NEGATIVE);
- add_metric("TOTAL TRADES", QString::number(total_trades), fincept::ui::colors::TEXT_PRIMARY);
- add_metric("WIN RATE", QString("%1%").arg(win_rate, 0, 'f', 1), fincept::ui::colors::TEXT_PRIMARY);
- add_metric("PROFIT FACTOR", QString::number(profit_factor, 'f', 2),
- profit_factor >= 1.0 ? fincept::ui::colors::POSITIVE : fincept::ui::colors::NEGATIVE);
-
- LOG_INFO("AlgoTrading", QString("Backtest results displayed: return=%1%").arg(total_return, 0, 'f', 2));
-}
+// ── on_error ─────────────────────────────────────────────────────────────────
void StrategyBuilderPanel::on_error(const QString& context, const QString& msg) {
if (status_label_) {
status_label_->setText(QString("Error [%1]: %2").arg(context, msg));
- status_label_->setStyleSheet(QString("color: %1; font-size: %2px; %3 background: transparent; border: none;")
- .arg(fincept::ui::colors::NEGATIVE)
- .arg(fincept::ui::fonts::SMALL)
- .arg(kMonoFont()));
+ status_label_->setStyleSheet(
+ QString("color: %1; font-size: %2px; %3 background: transparent; border: none;")
+ .arg(fincept::ui::colors::NEGATIVE)
+ .arg(fincept::ui::fonts::SMALL)
+ .arg(kMonoFont()));
}
}
diff --git a/fincept-qt/src/screens/algo_trading/StrategyBuilderPanel.h b/fincept-qt/src/screens/algo_trading/StrategyBuilderPanel.h
index 78a485535..becc7f220 100644
--- a/fincept-qt/src/screens/algo_trading/StrategyBuilderPanel.h
+++ b/fincept-qt/src/screens/algo_trading/StrategyBuilderPanel.h
@@ -4,16 +4,20 @@
#include <QComboBox>
#include <QDoubleSpinBox>
+#include <QGridLayout>
#include <QJsonArray>
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
+#include <QSplitter>
#include <QVBoxLayout>
#include <QWidget>
namespace fincept::screens {
-/// Strategy builder — condition-based entry/exit rule editor with backtest.
+/// Strategy builder — QSplitter workstation layout.
+/// Left: strategy editor (definition + conditions + risk).
+/// Right: backtest params + Quant Lab-style KPI result cards.
class StrategyBuilderPanel : public QWidget {
Q_OBJECT
public:
@@ -28,27 +32,47 @@ class StrategyBuilderPanel : public QWidget {
private:
void build_ui();
void connect_service();
+ QWidget* build_left_pane();
+ QWidget* build_right_pane();
QWidget* build_condition_row(QWidget* parent);
+ void display_backtest_result(const QJsonObject& data);
+ void clear_results();
- QLineEdit* name_edit_ = nullptr;
- QLineEdit* desc_edit_ = nullptr;
- QComboBox* timeframe_combo_ = nullptr;
- QComboBox* entry_logic_combo_ = nullptr;
- QComboBox* exit_logic_combo_ = nullptr;
- QDoubleSpinBox* stop_loss_spin_ = nullptr;
- QDoubleSpinBox* take_profit_spin_ = nullptr;
- QDoubleSpinBox* trailing_stop_spin_ = nullptr;
-
- QVBoxLayout* entry_conditions_layout_ = nullptr;
- QVBoxLayout* exit_conditions_layout_ = nullptr;
- QVBoxLayout* results_layout_ = nullptr;
- QLabel* status_label_ = nullptr;
-
- // Backtest inputs
- QLineEdit* bt_symbol_ = nullptr;
- QDoubleSpinBox* bt_capital_ = nullptr;
- QLineEdit* bt_start_date_ = nullptr;
- QLineEdit* bt_end_date_ = nullptr;
+ // Left pane — strategy editor
+ QLineEdit* name_edit_ = nullptr;
+ QLineEdit* desc_edit_ = nullptr;
+ QComboBox* timeframe_combo_ = nullptr;
+ QComboBox* entry_logic_combo_ = nullptr;
+ QComboBox* exit_logic_combo_ = nullptr;
+ QDoubleSpinBox* stop_loss_spin_ = nullptr;
+ QDoubleSpinBox* take_profit_spin_ = nullptr;
+ QDoubleSpinBox* trailing_stop_spin_ = nullptr;
+ QVBoxLayout* entry_conditions_layout_ = nullptr;
+ QVBoxLayout* exit_conditions_layout_ = nullptr;
+
+ // Right pane — backtest
+ QLineEdit* bt_symbol_ = nullptr;
+ QDoubleSpinBox* bt_capital_ = nullptr;
+ QLineEdit* bt_start_date_ = nullptr;
+ QLineEdit* bt_end_date_ = nullptr;
+ QLabel* status_label_ = nullptr;
+ QVBoxLayout* results_layout_ = nullptr;
+ QLabel* bt_empty_label_ = nullptr;
+
+ // KPI card value labels — updated in display_backtest_result()
+ QLabel* kpi_total_return_val_ = nullptr;
+ QLabel* kpi_total_return_sub_ = nullptr;
+ QLabel* kpi_sharpe_val_ = nullptr;
+ QLabel* kpi_sharpe_sub_ = nullptr;
+ QLabel* kpi_max_dd_val_ = nullptr;
+ QLabel* kpi_max_dd_sub_ = nullptr;
+ QLabel* kpi_win_rate_val_ = nullptr;
+ QLabel* kpi_win_rate_sub_ = nullptr;
+ QLabel* kpi_trades_val_ = nullptr;
+ QLabel* kpi_trades_sub_ = nullptr;
+ QLabel* kpi_profit_factor_val_ = nullptr;
+ QLabel* kpi_profit_factor_sub_ = nullptr;
+ QWidget* kpi_grid_widget_ = nullptr; // hidden until first result
};
} // namespace fincept::screens
diff --git a/fincept-qt/src/screens/algo_trading/StrategyListPanel.cpp b/fincept-qt/src/screens/algo_trading/StrategyListPanel.cpp
index 45196a27a..79a19d5e1 100644
--- a/fincept-qt/src/screens/algo_trading/StrategyListPanel.cpp
+++ b/fincept-qt/src/screens/algo_trading/StrategyListPanel.cpp
@@ -5,39 +5,20 @@
#include "services/algo_trading/AlgoTradingService.h"
#include "ui/theme/Theme.h"
-#include <QComboBox>
-#include <QDoubleSpinBox>
+#include <algorithm>
+
+#include <QHeaderView>
#include <QHBoxLayout>
-#include <QLineEdit>
#include <QPushButton>
#include <QScrollArea>
+#include <QTableWidgetItem>
#include <QVBoxLayout>
-// ── Shared style constants ──────────────────────────────────────────────────
-
-namespace {
-
-inline QString kMonoFont() {
- return QString("font-family: %1;").arg(fincept::ui::fonts::DATA_FAMILY);
-}
-
-inline QString kInputStyle() {
- return QString("QLineEdit { background: %1; border: 1px solid %2; color: %3; padding: 4px 8px;"
- " font-size: %4px; %5 }"
- "QLineEdit:focus { border-color: %6; }")
- .arg(fincept::ui::colors::BG_SURFACE, fincept::ui::colors::BORDER_DIM, fincept::ui::colors::TEXT_PRIMARY)
- .arg(fincept::ui::fonts::SMALL)
- .arg(kMonoFont())
- .arg(fincept::ui::colors::BORDER_BRIGHT);
-}
-
-} // namespace
-
namespace fincept::screens {
using namespace fincept::services::algo;
-// ── Constructor ─────────────────────────────────────────────────────────────
+// ── Constructor ──────────────────────────────────────────────────────────────
StrategyListPanel::StrategyListPanel(QWidget* parent) : QWidget(parent) {
build_ui();
@@ -45,347 +26,308 @@ StrategyListPanel::StrategyListPanel(QWidget* parent) : QWidget(parent) {
LOG_INFO("AlgoTrading", "StrategyListPanel constructed");
}
-// ── Service connections ─────────────────────────────────────────────────────
+// ── Service connections ──────────────────────────────────────────────────────
void StrategyListPanel::connect_service() {
auto& svc = AlgoTradingService::instance();
connect(&svc, &AlgoTradingService::strategies_loaded, this, &StrategyListPanel::on_strategies_loaded);
- connect(&svc, &AlgoTradingService::strategy_deleted, this, [this](const QString& id) {
- Q_UNUSED(id)
- AlgoTradingService::instance().list_strategies();
- });
- connect(&svc, &AlgoTradingService::deployment_started, this,
- [](const QString& id) { LOG_INFO("AlgoTrading", QString("Deployment started: %1").arg(id)); });
connect(&svc, &AlgoTradingService::error_occurred, this, &StrategyListPanel::on_error);
}
-// ── Build strategy card ─────────────────────────────────────────────────────
-
-QWidget* StrategyListPanel::build_strategy_card(const AlgoStrategy& s, QWidget* parent) {
- auto* card = new QWidget(parent);
- card->setStyleSheet(QString("background: %1; border: 1px solid %2;")
- .arg(fincept::ui::colors::BG_SURFACE, fincept::ui::colors::BORDER_DIM));
-
- auto* vl = new QVBoxLayout(card);
- vl->setContentsMargins(12, 10, 12, 10);
- vl->setSpacing(6);
-
- // Top row: name + timeframe
- auto* top = new QHBoxLayout;
- top->setSpacing(8);
-
- auto* name_lbl = new QLabel(s.name, card);
- name_lbl->setStyleSheet(QString("color: %1; font-size: %2px; font-weight: 700; %3"
- " background: transparent; border: none;")
- .arg(fincept::ui::colors::AMBER)
- .arg(fincept::ui::fonts::DATA)
- .arg(kMonoFont()));
- top->addWidget(name_lbl);
-
- auto* tf_badge = new QLabel(s.timeframe.toUpper(), card);
- tf_badge->setStyleSheet(QString("color: %1; font-size: %2px; font-weight: 700; %3"
- " padding: 2px 6px; background: rgba(8,145,178,0.08);"
- " border: 1px solid rgba(8,145,178,0.25);")
- .arg(fincept::ui::colors::CYAN)
- .arg(fincept::ui::fonts::TINY)
- .arg(kMonoFont()));
- top->addWidget(tf_badge);
- top->addStretch();
-
- vl->addLayout(top);
-
- // Description
- if (!s.description.isEmpty()) {
- auto* desc = new QLabel(s.description, card);
- desc->setWordWrap(true);
- desc->setStyleSheet(QString("color: %1; font-size: %2px; %3 background: transparent; border: none;")
- .arg(fincept::ui::colors::TEXT_SECONDARY)
- .arg(fincept::ui::fonts::SMALL)
- .arg(kMonoFont()));
- vl->addWidget(desc);
- }
-
- // Metrics row
- auto* metrics = new QHBoxLayout;
- metrics->setSpacing(16);
-
- auto add_metric = [&](const QString& label, const QString& value) {
- auto* w = new QWidget(card);
- auto* ml = new QVBoxLayout(w);
- ml->setContentsMargins(0, 0, 0, 0);
- ml->setSpacing(0);
- auto* lbl = new QLabel(label, w);
- lbl->setStyleSheet(QString("color: %1; font-size: %2px; %3 background: transparent; border: none;")
- .arg(fincept::ui::colors::TEXT_TERTIARY)
- .arg(fincept::ui::fonts::TINY)
- .arg(kMonoFont()));
- auto* val = new QLabel(value, w);
- val->setStyleSheet(QString("color: %1; font-size: %2px; font-weight: 700; %3"
- " background: transparent; border: none;")
- .arg(fincept::ui::colors::TEXT_PRIMARY)
- .arg(fincept::ui::fonts::SMALL)
- .arg(kMonoFont()));
- ml->addWidget(lbl);
- ml->addWidget(val);
- metrics->addWidget(w);
- };
-
- add_metric("ENTRY", QString::number(s.entry_conditions.size()));
- add_metric("EXIT", QString::number(s.exit_conditions.size()));
- add_metric("SL", s.stop_loss > 0 ? QString("%1%").arg(s.stop_loss, 0, 'f', 1) : "OFF");
- add_metric("TP", s.take_profit > 0 ? QString("%1%").arg(s.take_profit, 0, 'f', 1) : "OFF");
-
- metrics->addStretch();
-
- vl->addLayout(metrics);
-
- // ── Deploy form (hidden until DEPLOY clicked) ────────────────────────────
- auto* deploy_form = new QWidget(card);
- deploy_form->setVisible(false);
- deploy_form->setStyleSheet(QString("background: %1; border-top: 1px solid %2;")
- .arg(fincept::ui::colors::BG_BASE, fincept::ui::colors::BORDER_DIM));
- auto* form_hl = new QHBoxLayout(deploy_form);
- form_hl->setContentsMargins(0, 6, 0, 0);
- form_hl->setSpacing(8);
-
- auto make_field = [&](const QString& label_text, QWidget* input_widget) {
- auto* col = new QWidget(deploy_form);
- auto* cvl = new QVBoxLayout(col);
- cvl->setContentsMargins(0, 0, 0, 0);
- cvl->setSpacing(2);
- auto* lbl = new QLabel(label_text, col);
- lbl->setStyleSheet(QString("color: %1; font-size: %2px; font-weight: 700; %3"
- " background: transparent; border: none;")
- .arg(fincept::ui::colors::TEXT_TERTIARY)
- .arg(fincept::ui::fonts::TINY)
- .arg(kMonoFont()));
- cvl->addWidget(lbl);
- input_widget->setParent(col);
- cvl->addWidget(input_widget);
- form_hl->addWidget(col);
- };
-
- auto* sym_input = new QLineEdit(deploy_form);
- sym_input->setPlaceholderText("RELIANCE");
- sym_input->setText("RELIANCE");
- sym_input->setFixedHeight(26);
- sym_input->setStyleSheet(kInputStyle());
- make_field("SYMBOL", sym_input);
-
- auto* mode_combo = new QComboBox(deploy_form);
- mode_combo->addItems({"paper", "live"});
- mode_combo->setFixedHeight(26);
- mode_combo->setStyleSheet(
- QString("QComboBox { background: %1; color: %2; border: 1px solid %3; padding: 2px 6px;"
- " font-size: %4px; %5 }"
- "QComboBox::drop-down { border: none; }"
- "QComboBox QAbstractItemView { background: %1; color: %2; border: 1px solid %3;"
- " selection-background-color: %6; %5 }")
- .arg(fincept::ui::colors::BG_SURFACE, fincept::ui::colors::TEXT_PRIMARY, fincept::ui::colors::BORDER_DIM)
- .arg(fincept::ui::fonts::SMALL)
- .arg(kMonoFont())
- .arg(fincept::ui::colors::BG_HOVER));
- make_field("MODE", mode_combo);
-
- auto* tf_combo = new QComboBox(deploy_form);
- tf_combo->addItems(algo_timeframes());
- tf_combo->setCurrentIndex(algo_timeframes().indexOf("1d"));
- tf_combo->setFixedHeight(26);
- tf_combo->setStyleSheet(mode_combo->styleSheet());
- make_field("TIMEFRAME", tf_combo);
-
- auto* qty_spin = new QDoubleSpinBox(deploy_form);
- qty_spin->setRange(0.01, 1e7);
- qty_spin->setDecimals(2);
- qty_spin->setValue(1.0);
- qty_spin->setFixedHeight(26);
- qty_spin->setStyleSheet(
- QString("QDoubleSpinBox { background: %1; color: %2; border: 1px solid %3; padding: 2px 6px;"
- " font-size: %4px; %5 }"
- "QDoubleSpinBox::up-button, QDoubleSpinBox::down-button { width: 14px; }")
- .arg(fincept::ui::colors::BG_SURFACE, fincept::ui::colors::TEXT_PRIMARY, fincept::ui::colors::BORDER_DIM)
- .arg(fincept::ui::fonts::SMALL)
- .arg(kMonoFont()));
- make_field("QTY", qty_spin);
-
- auto* confirm_btn = new QPushButton("GO", deploy_form);
- confirm_btn->setCursor(Qt::PointingHandCursor);
- confirm_btn->setFixedSize(48, 26);
- confirm_btn->setStyleSheet(QString("QPushButton { background: rgba(22,163,74,0.1); color: %1; border: 1px solid %1;"
- " font-size: %2px; font-weight: 700; %3 }"
- "QPushButton:hover { background: %1; color: %4; }")
- .arg(fincept::ui::colors::POSITIVE)
- .arg(fincept::ui::fonts::TINY)
- .arg(kMonoFont())
- .arg(fincept::ui::colors::BG_BASE));
- connect(confirm_btn, &QPushButton::clicked, card,
- [id = s.id, sym_input, mode_combo, tf_combo, qty_spin, deploy_form]() {
- QString symbol = sym_input->text().trimmed().toUpper();
- if (symbol.isEmpty())
- symbol = "RELIANCE";
- AlgoTradingService::instance().deploy_strategy(id, symbol, mode_combo->currentText(),
- tf_combo->currentText(), qty_spin->value());
- deploy_form->setVisible(false);
- LOG_INFO("AlgoTrading",
- QString("Deploy: strategy=%1 symbol=%2 mode=%3").arg(id, symbol, mode_combo->currentText()));
- });
- auto* cancel_btn = new QPushButton("✕", deploy_form);
- cancel_btn->setCursor(Qt::PointingHandCursor);
- cancel_btn->setFixedSize(26, 26);
- cancel_btn->setStyleSheet(QString("QPushButton { background: transparent; color: %1; border: 1px solid %2;"
- " font-size: %3px; %4 }"
- "QPushButton:hover { color: %5; border-color: %5; }")
- .arg(fincept::ui::colors::TEXT_TERTIARY, fincept::ui::colors::BORDER_DIM)
- .arg(fincept::ui::fonts::TINY)
- .arg(kMonoFont())
- .arg(fincept::ui::colors::NEGATIVE));
- connect(cancel_btn, &QPushButton::clicked, deploy_form, [deploy_form]() { deploy_form->setVisible(false); });
-
- form_hl->addWidget(confirm_btn, 0, Qt::AlignBottom);
- form_hl->addWidget(cancel_btn, 0, Qt::AlignBottom);
- form_hl->addStretch();
-
- vl->addWidget(deploy_form);
-
- // ── Action buttons ───────────────────────────────────────────────────────
- auto* actions = new QHBoxLayout;
- actions->setSpacing(8);
- actions->addStretch();
-
- auto* deploy_btn = new QPushButton("DEPLOY", card);
- deploy_btn->setCursor(Qt::PointingHandCursor);
- deploy_btn->setFixedHeight(28);
- deploy_btn->setStyleSheet(QString("QPushButton { background: rgba(22,163,74,0.1); color: %1; border: 1px solid %1;"
- " font-size: %2px; font-weight: 700; %3 padding: 4px 16px; }"
- "QPushButton:hover { background: %1; color: %4; }")
- .arg(fincept::ui::colors::POSITIVE)
- .arg(fincept::ui::fonts::TINY)
- .arg(kMonoFont())
- .arg(fincept::ui::colors::BG_BASE));
- connect(deploy_btn, &QPushButton::clicked, card,
- [deploy_form]() { deploy_form->setVisible(!deploy_form->isVisible()); });
- actions->addWidget(deploy_btn);
-
- auto* delete_btn = new QPushButton("DELETE", card);
- delete_btn->setCursor(Qt::PointingHandCursor);
- delete_btn->setFixedHeight(28);
- delete_btn->setStyleSheet(QString("QPushButton { background: transparent; color: %1; border: 1px solid %1;"
- " font-size: %2px; font-weight: 700; %3 padding: 4px 16px; }"
- "QPushButton:hover { background: rgba(220,38,38,0.1); }")
- .arg(fincept::ui::colors::NEGATIVE)
- .arg(fincept::ui::fonts::TINY)
- .arg(kMonoFont()));
- connect(delete_btn, &QPushButton::clicked, card, [id = s.id]() {
- AlgoTradingService::instance().delete_strategy(id);
- LOG_INFO("AlgoTrading", QString("Delete requested for strategy: %1").arg(id));
- });
- actions->addWidget(delete_btn);
-
- vl->addLayout(actions);
-
- return card;
-}
-
-// ── Build UI ────────────────────────────────────────────────────────────────
+// ── Build UI ─────────────────────────────────────────────────────────────────
void StrategyListPanel::build_ui() {
+ using namespace fincept::ui;
+
auto* root = new QVBoxLayout(this);
root->setContentsMargins(0, 0, 0, 0);
root->setSpacing(0);
- // Top bar: search + count
+ // ── Top bar ──────────────────────────────────────────────────────────────
auto* top_bar = new QWidget(this);
top_bar->setFixedHeight(44);
- top_bar->setStyleSheet(QString("background: %1; border-bottom: 1px solid %2;")
- .arg(fincept::ui::colors::BG_RAISED, fincept::ui::colors::BORDER_DIM));
+ top_bar->setStyleSheet(QString("background:%1; border-bottom:1px solid %2;")
+ .arg(colors::BG_RAISED(), colors::BORDER_DIM()));
auto* top_hl = new QHBoxLayout(top_bar);
top_hl->setContentsMargins(12, 0, 12, 0);
- top_hl->setSpacing(12);
-
- auto* search_icon = new QLabel("SEARCH", top_bar);
- search_icon->setStyleSheet(QString("color: %1; font-size: %2px; font-weight: 700; %3"
- " background: transparent; border: none;")
- .arg(fincept::ui::colors::TEXT_TERTIARY)
- .arg(fincept::ui::fonts::TINY)
- .arg(kMonoFont()));
- top_hl->addWidget(search_icon);
+ top_hl->setSpacing(8);
search_edit_ = new QLineEdit(top_bar);
- search_edit_->setPlaceholderText("Filter strategies...");
- search_edit_->setStyleSheet(kInputStyle());
+ search_edit_->setPlaceholderText("Search strategies...");
search_edit_->setFixedHeight(28);
- top_hl->addWidget(search_edit_, 1);
+ search_edit_->setStyleSheet(
+ QString("QLineEdit { background:%1; border:1px solid %2; color:%3;"
+ " padding:4px 8px; font-size:%4px; font-family:%5; }"
+ "QLineEdit:focus { border-color:%6; }")
+ .arg(colors::BG_SURFACE(), colors::BORDER_DIM(), colors::TEXT_PRIMARY())
+ .arg(fonts::SMALL)
+ .arg(fonts::DATA_FAMILY(), colors::BORDER_BRIGHT()));
+ top_hl->addWidget(search_edit_, 2);
+
+ // Category filter
+ cat_combo_ = new QComboBox(top_bar);
+ cat_combo_->setFixedHeight(28);
+ cat_combo_->setFixedWidth(150);
+ cat_combo_->addItem("All Categories");
+ const QString combo_style =
+ QString("QComboBox { background:%1; color:%2; border:1px solid %3;"
+ " padding:2px 6px; font-size:%4px; font-family:%5; }"
+ "QComboBox::drop-down { border:none; }"
+ "QComboBox QAbstractItemView { background:%1; color:%2; border:1px solid %3;"
+ " selection-background-color:%6; font-family:%5; }")
+ .arg(colors::BG_SURFACE(), colors::TEXT_PRIMARY(), colors::BORDER_DIM())
+ .arg(fonts::TINY)
+ .arg(fonts::DATA_FAMILY(), colors::BG_HOVER());
+ cat_combo_->setStyleSheet(combo_style);
+ top_hl->addWidget(cat_combo_);
+
+ // Sort
+ auto* sort_lbl = new QLabel("SORT:", top_bar);
+ sort_lbl->setStyleSheet(QString("color:%1; font-size:%2px; font-weight:700; font-family:%3;"
+ " background:transparent; border:none;")
+ .arg(colors::TEXT_TERTIARY())
+ .arg(fonts::TINY)
+ .arg(fonts::DATA_FAMILY()));
+ top_hl->addWidget(sort_lbl);
+
+ sort_combo_ = new QComboBox(top_bar);
+ sort_combo_->setFixedHeight(28);
+ sort_combo_->setFixedWidth(120);
+ sort_combo_->addItems({"Name A→Z", "Name Z→A", "Category"});
+ sort_combo_->setStyleSheet(combo_style);
+ top_hl->addWidget(sort_combo_);
count_label_ = new QLabel("0 strategies", top_bar);
- count_label_->setStyleSheet(QString("color: %1; font-size: %2px; font-weight: 700; %3"
- " background: transparent; border: none;")
- .arg(fincept::ui::colors::TEXT_SECONDARY)
- .arg(fincept::ui::fonts::TINY)
- .arg(kMonoFont()));
+ count_label_->setStyleSheet(QString("color:%1; font-size:%2px; font-weight:700; font-family:%3;"
+ " background:transparent; border:none;")
+ .arg(colors::TEXT_SECONDARY())
+ .arg(fonts::TINY)
+ .arg(fonts::DATA_FAMILY()));
top_hl->addWidget(count_label_);
root->addWidget(top_bar);
- // Scroll area for cards
- auto* scroll = new QScrollArea(this);
- scroll->setWidgetResizable(true);
- scroll->setFrameShape(QFrame::NoFrame);
- scroll->setStyleSheet(QString("QScrollArea { background: %1; border: none; }"
- "QScrollBar:vertical { background: %1; width: 6px; }"
- "QScrollBar::handle:vertical { background: %2; }"
- "QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical { height: 0; }")
- .arg(fincept::ui::colors::BG_BASE, fincept::ui::colors::BORDER_MED));
-
- auto* list_widget = new QWidget(this);
- list_widget->setStyleSheet(QString("background: %1;").arg(fincept::ui::colors::BG_BASE));
- list_layout_ = new QVBoxLayout(list_widget);
- list_layout_->setContentsMargins(16, 12, 16, 12);
- list_layout_->setSpacing(8);
- list_layout_->addStretch();
-
- scroll->setWidget(list_widget);
- root->addWidget(scroll, 1);
-
- // Filter strategies when search text changes
- connect(search_edit_, &QLineEdit::textChanged, this, [this](const QString& text) {
- QString filter = text.trimmed().toLower();
- for (int i = 0; i < list_layout_->count(); ++i) {
- auto* item = list_layout_->itemAt(i);
- auto* w = item ? item->widget() : nullptr;
- if (!w)
- continue;
- if (filter.isEmpty()) {
- w->setVisible(true);
- } else {
- QString card_name = w->property("strategy_name").toString().toLower();
- w->setVisible(card_name.contains(filter));
- }
- }
- });
+ // ── Table ────────────────────────────────────────────────────────────────
+ table_ = new QTableWidget(this);
+ table_->setColumnCount(4); // #, NAME, CATEGORY, ID
+ table_->setHorizontalHeaderLabels({"#", "STRATEGY NAME", "CATEGORY", "ID"});
+ table_->verticalHeader()->setVisible(false);
+ table_->setSelectionBehavior(QAbstractItemView::SelectRows);
+ table_->setSelectionMode(QAbstractItemView::SingleSelection);
+ table_->setEditTriggers(QAbstractItemView::NoEditTriggers);
+ table_->setAlternatingRowColors(true);
+ table_->setSortingEnabled(false); // we sort ourselves
+ table_->setShowGrid(false);
+ table_->setFocusPolicy(Qt::NoFocus);
+ table_->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Fixed);
+ table_->horizontalHeader()->setSectionResizeMode(1, QHeaderView::Stretch);
+ table_->horizontalHeader()->setSectionResizeMode(2, QHeaderView::Fixed);
+ table_->horizontalHeader()->setSectionResizeMode(3, QHeaderView::Fixed);
+ table_->setColumnWidth(0, 40);
+ table_->setColumnWidth(2, 180);
+ table_->setColumnWidth(3, 120);
+ table_->verticalHeader()->setDefaultSectionSize(26);
+ table_->setStyleSheet(
+ QString("QTableWidget { background:%1; alternate-background-color:%2;"
+ " color:%3; border:none; font-size:%4px; font-family:%5; gridline-color:%6; }"
+ "QTableWidget::item { padding:2px 8px; border:none; }"
+ "QTableWidget::item:selected { background:%7; color:%3; }"
+ "QHeaderView::section { background:%8; color:%9; font-size:%4px;"
+ " font-weight:700; font-family:%5; border:none;"
+ " border-bottom:1px solid %6; padding:4px 8px; }")
+ .arg(colors::BG_BASE(), colors::BG_SURFACE(), colors::TEXT_PRIMARY())
+ .arg(fonts::SMALL)
+ .arg(fonts::DATA_FAMILY(), colors::BORDER_DIM(), colors::BG_HOVER(),
+ colors::BG_RAISED(), colors::TEXT_TERTIARY()));
+ root->addWidget(table_, 1);
+
+ // ── Pagination bar ───────────────────────────────────────────────────────
+ auto* page_bar = new QWidget(this);
+ page_bar->setFixedHeight(36);
+ page_bar->setStyleSheet(QString("background:%1; border-top:1px solid %2;")
+ .arg(colors::BG_RAISED(), colors::BORDER_DIM()));
+ auto* page_hl = new QHBoxLayout(page_bar);
+ page_hl->setContentsMargins(12, 0, 12, 0);
+ page_hl->setSpacing(8);
+
+ const QString btn_style =
+ QString("QPushButton { background:%1; color:%2; border:1px solid %3;"
+ " font-size:%4px; font-family:%5; padding:2px 12px; }"
+ "QPushButton:hover { border-color:%6; color:%6; }"
+ "QPushButton:disabled { color:%3; border-color:%3; }")
+ .arg(colors::BG_SURFACE(), colors::TEXT_PRIMARY(), colors::BORDER_DIM())
+ .arg(fonts::TINY)
+ .arg(fonts::DATA_FAMILY(), colors::CYAN());
+
+ prev_btn_ = new QPushButton("◀ PREV", page_bar);
+ prev_btn_->setFixedHeight(24);
+ prev_btn_->setCursor(Qt::PointingHandCursor);
+ prev_btn_->setStyleSheet(btn_style);
+ page_hl->addWidget(prev_btn_);
+
+ page_label_ = new QLabel("Page 1 of 1", page_bar);
+ page_label_->setStyleSheet(QString("color:%1; font-size:%2px; font-weight:700; font-family:%3;"
+ " background:transparent; border:none;")
+ .arg(colors::TEXT_SECONDARY())
+ .arg(fonts::TINY)
+ .arg(fonts::DATA_FAMILY()));
+ page_label_->setAlignment(Qt::AlignCenter);
+ page_hl->addWidget(page_label_, 1);
+
+ next_btn_ = new QPushButton("NEXT ▶", page_bar);
+ next_btn_->setFixedHeight(24);
+ next_btn_->setCursor(Qt::PointingHandCursor);
+ next_btn_->setStyleSheet(btn_style);
+ page_hl->addWidget(next_btn_);
+
+ root->addWidget(page_bar);
+
+ // ── Connections ──────────────────────────────────────────────────────────
+ connect(search_edit_, &QLineEdit::textChanged, this, &StrategyListPanel::on_filter_changed);
+ connect(cat_combo_, QOverload<int>::of(&QComboBox::currentIndexChanged),
+ this, [this](int) { on_filter_changed(search_edit_->text()); });
+ connect(sort_combo_, QOverload<int>::of(&QComboBox::currentIndexChanged),
+ this, &StrategyListPanel::on_sort_changed);
+ connect(prev_btn_, &QPushButton::clicked, this, [this]() { go_to_page(current_page_ - 1); });
+ connect(next_btn_, &QPushButton::clicked, this, [this]() { go_to_page(current_page_ + 1); });
}
-// ── Slots ───────────────────────────────────────────────────────────────────
+// ── Render page ──────────────────────────────────────────────────────────────
-void StrategyListPanel::on_strategies_loaded(QVector<AlgoStrategy> strategies) {
- // Clear existing cards (keep the stretch at end)
- while (list_layout_->count() > 0) {
- auto* item = list_layout_->takeAt(0);
- if (item->widget())
- item->widget()->deleteLater();
- delete item;
- }
+void StrategyListPanel::render_page() {
+ using namespace fincept::ui;
+
+ table_->setSortingEnabled(false);
+ table_->setRowCount(0);
+
+ const int total = filtered_.size();
+ const int start = current_page_ * kPageSize;
+ const int end = qMin(start + kPageSize, total);
+ const int page_num = total > 0 ? current_page_ + 1 : 0;
+ const int total_pages = (total + kPageSize - 1) / qMax(kPageSize, 1);
+
+ table_->setRowCount(end - start);
+
+ for (int i = start; i < end; ++i) {
+ const auto& s = filtered_[i];
+ const int row = i - start;
+
+ // Col 0: row number
+ auto* num_item = new QTableWidgetItem(QString::number(i + 1));
+ num_item->setTextAlignment(Qt::AlignCenter);
+ num_item->setForeground(QColor(colors::TEXT_TERTIARY()));
+ table_->setItem(row, 0, num_item);
- for (const auto& s : strategies) {
- auto* card = build_strategy_card(s, nullptr);
- card->setProperty("strategy_name", s.name);
- list_layout_->addWidget(card);
+ // Col 1: name
+ auto* name_item = new QTableWidgetItem(s.name);
+ name_item->setForeground(QColor(colors::AMBER()));
+ table_->setItem(row, 1, name_item);
+
+ // Col 2: category (description field)
+ auto* cat_item = new QTableWidgetItem(s.description);
+ cat_item->setForeground(QColor(colors::CYAN()));
+ cat_item->setTextAlignment(Qt::AlignCenter);
+ table_->setItem(row, 2, cat_item);
+
+ // Col 3: ID
+ auto* id_item = new QTableWidgetItem(s.id);
+ id_item->setForeground(QColor(colors::TEXT_TERTIARY()));
+ table_->setItem(row, 3, id_item);
}
- list_layout_->addStretch();
+
+ update_pagination_controls();
+
+ page_label_->setText(total > 0
+ ? QString("Page %1 of %2 · %3 strategies").arg(page_num).arg(total_pages).arg(total)
+ : "No strategies");
count_label_->setText(
- QString("%1 %2").arg(strategies.size()).arg(strategies.size() == 1 ? "strategy" : "strategies"));
+ QString("%1 of %2").arg(total).arg(strategies_.size()));
+}
+
+void StrategyListPanel::update_pagination_controls() {
+ const int total_pages = (filtered_.size() + kPageSize - 1) / qMax(kPageSize, 1);
+ prev_btn_->setEnabled(current_page_ > 0);
+ next_btn_->setEnabled(current_page_ < total_pages - 1);
+}
+
+void StrategyListPanel::go_to_page(int page) {
+ const int total_pages = (filtered_.size() + kPageSize - 1) / qMax(kPageSize, 1);
+ current_page_ = qBound(0, page, qMax(0, total_pages - 1));
+ render_page();
+}
+
+// ── Filter + sort ─────────────────────────────────────────────────────────────
+
+void StrategyListPanel::on_filter_changed(const QString&) {
+ const QString text = search_edit_->text().trimmed().toLower();
+ const QString cat = cat_combo_->currentIndex() == 0
+ ? QString()
+ : cat_combo_->currentText();
+
+ filtered_.clear();
+ filtered_.reserve(strategies_.size());
+ for (const auto& s : strategies_) {
+ if (!text.isEmpty() && !s.name.toLower().contains(text) &&
+ !s.description.toLower().contains(text))
+ continue;
+ if (!cat.isEmpty() && s.description != cat)
+ continue;
+ filtered_.append(s);
+ }
+
+ current_page_ = 0;
+ render_page();
+}
+
+void StrategyListPanel::on_sort_changed(int index) {
+ if (index == 0) { // Name A→Z
+ std::sort(filtered_.begin(), filtered_.end(),
+ [](const AlgoStrategy& a, const AlgoStrategy& b) { return a.name < b.name; });
+ } else if (index == 1) { // Name Z→A
+ std::sort(filtered_.begin(), filtered_.end(),
+ [](const AlgoStrategy& a, const AlgoStrategy& b) { return a.name > b.name; });
+ } else if (index == 2) { // Category
+ std::sort(filtered_.begin(), filtered_.end(),
+ [](const AlgoStrategy& a, const AlgoStrategy& b) {
+ return a.description < b.description || (a.description == b.description && a.name < b.name);
+ });
+ }
+ current_page_ = 0;
+ render_page();
+}
+
+// ── Slots ─────────────────────────────────────────────────────────────────────
+
+void StrategyListPanel::on_strategies_loaded(QVector<AlgoStrategy> strategies) {
+ strategies_ = std::move(strategies);
+
+ // Populate category combo from unique categories
+ const QString prev_cat = cat_combo_->currentIndex() > 0 ? cat_combo_->currentText() : QString();
+ cat_combo_->blockSignals(true);
+ cat_combo_->clear();
+ cat_combo_->addItem("All Categories");
+ QStringList cats;
+ for (const auto& s : strategies_)
+ if (!cats.contains(s.description))
+ cats.append(s.description);
+ cats.sort();
+ for (const auto& c : cats)
+ cat_combo_->addItem(c);
+ if (!prev_cat.isEmpty()) {
+ int idx = cat_combo_->findText(prev_cat);
+ if (idx >= 0) cat_combo_->setCurrentIndex(idx);
+ }
+ cat_combo_->blockSignals(false);
+
+ // Reset filtered to full list, sort by name
+ filtered_ = strategies_;
+ std::sort(filtered_.begin(), filtered_.end(),
+ [](const AlgoStrategy& a, const AlgoStrategy& b) { return a.name < b.name; });
+ current_page_ = 0;
+ render_page();
- LOG_INFO("AlgoTrading", QString("Loaded %1 strategies").arg(strategies.size()));
+ LOG_INFO("AlgoTrading", QString("Loaded %1 strategies").arg(strategies_.size()));
}
void StrategyListPanel::on_error(const QString& context, const QString& msg) {
diff --git a/fincept-qt/src/screens/algo_trading/StrategyListPanel.h b/fincept-qt/src/screens/algo_trading/StrategyListPanel.h
index d1f8d80ac..550ee378a 100644
--- a/fincept-qt/src/screens/algo_trading/StrategyListPanel.h
+++ b/fincept-qt/src/screens/algo_trading/StrategyListPanel.h
@@ -2,14 +2,17 @@
#pragma once
#include "services/algo_trading/AlgoTradingTypes.h"
+#include <QComboBox>
#include <QLabel>
#include <QLineEdit>
+#include <QPushButton>
+#include <QTableWidget>
#include <QVBoxLayout>
#include <QWidget>
namespace fincept::screens {
-/// Strategy list — manage, deploy, delete saved strategies.
+/// Strategy list — compact table with pagination, loads from registry_index.json in <50ms.
class StrategyListPanel : public QWidget {
Q_OBJECT
public:
@@ -17,16 +20,31 @@ class StrategyListPanel : public QWidget {
private slots:
void on_strategies_loaded(QVector<fincept::services::algo::AlgoStrategy> strategies);
+ void on_sort_changed(int index);
void on_error(const QString& context, const QString& msg);
+ void on_filter_changed(const QString& text);
+ void go_to_page(int page);
private:
void build_ui();
void connect_service();
- QWidget* build_strategy_card(const fincept::services::algo::AlgoStrategy& s, QWidget* parent);
+ void render_page();
+ void update_pagination_controls();
- QLineEdit* search_edit_ = nullptr;
- QVBoxLayout* list_layout_ = nullptr;
- QLabel* count_label_ = nullptr;
+ static constexpr int kPageSize = 50;
+
+ QLineEdit* search_edit_ = nullptr;
+ QLabel* count_label_ = nullptr;
+ QComboBox* sort_combo_ = nullptr;
+ QComboBox* cat_combo_ = nullptr;
+ QTableWidget* table_ = nullptr;
+ QLabel* page_label_ = nullptr;
+ QPushButton* prev_btn_ = nullptr;
+ QPushButton* next_btn_ = nullptr;
+
+ QVector<fincept::services::algo::AlgoStrategy> strategies_; // full list
+ QVector<fincept::services::algo::AlgoStrategy> filtered_; // after search/sort
+ int current_page_ = 0; // 0-based
};
} // namespace fincept::screens
diff --git a/fincept-qt/src/screens/markets/MarketPanel.cpp b/fincept-qt/src/screens/markets/MarketPanel.cpp
index b99fe5a8b..3a3cc03b0 100644
--- a/fincept-qt/src/screens/markets/MarketPanel.cpp
+++ b/fincept-qt/src/screens/markets/MarketPanel.cpp
@@ -18,7 +18,7 @@ MarketPanel::MarketPanel(const MarketPanelConfig& config, QWidget* parent)
config_.column_order = default_market_columns();
setMinimumWidth(180);
setMinimumHeight(kHeaderH + kColHeaderH + kRowH * 4); // always room for at least 4 rows
- setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+ setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Ignored);
build_ui();
connect(&ui::ThemeManager::instance(), &ui::ThemeManager::theme_changed, this,
[this](const ui::ThemeTokens&) { refresh_theme(); });
@@ -83,9 +83,13 @@ void MarketPanel::build_ui() {
table_->verticalHeader()->setDefaultSectionSize(kRowH);
table_->horizontalHeader()->setFixedHeight(kColHeaderH);
table_->horizontalHeader()->setHighlightSections(false);
- table_->horizontalHeader()->setStretchLastSection(true);
+ table_->horizontalHeader()->setStretchLastSection(false);
table_->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
table_->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ // Prevent the table's content-based sizeHint from dominating splitter layout.
+ // Without this, QTableWidget returns a large sizeHint proportional to row count,
+ // causing the first panel in each column to grab disproportionate space.
+ table_->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Ignored);
setup_table_columns();
bl->addWidget(table_);
@@ -110,15 +114,20 @@ void MarketPanel::build_ui() {
void MarketPanel::setup_table_columns() {
const QStringList& cols = config_.column_order;
table_->setColumnCount(cols.size());
- table_->setHorizontalHeaderLabels(cols);
+ // Set header labels with alignment matching cell alignment
for (int i = 0; i < cols.size(); ++i) {
const QString& c = cols[i];
- if (c == "SYMBOL" || c == "NAME")
- table_->horizontalHeader()->setSectionResizeMode(i, QHeaderView::Stretch);
- else
- table_->horizontalHeader()->setSectionResizeMode(i, QHeaderView::ResizeToContents);
+ auto* hdr = new QTableWidgetItem(c);
+ bool is_text = (c == "SYMBOL" || c == "NAME");
+ hdr->setTextAlignment(is_text ? (Qt::AlignLeft | Qt::AlignVCenter)
+ : (Qt::AlignRight | Qt::AlignVCenter));
+ table_->setHorizontalHeaderItem(i, hdr);
}
+
+ // All columns stretch to fill available width evenly.
+ for (int i = 0; i < cols.size(); ++i)
+ table_->horizontalHeader()->setSectionResizeMode(i, QHeaderView::Stretch);
}
// ---------------------------------------------------------------------------
@@ -272,6 +281,18 @@ void MarketPanel::update_visible_rows() {
table_->setRowCount(qMax(visible, 0));
}
+// ---------------------------------------------------------------------------
+// Size hints — small uniform value so QSplitter distributes equal height
+// ---------------------------------------------------------------------------
+
+QSize MarketPanel::sizeHint() const {
+ return QSize(180, 138); // kHeaderH + kColHeaderH + kRowH*4
+}
+
+QSize MarketPanel::minimumSizeHint() const {
+ return QSize(180, 138);
+}
+
// ---------------------------------------------------------------------------
// Resize
// ---------------------------------------------------------------------------
diff --git a/fincept-qt/src/screens/markets/MarketPanel.h b/fincept-qt/src/screens/markets/MarketPanel.h
index 7c07a917d..a5fab3fcf 100644
--- a/fincept-qt/src/screens/markets/MarketPanel.h
+++ b/fincept-qt/src/screens/markets/MarketPanel.h
@@ -24,6 +24,9 @@ class MarketPanel : public QWidget {
const QString& panel_id() const { return config_.id; }
void update_config(const MarketPanelConfig& cfg);
+ QSize sizeHint() const override;
+ QSize minimumSizeHint() const override;
+
signals:
void refresh_finished();
void edit_requested(const QString& panel_id);
diff --git a/fincept-qt/src/screens/markets/MarketsScreen.cpp b/fincept-qt/src/screens/markets/MarketsScreen.cpp
index f5020814b..f3347661f 100644
--- a/fincept-qt/src/screens/markets/MarketsScreen.cpp
+++ b/fincept-qt/src/screens/markets/MarketsScreen.cpp
@@ -117,6 +117,20 @@ void MarketsScreen::build_splitter_layout() {
}
}
+ // Distribute equal height to every panel in each column so no single row
+ // grabs disproportionate space. (Restored saved state may override this.)
+ for (auto* vs : col_splitters_) {
+ const int n = vs->count();
+ if (n > 1) {
+ const int equal = 1000; // arbitrary equal weight
+ QList<int> sizes;
+ sizes.reserve(n);
+ for (int i = 0; i < n; ++i)
+ sizes.append(equal);
+ vs->setSizes(sizes);
+ }
+ }
+
refresh_theme();
}
@@ -157,11 +171,9 @@ int MarketsScreen::column_with_fewest_panels() const {
void MarketsScreen::save_splitter_state() {
if (!h_splitter_) return;
- QString state = QString::fromLatin1(h_splitter_->saveState().toBase64());
- for (int i = 0; i < col_splitters_.size(); ++i) {
- state += QString("|col%1:%2").arg(i).arg(
- QString::fromLatin1(col_splitters_[i]->saveState().toBase64()));
- }
+ // Save only horizontal splitter state (column widths).
+ // Vertical row heights are always equal-distributed on build.
+ const QString state = QString::fromLatin1(h_splitter_->saveState().toBase64());
SettingsRepository::instance().set("markets_splitter_state", state);
}
@@ -172,22 +184,14 @@ void MarketsScreen::restore_splitter_state() {
const QString saved = res.value();
int sep = saved.indexOf('|');
+ // Restore only the horizontal splitter (column widths).
+ // Vertical (row heights) are set to equal in build_splitter_layout()
+ // and must not be overridden by stale saved state.
if (sep < 0) {
h_splitter_->restoreState(QByteArray::fromBase64(saved.toLatin1()));
return;
}
h_splitter_->restoreState(QByteArray::fromBase64(saved.left(sep).toLatin1()));
- const QStringList parts = saved.mid(sep + 1).split('|');
- for (const QString& part : parts) {
- if (!part.startsWith("col")) continue;
- int colon = part.indexOf(':');
- if (colon < 0) continue;
- int idx = part.mid(3, colon - 3).toInt();
- if (idx >= 0 && idx < col_splitters_.size()) {
- col_splitters_[idx]->restoreState(
- QByteArray::fromBase64(part.mid(colon + 1).toLatin1()));
- }
- }
}
// ---------------------------------------------------------------------------
@@ -492,6 +496,25 @@ void MarketsScreen::update_clocks() {
void MarketsScreen::showEvent(QShowEvent* event) {
QWidget::showEvent(event);
+
+ // Distribute equal space now that geometry is valid.
+ // Horizontal: equal column widths.
+ if (h_splitter_ && h_splitter_->count() > 1) {
+ QList<int> hsizes;
+ for (int i = 0; i < h_splitter_->count(); ++i)
+ hsizes.append(1000);
+ h_splitter_->setSizes(hsizes);
+ }
+ // Vertical: equal panel heights within each column.
+ for (auto* vs : col_splitters_) {
+ if (vs->count() > 1) {
+ QList<int> vsizes;
+ for (int i = 0; i < vs->count(); ++i)
+ vsizes.append(1000);
+ vs->setSizes(vsizes);
+ }
+ }
+
if (auto_update_ && auto_refresh_timer_) auto_refresh_timer_->start();
if (session_timer_) session_timer_->start();
if (clock_timer_) clock_timer_->start();
diff --git a/fincept-qt/src/screens/news/NewsScreen.cpp b/fincept-qt/src/screens/news/NewsScreen.cpp
index 797d75814..363095577 100644
--- a/fincept-qt/src/screens/news/NewsScreen.cpp
+++ b/fincept-qt/src/screens/news/NewsScreen.cpp
@@ -221,15 +221,18 @@ void NewsScreen::connect_signals() {
auto& km = KeyConfigManager::instance();
auto* act_next = km.action(KeyAction::NewsNext);
- act_next->setParent(this);
+ act_next->setShortcutContext(Qt::WidgetWithChildrenShortcut);
+ addAction(act_next);
connect(act_next, &QAction::triggered, this, [this]() { feed_panel_->select_next(); });
auto* act_prev = km.action(KeyAction::NewsPrev);
- act_prev->setParent(this);
+ act_prev->setShortcutContext(Qt::WidgetWithChildrenShortcut);
+ addAction(act_prev);
connect(act_prev, &QAction::triggered, this, [this]() { feed_panel_->select_previous(); });
auto* act_open = km.action(KeyAction::NewsOpen);
- act_open->setParent(this);
+ act_open->setShortcutContext(Qt::WidgetWithChildrenShortcut);
+ addAction(act_open);
connect(act_open, &QAction::triggered, this, [this]() {
auto idx = feed_panel_->list_view()->currentIndex();
if (idx.isValid()) {
@@ -240,7 +243,8 @@ void NewsScreen::connect_signals() {
});
auto* act_close = km.action(KeyAction::NewsClose);
- act_close->setParent(this);
+ act_close->setShortcutContext(Qt::WidgetWithChildrenShortcut);
+ addAction(act_close);
connect(act_close, &QAction::triggered, this, [this]() {
if (detail_panel_->is_panel_open())
detail_panel_->close_panel();
diff --git a/fincept-qt/src/screens/setup/SetupScreen.cpp b/fincept-qt/src/screens/setup/SetupScreen.cpp
index 22d713fdf..1f5dfaa9d 100644
--- a/fincept-qt/src/screens/setup/SetupScreen.cpp
+++ b/fincept-qt/src/screens/setup/SetupScreen.cpp
@@ -3,7 +3,6 @@
#include "core/logging/Logger.h"
#include "python/PythonSetupManager.h"
-#include "services/stt/WhisperService.h"
#include "ui/theme/Theme.h"
#include <QHBoxLayout>
@@ -33,11 +32,6 @@ SetupScreen::SetupScreen(QWidget* parent) : QWidget(parent) {
connect(&python::PythonSetupManager::instance(), &python::PythonSetupManager::setup_complete, this,
&SetupScreen::on_setup_done);
- auto& ws = services::WhisperService::instance();
- connect(&ws, &services::WhisperService::model_download_progress, this, &SetupScreen::on_whisper_progress);
- connect(&ws, &services::WhisperService::model_ready, this, &SetupScreen::on_whisper_ready);
- connect(&ws, &services::WhisperService::error_occurred, this, &SetupScreen::on_whisper_error);
-
// 15-minute overall timeout — shows skip button if setup is stuck
timeout_timer_ = new QTimer(this);
timeout_timer_->setSingleShot(true);
@@ -104,8 +98,6 @@ void SetupScreen::build_ui() {
"Backtesting, portfolio optimization and legacy quant tools"));
cl->addWidget(build_step_row("packages-numpy2", "Install Analytics Libraries",
"Machine learning, data science and AI agent frameworks"));
- cl->addWidget(build_step_row("whisper", "Download Voice Assistant",
- "Offline voice recognition model for speech commands (~57 MB)"));
cl->addSpacing(16);
@@ -150,19 +142,6 @@ void SetupScreen::build_ui() {
connect(skip_btn_, &QPushButton::clicked, this, &SetupScreen::on_skip_clicked);
cl->addWidget(skip_btn_);
- // Retry voice model button
- retry_whisper_btn_ = new QPushButton("RETRY VOICE MODEL DOWNLOAD", center);
- retry_whisper_btn_->setFixedHeight(36);
- retry_whisper_btn_->setCursor(Qt::PointingHandCursor);
- retry_whisper_btn_->setVisible(false);
- retry_whisper_btn_->setStyleSheet(
- QString("QPushButton { background:transparent; color:%1; border:1px solid %1;"
- " font-family:%2; font-size:12px; font-weight:600; letter-spacing:1px; border-radius:3px; }"
- "QPushButton:hover { background:%3; }")
- .arg(kAccent, fonts::DATA_FAMILY, colors::BG_RAISED));
- connect(retry_whisper_btn_, &QPushButton::clicked, this, &SetupScreen::on_retry_whisper);
- cl->addWidget(retry_whisper_btn_);
-
// Install dir — small, dim, for power users
auto* dir_label = new QLabel("Installing to: " + python::PythonSetupManager::instance().install_dir(), center);
dir_label->setAlignment(Qt::AlignCenter);
@@ -343,12 +322,14 @@ void SetupScreen::on_progress(const python::SetupProgress& progress) {
void SetupScreen::on_setup_done(bool success, const QString& error) {
if (success) {
- LOG_INFO("SetupScreen", "Python setup completed — starting voice model download");
- status_label_->setText("Downloading the offline voice assistant model...");
+ LOG_INFO("SetupScreen", "Python setup completed — all steps done");
+ status_label_->setText("Everything is ready! Launching Fincept Terminal...");
status_label_->setStyleSheet(
- QString("color:%1; font-family:%2; font-size:10px; margin-top:6px;").arg(kAccent, fonts::DATA_FAMILY));
- mark_step_active("whisper");
- services::WhisperService::instance().download_for_setup();
+ QString("color:%1; font-family:%2; font-size:10px; margin-top:6px;").arg(colors::GREEN, fonts::DATA_FAMILY));
+ begin_btn_->setText("LAUNCH");
+ if (timeout_timer_)
+ timeout_timer_->stop();
+ QTimer::singleShot(1500, this, [this]() { emit setup_complete(); });
} else {
// Stop all running pulses
for (auto [k, s] : steps_.asKeyValueRange())
@@ -363,56 +344,6 @@ void SetupScreen::on_setup_done(bool success, const QString& error) {
}
}
-void SetupScreen::on_whisper_progress(int percent) {
- if (!steps_.contains("whisper"))
- return;
- auto& s = steps_["whisper"];
- // Whisper gives real % from QNetworkReply — stop pulse and use real value
- stop_pulse("whisper");
- s.bar->setValue(percent);
- s.status->setText(QString("%1%").arg(percent));
- s.status->setStyleSheet(QString("color:%1; font-family:%2; font-size:9px;").arg(kAccent, fonts::DATA_FAMILY));
- status_label_->setText(QString("Downloading voice assistant model... %1%").arg(percent));
-}
-
-void SetupScreen::on_whisper_ready() {
- mark_step_done("whisper");
- status_label_->setText("Everything is ready! Launching Fincept Terminal...");
- status_label_->setStyleSheet(
- QString("color:%1; font-family:%2; font-size:10px; margin-top:6px;").arg(colors::GREEN, fonts::DATA_FAMILY));
- begin_btn_->setText("LAUNCH");
-
- LOG_INFO("SetupScreen", "Whisper model ready — setup fully complete");
- if (timeout_timer_)
- timeout_timer_->stop();
- QTimer::singleShot(1500, this, [this]() { emit setup_complete(); });
-}
-
-void SetupScreen::on_whisper_error(const QString& message) {
- stop_pulse("whisper");
- if (steps_.contains("whisper")) {
- auto& s = steps_["whisper"];
- s.bar->setValue(s.pulse_val > 0 ? s.pulse_val : 0);
- s.status->setText("SKIPPED");
- s.status->setStyleSheet(
- QString("color:%1; font-family:%2; font-size:9px;").arg(colors::TEXT_TERTIARY, fonts::DATA_FAMILY));
- }
- LOG_WARN("SetupScreen", "Whisper model download failed: " + message);
- whisper_failed_ = true;
- status_label_->setText("Voice assistant couldn't be downloaded — voice commands won't be available.\n"
- "All other features work normally. You can retry or continue without it.");
- status_label_->setStyleSheet(QString("color:%1; font-family:%2; font-size:10px; margin-top:6px;")
- .arg(colors::TEXT_TERTIARY, fonts::DATA_FAMILY));
- begin_btn_->setText("SETUP COMPLETE");
-
- if (retry_whisper_btn_)
- retry_whisper_btn_->setVisible(true);
- if (skip_btn_) {
- skip_btn_->setVisible(true);
- skip_btn_->setText("CONTINUE WITHOUT VOICE COMMANDS");
- }
-}
-
void SetupScreen::on_skip_clicked() {
LOG_INFO("SetupScreen", "User skipped setup — launching app");
if (timeout_timer_)
@@ -432,20 +363,6 @@ void SetupScreen::on_setup_timeout() {
skip_btn_->setVisible(true);
}
-void SetupScreen::on_retry_whisper() {
- whisper_failed_ = false;
- if (retry_whisper_btn_)
- retry_whisper_btn_->setVisible(false);
- if (skip_btn_)
- skip_btn_->setVisible(false);
- mark_step_active("whisper");
- status_label_->setText("Retrying voice assistant model download...");
- status_label_->setStyleSheet(
- QString("color:%1; font-family:%2; font-size:10px; margin-top:6px;").arg(kAccent, fonts::DATA_FAMILY));
- LOG_INFO("SetupScreen", "User requested Whisper retry");
- services::WhisperService::instance().download_for_setup();
-}
-
void SetupScreen::mark_step_done(const QString& key) {
if (!steps_.contains(key))
return;
@@ -458,7 +375,6 @@ void SetupScreen::mark_step_done(const QString& key) {
void SetupScreen::prefill_completed_steps() {
const auto status = python::PythonSetupManager::instance().check_status();
- const bool whisper = services::WhisperService::is_model_downloaded();
if (status.uv_installed)
mark_step_done("uv");
@@ -470,13 +386,11 @@ void SetupScreen::prefill_completed_steps() {
mark_step_done("packages-numpy1");
if (status.venv_numpy2_ready)
mark_step_done("packages-numpy2");
- if (whisper)
- mark_step_done("whisper");
const bool any_done = status.uv_installed || status.python_installed || status.venv_numpy1_ready ||
- status.venv_numpy2_ready || whisper;
+ status.venv_numpy2_ready;
const bool all_done = status.uv_installed && status.python_installed && status.venv_numpy1_ready &&
- status.venv_numpy2_ready && whisper;
+ status.venv_numpy2_ready;
summary_lbl_->setText({});
diff --git a/fincept-qt/src/screens/setup/SetupScreen.h b/fincept-qt/src/screens/setup/SetupScreen.h
index ac1646ea8..b3687f9cf 100644
--- a/fincept-qt/src/screens/setup/SetupScreen.h
+++ b/fincept-qt/src/screens/setup/SetupScreen.h
@@ -28,12 +28,8 @@ class SetupScreen : public QWidget {
void on_begin_setup();
void on_progress(const fincept::python::SetupProgress& progress);
void on_setup_done(bool success, const QString& error);
- void on_whisper_progress(int percent);
- void on_whisper_ready();
- void on_whisper_error(const QString& message);
void on_skip_clicked(); // user-initiated skip
void on_setup_timeout(); // overall 15-min timeout fired
- void on_retry_whisper(); // retry voice model after failure
private:
void build_ui();
@@ -46,12 +42,10 @@ class SetupScreen : public QWidget {
QPushButton* begin_btn_ = nullptr;
QPushButton* skip_btn_ = nullptr;
- QPushButton* retry_whisper_btn_ = nullptr;
QLabel* status_label_ = nullptr;
QLabel* subtitle_lbl_ = nullptr;
QLabel* summary_lbl_ = nullptr;
QTimer* timeout_timer_ = nullptr; // 15-min overall timeout
- bool whisper_failed_ = false;
// Step progress bars (keyed by step name)
struct StepUI {
diff --git a/fincept-qt/src/services/ai_quant_lab/AIQuantLabService.cpp b/fincept-qt/src/services/ai_quant_lab/AIQuantLabService.cpp
index b4dc13c62..e93b61325 100644
--- a/fincept-qt/src/services/ai_quant_lab/AIQuantLabService.cpp
+++ b/fincept-qt/src/services/ai_quant_lab/AIQuantLabService.cpp
@@ -307,11 +307,38 @@ void AIQuantLabService::rolling_create_schedule(const QJsonObject& params) {
run_module("rolling_retraining", "create", params);
}
void AIQuantLabService::rolling_execute_retrain(const QJsonObject& params) {
- run_module("rolling_retraining", "retrain", params);
+ // Retrain emits multiple JSON lines (streaming progress events).
+ // We parse each line individually and emit result_ready per event.
+ auto json = QJsonDocument(params).toJson(QJsonDocument::Compact);
+ QPointer<AIQuantLabService> self = this;
+ python::PythonRunner::instance().run(
+ "ai_quant_lab/qlib_rolling_retraining.py", {"retrain", json},
+ [self](python::PythonResult result) {
+ if (!self) return;
+ if (!result.success && result.output.isEmpty()) {
+ emit self->error_occurred("rolling_retraining", result.error);
+ return;
+ }
+ // Parse each JSON line and emit separately
+ const auto lines = result.output.split('\n', Qt::SkipEmptyParts);
+ for (const auto& line : lines) {
+ const auto trimmed = line.trimmed();
+ if (!trimmed.startsWith('{')) continue;
+ auto doc = QJsonDocument::fromJson(trimmed.toUtf8());
+ if (doc.isNull()) continue;
+ emit self->result_ready("rolling_retraining", "retrain", doc.object());
+ }
+ });
}
void AIQuantLabService::rolling_list_schedules() {
run_python_cached("ai_quant_lab/qlib_rolling_retraining.py", {"list"}, "rolling_retraining", "list", kListTtlSec);
}
+void AIQuantLabService::rolling_preview_tasks(const QJsonObject& params) {
+ run_module("rolling_retraining", "preview", params);
+}
+void AIQuantLabService::rolling_delete_schedule(const QJsonObject& params) {
+ run_module("rolling_retraining", "delete", params);
+}
// ── Deep Agent (LangGraph multi-agent) ───────────────────────────────────────
void AIQuantLabService::run_deep_agent(const QJsonObject& params) {
diff --git a/fincept-qt/src/services/ai_quant_lab/AIQuantLabService.h b/fincept-qt/src/services/ai_quant_lab/AIQuantLabService.h
index 7eb925b12..8dc02bd31 100644
--- a/fincept-qt/src/services/ai_quant_lab/AIQuantLabService.h
+++ b/fincept-qt/src/services/ai_quant_lab/AIQuantLabService.h
@@ -113,6 +113,8 @@ class AIQuantLabService : public QObject {
void rolling_create_schedule(const QJsonObject& params);
void rolling_execute_retrain(const QJsonObject& params);
void rolling_list_schedules();
+ void rolling_preview_tasks(const QJsonObject& params);
+ void rolling_delete_schedule(const QJsonObject& params);
// ── Feature Engineering ─────────────────────────────────────────────────
void feature_compute(const QJsonObject& params);
diff --git a/fincept-qt/src/services/algo_trading/AlgoTradingService.cpp b/fincept-qt/src/services/algo_trading/AlgoTradingService.cpp
index f73bb73df..2edab182a 100644
--- a/fincept-qt/src/services/algo_trading/AlgoTradingService.cpp
+++ b/fincept-qt/src/services/algo_trading/AlgoTradingService.cpp
@@ -6,6 +6,7 @@
#include "python/PythonRunner.h"
#include "storage/cache/CacheManager.h"
+#include <QFile>
#include <QJsonDocument>
#include <QPointer>
#include <QUuid>
@@ -14,7 +15,7 @@ namespace fincept::services::algo {
static constexpr int kStrategiesTtlSec = 30;
static constexpr int kDeploymentsTtlSec = 30;
-static constexpr const char* kStrategiesCacheKey = "algo:strategies";
+static constexpr const char* kStrategiesCacheKey = "algo:strategies:registry";
static constexpr const char* kDeploymentsCacheKey = "algo:deployments";
// ── DB path helper ────────────────────────────────────────────────────────────
@@ -91,16 +92,23 @@ static QVector<AlgoStrategy> parse_strategies(const QJsonArray& arr) {
}
void AlgoTradingService::list_strategies() {
- const QVariant cached = fincept::CacheManager::instance().get(kStrategiesCacheKey);
- if (!cached.isNull()) {
- auto doc = QJsonDocument::fromJson(cached.toString().toUtf8());
+ // Fast path: read pre-generated registry_index.json directly — no Python spawn needed
+ const QString json_path =
+ python::PythonRunner::instance().scripts_dir() + "/strategies/registry_index.json";
+ QFile f(json_path);
+ if (f.open(QIODevice::ReadOnly)) {
+ auto doc = QJsonDocument::fromJson(f.readAll());
+ f.close();
if (!doc.isNull()) {
+ LOG_INFO("AlgoTrading", QString("Loaded registry from %1").arg(json_path));
emit strategies_loaded(parse_strategies(doc.object()["strategies"].toArray()));
return;
}
}
- run_python("algo_trading/backtest_engine.py", {"list_strategies", "--db", algo_db_path()}, "list_strategies",
+ // Fallback: run Python to regenerate the index
+ LOG_WARN("AlgoTrading", "registry_index.json missing — falling back to Python");
+ run_python("algo_trading/backtest_engine.py", {"list_registry"}, "list_strategies",
[this](bool ok, const QString& out) {
if (!ok) {
emit error_occurred("list_strategies", out);
@@ -108,10 +116,6 @@ void AlgoTradingService::list_strategies() {
}
auto doc = QJsonDocument::fromJson(python::extract_json(out).toUtf8());
auto obj = doc.object();
- fincept::CacheManager::instance().put(
- kStrategiesCacheKey,
- QVariant(QString::fromUtf8(QJsonDocument(obj).toJson(QJsonDocument::Compact))),
- kStrategiesTtlSec, "algo_trading");
emit strategies_loaded(parse_strategies(obj["strategies"].toArray()));
});
}
diff --git a/fincept-qt/src/services/algo_trading/AlgoTradingTypes.h b/fincept-qt/src/services/algo_trading/AlgoTradingTypes.h
index e99ccbc47..2cc0b1fc2 100644
--- a/fincept-qt/src/services/algo_trading/AlgoTradingTypes.h
+++ b/fincept-qt/src/services/algo_trading/AlgoTradingTypes.h
@@ -26,6 +26,7 @@ struct AlgoStrategy {
bool is_active = true;
QString created_at;
QString updated_at;
+ QJsonObject last_backtest; // in-memory only — populated when backtest runs, not persisted
};
// ── Deployment ──────────────────────────────────────────────────────────────
diff --git a/fincept-qt/src/services/stt/SpeechService.cpp b/fincept-qt/src/services/stt/SpeechService.cpp
new file mode 100644
index 000000000..5cf486c90
--- /dev/null
+++ b/fincept-qt/src/services/stt/SpeechService.cpp
@@ -0,0 +1,226 @@
+// SpeechService.cpp — Python-based speech-to-text via Google Speech Recognition.
+//
+// Process lifecycle:
+// start_listening() → spawn QProcess running speech_to_text.py
+// stdout JSON lines → parse_line() → emit transcription_ready / error_occurred
+// stop_listening() → kill QProcess
+//
+// The Python script handles mic capture, ambient noise calibration, and
+// Google API calls. This service just manages the process and parses output.
+
+#include "services/stt/SpeechService.h"
+
+#include "core/logging/Logger.h"
+#include "python/PythonRunner.h"
+#include "python/PythonSetupManager.h"
+
+#include <QFileInfo>
+#include <QJsonDocument>
+#include <QJsonObject>
+#include <QProcessEnvironment>
+
+namespace fincept::services {
+
+static constexpr auto TAG = "SpeechService";
+
+// ── Singleton ────────────────────────────────────────────────────────────────
+
+SpeechService& SpeechService::instance() {
+ static SpeechService s_instance;
+ return s_instance;
+}
+
+SpeechService::SpeechService(QObject* parent) : QObject(parent) {
+ LOG_INFO(TAG, "SpeechService initialised");
+}
+
+SpeechService::~SpeechService() {
+ kill_process();
+}
+
+// ── Public API ───────────────────────────────────────────────────────────────
+
+void SpeechService::start_listening() {
+ if (listening_.load(std::memory_order_relaxed))
+ return;
+ spawn_process();
+}
+
+void SpeechService::stop_listening() {
+ if (!listening_.load(std::memory_order_relaxed))
+ return;
+ kill_process();
+}
+
+bool SpeechService::is_listening() const noexcept {
+ return listening_.load(std::memory_order_relaxed);
+}
+
+// ── Process management ───────────────────────────────────────────────────────
+
+void SpeechService::spawn_process() {
+ if (process_) {
+ LOG_WARN(TAG, "Process already running — ignoring spawn request");
+ return;
+ }
+
+ // Resolve the Python executable from the numpy2 venv
+ QString python_exe = python::PythonSetupManager::instance().python_path("venv-numpy2");
+ if (python_exe.isEmpty() || !QFileInfo::exists(python_exe)) {
+ // Fallback to PythonRunner's resolved path
+ python_exe = python::PythonRunner::instance().python_path();
+ }
+ if (python_exe.isEmpty()) {
+ const QString msg = QStringLiteral("Python not available — cannot start voice input");
+ LOG_ERROR(TAG, msg);
+ emit error_occurred(msg);
+ return;
+ }
+
+ // Resolve script path
+ const QString scripts_dir = python::PythonRunner::instance().scripts_dir();
+ const QString script_path = scripts_dir + QStringLiteral("/voice/speech_to_text.py");
+ if (!QFileInfo::exists(script_path)) {
+ const QString msg = QStringLiteral("Voice script not found: ") + script_path;
+ LOG_ERROR(TAG, msg);
+ emit error_occurred(msg);
+ return;
+ }
+
+ process_ = new QProcess(this);
+
+ // Environment setup — match PythonRunner's env for consistency
+ QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
+ env.insert("PYTHONIOENCODING", "utf-8");
+ env.insert("PYTHONDONTWRITEBYTECODE", "1");
+ env.insert("PYTHONUNBUFFERED", "1");
+ env.insert("FINCEPT_DATA_DIR", python::PythonSetupManager::instance().install_dir());
+
+ QString existing_pypath = env.value("PYTHONPATH");
+ QString new_pypath = scripts_dir + (existing_pypath.isEmpty() ? "" : ";" + existing_pypath);
+ env.insert("PYTHONPATH", new_pypath);
+
+ process_->setProcessEnvironment(env);
+ process_->setWorkingDirectory(scripts_dir);
+
+#ifdef _WIN32
+ process_->setCreateProcessArgumentsModifier([](QProcess::CreateProcessArguments* cpa) {
+ cpa->flags |= 0x08000000; // CREATE_NO_WINDOW
+ });
+#endif
+
+ connect(process_, &QProcess::readyReadStandardOutput, this, &SpeechService::on_stdout_ready);
+ connect(process_, &QProcess::finished, this, &SpeechService::on_process_finished);
+ connect(process_, &QProcess::errorOccurred, this, [this](QProcess::ProcessError err) {
+ if (err == QProcess::FailedToStart) {
+ const QString msg = QStringLiteral("Failed to start voice recognition process");
+ LOG_ERROR(TAG, msg);
+ emit error_occurred(msg);
+ kill_process();
+ }
+ });
+
+ stdout_buffer_.clear();
+ process_->start(python_exe, {script_path});
+
+ listening_.store(true, std::memory_order_release);
+ LOG_INFO(TAG, "Voice recognition process started");
+ emit listening_changed(true);
+}
+
+void SpeechService::kill_process() {
+ if (!process_)
+ return;
+
+ // Disconnect signals before killing to avoid spurious callbacks
+ disconnect(process_, nullptr, this, nullptr);
+
+ if (process_->state() != QProcess::NotRunning) {
+ process_->kill();
+ process_->waitForFinished(2000);
+ }
+ process_->deleteLater();
+ process_ = nullptr;
+ stdout_buffer_.clear();
+
+ const bool was_listening = listening_.exchange(false, std::memory_order_acq_rel);
+ if (was_listening) {
+ LOG_INFO(TAG, "Voice recognition process stopped");
+ emit listening_changed(false);
+ }
+}
+
+// ── stdout parsing ───────────────────────────────────────────────────────────
+
+void SpeechService::on_stdout_ready() {
+ if (!process_)
+ return;
+
+ stdout_buffer_.append(process_->readAllStandardOutput());
+
+ // Process complete lines (JSON-lines protocol)
+ while (true) {
+ const int newline_pos = stdout_buffer_.indexOf('\n');
+ if (newline_pos < 0)
+ break;
+
+ const QByteArray line = stdout_buffer_.left(newline_pos).trimmed();
+ stdout_buffer_.remove(0, newline_pos + 1);
+
+ if (!line.isEmpty())
+ parse_line(line);
+ }
+}
+
+void SpeechService::parse_line(const QByteArray& line) {
+ QJsonParseError parse_err;
+ const QJsonDocument doc = QJsonDocument::fromJson(line, &parse_err);
+ if (parse_err.error != QJsonParseError::NoError) {
+ LOG_WARN(TAG, QString("Non-JSON stdout line: %1").arg(QString::fromUtf8(line)));
+ return;
+ }
+
+ const QJsonObject obj = doc.object();
+
+ if (obj.contains("text")) {
+ const QString text = obj["text"].toString().trimmed();
+ if (!text.isEmpty()) {
+ LOG_DEBUG(TAG, QString("Transcript: \"%1\"").arg(text));
+ emit transcription_ready(text);
+ }
+ } else if (obj.contains("error")) {
+ const QString msg = obj["error"].toString();
+ LOG_WARN(TAG, QString("STT error: %1").arg(msg));
+ emit error_occurred(msg);
+ } else if (obj.contains("fatal")) {
+ const QString msg = obj["fatal"].toString();
+ LOG_ERROR(TAG, QString("STT fatal: %1").arg(msg));
+ emit error_occurred(msg);
+ kill_process();
+ } else if (obj.contains("status")) {
+ const QString status = obj["status"].toString();
+ LOG_DEBUG(TAG, QString("STT status: %1").arg(status));
+ }
+}
+
+void SpeechService::on_process_finished(int exit_code, QProcess::ExitStatus status) {
+ LOG_INFO(TAG, QString("Voice process exited (code=%1, status=%2)")
+ .arg(exit_code)
+ .arg(status == QProcess::CrashExit ? "crash" : "normal"));
+
+ if (process_) {
+ process_->deleteLater();
+ process_ = nullptr;
+ }
+ stdout_buffer_.clear();
+
+ const bool was_listening = listening_.exchange(false, std::memory_order_acq_rel);
+ if (was_listening) {
+ emit listening_changed(false);
+ if (status == QProcess::CrashExit || exit_code != 0) {
+ emit error_occurred(QStringLiteral("Voice recognition stopped unexpectedly"));
+ }
+ }
+}
+
+} // namespace fincept::services
diff --git a/fincept-qt/src/services/stt/SpeechService.h b/fincept-qt/src/services/stt/SpeechService.h
new file mode 100644
index 000000000..62d66d7a7
--- /dev/null
+++ b/fincept-qt/src/services/stt/SpeechService.h
@@ -0,0 +1,62 @@
+#pragma once
+// SpeechService.h — Speech-to-text via Python speech_recognition + Google API.
+//
+// Architecture:
+// • start_listening() spawns scripts/voice/speech_to_text.py as a QProcess
+// • Python script captures mic audio, sends to Google STT
+// • Results stream back as JSON lines on stdout
+// • stop_listening() kills the process
+//
+// Complies with P1 (never block UI), P6 (service layer), P15 (thread safety).
+// Uses its own QProcess (not PythonRunner) because PythonRunner is designed
+// for short-lived scripts with a single callback — this is a long-running
+// streaming process, same pattern as ExchangeService's WebSocket process.
+
+#include <QObject>
+#include <QProcess>
+#include <QString>
+
+#include <atomic>
+
+namespace fincept::services {
+
+class SpeechService : public QObject {
+ Q_OBJECT
+
+ public:
+ static SpeechService& instance();
+
+ SpeechService(const SpeechService&) = delete;
+ SpeechService& operator=(const SpeechService&) = delete;
+
+ void start_listening();
+ void stop_listening();
+
+ [[nodiscard]] bool is_listening() const noexcept;
+
+ signals:
+ /// Fired on the UI thread with the transcribed text.
+ void transcription_ready(const QString& text);
+
+ /// Fired when listening state changes — UI can update mic button.
+ void listening_changed(bool active);
+
+ /// Fired on recoverable or fatal errors.
+ void error_occurred(const QString& message);
+
+ private:
+ explicit SpeechService(QObject* parent = nullptr);
+ ~SpeechService() override;
+
+ void spawn_process();
+ void kill_process();
+ void on_stdout_ready();
+ void on_process_finished(int exit_code, QProcess::ExitStatus status);
+ void parse_line(const QByteArray& line);
+
+ QProcess* process_ = nullptr;
+ QByteArray stdout_buffer_;
+ std::atomic<bool> listening_{false};
+};
+
+} // namespace fincept::services
diff --git a/fincept-qt/src/services/stt/WhisperService.cpp b/fincept-qt/src/services/stt/WhisperService.cpp
deleted file mode 100644
index 73e6306b9..000000000
--- a/fincept-qt/src/services/stt/WhisperService.cpp
+++ /dev/null
@@ -1,500 +0,0 @@
-// WhisperService.cpp — Offline speech-to-text via whisper.cpp
-//
-// Threading model:
-// Audio thread : QAudioSource callback → append_samples() → ring_mutex_ try-lock
-// UI thread : drain_timer_ fires → drain_and_infer() → QtConcurrent::run()
-// Worker thread : run_inference() → whisper_full() → invokeMethod back to UI
-//
-// All whisper_* calls happen exclusively on the worker thread.
-// All Qt widget / signal interactions happen exclusively on the UI thread.
-
-#include "services/stt/WhisperService.h"
-
-#include "core/logging/Logger.h"
-#include "python/PythonSetupManager.h"
-
-// whisper.cpp public C API
-#include "whisper.h"
-
-#include <QAudioFormat>
-#include <QAudioSource>
-#include <QDir>
-#include <QFile>
-#include <QMediaDevices>
-#include <QMutexLocker>
-#include <QNetworkReply>
-#include <QNetworkRequest>
-#include <QPointer>
-#include <QSaveFile>
-#include <QtConcurrent/QtConcurrent>
-
-#include <algorithm>
-#include <cmath>
-#include <numeric>
-
-namespace fincept::services {
-
-static constexpr auto TAG = "WhisperService";
-
-// ── Singleton ─────────────────────────────────────────────────────────────────
-
-WhisperService& WhisperService::instance() {
- static WhisperService s_instance;
- return s_instance;
-}
-
-WhisperService::WhisperService(QObject* parent) : QObject(parent) {
- ring_buffer_.reserve(kMaxWindowSamples);
- window_buffer_.reserve(kMaxWindowSamples);
-
- nam_ = new QNetworkAccessManager(this);
-
- drain_timer_ = new QTimer(this);
- drain_timer_->setInterval(kDrainIntervalMs);
- connect(drain_timer_, &QTimer::timeout, this, &WhisperService::drain_and_infer);
-
- retry_timer_ = new QTimer(this);
- retry_timer_->setSingleShot(true);
- connect(retry_timer_, &QTimer::timeout, this, &WhisperService::download_model);
-
- LOG_INFO(TAG, "WhisperService initialised");
-}
-
-WhisperService::~WhisperService() {
- stop_listening();
- if (ctx_) {
- whisper_free(ctx_);
- ctx_ = nullptr;
- }
-}
-
-// ── Public API ────────────────────────────────────────────────────────────────
-
-void WhisperService::start_listening() {
- if (listening_.load(std::memory_order_relaxed))
- return;
-
- if (!model_loaded_.load(std::memory_order_relaxed)) {
- ensure_model(); // async — will call start_listening() again via model_ready
- return;
- }
-
- open_audio_device();
-}
-
-void WhisperService::stop_listening() {
- if (!listening_.load(std::memory_order_relaxed))
- return;
- close_audio_device();
-}
-
-bool WhisperService::is_listening() const noexcept {
- return listening_.load(std::memory_order_relaxed);
-}
-
-bool WhisperService::is_model_ready() const noexcept {
- return model_loaded_.load(std::memory_order_relaxed);
-}
-
-QString WhisperService::model_path() const {
- // Co-locate with all other Fincept data under com.fincept.terminal/models/
- // to keep the install footprint in one place.
- const QString dir = python::PythonSetupManager::instance().install_dir() + QStringLiteral("/models");
- return dir + u'/' + kModelFilename;
-}
-
-// static
-bool WhisperService::is_model_downloaded() {
- return QFile::exists(instance().model_path());
-}
-
-void WhisperService::download_for_setup() {
- if (is_model_downloaded()) {
- // Already present — just report 100% so the setup step goes green.
- emit model_download_progress(100);
- emit model_ready();
- return;
- }
- download_attempt_ = 0;
- download_model();
-}
-
-// ── Model management ──────────────────────────────────────────────────────────
-
-void WhisperService::ensure_model() {
- if (model_loaded_.load(std::memory_order_relaxed))
- return;
-
- const QString path = model_path();
- if (QFile::exists(path)) {
- if (load_model()) {
- emit model_ready();
- start_listening();
- }
- return;
- }
-
- if (!download_active_.exchange(true, std::memory_order_acq_rel)) {
- LOG_INFO(TAG, QString("Model not found at %1 — downloading").arg(path));
- download_model();
- }
-}
-
-void WhisperService::download_model() {
- const QString dir = python::PythonSetupManager::instance().install_dir() + QStringLiteral("/models");
- QDir().mkpath(dir);
-
- QNetworkRequest req{QUrl{QString::fromUtf8(kModelUrl)}};
- req.setAttribute(QNetworkRequest::RedirectPolicyAttribute, QNetworkRequest::NoLessSafeRedirectPolicy);
-
- auto* reply = nam_->get(req);
-
- connect(reply, &QNetworkReply::downloadProgress, this, [this](qint64 received, qint64 total) {
- if (total > 0) {
- const int pct = static_cast<int>(received * 100 / total);
- emit model_download_progress(pct);
- }
- });
-
- connect(reply, &QNetworkReply::finished, this, [this, reply]() { on_download_finished(reply); });
-}
-
-void WhisperService::on_download_finished(QNetworkReply* reply) {
- reply->deleteLater();
- download_active_.store(false, std::memory_order_release);
-
- if (reply->error() != QNetworkReply::NoError) {
- const QString net_err = reply->errorString();
- ++download_attempt_;
- if (download_attempt_ <= kMaxDownloadRetries) {
- // Exponential backoff: 2s, 4s, 8s
- const int delay_ms = kRetryBaseMs * (1 << (download_attempt_ - 1));
- LOG_WARN(TAG, QString("Model download failed (attempt %1/%2): %3 — retrying in %4 ms")
- .arg(download_attempt_)
- .arg(kMaxDownloadRetries)
- .arg(net_err)
- .arg(delay_ms));
- emit model_download_progress(0); // reset progress bar
- retry_timer_->start(delay_ms);
- } else {
- const QString msg =
- QString("Model download failed after %1 attempts: %2").arg(kMaxDownloadRetries).arg(net_err);
- LOG_ERROR(TAG, msg);
- download_attempt_ = 0;
- download_active_.store(false, std::memory_order_release);
- emit error_occurred(msg);
- }
- return;
- }
-
- // Validate download size before writing — ggml-base.en-q5_0.bin is ~57 MB.
- // A truncated response (e.g. from a proxy cut-off) would load but produce
- // garbage transcripts or crash whisper_init_from_file_with_params().
- static constexpr qint64 kMinModelBytes = 50LL * 1024 * 1024; // 50 MB floor
- const QByteArray model_data = reply->readAll();
- if (model_data.size() < kMinModelBytes) {
- const QString msg = QString("Model download incomplete: received %1 bytes (expected ≥ %2 MB)")
- .arg(model_data.size())
- .arg(kMinModelBytes / (1024 * 1024));
- LOG_ERROR(TAG, msg);
- emit error_occurred(msg);
- return;
- }
-
- // Write atomically via QSaveFile — avoids a truncated file on crash.
- QSaveFile f{model_path()};
- if (!f.open(QIODevice::WriteOnly)) {
- const QString msg = QStringLiteral("Cannot write model to ") + model_path();
- LOG_ERROR(TAG, msg);
- emit error_occurred(msg);
- return;
- }
- f.write(model_data);
- if (!f.commit()) {
- LOG_ERROR(TAG, "QSaveFile::commit() failed for model");
- emit error_occurred(QStringLiteral("Failed to save model file"));
- return;
- }
-
- download_attempt_ = 0; // reset for any future re-download
- LOG_INFO(TAG, QString("Model downloaded and saved (%1 MB)").arg(model_data.size() / (1024 * 1024)));
- emit model_download_progress(100);
-
- if (load_model()) {
- emit model_ready();
- start_listening();
- }
-}
-
-bool WhisperService::load_model() {
- const QString path = model_path();
- LOG_INFO(TAG, QString("Loading whisper model: %1").arg(path));
-
- whisper_context_params cparams = whisper_context_default_params();
- cparams.use_gpu = false; // CPU-only — Vulkan opt-in left for future work
-
- ctx_ = whisper_init_from_file_with_params(path.toUtf8().constData(), cparams);
- if (!ctx_) {
- const QString msg = QStringLiteral("whisper_init_from_file_with_params() failed — ") +
- QStringLiteral("model file may be corrupt: ") + path;
- LOG_ERROR(TAG, msg);
- emit error_occurred(msg);
- return false;
- }
-
- model_loaded_.store(true, std::memory_order_release);
- LOG_INFO(TAG, "Whisper model loaded");
- return true;
-}
-
-// ── Audio capture ─────────────────────────────────────────────────────────────
-
-void WhisperService::open_audio_device() {
- QAudioFormat fmt;
- fmt.setSampleRate(kSampleRate);
- fmt.setChannelCount(1);
- fmt.setSampleFormat(QAudioFormat::Float);
-
- const QAudioDevice dev = QMediaDevices::defaultAudioInput();
- if (dev.isNull()) {
- const QString msg = QStringLiteral("No audio input device available");
- LOG_ERROR(TAG, msg);
- emit error_occurred(msg);
- return;
- }
-
- // If the device doesn't natively support Float, fall back to Int16.
- // We'll convert in the callback.
- if (!dev.isFormatSupported(fmt)) {
- fmt.setSampleFormat(QAudioFormat::Int16);
- if (!dev.isFormatSupported(fmt)) {
- const QString msg = QStringLiteral("Audio device does not support 16kHz mono");
- LOG_ERROR(TAG, msg);
- emit error_occurred(msg);
- return;
- }
- }
-
- audio_source_ = new QAudioSource(dev, fmt, this);
- audio_source_->setBufferSize(kSampleRate / 10 * sizeof(float)); // 100 ms buffer
-
- // Use the IO-device pull model (compatible with all Qt6 versions including
- // those without the callback-based start() overload added in Qt 6.7).
- QIODevice* io = audio_source_->start();
- if (!io) {
- const QString msg = QStringLiteral("Failed to open audio input device");
- LOG_ERROR(TAG, msg);
- emit error_occurred(msg);
- audio_source_->deleteLater();
- audio_source_ = nullptr;
- return;
- }
-
- // Read available audio every ~50 ms via a secondary timer.
- // This keeps the audio read off the critical path while being frequent enough
- // to avoid buffer overruns (audio_source_ buffer holds 100 ms).
- auto* read_timer = new QTimer(this);
- read_timer->setObjectName(QStringLiteral("whisper_read_timer"));
- read_timer->setInterval(50);
-
- const bool is_float = (fmt.sampleFormat() == QAudioFormat::Float);
- connect(read_timer, &QTimer::timeout, this, [this, io, is_float]() {
- if (!io || !audio_source_)
- return;
- const QByteArray data = io->readAll();
- if (data.isEmpty())
- return;
-
- if (is_float) {
- const auto* samples = reinterpret_cast<const float*>(data.constData());
- const qsizetype count = data.size() / static_cast<qsizetype>(sizeof(float));
- append_samples(samples, count);
- } else {
- // Int16 → Float32 conversion
- const auto* samples16 = reinterpret_cast<const qint16*>(data.constData());
- const qsizetype count = data.size() / static_cast<qsizetype>(sizeof(qint16));
- std::vector<float> converted(static_cast<std::size_t>(count));
- constexpr float kScale = 1.0f / 32768.0f;
- for (qsizetype i = 0; i < count; ++i)
- converted[static_cast<std::size_t>(i)] = samples16[i] * kScale;
- append_samples(converted.data(), count);
- }
- });
- read_timer->start();
-
- listening_.store(true, std::memory_order_release);
- drain_timer_->start();
-
- LOG_INFO(TAG, "Audio capture started");
- emit listening_changed(true);
-}
-
-void WhisperService::close_audio_device() {
- drain_timer_->stop();
-
- // Stop and destroy the read timer (child of this, found by object name).
- if (auto* t = findChild<QTimer*>(QStringLiteral("whisper_read_timer")))
- t->deleteLater();
-
- if (audio_source_) {
- audio_source_->stop();
- audio_source_->deleteLater();
- audio_source_ = nullptr;
- }
-
- // Clear buffers so the next session starts clean.
- {
- QMutexLocker lock{&ring_mutex_};
- ring_buffer_.clear();
- }
- window_buffer_.clear();
-
- listening_.store(false, std::memory_order_release);
- LOG_INFO(TAG, "Audio capture stopped");
- emit listening_changed(false);
-}
-
-// ── Ring buffer ───────────────────────────────────────────────────────────────
-
-void WhisperService::append_samples(const float* data, qsizetype frames) {
- // Best-effort lock — never block the timer callback.
- if (!ring_mutex_.tryLock())
- return;
- const std::size_t n = static_cast<std::size_t>(frames);
- // Clamp ring buffer to avoid unbounded growth if inference falls behind.
- if (ring_buffer_.size() + n > static_cast<std::size_t>(kMaxWindowSamples * 2))
- ring_buffer_.erase(ring_buffer_.begin(), ring_buffer_.begin() + static_cast<std::ptrdiff_t>(n));
- ring_buffer_.insert(ring_buffer_.end(), data, data + n);
- ring_mutex_.unlock();
-}
-
-std::vector<float> WhisperService::drain_samples() {
- QMutexLocker lock{&ring_mutex_};
- std::vector<float> out;
- out.swap(ring_buffer_);
- return out;
-}
-
-// ── VAD helper ────────────────────────────────────────────────────────────────
-// Returns true if the tail of the buffer contains speech above the RMS threshold.
-static bool has_speech(const std::vector<float>& buf, int tail_samples, float threshold) {
- if (buf.empty())
- return false;
- const auto n = static_cast<std::ptrdiff_t>(std::min(static_cast<std::size_t>(tail_samples), buf.size()));
- const float* begin = buf.data() + static_cast<std::ptrdiff_t>(buf.size()) - n;
- const float rms = std::sqrt(std::inner_product(begin, begin + n, begin, 0.0f) / static_cast<float>(n));
- return rms > threshold;
-}
-
-// ── Inference dispatch ────────────────────────────────────────────────────────
-
-void WhisperService::drain_and_infer() {
- if (!model_loaded_.load(std::memory_order_relaxed))
- return;
- if (inference_busy_.load(std::memory_order_relaxed))
- return;
-
- auto new_samples = drain_samples();
- if (new_samples.empty())
- return;
-
- // Append new audio to the sliding window.
- window_buffer_.insert(window_buffer_.end(), new_samples.begin(), new_samples.end());
-
- // Trim window to kMaxWindowSamples (keep most recent).
- if (window_buffer_.size() > static_cast<std::size_t>(kMaxWindowSamples)) {
- const std::size_t excess = window_buffer_.size() - static_cast<std::size_t>(kMaxWindowSamples);
- window_buffer_.erase(window_buffer_.begin(), window_buffer_.begin() + static_cast<std::ptrdiff_t>(excess));
- }
-
- // VAD gate — only infer if there is actual speech in the window tail.
- if (!has_speech(window_buffer_, kVadTailSamples, kVadThreshold))
- return;
-
- // Take a snapshot for the worker thread — do NOT pass pointers to members.
- std::vector<float> snapshot = window_buffer_;
-
- inference_busy_.store(true, std::memory_order_release);
-
- QPointer<WhisperService> self = this;
- QtConcurrent::run([self, snapshot = std::move(snapshot)]() mutable {
- if (!self)
- return;
- self->run_inference(std::move(snapshot));
- });
-}
-
-void WhisperService::run_inference(std::vector<float> samples) {
- // This method runs on a QtConcurrent worker thread.
- // MUST NOT access any QWidget or emit signals directly —
- // all UI interaction goes via QMetaObject::invokeMethod.
-
- whisper_full_params wparams = whisper_full_default_params(WHISPER_SAMPLING_GREEDY);
- wparams.n_threads = kInferenceThreads;
- wparams.single_segment = false;
- wparams.print_realtime = false;
- wparams.print_progress = false;
- wparams.print_timestamps = false;
- wparams.print_special = false;
- wparams.translate = false;
- wparams.language = "en";
- // Reduce audio context from 1500 (30 s) to 256 (~5 s) for lower latency.
- wparams.audio_ctx = 256;
- wparams.no_context = false; // keep prior context for continuity
-
- const int rc = whisper_full(ctx_, wparams, samples.data(), static_cast<int>(samples.size()));
-
- inference_busy_.store(false, std::memory_order_release);
-
- if (rc != 0) {
- LOG_WARN(TAG, QString("whisper_full() returned %1").arg(rc));
- return;
- }
-
- // Collect all segments into a single string.
- QString text;
- const int n_seg = whisper_full_n_segments(ctx_);
- for (int i = 0; i < n_seg; ++i) {
- const char* seg_text = whisper_full_get_segment_text(ctx_, i);
- if (seg_text)
- text += QString::fromUtf8(seg_text);
- }
-
- text = text.trimmed();
-
- // Strip whisper hallucination tokens (background noise artifacts).
- static const QStringList kHallucinationTokens{
- QStringLiteral("[BLANK_AUDIO]"),
- QStringLiteral("[ Silence ]"),
- QStringLiteral("(silence)"),
- QStringLiteral("[silence]"),
- QStringLiteral("(Music)"),
- QStringLiteral("[Music]"),
- QStringLiteral("[ Music ]"),
- QStringLiteral("(Applause)"),
- QStringLiteral("Thanks for watching!"),
- QStringLiteral("Thank you for watching."),
- };
- for (const QString& token : kHallucinationTokens) {
- if (text.contains(token, Qt::CaseInsensitive)) {
- text.clear();
- break;
- }
- }
-
- if (text.isEmpty())
- return;
-
- LOG_DEBUG(TAG, QString("Transcript: \"%1\"").arg(text));
-
- QPointer<WhisperService> self = this;
- QMetaObject::invokeMethod(
- self,
- [self, text]() {
- if (self)
- emit self->transcription_ready(text);
- },
- Qt::QueuedConnection);
-}
-
-} // namespace fincept::services
diff --git a/fincept-qt/src/services/stt/WhisperService.h b/fincept-qt/src/services/stt/WhisperService.h
deleted file mode 100644
index 2263948c0..000000000
--- a/fincept-qt/src/services/stt/WhisperService.h
+++ /dev/null
@@ -1,169 +0,0 @@
-#pragma once
-// WhisperService.h — Offline speech-to-text via whisper.cpp
-//
-// Architecture:
-// • QAudioSource (callback mode) → lock-free ring buffer (audio thread)
-// • QTimer drain → QtConcurrent::run whisper_full() (worker thread)
-// • QMetaObject::invokeMethod → emit transcription_ready (UI thread)
-//
-// Complies with P1 (never block UI thread), P6 (service layer), P8 (QPointer guards).
-//
-// Model lifecycle:
-// 1. SetupScreen calls download_for_setup() during first-run setup.
-// Progress is reported via model_download_progress(int %).
-// Model is stored at: com.fincept.terminal/models/ggml-base.en-q5_0.bin
-// 2. On first start_listening(), model is already present — loads immediately.
-// 3. If model is somehow absent (manual delete), it auto-downloads on mic press.
-
-#include <QAudioFormat>
-#include <QAudioSource>
-#include <QMediaDevices>
-#include <QMutex>
-#include <QNetworkAccessManager>
-#include <QNetworkReply>
-#include <QObject>
-#include <QPointer>
-#include <QString>
-#include <QTimer>
-
-#include <atomic>
-#include <vector>
-
-// Forward-declare whisper context to avoid pulling the full header into every TU
-// that includes WhisperService.h.
-struct whisper_context;
-
-namespace fincept::services {
-
-// ── WhisperService ────────────────────────────────────────────────────────────
-//
-// Singleton. Typical usage from AiChatBubble:
-//
-// auto& ws = WhisperService::instance();
-// connect(&ws, &WhisperService::transcription_ready,
-// this, &AiChatBubble::on_transcription);
-// connect(&ws, &WhisperService::model_download_progress,
-// this, [this](int pct){ show_progress(pct); });
-// connect(&ws, &WhisperService::model_ready,
-// this, [this]{ start_listening_ui(); });
-// ws.start_listening(); // triggers download if model absent
-//
-class WhisperService : public QObject {
- Q_OBJECT
-
- public:
- static WhisperService& instance();
-
- // Delete copy/move — singleton.
- WhisperService(const WhisperService&) = delete;
- WhisperService& operator=(const WhisperService&) = delete;
-
- // ── Public API ────────────────────────────────────────────────────────────
-
- /// Begin microphone capture. If the model isn't downloaded yet, starts the
- /// download first and emits model_ready() when safe to proceed.
- void start_listening();
-
- /// Stop microphone capture immediately. Any in-flight inference is
- /// discarded — its result will not be emitted.
- void stop_listening();
-
- [[nodiscard]] bool is_listening() const noexcept;
- [[nodiscard]] bool is_model_ready() const noexcept;
-
- /// True if the model file exists on disk (downloaded during setup or previously).
- [[nodiscard]] static bool is_model_downloaded();
-
- /// Called by SetupScreen during first-run setup to pre-download the model.
- /// Emits model_download_progress(0-100) and model_ready() on completion,
- /// or error_occurred() on failure. No-op if model is already present.
- void download_for_setup();
-
- /// Absolute path to the model file (may not exist yet).
- /// Located at: com.fincept.terminal/models/ggml-base.en-q5_0.bin
- [[nodiscard]] QString model_path() const;
-
- signals:
- /// Fired on the UI thread when whisper produces a non-empty transcript.
- void transcription_ready(const QString& text);
-
- /// Fired 0-100 during model download.
- void model_download_progress(int percent);
-
- /// Fired once after the model is successfully loaded and ready.
- void model_ready();
-
- /// Fired if something goes wrong (download failure, mic unavailable, etc.).
- void error_occurred(const QString& message);
-
- /// Fired when listening state changes — UI can update mic button.
- void listening_changed(bool active);
-
- private:
- explicit WhisperService(QObject* parent = nullptr);
- ~WhisperService() override;
-
- // ── Model management ──────────────────────────────────────────────────────
- void ensure_model();
- void download_model();
- bool load_model();
- void on_download_finished(QNetworkReply* reply);
-
- // ── Audio capture ─────────────────────────────────────────────────────────
- void open_audio_device();
- void close_audio_device();
-
- // ── Inference ─────────────────────────────────────────────────────────────
- // Called by drain_timer_ on the UI thread; dispatches work to thread pool.
- void drain_and_infer();
-
- // Runs on a worker thread — must NOT touch any QWidget or member directly.
- // Posts result back via invokeMethod.
- void run_inference(std::vector<float> samples);
-
- // ── Ring buffer helpers ───────────────────────────────────────────────────
- // append_samples() is called from the audio-thread callback — must be
- // lock-free (or at worst a single try-lock that drops frames on contention).
- void append_samples(const float* data, qsizetype frames);
- std::vector<float> drain_samples();
-
- // ── Constants ─────────────────────────────────────────────────────────────
- static constexpr int kMaxDownloadRetries = 3;
- static constexpr int kRetryBaseMs = 2'000; // 2s, 4s, 8s backoff
- static constexpr int kSampleRate = 16'000; // Hz — whisper requirement
- static constexpr int kDrainIntervalMs = 1'200; // how often to kick inference
- static constexpr int kWindowSeconds = 6; // sliding audio window
- static constexpr int kMaxWindowSamples = kSampleRate * kWindowSeconds;
- static constexpr float kVadThreshold = 0.012f; // RMS silence gate
- static constexpr int kVadTailSamples = kSampleRate / 2; // 500 ms of tail required
- static constexpr int kInferenceThreads = 4; // whisper n_threads
-
- static constexpr const char* kModelFilename = "ggml-base.en-q5_0.bin";
- static constexpr const char* kModelUrl =
- "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-base.en-q5_0.bin";
-
- // ── State ─────────────────────────────────────────────────────────────────
- whisper_context* ctx_ = nullptr;
- QAudioSource* audio_source_ = nullptr;
- QNetworkAccessManager* nam_ = nullptr;
- QTimer* drain_timer_ = nullptr;
- QTimer* retry_timer_ = nullptr; // one-shot retry delay
-
- int download_attempt_ = 0; // current attempt count (reset on success)
-
- std::atomic<bool> listening_{false};
- std::atomic<bool> model_loaded_{false};
- std::atomic<bool> inference_busy_{false}; // prevent overlapping inferences
- std::atomic<bool> download_active_{false};
-
- // Ring buffer — written by audio thread, read by UI thread drain_timer_.
- // Protected by ring_mutex_ (audio callback does a non-blocking try-lock;
- // on contention it simply drops the frame rather than blocking realtime thread).
- mutable QMutex ring_mutex_;
- std::vector<float> ring_buffer_;
-
- // Sliding window — accumulated across drain cycles for context continuity.
- std::vector<float> window_buffer_;
-};
-
-} // namespace fincept::services
diff --git a/fincept-qt/src/ui/theme/ThemeManager.cpp b/fincept-qt/src/ui/theme/ThemeManager.cpp
index c470fd966..c89363613 100644
--- a/fincept-qt/src/ui/theme/ThemeManager.cpp
+++ b/fincept-qt/src/ui/theme/ThemeManager.cpp
@@ -1,6 +1,9 @@
#include "ui/theme/ThemeManager.h"
+#include "core/logging/Logger.h"
+
#include <QApplication>
+#include <QWidget>
namespace fincept::ui {
@@ -91,21 +94,29 @@ QFont ThemeManager::current_font() const {
}
void ThemeManager::rebuild_and_apply() {
- // Keep qApp->font() in sync with our font_family_/font_size_px_ so that
- // widgets using inline setStyleSheet() (which bypass QSS font inheritance)
- // still render with the correct font.
+ LOG_INFO("ThemeManager", QString("rebuild_and_apply: font=%1 size=%2px density_pad=%3")
+ .arg(font_family_).arg(font_size_px_).arg(density_pad_));
+
QFont f(font_family_);
f.setStyleHint(QFont::Monospace);
f.setPixelSize(font_size_px_);
- if (qApp->font() != f)
+ if (qApp->font() != f) {
+ LOG_INFO("ThemeManager", "Applying new QFont to qApp");
qApp->setFont(f);
+ }
QString qss = build_global_qss();
+ LOG_INFO("ThemeManager", QString("Global QSS length: %1 chars").arg(qss.length()));
if (qss != cached_qss_) {
+ LOG_INFO("ThemeManager", "QSS changed — calling qApp->setStyleSheet()");
cached_qss_ = qss;
qApp->setStyleSheet(qss);
+ LOG_INFO("ThemeManager", "qApp->setStyleSheet() complete");
+ } else {
+ LOG_INFO("ThemeManager", "QSS unchanged — skipping setStyleSheet");
}
emit theme_changed(current_);
+ LOG_INFO("ThemeManager", "theme_changed emitted");
}
QString ThemeManager::build_global_qss() const {
@@ -200,8 +211,63 @@ QString ThemeManager::build_global_qss() const {
QMenu::separator { background: %6; height: 1px; }
QScrollArea { border: none; background: %1; }
+ /* QFrame transparent background — EXCLUDE ADS classes that extend QFrame
+ (CDockWidgetTab, CDockAreaTitleBar) because this app-level rule would
+ override their widget-level styling from CDockManager, making tabs
+ transparent and labels invisible. We use :!property selectors are not
+ available, so we explicitly re-set ADS widgets after. */
QFrame { background: transparent; border: none; }
- QDialog { background: %1; color: %2; }
+ /* Re-assert ADS widget backgrounds AFTER the QFrame rule.
+ In app-level QSS, later rules with more specific selectors win. */
+ ads--CDockContainerWidget { background: %1; border: none; }
+ ads--CDockAreaWidget { background: %1; border: none; }
+ ads--CDockWidget { background: %1; border: none; }
+ ads--CDockAreaTitleBar {
+ background: %12;
+ border-bottom: 1px solid %6;
+ padding: 0px;
+ min-height: 24px;
+ max-height: 24px;
+ }
+ ads--CDockAreaWidget[focused="true"] ads--CDockAreaTitleBar {
+ background: %12;
+ border-bottom: 1px solid %9;
+ }
+ ads--CDockWidgetTab {
+ background: %5;
+ border: none;
+ border-right: 1px solid %6;
+ padding: 2px 8px;
+ min-height: 22px;
+ max-height: 22px;
+ }
+ ads--CDockWidgetTab[activeTab="true"] {
+ background: %12;
+ border-bottom: 2px solid %9;
+ border-right: 1px solid %6;
+ }
+ ads--CDockWidgetTab[focused="true"] {
+ background: %12;
+ border-bottom: 2px solid %9;
+ border-right: 1px solid %6;
+ }
+ ads--CDockWidgetTab QLabel {
+ color: %10;
+ font-size: 11px;
+ font-weight: 600;
+ background: transparent;
+ }
+ ads--CDockWidgetTab[activeTab="true"] QLabel { color: %2; }
+ ads--CDockWidgetTab[focused="true"] QLabel { color: %2; }
+ ads--CDockSplitter::handle { background-color: %6; }
+ ads--CTitleBarButton {
+ padding: 2px; max-width: 16px; max-height: 16px;
+ min-width: 16px; min-height: 16px;
+ background: transparent; border: none;
+ }
+ ads--CTitleBarButton:hover { background: %11; }
+ ads--CAutoHideSideBar { background: %1; border: none; }
+ QScrollArea#dockWidgetScrollArea { padding: 0px; border: none; }
QTabWidget::pane { border: none; background: %1; }
@@ -257,52 +323,7 @@ QString ThemeManager::build_global_qss() const {
QStatusBar { border: none; background: %1; padding: 0; }
QToolBar { border: none; background: %1; spacing: 0; padding: 0; }
- /* ── ADS Docking System ─────────────────────────────────────────── */
- ads--CDockContainerWidget { background: %1; }
- ads--CDockAreaWidget { background: %1; }
- ads--CDockAreaTitleBar {
- background: %12;
- border-bottom: 1px solid %3;
- padding: 0px;
- min-height: 24px;
- max-height: 24px;
- }
- ads--CDockAreaWidget[focused="true"] ads--CDockAreaTitleBar {
- border-bottom: 2px solid %9;
- }
- ads--CDockWidgetTab {
- background: %12;
- border: none;
- padding: 2px 8px;
- min-height: 22px;
- max-height: 22px;
- }
- ads--CDockWidgetTab[activeTab="true"] {
- background: %11;
- border-bottom: 2px solid %9;
- }
- ads--CDockWidgetTab[focused="true"] {
- background: %9;
- }
- ads--CDockWidgetTab #dockWidgetTabLabel {
- color: %10;
- font-size: 11px;
- font-weight: 600;
- background: transparent;
- }
- ads--CDockWidgetTab[activeTab="true"] #dockWidgetTabLabel {
- color: %2;
- }
- ads--CDockWidgetTab[focused="true"] #dockWidgetTabLabel {
- color: %17;
- }
- ads--CDockWidget {
- background: %1;
- border: none;
- }
- ads--CDockSplitter::handle {
- background-color: %3;
- }
+ /* ── ADS icon buttons ───────────────────────────────────────────── */
#tabCloseButton {
background: none; border: none; padding: 2px;
width: 16px; height: 16px; min-width: 16px; min-height: 16px;
@@ -356,14 +377,6 @@ QString ThemeManager::build_global_qss() const {
background: %11;
image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><line x1='3' y1='12' x2='13' y2='12' stroke='%23e5e5e5' stroke-width='1.5' stroke-linecap='round'/></svg>");
}
- ads--CTitleBarButton {
- padding: 2px; max-width: 16px; max-height: 16px;
- min-width: 16px; min-height: 16px;
- }
- ads--CTitleBarButton:hover { background: %11; }
- ads--CAutoHideSideBar { background: %1; border: none; }
- QScrollArea#dockWidgetScrollArea { padding: 0px; border: none; }
-
/* ── Reusable object-name selectors ────────────────────────────── */
#sectionTitle {
color: %9; font-size: 13px; font-weight: 700;
@@ -470,4 +483,79 @@ QString ThemeManager::build_global_qss() const {
.arg(t.negative_bg);
}
+QString ThemeManager::build_ads_qss() const {
+ const auto& t = current_;
+ LOG_INFO("ThemeManager", QString("build_ads_qss: bg_base=%1 bg_raised=%2 bg_surface=%3 accent=%4 border_dim=%5")
+ .arg(t.bg_base).arg(t.bg_raised).arg(t.bg_surface).arg(t.accent).arg(t.border_dim));
+ // This stylesheet is applied directly to CDockManager to completely override
+ // ADS's internally loaded default.css / focus_highlighting.css which use
+ // palette(window)/palette(highlight) — the Windows system gray/blue colors.
+ QString qss = QString(R"(
+ ads--CDockContainerWidget { background: %1; }
+ ads--CDockAreaWidget { background: %1; }
+ ads--CDockAreaTitleBar {
+ background: %2;
+ border-bottom: 1px solid %3;
+ padding: 0px;
+ min-height: 24px;
+ max-height: 24px;
+ }
+ ads--CDockAreaWidget[focused="true"] ads--CDockAreaTitleBar {
+ background: %2;
+ border-bottom: 1px solid %4;
+ }
+ ads--CDockWidgetTab {
+ background: %5;
+ border: none;
+ border-right: 1px solid %3;
+ padding: 2px 8px;
+ min-height: 22px;
+ max-height: 22px;
+ }
+ ads--CDockWidgetTab[activeTab="true"] {
+ background: %2;
+ border-bottom: 2px solid %4;
+ border-right: 1px solid %3;
+ }
+ ads--CDockWidgetTab[focused="true"] {
+ background: %2;
+ border-bottom: 2px solid %4;
+ border-right: 1px solid %3;
+ }
+ ads--CDockWidgetTab QLabel {
+ color: %6;
+ font-size: 11px;
+ font-weight: 600;
+ background: transparent;
+ }
+ ads--CDockWidgetTab[activeTab="true"] QLabel {
+ color: %7;
+ }
+ ads--CDockWidgetTab[focused="true"] QLabel {
+ color: %7;
+ }
+ ads--CDockWidget { background: %1; border: none; }
+ ads--CDockSplitter::handle { background-color: %3; }
+ ads--CTitleBarButton {
+ padding: 2px; max-width: 16px; max-height: 16px;
+ min-width: 16px; min-height: 16px;
+ background: transparent; border: none;
+ }
+ ads--CTitleBarButton:hover { background: %8; }
+ ads--CAutoHideSideBar { background: %1; border: none; }
+ QScrollArea#dockWidgetScrollArea { padding: 0px; border: none; }
+ )")
+ .arg(t.bg_base) // %1
+ .arg(t.bg_raised) // %2
+ .arg(t.border_dim) // %3
+ .arg(t.accent) // %4
+ .arg(t.bg_surface) // %5
+ .arg(t.text_secondary) // %6
+ .arg(t.text_primary) // %7
+ .arg(t.bg_hover); // %8
+
+ LOG_INFO("ThemeManager", QString("build_ads_qss: produced %1 chars").arg(qss.length()));
+ return qss;
+}
+
} // namespace fincept::ui
diff --git a/fincept-qt/src/ui/theme/ThemeManager.h b/fincept-qt/src/ui/theme/ThemeManager.h
index b33a11130..9e0f54957 100644
--- a/fincept-qt/src/ui/theme/ThemeManager.h
+++ b/fincept-qt/src/ui/theme/ThemeManager.h
@@ -42,6 +42,10 @@ class ThemeManager : public QObject {
QFont current_font() const;
static QStringList available_densities(); // single source of truth for density names
+ /// Returns QSS that must be applied directly to the CDockManager widget
+ /// to override ADS's internally loaded default.css / focus_highlighting.css.
+ QString build_ads_qss() const;
+
signals:
/// Emitted after every successful apply_theme / apply_density call.
/// Custom paintEvent widgets connect to this to invalidate caches and call update().