tvsignals-to-tg/app/config.py
Artemii Peretiachenko cdbda8fea3 Replace TradingView polling with a local LTF/FVG scanner that posts Telegram cards and Heryon webhooks.
Per-strategy Heryon accounts, reversal captions with previous-trade path on charts, and Telegram replies chained by ticker.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-30 20:37:16 +02:00

48 lines
1.4 KiB
Python

from functools import lru_cache
from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings(BaseSettings):
model_config = SettingsConfigDict(
env_file=".env",
env_file_encoding="utf-8",
extra="ignore",
)
telegram_bot_token: str
telegram_chat_id: str
telegram_message_thread_id: int
webhook_secret: str
host: str = "0.0.0.0"
port: int = 8000
scanner_enabled: bool = True
scanner_poll_seconds: float = 20.0
watchlist_path: str = "watchlist.yaml"
scanner_state_path: str = "data/scanner.db"
risk_usd: float = 40.0
geryon_webhook_url: str = ""
geryon_account_id: str = "admin1"
geryon_account_id_ltf: str = ""
geryon_account_id_fvg: str = ""
geryon_order_type: str = "bbo"
geryon_secret: str = ""
geryon_secret_ltf: str = ""
geryon_secret_fvg: str = ""
def geryon_account_id_for(self, strategy_id: str) -> str:
if strategy_id == "ltf":
return self.geryon_account_id_ltf or self.geryon_account_id
return self.geryon_account_id_fvg or self.geryon_account_id
def geryon_secret_for(self, strategy_id: str) -> str:
if strategy_id == "ltf":
return self.geryon_secret_ltf or self.geryon_secret
return self.geryon_secret_fvg or self.geryon_secret
@lru_cache
def get_settings() -> Settings:
return Settings()