From 5e39f2767fb0620235a70f2ec2ca7ae28231ddcf Mon Sep 17 00:00:00 2001 From: Giulio De Pasquale Date: Mon, 22 Feb 2021 11:27:25 +0000 Subject: [PATCH] default max_loss relative to min_profit --- src/strategy.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/strategy.rs b/src/strategy.rs index e9571bf..852385d 100644 --- a/src/strategy.rs +++ b/src/strategy.rs @@ -148,8 +148,8 @@ impl Default for HiddenTrailingStop { let leverage = 15.0; // in percentage - let capital_max_loss = 15.0; - let capital_min_profit = 8.5; + let capital_min_profit = 4.0; + let capital_max_loss = capital_min_profit * 1.65; let capital_good_profit = capital_min_profit * 2.0; let weighted_min_profit = capital_min_profit / leverage; @@ -281,7 +281,7 @@ impl PositionStrategy for HiddenTrailingStop { .next().map_or_else(|| 0.0, |&x| x); // we need to consider possible slippage when executing the stop order - let slippage_percentage = self.max_loss_percentage * 0.05; + let slippage_percentage = self.max_loss_percentage * 0.085; // calculating the stop price based on short/long position let stop_loss_price = {