update for v3 Strategy Interface

This commit is contained in:
Bloodhunter4rc 2022-05-29 12:50:20 +02:00 committed by GitHub
parent 4eb29c8810
commit 983fc919bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,7 +44,7 @@ class FreqaiExampleStrategy(IStrategy):
process_only_new_candles = False process_only_new_candles = False
stoploss = -0.05 stoploss = -0.05
use_sell_signal = True use_exit_signal = True
startup_candle_count: int = 300 startup_candle_count: int = 300
def informative_pairs(self): def informative_pairs(self):
@ -182,7 +182,7 @@ class FreqaiExampleStrategy(IStrategy):
dataframe["sell_roi"] = dataframe["target_mean"] - dataframe["target_std"] dataframe["sell_roi"] = dataframe["target_mean"] - dataframe["target_std"]
return dataframe return dataframe
def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
buy_conditions = [ buy_conditions = [
(dataframe["prediction"] > dataframe["target_roi"]) & (dataframe["do_predict"] == 1) (dataframe["prediction"] > dataframe["target_roi"]) & (dataframe["do_predict"] == 1)
@ -193,7 +193,7 @@ class FreqaiExampleStrategy(IStrategy):
return dataframe return dataframe
def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
sell_conditions = [ sell_conditions = [
(dataframe["do_predict"] <= 0) (dataframe["do_predict"] <= 0)
] ]