pass the previous date, for stake_amount callback

because signals are shifted by 1
This commit is contained in:
orehunt 2020-11-02 14:35:10 +01:00
parent 42ea64544c
commit 61ea5be7cf

View File

@ -344,7 +344,8 @@ class Backtesting:
and tmp != end_date
and row[BUY_IDX] == 1 and row[SELL_IDX] != 1):
# Enter trade
stake_amount = get_stake_amount(pair, row[DATE_IDX])
prev_date = data[pair][indexes[pair] - 1][DATE_IDX]
stake_amount = get_stake_amount(pair, prev_date)
trade = Trade(
pair=pair,
open_rate=row[OPEN_IDX],