forked from kodorvan/stcs
The function allows you to write the number 0
This commit is contained in:
@@ -134,7 +134,7 @@ def check_limit_price(limit_price, min_price, max_price) -> str | None:
|
||||
|
||||
|
||||
async def get_liquidation_price(
|
||||
tg_id: int, symbol: str, entry_price: float, leverage: float
|
||||
tg_id: int, symbol: str, entry_price: float, leverage: float
|
||||
) -> tuple[float, float]:
|
||||
"""
|
||||
Function to get liquidation price
|
||||
@@ -158,7 +158,7 @@ async def get_liquidation_price(
|
||||
|
||||
|
||||
async def calculate_total_budget(
|
||||
quantity, martingale_factor, max_steps, commission_fee_percent
|
||||
quantity, martingale_factor, max_steps, commission_fee_percent
|
||||
) -> float:
|
||||
"""
|
||||
Calculate the total budget for a series of trading steps.
|
||||
@@ -174,7 +174,7 @@ async def calculate_total_budget(
|
||||
"""
|
||||
total = 0
|
||||
for step in range(max_steps):
|
||||
set_quantity = quantity * (martingale_factor**step)
|
||||
set_quantity = quantity * (martingale_factor ** step)
|
||||
if commission_fee_percent == 0:
|
||||
# Commission fee is not added to the position size
|
||||
r_quantity = set_quantity
|
||||
|
Reference in New Issue
Block a user