diff --git a/README.md b/README.md new file mode 100644 index 0000000..b53d90a --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# FinHack® 炼金术 +FinHack® is a scalable quantitative finance framework. + +FinHack® 是一个易于拓展的量化金融框架 + diff --git a/README.txt b/README.txt deleted file mode 100644 index b3bf406..0000000 --- a/README.txt +++ /dev/null @@ -1 +0,0 @@ -一个大版本更新,近期会把文档补上,之前的版本作废。 diff --git a/database/finhack_structure.sql b/database/finhack_structure.sql new file mode 100644 index 0000000..3ce99ef --- /dev/null +++ b/database/finhack_structure.sql @@ -0,0 +1,181 @@ +-- MySQL dump 10.13 Distrib 8.0.30, for Linux (x86_64) +-- +-- Host: localhost Database: finhack +-- ------------------------------------------------------ +-- Server version 8.0.30 + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!50503 SET NAMES utf8mb4 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `auto_train` +-- + +DROP TABLE IF EXISTS `auto_train`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `auto_train` ( + `id` int NOT NULL AUTO_INCREMENT, + `start_date` varchar(10) DEFAULT NULL, + `valid_date` varchar(10) DEFAULT NULL, + `end_date` varchar(10) DEFAULT NULL, + `features` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci, + `label` varchar(255) DEFAULT NULL, + `shift` int DEFAULT NULL, + `param` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci, + `hash` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, + `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `loss` varchar(255) DEFAULT NULL, + `algorithm` varchar(255) DEFAULT NULL, + `filter` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '', + `score` double(10,10) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=12548 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `backtest` +-- + +DROP TABLE IF EXISTS `backtest`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `backtest` ( + `id` int NOT NULL AUTO_INCREMENT, + `instance_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL, + `features_list` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci, + `train` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, + `model` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, + `strategy` varchar(255) DEFAULT NULL, + `start_date` varchar(10) DEFAULT NULL, + `end_date` varchar(10) DEFAULT NULL, + `init_cash` double(100,5) DEFAULT NULL, + `args` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci, + `history` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci, + `returns` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci, + `logs` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci, + `total_value` double(100,5) DEFAULT NULL, + `alpha` double(100,5) DEFAULT NULL, + `beta` double(100,5) DEFAULT NULL, + `annual_return` double(100,5) DEFAULT NULL, + `cagr` double(100,5) DEFAULT NULL, + `annual_volatility` double(100,5) DEFAULT NULL, + `info_ratio` double(100,5) DEFAULT NULL, + `downside_risk` double(100,5) DEFAULT NULL, + `R2` double(100,5) DEFAULT NULL, + `sharpe` double(100,5) DEFAULT NULL, + `sortino` double(100,5) DEFAULT NULL, + `calmar` double(100,5) DEFAULT NULL, + `omega` double(100,5) DEFAULT NULL, + `max_down` double(100,5) DEFAULT NULL, + `SQN` double(100,5) DEFAULT NULL, + `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `filter` varchar(255) DEFAULT '', + `win` double(100,5) DEFAULT NULL, + `server` varchar(255) DEFAULT NULL, + `trade_num` int DEFAULT NULL, + `runtime` varchar(255) DEFAULT NULL, + `starttime` varchar(100) DEFAULT NULL, + `endtime` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, + `benchReturns` mediumtext, + `roto` double(100,5) DEFAULT NULL, + `simulate` int DEFAULT '0', + `benchmark` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `instence_id` (`instance_id`) +) ENGINE=InnoDB AUTO_INCREMENT=387973 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `factors_analysis` +-- + +DROP TABLE IF EXISTS `factors_analysis`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `factors_analysis` ( + `id` int NOT NULL AUTO_INCREMENT, + `factor_name` varchar(255) DEFAULT NULL, + `days` varchar(255) DEFAULT NULL, + `pool` varchar(255) DEFAULT NULL, + `start_date` varchar(10) DEFAULT NULL, + `end_date` varchar(10) DEFAULT NULL, + `formula` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci, + `IC` float(10,5) DEFAULT NULL, + `IR` float(10,5) DEFAULT NULL, + `IRR` float(10,5) DEFAULT NULL, + `score` float(10,5) DEFAULT NULL, + `max_up_corr` float(10,7) DEFAULT NULL, + `hash` varchar(255) DEFAULT NULL, + `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2388 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `factors_list` +-- + +DROP TABLE IF EXISTS `factors_list`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `factors_list` ( + `id` int NOT NULL AUTO_INCREMENT, + `factor_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, + `indicators` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, + `func_name` varchar(255) DEFAULT NULL, + `code` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci, + `return_fileds` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci, + `md5` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, + `check_type` int DEFAULT '0', + `status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT 'activate', + `created_at` datetime DEFAULT CURRENT_TIMESTAMP, + `updated_at` datetime DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2406 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `factors_mining` +-- + +DROP TABLE IF EXISTS `factors_mining`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `factors_mining` ( + `id` int NOT NULL AUTO_INCREMENT, + `factor_name` varchar(255) DEFAULT NULL, + `days` varchar(255) DEFAULT NULL, + `pool` varchar(255) DEFAULT NULL, + `start_date` varchar(10) DEFAULT NULL, + `end_date` varchar(10) DEFAULT NULL, + `formula` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci, + `IC` float(20,5) DEFAULT NULL, + `IR` float(20,5) DEFAULT NULL, + `IRR` float(20,5) DEFAULT NULL, + `score` float(10,5) DEFAULT NULL, + `hash` varchar(255) DEFAULT NULL, + `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `hash` (`hash`(32)) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=31156 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2023-12-26 18:40:11 diff --git a/examples/demo-project/strategy/AITopNStrategy.py b/examples/demo-project/strategy/AITopNStrategy.py index 7baa399..a8b8dfa 100644 --- a/examples/demo-project/strategy/AITopNStrategy.py +++ b/examples/demo-project/strategy/AITopNStrategy.py @@ -23,11 +23,11 @@ def initialize(context): # 为股票设定滑点为百分比滑点 set_slippage(PriceRelatedSlippage(0.00246),type='stock') # 持仓数量 - g.stocknum = 3 + g.stocknum = 50 # 交易日计时器 g.days = 0 # 调仓频率 - g.refresh_rate = 5 + g.refresh_rate = 1 # 运行函数 #inout_cash(100000) diff --git a/finhack/core/core.py b/finhack/core/core.py index e428fec..7568363 100644 --- a/finhack/core/core.py +++ b/finhack/core/core.py @@ -98,7 +98,8 @@ def check_project(self): if module=="project": project_path=args.project_path if project_path==None: - project_path=os.getcwd()+"project_"+str(int(time.time())) + project_path=os.getcwd()+"/project_"+str(int(time.time())) + self.project_path=project_path template_path=Utils.get_template_path() if action=="create": @@ -107,6 +108,7 @@ def check_project(self): print("创建完毕!项目路径为 %s 请切换到该目录或使用-p参数指定目录并执行相应操作!" % (project_path).replace('//','/')) else: print("创建失败!") + exit() elif action=="renew": #todo pass diff --git a/finhack/library/utils.py b/finhack/library/utils.py index f33571f..bed32ae 100644 --- a/finhack/library/utils.py +++ b/finhack/library/utils.py @@ -19,7 +19,7 @@ def get_framework_path(): #获取框架的模板路径 def get_template_path(): - framework_path=utils.get_framework_path() + framework_path=Utils.get_framework_path() template_path=framework_path+"/widgets/templates/empty_project" return template_path diff --git a/finhack/note b/finhack/note deleted file mode 100644 index d47aa41..0000000 --- a/finhack/note +++ /dev/null @@ -1,8 +0,0 @@ -finhack broker run/stop/restart -finhack train run/stop/restart -finhack collecter run/stop/restart -finhack factor run/stop/restart -finhack http run/stop/restart -finhack cache -finhack data -finhack run \ No newline at end of file diff --git a/finhack/trainer/lightgbm/lightgbm_trainer.py b/finhack/trainer/lightgbm/lightgbm_trainer.py index 6dfc72b..fd3ad4e 100644 --- a/finhack/trainer/lightgbm/lightgbm_trainer.py +++ b/finhack/trainer/lightgbm/lightgbm_trainer.py @@ -17,7 +17,7 @@ from finhack.market.astock.astock import AStock from finhack.factor.default.taskRunner import taskRunner from finhack.factor.default.factorManager import factorManager - +from lightgbm import log_evaluation, early_stopping from finhack.trainer.trainer import Trainer class LightgbmTrainer(Trainer): @@ -124,14 +124,15 @@ def train(self,data_train,data_valid,data_path='/tmp',md5='test',loss="ds",param print('Starting training...') # 模型训练 - + callbacks = [log_evaluation(period=100), early_stopping(stopping_rounds=30)] if loss=="ds": + params['objective']=self.custom_obj gbm = lgb.train(params, data_train, num_boost_round=100, valid_sets=data_valid, - early_stopping_rounds=5, - fobj=self.custom_obj, + callbacks=callbacks, + feval=self.custom_eval ) else: @@ -139,7 +140,7 @@ def train(self,data_train,data_valid,data_path='/tmp',md5='test',loss="ds",param data_train, num_boost_round=100, valid_sets=data_valid, - early_stopping_rounds=5 + callbacks=callbacks ) print('Saving model...') diff --git a/finhack/trainer/trainer.py b/finhack/trainer/trainer.py index c94a2b7..6cf29f0 100644 --- a/finhack/trainer/trainer.py +++ b/finhack/trainer/trainer.py @@ -6,6 +6,8 @@ import importlib import lightgbm as lgb from runtime.constant import * + + class Trainer: def getTrainData(self,start_date='20000101',valid_date="20080101",end_date='20100101',features=[],label='abs',shift=10,filter_name='',dropna=False,norm=False): data_path=DATA_DIR diff --git a/finhack/widgets/templates/empty_project/data/cache/runtime/constant.py b/finhack/widgets/templates/empty_project/data/cache/runtime/constant.py index 8090a6d..7d3bc9a 100644 --- a/finhack/widgets/templates/empty_project/data/cache/runtime/constant.py +++ b/finhack/widgets/templates/empty_project/data/cache/runtime/constant.py @@ -1,5 +1,5 @@ FRAMEWORK_DIR="/root/anaconda3/envs/finhack/lib/python3.9/site-packages/finhack" -BASE_DIR="/data/code/finhack-new/examples/demo-project" +BASE_DIR="/data/code/finhack/examples/demo-project" DATA_DIR=BASE_DIR+"/data/" CACHE_DIR=DATA_DIR+"cache/" CONFIG_DIR=DATA_DIR+"config/" diff --git a/finhack/widgets/templates/empty_project/strategy/AITopNStrategy.py b/finhack/widgets/templates/empty_project/strategy/AITopNStrategy.py index 7baa399..627f9ac 100644 --- a/finhack/widgets/templates/empty_project/strategy/AITopNStrategy.py +++ b/finhack/widgets/templates/empty_project/strategy/AITopNStrategy.py @@ -23,11 +23,11 @@ def initialize(context): # 为股票设定滑点为百分比滑点 set_slippage(PriceRelatedSlippage(0.00246),type='stock') # 持仓数量 - g.stocknum = 3 + g.stocknum = 50 # 交易日计时器 g.days = 0 # 调仓频率 - g.refresh_rate = 5 + g.refresh_rate = 15 # 运行函数 #inout_cash(100000) diff --git a/requirements.txt b/requirements.txt index 7165528..beeed5a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -22,3 +22,5 @@ TA_Lib==0.4.24 tabulate==0.8.10 mysql-connector-python==8.0.30 tushare==1.2.87 +lightgbm==4.2.0 +cryptography==39.0.1 \ No newline at end of file diff --git a/script/init.sh b/script/conda.sh similarity index 76% rename from script/init.sh rename to script/conda.sh index ebaba9e..3cb4cf4 100755 --- a/script/init.sh +++ b/script/conda.sh @@ -1,3 +1,2 @@ conda remove --name finhack --all conda create --name finhack python=3.9 -conda activate finhack diff --git a/script/docker.sh b/script/docker.sh new file mode 100644 index 0000000..8615d5c --- /dev/null +++ b/script/docker.sh @@ -0,0 +1,107 @@ +#!/bin/bash +echo "请注意修改默认密码,并确保 MySQL 与 Redis 不要面向公网访问!" +read -p "是否继续创建 Docker 容器?(y/n) " -n 1 -r +echo # 新行 +if [[ $REPLY =~ ^[Yy]$ ]] +then + CURRENT_DIR=$(pwd) + # 设置 MySQL 容器的参数 + MYSQL_CONTAINER_NAME="finhack-mysql" + MYSQL_ROOT_PASSWORD="finhack" + MYSQL_DATABASE1="tushare" + MYSQL_DATABASE2="finhack" + MYSQL_PORT=3307 + MYSQL_DATA_DIR="$CURRENT_DIR/database/mysql-data" + + # 设置 Redis 容器的参数 + REDIS_CONTAINER_NAME="finhack-redis" + REDIS_PASSWORD="finhack" + REDIS_PORT=6380 + REDIS_DATA_DIR="$CURRENT_DIR/database/redis-data" + + # 获取脚本所在的目录的绝对路径 + SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" + # 设置 SQL 文件的绝对路径 + FINHACK_STRUCTURE_SQL="$SCRIPT_DIR/../database/finhack_structure.sql" + + # 检查并创建 MySQL 数据目录 + if [ ! -d "$MYSQL_DATA_DIR" ]; then + echo "MySQL 数据目录不存在,正在创建..." + mkdir -p "$MYSQL_DATA_DIR" + fi + + # 检查并创建 Redis 数据目录 + if [ ! -d "$REDIS_DATA_DIR" ]; then + echo "Redis 数据目录不存在,正在创建..." + mkdir -p "$REDIS_DATA_DIR" + fi + + + # 检查 MySQL 容器是否存在 + if [ $(docker ps -aq -f name=^/${MYSQL_CONTAINER_NAME}$) ]; then + # 如果容器存在,询问用户是否删除 + read -p "MySQL 容器已经存在。是否删除并重新创建?(y/n) " -n 1 -r + echo # 新行 + if [[ $REPLY =~ ^[Yy]$ ]]; then + # 删除容器 + docker rm -f $MYSQL_CONTAINER_NAME + else + echo "操作已取消。" + exit 1 + fi + fi + + # 创建 MySQL 容器 + echo "正在创建 MySQL 容器..." + docker run --name $MYSQL_CONTAINER_NAME \ + -e MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD \ + -e MYSQL_DATABASE=$MYSQL_DATABASE1 \ + -e MYSQL_DATABASE=$MYSQL_DATABASE2 \ + -p $MYSQL_PORT:3306 \ + -v $MYSQL_DATA_DIR:/var/lib/mysql \ + -d mysql:latest + + # 等待 MySQL 容器完全启动 + echo "正在等待 MySQL 初始化..." + sleep 30 + + + # 创建第1个数据库 + echo "正在创建数据库 $MYSQL_DATABASE1..." + docker exec -i $MYSQL_CONTAINER_NAME mysql -uroot -p$MYSQL_ROOT_PASSWORD -e "CREATE DATABASE IF NOT EXISTS $MYSQL_DATABASE1;" + + # 导入 SQL 文件 + echo "正在导入数据库 $MYSQL_DATABASE2..." + docker exec -i $MYSQL_CONTAINER_NAME mysql -uroot -p$MYSQL_ROOT_PASSWORD $MYSQL_DATABASE2 < "$FINHACK_STRUCTURE_SQL" + + + + + + # 检查 Redis 容器是否存在 + if [ $(docker ps -aq -f name=^/${REDIS_CONTAINER_NAME}$) ]; then + # 如果容器存在,询问用户是否删除 + read -p "Redis 容器已经存在。是否删除并重新创建?(y/n) " -n 1 -r + echo # 新行 + if [[ $REPLY =~ ^[Yy]$ ]]; then + # 删除容器 + docker rm -f $REDIS_CONTAINER_NAME + else + echo "操作已取消。" + exit 1 + fi + fi + + # 创建 Redis 容器 + echo "正在创建 Redis 容器..." + docker run --name $REDIS_CONTAINER_NAME \ + -p $REDIS_PORT:6379 \ + -v $REDIS_DATA_DIR:/data \ + -d redis:latest redis-server --appendonly yes --requirepass $REDIS_PASSWORD + + echo "容器已创建并正在运行。" + +else + # 用户输入不是 'y',不执行命令 + echo "操作已取消。" +fi diff --git a/script/install.sh b/script/install.sh deleted file mode 100755 index 492c4d8..0000000 --- a/script/install.sh +++ /dev/null @@ -1,14 +0,0 @@ -rsync -av --include='*/' --include='factorlist/' --include='factorlist/**' \ - --include='*.py' --include='*.conf' --exclude='*' --exclude='__pycache__/' \ - ./examples/demo-project/ ./finhack/widgets/templates/empty_project - -rm -rf ./finhack/widgets/templates/empty_project/data/factors/date_factors/* - -sed -i '/password=/s/=.*/=/' ./finhack/widgets/templates/empty_project/data/config/db.conf -sed -i '/token=/s/=.*/=/' ./finhack/widgets/templates/empty_project/data/config/ts.conf -sed -i '/feishu_webhook=/s/=.*/=/' ./finhack/widgets/templates/empty_project/data/config/alert.conf -sed -i '/dingtalk_webhook_webhook=/s/=.*/=/' ./finhack/widgets/templates/empty_project/data/config/alert.conf - -python setup.py sdist -pip install . -ls /root/anaconda3/envs/finhack/lib/python3.9/site-packages diff --git a/script/package.sh b/script/package.sh index 686de4a..638223f 100755 --- a/script/package.sh +++ b/script/package.sh @@ -1,4 +1,20 @@ -rm -rf dist -rm -rf finhack.egg-info -python setup.py sdist +mysqldump -uroot -p --no-data finhack > ./databases/finhack_structure.sql + + + +rsync -av --include='*/' --include='factorlist/' --include='factorlist/**' \ + --include='*.py' --include='*.conf' --exclude='*' --exclude='__pycache__/' \ + ./examples/demo-project/ ./finhack/widgets/templates/empty_project + +rm -rf ./finhack/widgets/templates/empty_project/data/factors/date_factors/* + +sed -i '/password=/s/=.*/=/' ./finhack/widgets/templates/empty_project/data/config/db.conf +sed -i '/token=/s/=.*/=/' ./finhack/widgets/templates/empty_project/data/config/ts.conf +sed -i '/feishu_webhook=/s/=.*/=/' ./finhack/widgets/templates/empty_project/data/config/alert.conf +sed -i '/dingtalk_webhook_webhook=/s/=.*/=/' ./finhack/widgets/templates/empty_project/data/config/alert.conf + +python setup.py sdist +pip install . twine upload dist/* + +ls /root/anaconda3/envs/finhack/lib/python3.9/site-packages