fix hyperopt.sh
This commit is contained in:
parent
da6d3fe292
commit
531e8d6906
@ -218,55 +218,31 @@ rm -rf user_data/models/*
|
||||
rm -rf ./freqtrade/user_data/data/backtest_results/*
|
||||
rm -fr ./user_data/dryrun_results/*
|
||||
rm result/*
|
||||
|
||||
PARAMS_NAME=freqaiprimer
|
||||
hyperopt_config="${STRATEGY_NAME%.py}.json"
|
||||
|
||||
echo "docker-compose run --rm freqtrade backtesting $PAIRS_FLAG \
|
||||
echo "docker-compose run --rm freqtrade hyperopt $PAIRS_FLAG \
|
||||
--logfile /freqtrade/user_data/logs/freqtrade.log \
|
||||
--freqaimodel LightGBMRegressorMultiTarget \
|
||||
--config /freqtrade/config_examples/$CONFIG_FILE \
|
||||
--strategy-path /freqtrade/templates \
|
||||
--strategy $STRATEGY_NAME \
|
||||
--timerange $START_DATE-$END_DATE \
|
||||
--fee 0.0008 \
|
||||
--breakdown day \
|
||||
--cache none >output.log"
|
||||
|
||||
docker-compose run --rm freqtrade backtesting $PAIRS_FLAG \
|
||||
--config /freqtrade/config_examples/$CONFIG_FILE \
|
||||
--config /freqtrade/templates/${PARAMS_NAME}.json \
|
||||
--strategy-path /freqtrade/templates \
|
||||
--timerange ${START_DATE}-${END_DATE} \
|
||||
-e 100 \
|
||||
-j 4 \
|
||||
--hyperopt-loss ShortTradeDurHyperOptLoss \
|
||||
--spaces buy sell trailing \
|
||||
--fee 0.0016"
|
||||
docker-compose run --rm freqtrade hyperopt $PAIRS_FLAG \
|
||||
--logfile /freqtrade/user_data/logs/freqtrade.log \
|
||||
--freqaimodel LightGBMRegressorMultiTarget \
|
||||
--config /freqtrade/config_examples/$CONFIG_FILE \
|
||||
--strategy-path /freqtrade/templates \
|
||||
--strategy $STRATEGY_NAME \
|
||||
--timerange $START_DATE-$END_DATE \
|
||||
--fee 0.0008 \
|
||||
--breakdown day \
|
||||
--cache none >output.log 2>&1
|
||||
|
||||
sed -i 's/\x1B\[[0-9;]*m//g' output.log
|
||||
|
||||
rm ./result/*.json -fr
|
||||
rm ./result/*.py -fr
|
||||
mv ./user_data/backtest_results/* ./result/
|
||||
|
||||
cd ./result
|
||||
# 查找当前目录下的所有 zip 文件
|
||||
zip_files=(*.zip)
|
||||
|
||||
# 检查是否只有一个 zip 文件
|
||||
if [ ${#zip_files[@]} -eq 1 ]; then
|
||||
# 解压缩该 zip 文件到当前目录
|
||||
unzip "${zip_files[0]}"
|
||||
rm *.zip
|
||||
rm *.feather
|
||||
else
|
||||
echo "当前目录下没有 zip 文件或者有多个 zip 文件,无法操作。"
|
||||
fi
|
||||
|
||||
cd -
|
||||
sed -i 's/\x1B\[[0-9;]*m//g' output.log
|
||||
cp output.log result/ -f
|
||||
cd tools/
|
||||
python tradestocsv.py
|
||||
python analytic.py >../result/analytic.log
|
||||
cd ../
|
||||
--config /freqtrade/config_examples/$CONFIG_FILE \
|
||||
--config /freqtrade/templates/${PARAMS_NAME}.json \
|
||||
--strategy-path /freqtrade/templates \
|
||||
--timerange ${START_DATE}-${END_DATE} \
|
||||
-e 100 \
|
||||
-j 4 \
|
||||
--hyperopt-loss SharpeHyperOptLoss \
|
||||
--spaces buy sell trailing \
|
||||
--fee 0.0016
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user