strategy interface: removed some changes
This commit is contained in:
parent
314359dd6e
commit
a5be535cc9
@ -232,10 +232,7 @@ class Backtesting:
|
|||||||
pair_data.loc[:, 'buy_tag'] = None # cleanup if buy_tag is exist
|
pair_data.loc[:, 'buy_tag'] = None # cleanup if buy_tag is exist
|
||||||
|
|
||||||
df_analyzed = self.strategy.advise_sell(
|
df_analyzed = self.strategy.advise_sell(
|
||||||
self.strategy.advise_buy(
|
self.strategy.advise_buy(pair_data, {'pair': pair}),
|
||||||
pair_data,
|
|
||||||
{'pair': pair}
|
|
||||||
),
|
|
||||||
{'pair': pair}
|
{'pair': pair}
|
||||||
).copy()
|
).copy()
|
||||||
# Trim startup period from analyzed dataframe
|
# Trim startup period from analyzed dataframe
|
||||||
|
@ -285,13 +285,11 @@ class Hyperopt:
|
|||||||
# Apply parameters
|
# Apply parameters
|
||||||
if HyperoptTools.has_space(self.config, 'buy'):
|
if HyperoptTools.has_space(self.config, 'buy'):
|
||||||
self.backtesting.strategy.advise_buy = ( # type: ignore
|
self.backtesting.strategy.advise_buy = ( # type: ignore
|
||||||
self.custom_hyperopt.buy_strategy_generator(params_dict)
|
self.custom_hyperopt.buy_strategy_generator(params_dict))
|
||||||
)
|
|
||||||
|
|
||||||
if HyperoptTools.has_space(self.config, 'sell'):
|
if HyperoptTools.has_space(self.config, 'sell'):
|
||||||
self.backtesting.strategy.advise_sell = ( # type: ignore
|
self.backtesting.strategy.advise_sell = ( # type: ignore
|
||||||
self.custom_hyperopt.sell_strategy_generator(params_dict)
|
self.custom_hyperopt.sell_strategy_generator(params_dict))
|
||||||
)
|
|
||||||
|
|
||||||
if HyperoptTools.has_space(self.config, 'protection'):
|
if HyperoptTools.has_space(self.config, 'protection'):
|
||||||
for attr_name, attr in self.backtesting.strategy.enumerate_parameters('protection'):
|
for attr_name, attr in self.backtesting.strategy.enumerate_parameters('protection'):
|
||||||
|
@ -58,10 +58,7 @@ def merge_informative_pair(dataframe: pd.DataFrame, informative: pd.DataFrame,
|
|||||||
return dataframe
|
return dataframe
|
||||||
|
|
||||||
|
|
||||||
def stoploss_from_open(
|
def stoploss_from_open(open_relative_stop: float, current_profit: float) -> float:
|
||||||
open_relative_stop: float,
|
|
||||||
current_profit: float
|
|
||||||
) -> float:
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
Given the current profit, and a desired stop loss value relative to the open price,
|
Given the current profit, and a desired stop loss value relative to the open price,
|
||||||
|
@ -46,7 +46,7 @@ class SampleHyperOpt(IHyperOpt):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def buy_indicator_space() -> List[Dimension]:
|
def indicator_space() -> List[Dimension]:
|
||||||
"""
|
"""
|
||||||
Define your Hyperopt space for searching buy strategy parameters.
|
Define your Hyperopt space for searching buy strategy parameters.
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user