Use strategy.analyze_ticker in backtesting
This commit is contained in:
parent
5ef1730e24
commit
e7fb951fc5
@ -247,8 +247,10 @@ class Backtesting:
|
|||||||
pair_data.loc[:, 'buy'] = 0 # cleanup from previous run
|
pair_data.loc[:, 'buy'] = 0 # cleanup from previous run
|
||||||
pair_data.loc[:, 'sell'] = 0 # cleanup from previous run
|
pair_data.loc[:, 'sell'] = 0 # cleanup from previous run
|
||||||
|
|
||||||
ticker_data = self.strategy.advise_sell(
|
ticker_data = self.strategy.analyze_ticker(
|
||||||
self.strategy.advise_buy(pair_data, {'pair': pair}), {'pair': pair})[headers].copy()
|
pair_data, {'pair': pair},
|
||||||
|
populate_indicators=False,
|
||||||
|
)[headers].copy()
|
||||||
|
|
||||||
# to avoid using data from future, we buy/sell with signal from previous candle
|
# to avoid using data from future, we buy/sell with signal from previous candle
|
||||||
ticker_data.loc[:, 'buy'] = ticker_data['buy'].shift(1)
|
ticker_data.loc[:, 'buy'] = ticker_data['buy'].shift(1)
|
||||||
|
Loading…
Reference in New Issue
Block a user