fix calc_buy_num floor -> round
This commit is contained in:
@@ -14,7 +14,7 @@ def trading_time(now: datetime) -> bool:
|
||||
|
||||
def calc_buy_volume(price: float, buy_value: float) -> int:
|
||||
if price <= 0 or buy_value <= 0: return 0
|
||||
return max(1, floor(buy_value / (price * 100))) * 100
|
||||
return max(1, round(buy_value / (price * 100))) * 100
|
||||
|
||||
def calculate_min_profit_rate(price: float, profit_mult: int) -> float:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user