@@ -0,0 +1,158 @@
|
||||
# QuantDinger local configuration (copy to `.env` and edit)
|
||||
# `run.py` will load `backend_api_python/.env` automatically if present.
|
||||
|
||||
# =========================
|
||||
# Auth (local login)
|
||||
# =========================
|
||||
SECRET_KEY=quantdinger-secret-key-change-me
|
||||
ADMIN_USER=quantdinger
|
||||
ADMIN_PASSWORD=123456
|
||||
|
||||
# =========================
|
||||
# Network / App
|
||||
# =========================
|
||||
PYTHON_API_HOST=0.0.0.0
|
||||
PYTHON_API_PORT=5000
|
||||
PYTHON_API_DEBUG=False
|
||||
|
||||
# =========================
|
||||
# Pending orders worker (optional)
|
||||
# =========================
|
||||
# Paper mode default: disabled. If enabled, it will consume `pending_orders` and dispatch signals via webhook.
|
||||
# Poll and dispatch orders from `pending_orders` (live/signal).
|
||||
# Local mode default is enabled in code, but you can override here.
|
||||
ENABLE_PENDING_ORDER_WORKER=true
|
||||
|
||||
# Reclaim orders stuck in status=processing after worker crashes (seconds).
|
||||
PENDING_ORDER_STALE_SEC=90
|
||||
|
||||
# =========================
|
||||
# Strategy signal notifications (optional)
|
||||
# =========================
|
||||
# The frontend stores per-strategy notification_config.targets.*, but you can also set
|
||||
# a global fallback webhook URL used when a strategy enables "webhook" channel but
|
||||
# doesn't provide targets.webhook.
|
||||
SIGNAL_WEBHOOK_URL=
|
||||
SIGNAL_WEBHOOK_TOKEN=
|
||||
|
||||
# HTTP timeout for outbound notification requests (seconds).
|
||||
SIGNAL_NOTIFY_TIMEOUT_SEC=6
|
||||
|
||||
# Telegram (required if you enable telegram channel)
|
||||
TELEGRAM_BOT_TOKEN=
|
||||
|
||||
# Email / SMTP (required if you enable email channel)
|
||||
SMTP_HOST=
|
||||
SMTP_PORT=587
|
||||
SMTP_USER=
|
||||
SMTP_PASSWORD=
|
||||
SMTP_FROM=
|
||||
SMTP_USE_TLS=true
|
||||
SMTP_USE_SSL=false
|
||||
|
||||
# Phone / SMS (optional; Twilio REST, required if you enable phone channel)
|
||||
TWILIO_ACCOUNT_SID=
|
||||
TWILIO_AUTH_TOKEN=
|
||||
TWILIO_FROM_NUMBER=
|
||||
|
||||
# Restore strategies with status='running' on backend startup.
|
||||
# Set to true to disable auto-restore.
|
||||
DISABLE_RESTORE_RUNNING_STRATEGIES=false
|
||||
|
||||
# =========================
|
||||
# Strategy execution loop (tick interval)
|
||||
# =========================
|
||||
# Default tick interval for strategy monitoring loop (seconds).
|
||||
# The strategy thread will fetch current price and evaluate triggers once per tick.
|
||||
STRATEGY_TICK_INTERVAL_SEC=10
|
||||
|
||||
# In-memory price cache TTL (seconds). Normally doesn't matter when tick interval is >= TTL.
|
||||
PRICE_CACHE_TTL_SEC=10
|
||||
|
||||
# =========================
|
||||
# Outbound Proxy (optional, recommended if your network blocks data providers)
|
||||
# =========================
|
||||
# If you use a local proxy (common ports: 7890/7891/10808), set PROXY_PORT only.
|
||||
# Default scheme is socks5h and host is 127.0.0.1.
|
||||
PROXY_PORT=
|
||||
PROXY_HOST=127.0.0.1
|
||||
PROXY_SCHEME=socks5h
|
||||
PROXY_URL=
|
||||
|
||||
# You can also set standard variables directly (advanced):
|
||||
# ALL_PROXY=socks5h://127.0.0.1:10808
|
||||
# HTTP_PROXY=socks5h://127.0.0.1:10808
|
||||
# HTTPS_PROXY=socks5h://127.0.0.1:10808
|
||||
|
||||
# Allow frontend dev server
|
||||
CORS_ORIGINS=*
|
||||
|
||||
# Request rate limit (per minute)
|
||||
RATE_LIMIT=100
|
||||
|
||||
ENABLE_CACHE=False
|
||||
ENABLE_REQUEST_LOG=True
|
||||
ENABLE_AI_ANALYSIS=True
|
||||
|
||||
# =========================
|
||||
# OpenRouter / LLM
|
||||
# =========================
|
||||
OPENROUTER_API_KEY=
|
||||
OPENROUTER_API_URL=https://openrouter.ai/api/v1/chat/completions
|
||||
OPENROUTER_MODEL=openai/gpt-4o
|
||||
OPENROUTER_TEMPERATURE=0.7
|
||||
OPENROUTER_MAX_TOKENS=4000
|
||||
OPENROUTER_TIMEOUT=300
|
||||
OPENROUTER_CONNECT_TIMEOUT=30
|
||||
|
||||
# Optional: override model list shown in UI (JSON object: {"model_id":"Display Name", ...})
|
||||
AI_MODELS_JSON={}
|
||||
|
||||
# =========================
|
||||
# Market presets (optional)
|
||||
# =========================
|
||||
# Optional: override market types shown in UI (JSON array)
|
||||
MARKET_TYPES_JSON=[]
|
||||
|
||||
# Optional: supported crypto symbols list (JSON array)
|
||||
TRADING_SUPPORTED_SYMBOLS_JSON=[]
|
||||
|
||||
# =========================
|
||||
# Data sources (Kline / pricing)
|
||||
# =========================
|
||||
DATA_SOURCE_TIMEOUT=30
|
||||
DATA_SOURCE_RETRY=3
|
||||
DATA_SOURCE_RETRY_BACKOFF=0.5
|
||||
|
||||
# Finnhub (US stocks / forex helpers depending on implementation)
|
||||
FINNHUB_API_KEY=
|
||||
FINNHUB_TIMEOUT=10
|
||||
FINNHUB_RATE_LIMIT=60
|
||||
|
||||
# CCXT (crypto via Binance by default)
|
||||
CCXT_DEFAULT_EXCHANGE=binance
|
||||
CCXT_TIMEOUT=10000
|
||||
CCXT_PROXY=
|
||||
|
||||
# Akshare (CN/HK stocks if enabled)
|
||||
AKSHARE_TIMEOUT=30
|
||||
|
||||
# YFinance
|
||||
YFINANCE_TIMEOUT=30
|
||||
|
||||
# Tiingo (optional)
|
||||
TIINGO_API_KEY=
|
||||
TIINGO_TIMEOUT=10
|
||||
|
||||
# =========================
|
||||
# Web Search (optional)
|
||||
# =========================
|
||||
SEARCH_PROVIDER=google
|
||||
SEARCH_MAX_RESULTS=10
|
||||
SEARCH_GOOGLE_API_KEY=
|
||||
SEARCH_GOOGLE_CX=
|
||||
SEARCH_BING_API_KEY=
|
||||
|
||||
# Internal API key (optional, if you add internal-service auth later)
|
||||
INTERNAL_API_KEY=
|
||||
|
||||
Reference in New Issue
Block a user