feature(TrailingSL): add comment with warning about using -1 idx

This commit is contained in:
Joe Schr
2021-03-04 18:38:57 +01:00
parent a0f8971094
commit e289276091
+2
View File
@@ -47,6 +47,8 @@ class TrailingSL(IStrategy):
# so we need to get analyzed_dataframe from dp
dataframe, last_updated = self.dp.get_analyzed_dataframe(pair=pair,
timeframe=self.timeframe)
# only use .iat[-1] in live mode, otherwise you will look into the future
# see: https://www.freqtrade.io/en/latest/strategy-customization/#common-mistakes-when-developing-strategies
relative_sl = dataframe[SL_INDICATOR_NAME].iat[-1]
if (relative_sl is not None):