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

View File

@@ -745,6 +745,9 @@ class Zeus_8_3_2_B_4_2(IStrategy):
# if self.dp.runmode.value in ('backtest'):
# self.test_signal_success(dataframe, 0.005)
if self.dp.runmode.value in ('backtest'):
dataframe.to_feather(f"user_data/data/binance/{metadata['pair'].replace('/', '_')}_df.feather")
return dataframe
def calculateDownAndUp(self, dataframe, limit=0.0001):

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)

View File