# Copy to config.yaml and adjust. config.yaml is loaded if present.

ollama:
  base_url: "http://127.0.0.1:11434"
  # Use a model you have pulled locally (`ollama list`). Coder-tuned models follow JSON better.
  model: "qwen2.5-coder:7b"
  # Options passed to Ollama /api/chat
  options:
    temperature: 0.35
    num_ctx: 8192

workspace_root: ".."  # relative to self-coding-agent/ — repo root

# Only paths under workspace_root matching these prefixes are readable/writable.
allowed_path_prefixes:
  - "frontline/"
  - "lab/"
  - "self-coding-agent/generated/"
  - "backtesting/MT5/"

loop:
  max_iterations: 0          # 0 = run forever until SIGINT/SIGTERM
  sleep_seconds: 2.0       # pause between iterations
  consecutive_error_limit: 15  # then exponential backoff (cap 300s)

memory:
  journal_max_lines: 80      # tail of journal.jsonl injected into prompts
  evolution_path: "state/evolution.json"

mt5_backtest:
  enabled: true
  python_executable: "python"
  script_relative: "backtesting/MT5/run_backtest.py"
  default_strategy: "RSIReversalStrategy"
  default_symbol: "XAUUSD"
  default_start: "2023-01-01"
  default_end: "2024-01-01"

web:
  fetch_timeout_seconds: 25
  max_response_bytes: 400000

cursor:
  # Optional: if `cursor` is on PATH, open generated files after writes (best-effort).
  open_in_cursor_after_write: false

mission: |
  You are an autonomous coding agent for this trading/research repo.
  Improve MQL5 Expert Advisors under frontline/units/ and lab/EAs/, or Python strategies
  under backtesting/MT5/. Use actions to read files, write files, fetch docs from URLs,
  and run backtests. Prefer small, testable edits. Output valid JSON only.
