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:
@@ -169,3 +169,55 @@ class HabitTracker(Base):
|
||||
total_completions = Column(Integer, default=0)
|
||||
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
||||
updated_at = Column(DateTime(timezone=True), onupdate=func.now())
|
||||
|
||||
|
||||
class UserIndicatorPreferences(Base):
|
||||
"""User's preferred technical indicators for analysis and AI plan generation"""
|
||||
__tablename__ = "user_indicator_preferences"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
user_id = Column(String, nullable=True)
|
||||
indicator_name = Column(String) # SMA, EMA, RSI, MACD, BB, ATR, Stochastic, Fibonacci, VWAP, Pivot
|
||||
enabled = Column(Boolean, default=True)
|
||||
parameters = Column(JSON, nullable=True) # Indicator-specific parameters (e.g., period, length)
|
||||
priority = Column(Integer, default=0) # Higher priority = more important in AI analysis
|
||||
notes = Column(Text, nullable=True) # User notes about why they prefer this indicator
|
||||
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
||||
updated_at = Column(DateTime(timezone=True), onupdate=func.now())
|
||||
|
||||
|
||||
class AIPlanGeneration(Base):
|
||||
"""AI-generated daily trading plans"""
|
||||
__tablename__ = "ai_plan_generations"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
user_id = Column(String, nullable=True)
|
||||
plan_date = Column(Date, default=func.current_date())
|
||||
|
||||
# AI-generated plan details
|
||||
market_bias = Column(String) # BULLISH, BEARISH, NEUTRAL
|
||||
confidence = Column(Float) # 0-100
|
||||
daily_target = Column(Float, nullable=True)
|
||||
max_loss = Column(Float, nullable=True)
|
||||
entry_zone_min = Column(Float, nullable=True)
|
||||
entry_zone_max = Column(Float, nullable=True)
|
||||
target_price = Column(Float, nullable=True)
|
||||
stop_loss = Column(Float, nullable=True)
|
||||
support_levels = Column(JSON, default=[]) # List of support prices
|
||||
resistance_levels = Column(JSON, default=[]) # List of resistance prices
|
||||
max_trades = Column(Integer, default=3)
|
||||
trading_notes = Column(Text, nullable=True) # AI-generated strategy notes
|
||||
|
||||
# AI analysis metadata
|
||||
indicators_used = Column(JSON, default=[]) # List of indicators used in analysis
|
||||
reasoning = Column(Text, nullable=True) # AI's reasoning for the plan
|
||||
market_conditions = Column(JSON, nullable=True) # Market data used in analysis
|
||||
ai_model = Column(String, nullable=True) # Model used for generation
|
||||
|
||||
# User interaction
|
||||
accepted = Column(Boolean, default=False) # User accepted this plan
|
||||
modified = Column(Boolean, default=False) # User modified after generation
|
||||
feedback = Column(Text, nullable=True) # User feedback on plan accuracy
|
||||
|
||||
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
||||
updated_at = Column(DateTime(timezone=True), onupdate=func.now())
|
||||
|
||||
Reference in New Issue
Block a user