Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
FactorCalculate
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李煜
FactorCalculate
Commits
efcf8151
Commit
efcf8151
authored
Jul 17, 2019
by
李煜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code update
parent
d50e2048
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
650 deletions
+51
-650
README.md
README.md
+51
-19
client.py
client/client.py
+0
-599
models.py
factor/models.py
+0
-32
submit.py
submit.py
+0
-0
No files found.
README.md
View file @
efcf8151
# FactorCalculate
# FactorCalculate
RL 因子计算
# 1、目录架构
.
├── client # 客户端任务执行入口
│ ├── __init__.py
│ ├── all_factor_cal.py # 所有因子合并计算
│ ├── cash_flow.py
│ ├── constrain.py
│ ├── earning.py
│ ├── factor_scale_value.py
│ ├── factor_volatility_value.py
│ ├── growth.py
│ ├── historical_value.py
│ └── per_share_indicator.py
├── factor # 因子计算任务列表
│ ├── __init__.py
│ ├── factor_cash_flow.py # 收益质量
│ ├── factor_constrain.py # 收益质量
│ ├── factor_earning.py # 收益质量
│ ├── factor_per_share_indicators.py # 收益质量
│ ├── factor_growth.py # 历史成长
│ ├── factor_scale_value_task.py # 规模
│ ├── factor_volatility_value_task.py # 波动
│ ├── historical_value.py # 价值
│ ├── factor_base.py # 基类
│ ├── factor_config.py # 因子计算配置文件,包括数据读取地址, 存储地址等
│ ├── ttm_fundamental.py # TTM转换类
│ └── utillities # 工具类
├── README.md
├── cluster_work.py
├── init.py
└── sumbit.py
# 2、细节说明
### /factor
### /factor
该文件目录下保存的是因子计算的task文件, 以及每个task所依赖的因子计算文件。分布式计算时, 该目录下面的所有文件会提交到每个节点。
该文件目录下保存的是因子计算的task文件, 以及每个task所依赖的因子计算文件。
目前包含的task:
-
factor_growth # 历史成长
-
historical_values # 价值
-
factor_cash_flow # 收益质量
-
factor_constrain # 收益质量
-
factor_earning # 收益质量
-
factor_per_share_indicators # 收益质量
### /client
### /client
程序执行入口, 文件目录下包含单类因子计算, 以及合并计算
程序执行入口, 文件目录下包含单类因子计算, 以及合并计算
##### 使用示例
### sumbit
```
shell
分布式计算,提交入口
# 更新
python earning.py
--end_date
20190101
--count
3
--update
True
### init
python constrain.py
--end_date
20190101
--count
3
--update
True
初始化分布式计算redis数据库
python cash_flow.py
--end_date
20190101
--count
3
--update
True
python per_share_indicator.py
--end_date
20190101
--count
3
--update
True
python all_factor_cal.py
--end_date
20190101
--count
3
--update
True
```
具体参见client中的每个客户端代码。
### cluster_work
### cluster_work
分布式引擎节点启动程序
分布式引擎节点启动程序
,需后台运行。
### init
初始化分布式计算redis,运行之前需要在文件中设定需要指定的redis信息。
### sumbit
分布式计算任务提交入口,执行之后,客户端会将指定目录即目录下所有文件分发到所有计算节点中。
client/client.py
deleted
100644 → 0
View file @
d50e2048
This diff is collapsed.
Click to expand it.
factor/models.py
deleted
100644 → 0
View file @
d50e2048
# -*- coding: utf-8 -*-
from
sqlalchemy
import
BigInteger
,
Column
,
DateTime
,
Float
,
Index
,
Integer
,
String
,
Text
,
Boolean
,
text
,
JSON
,
TIMESTAMP
from
sqlalchemy.ext.declarative
import
declarative_base
Base
=
declarative_base
()
metadata
=
Base
.
metadata
class
Growth
(
Base
):
__tablename__
=
'growth'
trade_date
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
code
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
)
net_asset_grow_rate_latest
=
Column
(
Float
(
53
))
total_asset_grow_rate_latest
=
Column
(
Float
(
53
))
operating_revenue_grow_rate_ttm
=
Column
(
Float
(
53
))
operating_profit_grow_rate_ttm
=
Column
(
Float
(
53
))
total_profit_grow_rate_ttm
=
Column
(
Float
(
53
))
net_profit_grow_rate_ttm
=
Column
(
Float
(
53
))
np_parent_company_grow_rate
=
Column
(
Float
(
53
))
net_profit_grow_rate_3y_ttm
=
Column
(
Float
(
53
))
net_profit_grow_rate_5y_ttm
=
Column
(
Float
(
53
))
operating_revenue_grow_rate_3y_ttm
=
Column
(
Float
(
53
))
operating_revenue_grow_rate_5y_ttm
=
Column
(
Float
(
53
))
net_cash_flow_grow_rate_ttm
=
Column
(
Float
(
53
))
np_parent_company_cut_yoy_ttm
=
Column
(
Float
(
53
))
growth_egro_ttm
=
Column
(
Float
(
53
))
growth_sue_ttm
=
Column
(
Float
(
53
))
growth_suoi_ttm
=
Column
(
Float
(
53
))
financing_cash_grow_rate_ttm
=
Column
(
Float
(
53
))
invest_cash_grow_rate_ttm
=
Column
(
Float
(
53
))
oper_cash_grow_rate_ttm
=
Column
(
Float
(
53
))
growth_sgro_ttm
=
Column
(
Float
(
53
))
su
mb
it.py
→
su
bm
it.py
View file @
efcf8151
File moved
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment