Merge pull request #9592 from ArturoGamRod/docs/fix-typo

fix typo in stoploss_from_absolute code example doc
This commit is contained in:
Matthias 2023-12-25 08:16:40 +01:00 committed by GitHub
commit ad68eff8f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -489,7 +489,7 @@ The helper function `stoploss_from_absolute()` can be used to convert from an ab
dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe) dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)
trade_date = timeframe_to_prev_date(self.timeframe, trade.open_date_utc) trade_date = timeframe_to_prev_date(self.timeframe, trade.open_date_utc)
candle = dataframe.iloc[-1].squeeze() candle = dataframe.iloc[-1].squeeze()
sign = 1 if trade.is_short else -1 side = 1 if trade.is_short else -1
return stoploss_from_absolute(current_rate + (side * candle['atr'] * 2), return stoploss_from_absolute(current_rate + (side * candle['atr'] * 2),
current_rate, is_short=trade.is_short, current_rate, is_short=trade.is_short,
leverage=trade.leverage) leverage=trade.leverage)