新的策略,先开单,明天继续添加条件

This commit is contained in:
jackyu66git
2025-10-16 02:44:21 +08:00
parent eb3f394386
commit a1f8c6c605
6 changed files with 579 additions and 55 deletions
+5 -3
View File
@@ -21,7 +21,7 @@ logger = logging.getLogger(__name__)
# freqtrade plot-dataframe --strategy ChanLun_BTC --datadir user_data/data/binance -c ./user_data/ChanLun_SOL_30.json --timerange=20250309-
# freqtrade trade -c ./user_data/Chan/config/ChanLun_BTC_30.json --strategy ChanLun_BTC --strategy-path ./user_data/Chan/strategies
# freqtrade backtesting -c ./user_data/Chan/config/ChanLun_BTC_30.json --strategy ChanLun_BTC --strategy-path ./user_data/Chan/strategies --timerange=20250901-
# freqtrade backtesting -c ./user_data/Chan/config/ChanLun_BTC_30.json --strategy ChanLun_BTC --strategy-path ./user_data/Chan/strategies --timerange=20251008-
# freqtrade download-data -c ./user_data/Chan/config/ChanLun_BTC_30.json -t 1m 1m 1h 1d 1M --pairs BTC/USDT:USDT --timerange=20250405-
# freqtrade download-data -c ./user_data/Chan/config/ChanLun_BTC_30.json -t 1m 1h 1d 1M --pairs BTC/USDT --timerange=20170101-
# freqtrade hyperopt --hyperopt-loss SharpeHyperOptLossDaily --spaces roi --strategy ChanLun_BTC --strategy-path ./user_data/Chan/strategies -c ./user_data/Chan/config/ChanLun_BTC_30.json -e 200 --timerange=20250201-20250901
@@ -115,11 +115,13 @@ class ChanLun_BTC(IStrategy):
def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
self.init_dataframes(dataframe)
return dataframe
def init_dataframes(self, dataframe_m):
def init_dataframes(self, dataframe_1m):
dataframe_1h = self.dp.get_pair_dataframe(pair=self.pair, timeframe='1h')
dataframe_1d = self.dp.get_pair_dataframe(pair=self.pair, timeframe='1d')
dataframe_1M = self.dp.get_pair_dataframe(pair=self.pair, timeframe='1M')
self.chan.init_dataframes(dataframe_m, dataframe_1h, dataframe_1d, dataframe_1M)
self.chan.init_dataframes(dataframe_1m, dataframe_1h, dataframe_1d, dataframe_1M)
current_price = dataframe_1m.iloc[-1]['close']
print("Current Price: ", current_price)
self.print_all_current_klc()
def print_all_ema52(self):
for key, value in self.chan.get_ema52_dict().items():