Skip to main content
completed financial-ml

IDX AI Trading System

Full-stack AI trading platform for the Indonesia Stock Exchange — FastAPI backend, 13-page Streamlit dashboard, IMSS multi-agent market simulator, ML prediction pipelines, and research workspaces with Playwright E2E coverage.

Started: March 1, 2026
Completed: March 27, 2026

Evidence & Verification

Metrics and claims on this page are tied to the linked artifacts below (repository docs, experiment outputs, and deployment pages when available).

13
Dashboard Pages
15
Api Route Groups
multi-agent
Simulator Agents
7 days
Forecast Horizon

Tags

algorithmic-tradingmachine-learningbacktestingsentiment-analysisquantitative-financeindonesia-stock-exchangemulti-agent-simulation

Technologies

Python FastAPI Streamlit TensorFlow Keras scikit-learn SQLite Pandas TA-Lib Playwright

Architecture

Financial ML Pipeline

Multi-model comparison for stock price prediction

Market Data
Historical prices, volumes, indicators
Feature Pipeline
Technical indicators, lag features, rolling stats
Model Benchmark
Cross-validation, hyperparameter tuning

LSTM

RMSE:0.0234
MAE:0.0189
MAPE:2.34%
Click for details →

SVM

RMSE:0.0312
MAE:0.0256
MAPE:3.12%
Click for details →

KNN

RMSE:0.0421
MAE:0.0334
MAPE:4.21%
Click for details →
BEST

Ensemble

RMSE:0.0198
MAE:0.0156
MAPE:1.98%
Click for details →

Model Performance (MAPE)

LSTM
2.34%
SVM
3.12%
KNN
4.21%
Ensemble
1.98%
1.98% MAPEEnsemble Model · Best Performance

Overview

IDX AI Trading System consolidates prior finance work from financial_eng, quant-trading-id, and Predictive-Analytics-for-Indonesia-s-Economic-Forecasting into a unified full-stack trading platform. Unlike the earlier ML-only experiments, this is a production-oriented system with a FastAPI backend, Streamlit dashboard with 12 feature pages, multi-agent market simulation (IMSS), and research workspaces — designed for daily IDX equity operations.

Architecture

The system runs as a dual-service architecture: a FastAPI backend handling data, analysis, and ML inference, paired with a Streamlit multipage dashboard for interactive operations. Data persists in SQLite (trading.db, imss.db), with the IMSS simulator running as a self-contained package with background job lifecycle management.

Daily Jobs + SQLite (trading.db, imss.db)
        |                      |
        v                      v
   FastAPI Route Layer   IMSS Simulation Engine
        |                      |
        +----------> Streamlit Dashboard <----------+
                         (12 pages)

Dashboard (13 Pages)

The Streamlit dashboard provides a complete operator interface:

  1. Home — system health, data freshness, operator overview
  2. Screener — filter-driven stock screening and signal scan workflows
  3. Stock Detail — chart, technical, sentiment, flow, and risk views per symbol
  4. Sentiment — sentiment fetch, cleanup, and thematic analysis
  5. Virtual Trading — paper-trading simulation sessions with order/replay controls
  6. Settings — model operations, training readiness, artifact management
  7. Market Overview — market breadth, leaders, and flow screener surfaces
  8. ML Prediction — prediction, correlation, Monte Carlo, and technical overlays
  9. Backtesting — async backtest launch, polling, and results visualization
  10. Research Presets — promote accepted research candidates into durable presets
  11. Portfolio — positions, trade history filters, and reconciliation analytics
  12. Market Enrichment — market-to-sector-to-symbol enrichment workflow
  13. IMSS — background simulation run launch, monitoring, logs, and summary inspection

API Backend (15+ Route Groups)

The FastAPI backend exposes structured endpoints for:

  • /health — system health, freshness, manual update hooks
  • /stocks — symbols, snapshots, charts, foreign flow, broker datasets
  • /analysis, /fundamental — technical, signal, risk, and LLM-assisted analysis
  • /signals — scan and active signal feeds
  • /portfolio — summary, positions, and trade history
  • /simulation — paper-trading session lifecycle and metrics
  • /prediction — training, artifact management, inference, correlation, Monte Carlo
  • /backtest — synchronous runs and background backtest jobs
  • /market-enrichment — foreign/domestic flows, industries, brokers, symbol diagnostics
  • /imss — background IMSS run lifecycle (create, list, status, logs, summary)

IMSS: Multi-Agent Market Simulator

The IDX Market Swarm Simulator (IMSS) is a self-contained multi-agent simulation package. It models market participant behavior through agent archetypes, runs background simulation jobs with lifecycle management APIs and WebSocket streams, and provides summary inspection and log analysis through the dashboard. This enables strategy stress-testing against simulated market dynamics beyond historical replay.

ML Pipeline

Signal generation uses a BiLSTM + SVR + GradientBoosting ensemble with multi-seed variance reduction for short-horizon IDX equity prediction. The ensemble combines sequential pattern detection (BiLSTM via TensorFlow/Keras), support vector regression, and gradient boosting for robustness across market regimes. Backtesting implements walk-forward validation with Monte Carlo uncertainty quantification using volatility-adjusted features. Sentiment analysis integrates news and social media signals as exogenous features alongside technical indicators.

Research Workspaces

Three automated research tools feed discoveries back into the main system:

  • autoscreener — automated stock screening with configurable filters
  • automontecarlo — Monte Carlo simulation batches for strategy validation
  • autoresearch — systematic research pipeline with preset promotion flow

Testing

Python unit/integration tests plus Playwright E2E coverage across dashboard pages.

Historical Context

Earlier work included crypto forecasting (Bitcoin, XRP, ETH) and Indonesia macro-forecasting with 22+ economic indicators (R² = 0.933). Those experiments informed the consolidated architecture and evaluation strategy.