Skip to content

Commit

Permalink
remove warning that wasn't true. If the drift is 1.0 or -1.0 we will …
Browse files Browse the repository at this point in the history
…always rebalance regardless of weights.
  • Loading branch information
brettelliot committed Jan 2, 2025
1 parent 2bfe2c9 commit 29bb725
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions lumibot/components/drift_rebalancer_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,6 @@ def __init__(

def calculate(self, target_weights: Dict[str, Decimal]) -> pd.DataFrame:

if self.drift_type == DriftType.ABSOLUTE:
# The absolute value of all the weights are less than the drift_threshold
# then we will never trigger a rebalance.

if all([abs(weight) < self.drift_threshold for weight in target_weights.values()]):
self.strategy.logger.warning(
f"All target weights are less than the drift_threshold: {self.drift_threshold}. "
f"No rebalance will be triggered."
)

self.df = pd.DataFrame({
"symbol": target_weights.keys(),
"is_quote_asset": False,
Expand Down

0 comments on commit 29bb725

Please sign in to comment.