dalsi fix home-01
This commit is contained in:
@@ -129,10 +129,12 @@ def _apply_dynamic_grid_filter(
|
||||
if not remaining:
|
||||
break
|
||||
total_wh = len(remaining) * per_slot_wh
|
||||
if total_wh <= 0:
|
||||
acq = min(float(s.buy_price) for s in slots)
|
||||
pos_remaining = [t for t in remaining if float(slots[t].buy_price) >= 0]
|
||||
total_wh_pos = len(pos_remaining) * per_slot_wh
|
||||
if total_wh_pos <= 0:
|
||||
acq = min(float(s.buy_price) for s in slots if float(s.buy_price) >= 0)
|
||||
else:
|
||||
acq = sum(float(slots[t].buy_price) * per_slot_wh for t in remaining) / total_wh
|
||||
acq = sum(float(slots[t].buy_price) * per_slot_wh for t in pos_remaining) / total_wh_pos
|
||||
if abs(acq - acq_prev) < 0.05:
|
||||
break
|
||||
acq_prev = acq
|
||||
|
||||
Reference in New Issue
Block a user