47 lines
2.1 KiB
Python
47 lines
2.1 KiB
Python
from dotenv import load_dotenv
|
|
import os
|
|
|
|
load_dotenv()
|
|
|
|
class Settings:
|
|
alpaca_key = os.getenv("ALPACA_API_KEY", "")
|
|
alpaca_secret = os.getenv("ALPACA_API_SECRET", "")
|
|
alpaca_base = os.getenv("ALPACA_BASE_URL", "https://paper-api.alpaca.markets")
|
|
paper_mode = os.getenv("PAPER_MODE", "true").lower() == "true"
|
|
|
|
starting_capital_usd = float(os.getenv("STARTING_CAPITAL_USD", "100"))
|
|
max_order_usd = float(os.getenv("MAX_ORDER_USD", "5"))
|
|
max_daily_notional = float(os.getenv("MAX_DAILY_NOTIONAL", "40"))
|
|
max_open_positions = int(os.getenv("MAX_OPEN_POSITIONS", "8"))
|
|
min_confidence = float(os.getenv("MIN_CONFIDENCE", "0.60"))
|
|
fee_per_trade_usd = float(os.getenv("FEE_PER_TRADE_USD", "0.00"))
|
|
slippage_bps = float(os.getenv("SLIPPAGE_BPS", "5"))
|
|
|
|
trade_interval_hours = int(os.getenv("TRADE_INTERVAL_HOURS", "2"))
|
|
curate_interval_minutes = int(os.getenv("CURATE_INTERVAL_MINUTES", "30"))
|
|
timezone = os.getenv("TIMEZONE", "America/Los_Angeles")
|
|
force_paper_trades = os.getenv("FORCE_PAPER_TRADES", "true").lower() == "true"
|
|
|
|
ollama_url = os.getenv("OLLAMA_URL", "http://10.30.20.110:11434")
|
|
ollama_curator_model = os.getenv("OLLAMA_CURATOR_MODEL", "gemma3:latest")
|
|
ollama_decision_model = os.getenv("OLLAMA_DECISION_MODEL", "agent-oss:latest")
|
|
ollama_embed_model = os.getenv("OLLAMA_EMBED_MODEL", "nomic-embed-text:latest")
|
|
|
|
searx_url = os.getenv("SEARX_URL", "http://10.30.20.35:6969/search")
|
|
scraper_api = os.getenv("SCRAPER_API_URL", "http://10.30.20.115:24125")
|
|
|
|
qdrant_url = os.getenv("QDRANT_URL", "http://10.30.20.68:6333")
|
|
qdrant_collection = os.getenv("QDRANT_COLLECTION", "alpaca_memory")
|
|
|
|
trilium_url = os.getenv("TRILIUM_URL", "http://10.30.20.152:8080")
|
|
trilium_token = os.getenv("TRILIUM_TOKEN", "")
|
|
|
|
n8n_webhook = os.getenv("N8N_BOT_WEBHOOK", "")
|
|
|
|
db_path = os.getenv("DB_PATH", "sqlite:///./bot.db")
|
|
host = os.getenv("APP_HOST", "0.0.0.0")
|
|
port = int(os.getenv("APP_PORT", "8089"))
|
|
symbols = [s.strip().upper() for s in os.getenv("SYMBOLS", "SPY,QQQ").split(",") if s.strip()]
|
|
|
|
settings = Settings()
|