just update the Target drift attribute to so we dont have to inject the drift_percent every single time
This commit is contained in:
@ -30,6 +30,12 @@ class ObjectiveFunction(BaseModel):
|
||||
print(self.tcc_targets)
|
||||
return amount
|
||||
|
||||
def update_targets_drift(self, amount: float = 0.0):
|
||||
for target in self.tif_targets:
|
||||
target.drift = round(amount, 2)
|
||||
for target in self.tcc_targets:
|
||||
target.drift = round(amount, 2)
|
||||
|
||||
def minimum_drift(self) -> float:
|
||||
minimum_drift = 0.0
|
||||
|
||||
|
@ -15,8 +15,8 @@ class Target(BaseModel):
|
||||
def max_drift_increment(cls) -> int:
|
||||
return 1 # 10%
|
||||
|
||||
def minimum(self, drift_percent = 0.0) -> float:
|
||||
return self.value - (self.value * drift_percent)
|
||||
def minimum(self) -> float:
|
||||
return self.value - (self.value * self.drift)
|
||||
|
||||
def maximum(self, drift_percent = 0.0) -> float:
|
||||
return self.value + (self.value * drift_percent)
|
||||
def maximum(self) -> float:
|
||||
return self.value + (self.value * self.drift)
|
||||
|
Reference in New Issue
Block a user