Production-oriented EOD research pipeline for Indonesian stocks (IDX):
- ingest -> validate -> features -> score -> risk -> report -> notify
- dual signal model:
T+1andSwing 1-4 weeks - semi-auto execution workflow (manual order entry in Stockbit with Auto Order/Bracket)
PRD.mdis the product source of truth: current state, requirements, final-decision gates, roadmap, blockers, and next action.AGENTS.mdis the token-efficient operating contract for AI agents. It prevents full-repository rereads and defines safe autonomous work and handoff.
This project does not execute broker orders directly.
PRD.md defines a gated FINAL_EXECUTION end-state, but current runtime
status remains EXECUTION_DISABLED until its model and execution contracts pass.
It generates:
- top candidates by mode (
top_t1,top_swing) - suggested entry / stop / TP1 / TP2 / position size
- HTML / CSV / JSON reports
- optional Telegram summary
Primary runtime config:
config/settings.json- optional conservative profile:
config/settings.beginner.json
Schema is validated by pydantic (src/config.py).
Default setup now uses:
- primary REST provider: EODHD (
base_url_template) - token from env placeholder:
${EODHD_API_TOKEN} - automatic fallback chain:
REST -> yfinance -> CSV
Risk sizing now supports:
- ATR + realized volatility blend (
risk.volatility_realized_weight) - dynamic market-vol regime cap (
calm/normal/high/stress) - configurable regime caps for position-size multiplier
- mode-level execution caps and priority (
risk.max_positions_t1,risk.max_positions_swing,risk.execution_mode_priority) - liquidity-aware cost estimate (
backtest.liq_bucket_*,backtest.slippage_multiplier_*)
Model and coaching layer:
- model_v2 scaffolding in shadow mode (
model_v2.enabled,model_v2.shadow_mode) - auto promotion gate + rollback (
model_v2.promotion.*) for gradual v2 rollout - automatic weekly KPI snapshot and beginner coaching note (
coaching.*)
Canonical price columns:
date,ticker,open,high,low,close,volume,source,ingested_at
Universe file:
data/reference/universe_lq45_idx30.csv- optional event-risk blocklist:
data/reference/event_risk_blacklist.csv(local live file, git-ignored) - tracked baseline snapshot:
data/reference/event_risk_blacklist.sample.csv - optional auto-update feeds for event-risk:
pipeline.event_risk.auto_update - optional live fills import:
data/live/trade_fills.csv(template:data/live/trade_fills.sample.csv)
python -m src.cli update-universe --force
python -m src.cli update-event-risk --force
python -m src.cli recalibrate-volatility --force
python -m src.cli ingest-daily
python -m src.cli backfill-history --years 2
python -m src.cli compute-features
python -m src.cli build-research-manifest
python -m src.cli validate-research-manifest
python -m src.cli score
python -m src.cli backtest
python -m src.cli model-v2-promotion
python -m src.cli reconcile-live
python -m src.cli send-telegram
python -m src.cli run-dailyPowerShell automation:
powershell -ExecutionPolicy Bypass -File scripts/validate_env.ps1
powershell -ExecutionPolicy Bypass -File scripts/backfill_2y.ps1
powershell -ExecutionPolicy Bypass -File scripts/run_daily_retry.ps1
powershell -ExecutionPolicy Bypass -File scripts/run_daily_retry.ps1 -SettingsPath config/settings.beginner.json
powershell -ExecutionPolicy Bypass -File scripts/reconcile_live.ps1
powershell -ExecutionPolicy Bypass -File scripts/trade_gate_swing.ps1
powershell -ExecutionPolicy Bypass -File scripts/trade_gate_swing.ps1 -DebugReasons
powershell -ExecutionPolicy Bypass -File scripts/trade_gate_beginner.ps1
powershell -ExecutionPolicy Bypass -File scripts/trade_gate_beginner.ps1 -DebugReasonsLocal n8n setup guide:
docs/N8N_LOCAL_SETUP.mddocs/LIVE_RECONCILIATION.md
Model v2 integration blueprint:
docs/MODEL_V2_BLUEPRINT.mddocs/TRADER_BEGINNER_PLAYBOOK.md
Research dataset identity:
docs/RESEARCH_DATASET_MANIFEST.md
Backward compatibility:
python -m src.run_daily run-dailydata/raw/prices_daily.csvdata/processed/features.parquetreports/top_t1.csvreports/top_swing.csvreports/daily_report.csvreports/execution_plan.csvreports/daily_report.htmlreports/daily_signal.jsonreports/backtest_metrics.jsonreports/research_dataset_manifest.jsonreports/event_risk_active.csvreports/event_risk_excluded.csvreports/universe_update_state.jsonreports/model_v2_shadow_signals.csvreports/model_v2_shadow_signals.jsonreports/model_v2_ab_test.jsonreports/model_v2_state.jsonreports/model_v2_promotion_state.jsonreports/weekly_kpi.jsonreports/weekly_kpi.mdreports/beginner_coaching.mdreports/snapshots/signals_*.jsonreports/live_reconciliation.jsonreports/live_reconciliation.mdreports/live_reconciliation_details.csvreports/live_reconciliation_unmatched_entries.csvreports/run_log_YYYYMMDD.json
- Run
python -m src.cli run-daily(auto includes weekly universe refresh attempt and event-risk auto-refresh if enabled). - Optional manual refresh:
python -m src.cli update-event-risk --force. - Review
reports/daily_report.html. - Select max 1-3 signals.
- Place manual order in Stockbit and set Auto Order/Bracket.
- Do not override stop unless invalidation rule is met.
For first setup, run one-time historical bootstrap first:
- Set
EODHD_API_TOKEN(optional if you rely on yfinance fallback). - Run
python -m src.cli backfill-history --years 2. - Then run
python -m src.cli run-daily.
- This is research infrastructure, not financial advice.
- No strategy can guarantee profit.
- Keep secrets in environment variables only (
.envis ignored,.env.exampleis safe template). n8n/workflows/idx_trading_daily.jsonuses{{$env.TELEGRAM_CHAT_ID}}and does not store local credential IDs.- Raw local market dump
data/raw/prices_daily.csvis intentionally ignored for public publishing. - If a secret was ever committed, rotate it immediately (EODHD and Telegram token/chat access).