pass the previous date, for stake_amount callback
because signals are shifted by 1
This commit is contained in:
parent
42ea64544c
commit
61ea5be7cf
@ -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],
|
||||
|
Loading…
Reference in New Issue
Block a user