kikocis/freqtrade-strategies public
Changesets · Branches · Tags · Compare
| Changeset | e16f5a7c29bbd92570939f24036f3fcb706dbc57f0ac02badc6c082d910a823d |
|---|---|
| Author | Bryan Chain <bryan.chain@cerner.com> · 2021-05-04 12:50 -04:00 |
| Committer | Bryan Chain <bryan.chain@cerner.com> · 2021-05-04 12:50 -04:00 |
| Parents | dd8fdd3433c1 |
1 file changed
modified strategies/Solipsis_v5.py +4 −1
| @@ -301,7 +301,10 @@ | ||
| 301 | 301 | **kwargs) -> Optional[Union[str, bool]]: |
| 302 | 302 | |
| 303 | 303 | trade_open_date = timeframe_to_prev_date(self.timeframe, trade.open_date_utc) |
| 304 | - trade_row = dataframe.loc[dataframe['date'] == trade_open_date].squeeze() | |
| 304 | + trade_row = dataframe.loc[dataframe['date'] == trade_open_date] | |
| 305 | + if trade_row is None: | |
| 306 | + return | |
| 307 | + trade_row = trade_row.squeeze() | |
| 305 | 308 | |
| 306 | 309 | trade_dur = int((current_time.timestamp() - trade.open_date_utc.timestamp()) // 60) |
| 307 | 310 | max_profit = max(0, trade.calc_profit_ratio(trade.max_rate)) |