Created
May 19, 2017 07:48
-
-
Save adxrgh/506336442b1fa6379f3362834d305daa to your computer and use it in GitHub Desktop.
[wind.selected.FTCA]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from WindPy import * | |
import pandas as pd | |
from pandas import DataFrame | |
import ffn | |
w.start() | |
all_data={} | |
a=w.weqs('tp')#筛选出自由流通市值在50-200亿元之间,成交量增加50%,涨幅大于4%,且不为今年上市的新股 | |
for ticker in a.Data[0]: | |
all_data[ticker]=w.wsd(ticker,'close','20170101') | |
price=DataFrame({tic:data.Data[0] for tic,data in all_data.items()},index=all_data[next(iter(all_data))].Times) | |
syzs=(1+price.pct_change()).cumprod() | |
syzs.iloc[0,:]=1 | |
print(syzs.calc_ftca(threshold=0.5))#FTCA筛选分类 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment