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
34eec586
Commit
34eec586
authored
Jul 17, 2019
by
李煜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify code name
parent
ca469d54
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
7 additions
and
7 deletions
+7
-7
README.md
README.md
+1
-1
earning.py
client/earning.py
+1
-1
factor_volatility_value.py
client/factor_volatility_value.py
+2
-2
growth.py
client/growth.py
+1
-1
historical_value.py
client/historical_value.py
+1
-1
per_share_indicator.py
client/per_share_indicator.py
+1
-1
No files found.
README.md
View file @
34eec586
...
...
@@ -54,5 +54,5 @@ python ./client/all_factor_cal.py --end_date 20190101 --count 3 --update True
初始化分布式计算redis,运行之前需要在文件中设定需要指定的redis信息。
### sumbit
分布式计算任务提交入口,执行之后,客户端会将指定目录即目录下所有文件分发到所有计算节点中。
分布式计算任务提交入口,执行之后,客户端会将指定目录即目录下所有文件分发到所有计算节点中。
不同的客户端在提交任务时需要修改其中的相关配置。
client/earning.py
View file @
34eec586
...
...
@@ -135,7 +135,7 @@ def get_basic_earning(trade_date):
def
prepare_calculate
(
trade_date
):
#
cash flow
#
earning
tp_earning
,
ttm_earning_5y
,
ttm_earning
=
get_basic_earning
(
trade_date
)
if
len
(
tp_earning
)
<=
0
or
len
(
ttm_earning_5y
)
<=
0
or
len
(
ttm_earning
)
<=
0
:
print
(
"
%
s has no data"
%
trade_date
)
...
...
client/factor_volatility_value.py
View file @
34eec586
...
...
@@ -121,7 +121,7 @@ class FactorVolatilityValue(FactorBase):
temp_price_sets
=
index_daily_price_sets
[
index_daily_price_sets
.
trade_date
<=
trade_date
]
return
sk_daily_price_sets
,
temp_price_sets
[:
count
]
def
prepa
er
_calculate
(
self
,
trade_date
):
def
prepa
re
_calculate
(
self
,
trade_date
):
self
.
trade_date
=
trade_date
tp_price_return
,
temp_price_sets
=
self
.
get_basic_data
(
trade_date
)
...
...
@@ -159,7 +159,7 @@ class FactorVolatilityValue(FactorBase):
trade_date_sets
=
self
.
_trade_date
.
trade_date_sets_ago
(
start_date
,
end_date
,
count
)
for
trade_date
in
trade_date_sets
:
print
(
'因子计算日期:
%
s'
%
trade_date
)
self
.
prepa
er
_calculate
(
trade_date
)
self
.
prepa
re
_calculate
(
trade_date
)
print
(
'----->'
)
...
...
client/growth.py
View file @
34eec586
...
...
@@ -188,7 +188,7 @@ def get_basic_growth_data(trade_date):
def
prepare_calculate
(
trade_date
):
#
cash flow
#
growth
ttm_factor_sets
,
balance_sets
=
get_basic_growth_data
(
trade_date
)
growth_sets
=
pd
.
merge
(
ttm_factor_sets
,
balance_sets
,
on
=
'symbol'
)
if
len
(
growth_sets
)
<=
0
:
...
...
client/historical_value.py
View file @
34eec586
...
...
@@ -142,7 +142,7 @@ def get_basic_history_value_data(trade_date):
def
prepare_calculate
(
trade_date
):
# histor
y
_value
# histor
ical
_value
valuation_sets
,
ttm_factor_sets
,
cash_flow_sets
,
income_sets
=
get_basic_history_value_data
(
trade_date
)
valuation_sets
=
pd
.
merge
(
valuation_sets
,
income_sets
,
on
=
'symbol'
)
valuation_sets
=
pd
.
merge
(
valuation_sets
,
ttm_factor_sets
,
on
=
'symbol'
)
...
...
client/per_share_indicator.py
View file @
34eec586
...
...
@@ -121,7 +121,7 @@ def prepare_calculate(trade_date):
valuation_sets
=
pd
.
merge
(
valuation_sets
,
ttm_factor_sets
,
on
=
'symbol'
)
valuation_sets
=
pd
.
merge
(
valuation_sets
,
cash_flow_sets
,
on
=
'symbol'
)
valuation_sets
=
pd
.
merge
(
valuation_sets
,
balance_sets
,
on
=
'symbol'
)
if
len
(
valuation_sets
)
<=
0
:
if
len
(
valuation_sets
)
<=
0
:
print
(
"
%
s has no data"
%
trade_date
)
return
else
:
...
...
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