from django.db import models

class SimulationResult(models.Model):
    created_at = models.DateTimeField(auto_now_add=True)
    symbol = models.CharField(max_length=20, default="ES=F")
    
    # Risk Metrics
    expected_low = models.FloatField()
    worst_case_5th = models.FloatField()
    drawdown_prob = models.FloatField()
    
    # Trading Bias
    bias = models.CharField(max_length=10) # LONG, SHORT, NEUTRAL
    take_profit = models.FloatField()
    stop_loss = models.FloatField()
    
    # Sentiment
    sentiment_score = models.FloatField() # -1 to 1
    regime = models.IntegerField() # 0, 1, 2...
    
    # JSON or Text field for simulation paths if needed, but for now we'll keep it simple
    summary = models.TextField(blank=True)

    def __str__(self):
        return f"{self.symbol} Risk - {self.created_at.strftime('%Y-%m-%d %H:%M')}"