-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.env.example
More file actions
87 lines (71 loc) · 3.21 KB
/
.env.example
File metadata and controls
87 lines (71 loc) · 3.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Signum Trading Bot - Environment Configuration
# Copy this file to .env and fill in your actual credentials
# NEVER commit .env to git!
# Alpaca API Credentials (Paper Trading)
ALPACA_API_KEY=your_paper_api_key_here
ALPACA_API_SECRET=your_paper_api_secret_here
# --- Alerting ---
# Telegram Bot (RECOMMENDED — HTTPS port 443, instant, works on all VPS)
# 1. Message @BotFather on Telegram → /newbot → follow prompts → get token
# 2. Message your bot, then visit https://api.telegram.org/bot<TOKEN>/getUpdates
# to find your chat_id
TELEGRAM_BOT_TOKEN=
TELEGRAM_CHAT_ID=
# Webhook (Slack/Discord/Teams) — optional
ALERT_WEBHOOK_URL=
# Email recipients (used by Resend, SendGrid, and SMTP)
ALERT_EMAIL_TO=your_email@gmail.com # Comma-separated for multiple recipients
# Resend HTTP API (uses port 443, instant activation)
# Sign up at https://resend.com — free tier: 100 emails/day
RESEND_API_KEY=
RESEND_FROM_EMAIL=Signum Bot <onboarding@resend.dev>
# SendGrid HTTP API (alternative — works on all VPS, uses port 443)
# Free tier: 100 emails/day. Sign up at https://signup.sendgrid.com
# Create API key: Settings > API Keys > Create (Full Access)
SENDGRID_API_KEY=
SENDGRID_FROM_EMAIL= # Must be verified sender in SendGrid
# SMTP (fallback — blocked on DigitalOcean/most cloud VPS)
# Works with Gmail (smtp.gmail.com:587 + app password), Mailgun, etc.
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=
SMTP_PASSWORD=
SMTP_FROM= # Defaults to SMTP_USER if empty
SMTP_USE_TLS=true
# --- Risk & Position Sizing ---
MAX_POSITION_WEIGHT=0.30 # Max weight per position (30%)
MAX_PORTFOLIO_VAR_95=0.06 # Max daily VaR at 95% confidence (6%)
MAX_DRAWDOWN_LIMIT=0.15 # Kill switch: liquidate if drawdown exceeds this (15%)
STOP_LOSS_PCT=0.05 # Fixed stop-loss fallback when ATR unavailable (5%)
TAKE_PROFIT_PCT=0.15 # Fixed take-profit fallback when ATR unavailable (15%)
ATR_SL_MULTIPLIER=2.0 # Stop-loss at N x ATR below fill price
ATR_TP_MULTIPLIER=3.0 # Take-profit at N x ATR above fill price
# --- Trading Strategy ---
TOP_N_STOCKS=10 # Number of top-ranked stocks to hold
OPTIMIZER_METHOD=hrp # Portfolio optimizer: hrp, min_cvar, risk_parity
REBALANCE_FREQUENCY=weekly # daily or weekly
REBALANCE_DAY=2 # 0=Mon, 1=Tue, 2=Wed, 3=Thu, 4=Fri
# --- Order Execution ---
ORDER_POLL_INTERVAL_SECS=2 # How often to poll for fill status
ORDER_POLL_TIMEOUT_SECS=60 # Max time to wait for a fill
# --- Logging ---
LOG_DIR=/var/log/signum
LOG_LEVEL=INFO
LOG_FORMAT=text # "text" (human-readable) or "json" (structured, for log aggregators)
# --- Bot Behavior ---
SLEEP_AFTER_TRADE_HOURS=12 # Sleep after successful trade cycle
SLEEP_MARKET_CLOSED_HOURS=1 # Sleep when market is closed
# Restart Configuration
MAX_RETRIES=10
INITIAL_BACKOFF_SECS=5
MAX_BACKOFF_SECS=300
# Database (if using PostgreSQL for state persistence)
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_USER=quant
POSTGRES_PASSWORD=quant_dev
POSTGRES_DB=quant_platform
# Redis (if using for caching)
REDIS_URL=redis://localhost:6379
# MLflow (if using for model tracking)
MLFLOW_TRACKING_URI=http://localhost:5000