ajout export feather

This commit is contained in:
Jérôme Delacotte
2025-05-07 21:00:32 +02:00
parent cbcd88c48b
commit c719a887d5
3 changed files with 23 additions and 0 deletions

20
tools/mise.py Normal file
View File

@@ -0,0 +1,20 @@
def cumulative_loss_on_repeated_dips(initial_price=100, drop_percent=1.5, num_drops=20):
price = initial_price
total_invested = 0
total_value = 0
print(f"{'Step':>4} | {'Price':>8} | {'Invested':>10} | {'Total Value':>12} | {'Loss %':>8}")
print("-" * 52)
for i in range(1, num_drops + 1):
price *= (1 - drop_percent / 100)
total_invested += initial_price
total_value += price
loss_pct = (1 - total_value / total_invested) * 100
print(f"{i:>4} | {price:>8.2f} | {total_invested:>10.2f} | {total_value:>12.2f} | {loss_pct:>8.2f}")
final_loss_pct = (1 - total_value / total_invested) * 100
print("\n📉 Perte finale cumulée :", round(final_loss_pct, 2), "%")
# Exemple :
cumulative_loss_on_repeated_dips(drop_percent=1.5, num_drops=20)