We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5c3cd7c commit ca877a3Copy full SHA for ca877a3
Trading/model/history.py
@@ -21,6 +21,7 @@ class History(BaseModel):
21
high: Optional[List[float]] = None
22
low: Optional[List[float]] = None
23
close: Optional[List[float]] = None
24
+ len: Optional[int] = None
25
26
open_np: Optional[np.ndarray] | Any = None
27
high_np: Optional[np.ndarray] | Any = None
@@ -31,6 +32,7 @@ class History(BaseModel):
31
32
# post init
33
def model_post_init(self, __context):
34
self.to_numpy()
35
+ self.len = len(self.date)
36
37
def get_range_ratio(self):
38
return self.high_np.max() / self.low_np.min()
0 commit comments