update doc to reflect better empty dataframe check
This commit is contained in:
parent
6542070afa
commit
860a4d2390
@ -65,9 +65,10 @@ class AwesomeStrategy(IStrategy):
|
||||
trade_date = timeframe_to_prev_date(self.timeframe, trade.open_date_utc)
|
||||
# Look up trade candle.
|
||||
trade_candle = dataframe.loc[dataframe['date'] == trade_date]
|
||||
# trade_candle may be None for trades that just opened as it is still incomplete.
|
||||
if trade_candle is not None:
|
||||
# trade_candle may be empty for trades that just opened as it is still incomplete.
|
||||
if trade_candle.empty:
|
||||
# <...>
|
||||
trade_candle = trade_candle.squeeze()
|
||||
```
|
||||
|
||||
!!! Warning "Using .iloc[-1]"
|
||||
|
Loading…
Reference in New Issue
Block a user