Implement configuration of trading times
This commit is contained in:
@@ -24,6 +24,15 @@ TIF_CHOICES = (
|
||||
("fok", "FOK (Fill Or Kill)"),
|
||||
("ioc", "IOC (Immediate Or Cancel)"),
|
||||
)
|
||||
DAY_CHOICES = (
|
||||
("monday", "Monday"),
|
||||
("tuesday", "Tuesday"),
|
||||
("wednesday", "Wednesday"),
|
||||
("thursday", "Thursday"),
|
||||
("friday", "Friday"),
|
||||
("saturday", "Saturday"),
|
||||
("sunday", "Sunday"),
|
||||
)
|
||||
|
||||
|
||||
class Plan(models.Model):
|
||||
@@ -237,6 +246,16 @@ class Strategy(models.Model):
|
||||
return self.name
|
||||
|
||||
|
||||
class TradingTime(models.Model):
|
||||
user = models.ForeignKey(User, on_delete=models.CASCADE)
|
||||
name = models.CharField(max_length=255)
|
||||
description = models.TextField(null=True, blank=True)
|
||||
start_day = models.CharField(choices=DAY_CHOICES, max_length=255)
|
||||
end_day = models.CharField(choices=DAY_CHOICES, max_length=255)
|
||||
start_time = models.TimeField()
|
||||
end_time = models.TimeField()
|
||||
|
||||
|
||||
# class Perms(models.Model):
|
||||
# class Meta:
|
||||
# permissions = (
|
||||
|
||||
Reference in New Issue
Block a user