15. wip
This commit is contained in:
@ -118,6 +118,18 @@ class PriceBucketer:
|
||||
logger.debug(f"Aggregated {len(bucket_list)} bucket sets")
|
||||
return aggregated
|
||||
|
||||
def get_bucket_price(self, price: float) -> float:
|
||||
"""
|
||||
Get the bucket price for a given price.
|
||||
|
||||
Args:
|
||||
price: Original price
|
||||
|
||||
Returns:
|
||||
float: Bucket price (rounded to bucket boundaries)
|
||||
"""
|
||||
return math.floor(price / self.bucket_size) * self.bucket_size
|
||||
|
||||
def get_bucket_range(self, center_price: float, depth: int) -> Tuple[float, float]:
|
||||
"""
|
||||
Get price range for buckets around a center price.
|
||||
|
Reference in New Issue
Block a user