62 lines
1.7 KiB
Python
62 lines
1.7 KiB
Python
"""
|
|
Analysis configuration
|
|
"""
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class AnalysisConfig(BaseSettings):
|
|
"""Analysis configuration"""
|
|
|
|
# Redis connection
|
|
REDIS_HOST: str = "localhost"
|
|
REDIS_PORT: int = 6379
|
|
REDIS_DB: int = 0
|
|
|
|
# Stream keys
|
|
KLINE_5M_KEY: str = "binance:raw:kline:5m"
|
|
KLINE_15M_KEY: str = "binance:raw:kline:15m"
|
|
KLINE_1H_KEY: str = "binance:raw:kline:1h"
|
|
KLINE_4H_KEY: str = "binance:raw:kline:4h"
|
|
KLINE_1D_KEY: str = "binance:raw:kline:1d"
|
|
KLINE_1W_KEY: str = "binance:raw:kline:1w"
|
|
DEPTH_KEY: str = "binance:raw:depth:20"
|
|
TRADE_KEY: str = "binance:raw:trade"
|
|
|
|
# Analysis parameters
|
|
LOOKBACK_PERIODS: int = 200 # Number of candles to analyze
|
|
|
|
# Technical indicator periods
|
|
EMA_FAST: int = 20
|
|
EMA_SLOW: int = 50
|
|
RSI_PERIOD: int = 14
|
|
ATR_PERIOD: int = 14
|
|
ADX_PERIOD: int = 14
|
|
MACD_FAST: int = 12
|
|
MACD_SLOW: int = 26
|
|
MACD_SIGNAL: int = 9
|
|
BB_PERIOD: int = 20
|
|
BB_STD: float = 2.0
|
|
VOLUME_MA_PERIOD: int = 20
|
|
|
|
# Support/Resistance detection
|
|
SR_LOOKBACK: int = 50 # Periods to look back for S/R
|
|
SR_TOLERANCE: float = 0.002 # 0.2% price tolerance
|
|
|
|
# Order flow analysis
|
|
ORDERBOOK_IMBALANCE_THRESHOLD: float = 0.2 # 20% imbalance
|
|
LARGE_ORDER_THRESHOLD_USD: float = 100000 # $100k considered large
|
|
|
|
# Risk parameters (example values)
|
|
ACCOUNT_SIZE_USD: float = 100000
|
|
MAX_RISK_PCT: float = 0.01 # 1% per trade
|
|
DEFAULT_LEVERAGE: int = 3
|
|
ATR_STOP_MULTIPLIER: float = 1.8
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
case_sensitive = True
|
|
extra = 'ignore' # Ignore extra fields from .env
|
|
|
|
|
|
config = AnalysisConfig()
|