diff --git a/Zeus_8_3_2_B_4_2.py b/Zeus_8_3_2_B_4_2.py index ff2dd3d..6f4143b 100644 --- a/Zeus_8_3_2_B_4_2.py +++ b/Zeus_8_3_2_B_4_2.py @@ -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): diff --git a/tools/mise.py b/tools/mise.py new file mode 100644 index 0000000..e5fe108 --- /dev/null +++ b/tools/mise.py @@ -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) diff --git a/tools/statistique/main.py b/tools/statistique/main.py new file mode 100644 index 0000000..e69de29