Reorganize UI for external trading workflow with manual trade logging
- Restructure tabs to analysis-focused workflow: * Analysis Hub: AI analysis, risk management, manual trade logger * Daily Prep: Market summary, alerts, checklist, news, trading plan * Journal & Review: Trading journal, habit tracker, advanced analytics * Live Charts: Technical analysis with streaming charts - Add ManualTradeLogger component for logging trades from MT5/TradingView/cTrader - Remove execution-focused components (TradeControls, PortfolioTracker) - Update XAU/USD price to realistic ,084.99 - Add indicator preferences and AI plan service - Add comprehensive documentation on decision coverage and implementation
This commit is contained in:
@@ -384,3 +384,104 @@ class HabitTrackerResponse(BaseModel):
|
||||
class HabitCompletionRequest(BaseModel):
|
||||
habit_id: int
|
||||
completion_date: Optional[str] = None # ISO date string, defaults to today
|
||||
|
||||
|
||||
# ============================================================================
|
||||
# INDICATOR PREFERENCES SCHEMAS
|
||||
# ============================================================================
|
||||
|
||||
class IndicatorParameters(BaseModel):
|
||||
"""Common indicator parameters"""
|
||||
period: Optional[int] = None
|
||||
length: Optional[int] = None
|
||||
multiplier: Optional[float] = None
|
||||
# Add more as needed
|
||||
|
||||
|
||||
class IndicatorPreferenceCreate(BaseModel):
|
||||
indicator_name: str = Field(..., description="Name of the indicator (SMA, EMA, RSI, etc.)")
|
||||
enabled: bool = True
|
||||
parameters: Optional[dict] = None
|
||||
priority: int = Field(default=0, description="Higher priority = more important in AI analysis")
|
||||
notes: Optional[str] = None
|
||||
|
||||
|
||||
class IndicatorPreferenceUpdate(BaseModel):
|
||||
enabled: Optional[bool] = None
|
||||
parameters: Optional[dict] = None
|
||||
priority: Optional[int] = None
|
||||
notes: Optional[str] = None
|
||||
|
||||
|
||||
class IndicatorPreferenceResponse(BaseModel):
|
||||
id: int
|
||||
user_id: Optional[str]
|
||||
indicator_name: str
|
||||
enabled: bool
|
||||
parameters: Optional[dict]
|
||||
priority: int
|
||||
notes: Optional[str]
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class IndicatorPreferencesListResponse(BaseModel):
|
||||
preferences: List[IndicatorPreferenceResponse]
|
||||
total: int
|
||||
|
||||
|
||||
# ============================================================================
|
||||
# AI PLAN GENERATION SCHEMAS
|
||||
# ============================================================================
|
||||
|
||||
class MarketBias(str, Enum):
|
||||
BULLISH = "BULLISH"
|
||||
BEARISH = "BEARISH"
|
||||
NEUTRAL = "NEUTRAL"
|
||||
|
||||
|
||||
class AIPlanGenerationRequest(BaseModel):
|
||||
"""Request to generate an AI trading plan"""
|
||||
current_price: float = Field(..., description="Current market price")
|
||||
user_capital: Optional[float] = Field(None, description="User's available capital")
|
||||
risk_tolerance: Optional[str] = Field("moderate", description="conservative, moderate, aggressive")
|
||||
use_indicator_preferences: bool = Field(True, description="Use user's saved indicator preferences")
|
||||
price_data: Optional[List[PriceData]] = Field(None, description="Recent price data for analysis")
|
||||
indicators_data: Optional[dict] = Field(None, description="Current indicator values")
|
||||
|
||||
|
||||
class AIPlanGenerationResponse(BaseModel):
|
||||
"""AI-generated trading plan"""
|
||||
id: int
|
||||
plan_date: str # ISO date
|
||||
market_bias: MarketBias
|
||||
confidence: float # 0-100
|
||||
daily_target: Optional[float]
|
||||
max_loss: Optional[float]
|
||||
entry_zone_min: Optional[float]
|
||||
entry_zone_max: Optional[float]
|
||||
target_price: Optional[float]
|
||||
stop_loss: Optional[float]
|
||||
support_levels: List[float]
|
||||
resistance_levels: List[float]
|
||||
max_trades: int
|
||||
trading_notes: Optional[str]
|
||||
indicators_used: List[str]
|
||||
reasoning: Optional[str]
|
||||
market_conditions: Optional[dict]
|
||||
ai_model: Optional[str]
|
||||
created_at: datetime
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class AIPlanFeedback(BaseModel):
|
||||
"""User feedback on AI plan accuracy"""
|
||||
plan_id: int
|
||||
accepted: bool
|
||||
modified: bool = False
|
||||
feedback: Optional[str] = None
|
||||
|
||||
Reference in New Issue
Block a user